/* Site header, nav, footer and the language switcher.
 *
 * Split out of assets/css/main.css. Every rule below is verbatim from
 * that file and appears in its original relative order.
 */
.admin-bar { scroll-padding-top: 144px; }

/* ─── Site Header ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
/* When the WP admin bar is visible it sits fixed at 32px (46px on mobile).
   Shift the sticky threshold down so the header never hides behind it. */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

.site-header__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px var(--pad-h);
}

/* Wraps the logo + mobile menu-toggle button. display:contents by default
   so it's invisible to layout everywhere except the full-screen mobile
   menu (see mobile media query), where it becomes a real bordered bar. */
.site-header__bar { display: contents; }

/* Wraps .site-nav + .site-header__actions together — same display:contents
   default, so it's invisible to layout except in the full-screen mobile
   menu, where it becomes the container the gradient accent spans. */
.site-header__body { display: contents; }

.site-header__logo-link { margin-left: -7px; margin-top: -5px; }
.site-header__logo-link img,
.site-header__logo-link .custom-logo { height: 78px; width: auto; display: block; }

/* Fallback wordmark: only rendered when no custom logo is set (header.php). */
.site-header__logo-text {
  display: block;
  font: 700 26px/78px var(--font-serif);
  color: var(--teal);
  text-decoration: none;
}

.site-header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}
.site-header__menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brown-dark);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 27px;
  margin-left: auto;
  align-items: center;
  min-width: 320px;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 14px var(--font-sans);
  color: var(--brown-dark);
  text-decoration: none;
  transition: color .15s;
}
/* Desktop never shows this one — it only exists for mobile, which shows it
   after the label via its own display/order overrides further down. */
.site-nav__heart { display: none; color: var(--pastel-coral-mid); flex-shrink: 0; margin-top: -4px; }
/* Positioned above the marks below (z-index) so the hearts sit behind the
   text rather than on top of it. */
.site-nav__label { position: relative; z-index: 2; padding-bottom: 4px; border-bottom: 2px solid transparent; transition: border-color .15s; }
.site-nav__link:hover { color: var(--teal); }
.site-nav__link:hover .site-nav__label { border-color: var(--teal); }
.site-nav__link--active { font-weight: 700; color: var(--teal); }

/* Desktop active-page marker: two identical hearts pinned to the label's
   corners and rotated oppositely, instead of an underline. Absolutely
   positioned (not flex children), so unlike the old prepended-heart
   approach they never affect the label's own layout or width at all. */
.site-nav__mark {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  visibility: hidden;
  opacity: .9;
  pointer-events: none;
  background-color: var(--pastel-coral-mid);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-nav__link--active .site-nav__mark { visibility: visible; }
.site-nav__mark--a { left: -10px; top: -9px; transform: rotate(-16deg); }
.site-nav__mark--b { right: -10px; bottom: -9px; transform: rotate(16deg); }

/* "More" dropdown: holds Why Diapers? / Sponsors / Contact between 860px
   and 1100px, where there's no longer room to lay all seven links out in
   one row but the full-screen mobile menu (<=860px) hasn't kicked in yet.
   Hidden by default — shown only in that band, see the two @media blocks
   under Responsive further down. */
.site-nav__more { display: none; position: relative; }

/* Button, not a link — reset the parts .site-nav__link normally gets for
   free from being an <a> (font/color/display/gap/etc. still apply, since
   this shares that class; see the PHP walker). */
.site-nav__more-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.site-nav__more-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-bottom: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s;
}
.site-nav__more.is-open .site-nav__more-toggle { color: var(--teal); }
.site-nav__more.is-open .site-nav__more-toggle .site-nav__label { border-color: var(--teal); }
.site-nav__more.is-open .site-nav__more-toggle::after { transform: rotate(-135deg) translateY(2px); }

.site-nav__more-panel {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: var(--z-raised);
  flex-direction: column;
  /* Not stretch (the flex default) — an active item's heart marks are
     positioned relative to its own <a>, so that box has to stay hugging
     the label's actual width, exactly like the flex-row nav, rather than
     stretching to the panel's full width and stranding the marks out at
     the panel's edges instead of the text's corners. */
  align-items: flex-start;
  min-width: 180px;
  padding: 14px 16px;
  /* Row spacing lives here (gap), not as padding on each .site-nav__more-link
     — any padding on the link itself would push its text away from the
     link's own edge without moving the marks (which are positioned
     relative to that same edge), throwing off the hug-the-corners look. */
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-overlay);
}
.site-nav__more.is-open .site-nav__more-panel { display: flex; }
/* The mobile trailing-heart decoration only applies inside the full-screen
   takeover menu (.site-nav.is-open), never here — no override needed.
   The desktop corner-mark pair, on the other hand, is this panel's own
   active-page indicator (its home row is hidden behind .site-nav__more when
   the dropdown is showing), so it's left enabled. Hover still gets the same
   label underline as every other .site-nav__link — no extra background
   treatment needed on top of it. */

.site-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Compact red pill for tight header real estate — genuinely its own size,
   not a duplicate of .btn-primary-red; only the fill is shared (.fill-red). */
.btn-donate {
  font: 700 14px var(--font-sans);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-donate:hover { color: var(--white); background: var(--red-dark); }

/* ─── Site Footer ────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--teal-footer);
  color: #e9f1ef;
  font-family: var(--font-sans);
}
/* .eyebrow defaults to red; override for this dark background. */
.site-footer .eyebrow { color: #cfe2e0; }

.site-footer__accent-bar {
  height: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 35fr 2.5fr 27.5fr 18fr 17fr;
  gap: 40px;
  /* Vertical padding is fixed at the gutter floor — see .impact-band.wp-block-group.
     Bottom is reduced to 16px (not the full gutter) to match the rhythm
     between .site-footer__affiliate-row and .site-footer__translate below it. */
  padding: var(--row-gutter) var(--pad-h) 16px;
}

.site-footer__org-name {
  font: 600 22px var(--font-serif);
  color: var(--white);
  margin-bottom: 12px;
}

.site-footer__col p,
.site-footer__col address {
  font: 400 14px/1.6 var(--font-sans);
  color: #e0f0ee;
  margin: 0 0 8px;
  max-width: 300px;
}

/* Col headings use .eyebrow; color override below (footer bg is dark). */

.site-footer__col a {
  display: block;
  font: 600 14px var(--font-sans);
  color: #e9f1ef;
  text-decoration: none;
  margin-bottom: 6px;
}
.site-footer__col a[href^="tel"] { color: var(--pastel-yellow-alt); }
.site-footer__col a:hover { color: var(--white); }

/* Left/right spacing matches .site-footer__grid and .site-footer__translate
   (both var(--pad-h)); bottom spacing matches .site-footer__translate's own
   padding (16px) for uniform rhythm between the two rows. */
.site-footer__affiliate-row {
  padding: 0 var(--pad-h) 16px;
}
.site-footer__affiliate-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 800px;
}
.site-footer__affiliate-logos .partner-logo-box {
  flex: 1;
  background: #000;
}
.site-footer__affiliate-logos .partner-logo-box:last-child {
  flex: 0 0 auto;
  width: 70px;
  margin-left: auto;
}
.site-footer__affiliate-logos .partner-logo-box img {
  max-height: 62px;
}

.partner-logo-box {
  background: var(--white);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}
.partner-logo-box img {
  max-height: 54px;
  max-width: 96%;
  object-fit: contain;
  margin: auto;
  /* footer.php sets width/height on these so the browser can reserve the box
   * before the bytes land. Without this the width attribute becomes the used
   * width and max-width clamps it to the full column, stretching the element
   * box from 145x62 to 209x62 — object-fit keeps the logo undistorted inside
   * it, but the box is no longer the shape of the logo. width:auto hands
   * sizing back to max-height and the intrinsic ratio, and the attributes
   * still supply aspect-ratio, so the CLS protection survives. */
  width: auto;
}

/* ── Language switcher: a full-width row of its own between the footer's
   main grid and the copyright line. [gtranslate] renders a wrapper div
   (class .gtranslate_wrapper) here and its own JS fills it with one <a
   class="glink"> per language — no markup/classes of ours involved beyond
   this wrapping row. */
.site-footer__translate {
  border-top: 1px solid rgba(233,241,239,.18);
  padding: 16px var(--pad-h);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
}
/* Translate label uses .eyebrow; layout-only rule below. */
.site-footer__translate .eyebrow {
  flex-basis: 100%;
}
.site-footer__translate .gtranslate_wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.site-footer__translate .glink {
  font: 600 13px var(--font-sans);
  color: #e9f1ef;
  text-decoration: none;
}
.site-footer__translate .glink:hover { color: var(--white); text-decoration: underline; }
.site-footer__translate .glink.gt-current-lang { color: var(--pastel-yellow-alt); }

.site-footer__bottom {
  border-top: 1px solid rgba(233,241,239,.18);
  padding: 18px var(--pad-h);
  display: flex;
  justify-content: space-between;
  font: 400 13px var(--font-sans);
  color: #cfe2e0;
}
.site-footer__bottom a {
  color: #cfe2e0;
  text-decoration: none;
}
.site-footer__bottom a:hover { color: var(--white); }

/* Why Diapers? / Sponsors / Get in Touch move into the "More" dropdown — no
   room left for all seven links in one row above the 860px mobile-menu
   breakpoint. Its own breakpoint (not tied to the 1100px one above) since
   it's governed by nav content width, not the hero/impact-band layout. */
@media (max-width: 1150px) {
  .site-nav__link--collapsible { display: none; }
  .site-nav__more { display: inline-flex; }
}
@media (max-width: 860px) {

  .site-header__inner { padding: 14px var(--mob-h); }
  .site-header__menu-toggle { display: flex; position: relative; z-index: 1; }

  /* The full-screen mobile menu below lists every item flat again, so the
     1100px dropdown is redundant here — restore the plain links and hide
     the "More" trigger. */
  .site-nav__link--collapsible { display: inline-flex; }
  .site-nav__more { display: none; }

  /* Hamburger → X, so it's obvious the same button closes the menu */
  .site-header__menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header__menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .site-header__menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Full-screen takeover menu. The header itself becomes the fixed
     full-viewport panel (rather than guessing its own height to offset a
     separately-fixed nav), so the logo + close button stay in their normal
     place at the top and the nav/actions rows below just get more room to
     breathe with big tap targets. Its own .rule-bottom (border between the
     sticky header and page content, closed state) stops meaning anything
     once the header IS the full-screen panel — .site-header__bar's own
     border takes over as the one meaningful divider in this state, between
     the logo bar and the nav content below it. */
  .site-header:has(.site-nav.is-open) {
    position: fixed;
    inset: 0;
    z-index: var(--z-raised);
    overflow-y: auto;
    background: var(--cream);
    border-bottom: none;
  }
  /* Column layout so .site-header__body (flex:1) stretches to fill all
     remaining height down to the bottom of the screen — otherwise it
     only wraps its own content height, leaving the gradient short of
     the docked language bar. gap:0 removes the flex row/column gap that
     otherwise left a sliver between the header bar and the body below. */
  .site-header:has(.site-nav.is-open) .site-header__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    gap: 0;
  }
  body:has(.site-nav.is-open) { overflow: hidden; }

  /* The logo + close button become a real white bar, full-bleed against
     .site-header__inner's own padding on all sides that touch a screen
     edge (top + both sides), with a border marking where the cream nav
     content begins — same escape-hatch technique used for full-bleed
     sections elsewhere in the theme. width:100% alone isn't enough here:
     as a flex item it resolves against the *padded* content box, so the
     negative side margins only shift the box rather than stretching it
     all the way to the true edges — width has to explicitly add back the
     padding it's escaping. */
  .site-header:has(.site-nav.is-open) .site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% + 2 * var(--mob-h));
    background: var(--white);
    margin: -14px calc(-1 * var(--mob-h)) 0;
    padding: 14px var(--mob-h);
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 0 8px;
    min-width: unset;
  }
  .site-nav.is-open {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  /* Wraps nav + Donate as one column once open, so the gradient below can
     span both — same escape-hatch (negative margin, matching padding)
     used for the header bar above and for full-bleed sections elsewhere.
     A flex column (not block) so .site-nav's flex:1 actually stretches to
     fill the leftover height and the Donate bar below it lands flush at
     the bottom of the screen instead of trailing right after the links. */
  .site-header:has(.site-nav.is-open) .site-header__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
  }
  /* Same gradient-strip technique as .hero__slideshow::before and the
     footer's accent bar — one continuous band down the left edge of the
     whole scrollable body (nav + Donate), flush with the true screen
     edge, not a per-item treatment. */
  .site-header:has(.site-nav.is-open) .site-header__body::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--mob-h)); top: 0; bottom: 0;
    width: 10px;
    z-index: 1;
    background: linear-gradient(to bottom, var(--spectrum-stops));
  }

  .site-nav.is-open .site-nav__link {
    font-size: 22px;
    padding: 16px var(--mob-h);
  }
  .site-nav.is-open .site-nav__label { border-bottom: none; }
  /* Unlike the desktop flex-end row, mobile rows don't need a reserved
     gutter to stop siblings from shifting — each row is independent, so
     an invisible heart before the text would just misalign every row's
     left edge for no reason. Instead: no space at all on inactive rows,
     and the heart trails the text (order: 1) only on the active one. */
  .site-nav.is-open .site-nav__heart { display: none; order: 1; margin-top: 0; }
  .site-nav.is-open .site-nav__link--active .site-nav__heart { display: inline-block; }
  /* Desktop's overlapping-heart marker pair is absolutely positioned behind
     the label and would otherwise still render (rotated, overlapping the
     text) on the active mobile row too — not wanted here, mobile keeps its
     own single trailing heart above instead. */
  .site-nav.is-open .site-nav__mark { display: none; }

  /* Dark teal on dark brown is too close in luminance to read as a real
     color difference at a glance — red is a clearer signal for the
     current page, and the serif face (used for headings elsewhere)
     sets it apart from the sans-serif body links too. */
  .site-nav.is-open .site-nav__link--active {
    color: var(--brown-dark);
    font-weight: 600;
  }

  /* Donate only needs to exist inside the open full-screen menu — no need
     for it to persist in the collapsed mobile header bar too. Docked as
     its own white bar at the bottom of the screen (same full-bleed
     escape-hatch as .site-header__bar above), with a divider marking
     where the cream nav content ends — .site-nav's flex:1 pushes this
     down to sit flush against the true bottom edge rather than trailing
     right after the last link. */
  .site-header__actions { display: none; }
  .site-nav.is-open ~ .site-header__actions {
    display: flex;
    width: calc(100% + 2 * var(--mob-h));
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--white);
    border-top: 1px solid var(--border);
    margin: 0 calc(-1 * var(--mob-h)) -14px;
    padding: 20px var(--mob-h) calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .site-nav.is-open ~ .site-header__actions .btn-donate {
    flex: 1;
    text-align: center;
    padding: 16px 20px;
    font-size: 16px;
  }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__affiliate-row { display: none; }
  .site-footer__bottom { flex-direction: column; gap: 8px; }
}

@media (max-width: 540px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.partners-grid.wp-block-group .partner-logo-box {
  height: 100px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.partners-grid.wp-block-group .partner-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: auto;
}
