/* =========================================================
   Top announcement bar ("Coming Soon")
   Managed in TeedUp Settings > Top Announcement Bar.
   --announcement-bar-h is measured by the inline script in
   template-parts/announcement-bar.php; 40px is the pre-JS fallback.
   ========================================================= */

.announcement-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1001;
  color: var(--announcement-color, #003415);
  background: var(--announcement-bg, #e3f956);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-align: center;
}

/* Sit below the WordPress admin bar for logged-in editors. */
.admin-bar .announcement-bar {
  top: var(--wp-admin--admin-bar--height, 32px);
}

.announcement-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  max-width: 1864px;
  min-height: 40px;
  margin: 0 auto;
  padding: 8px 16px;
}

.announcement-bar__message > :first-child { margin-top: 0; }
.announcement-bar__message > :last-child { margin-bottom: 0; }

.announcement-bar__message p {
  margin: 0;
}

.announcement-bar__message a,
.announcement-bar__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.announcement-bar__link {
  font-weight: 700;
  white-space: nowrap;
}

.announcement-bar__message a:hover,
.announcement-bar__message a:focus-visible,
.announcement-bar__link:hover,
.announcement-bar__link:focus-visible {
  text-decoration-thickness: 2px;
}

.announcement-bar a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Push page content and the fixed header down by the bar's height. */
body.has-announcement-bar {
  padding-top: var(--announcement-bar-h, 40px);
}

/*
 * --announcement-bar-gap is extra breathing room between the bar and the header.
 * The header's own top offset (and how far the round logo overhangs the pill)
 * differs per breakpoint, so the extra amount does too. Each value below gives a
 * visible gap of roughly 16-25px between the bar and the top of the logo/pill.
 */
:root {
  --announcement-bar-gap: 0px;
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --announcement-bar-gap: 8px;
  }
}

@media (min-width: 1600px) {
  :root {
    --announcement-bar-gap: 16px;
  }
}

body.has-announcement-bar .site-header,
body.has-announcement-bar .site-header.is-open {
  margin-top: calc(var(--announcement-bar-h, 40px) + var(--announcement-bar-gap));
}

/* Keep the open mobile/tablet menu inside the viewport once it has moved down. */
@media (max-width: 1199px) {
  body.has-announcement-bar .site-header.is-open .site-header__bar {
    max-height: calc(100vh - var(--announcement-bar-h, 40px) - var(--announcement-bar-gap) - 24px);
  }
}

@media (max-width: 767px) {
  body.has-announcement-bar .site-header.is-open .site-header__bar {
    max-height: calc(100vh - var(--announcement-bar-h, 34px) - var(--announcement-bar-gap) - 42px);
  }

  .announcement-bar {
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .announcement-bar__inner {
    min-height: 34px;
    padding: 7px 16px;
  }
}

/* Below 600px WordPress makes the admin bar scroll away, so pin to the top. */
@media (max-width: 600px) {
  .admin-bar .announcement-bar {
    top: 0;
  }
}
