/**
 * Global chrome: site header, gingham paper bands, footer.
 * Graphique design, 12 October 2026. Mobile first; tokens only.
 */

/* === HEADER ============================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  box-shadow: var(--shadow-header);
  padding-inline: var(--space-gutter);
}

.admin-bar .site-header {
  top: var(--wp-admin--admin-bar--height, 0);
}

.site-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-s);
  min-height: var(--header-height);
  max-width: var(--container-wide);
  margin-inline: auto;
}

.site-header .wordmark {
  margin-inline-end: auto;
}

/* --- Menu: mobile panel first -------------------------------------------- */
.nav-links {
  display: none;
}

.nav-links.is-open {
  position: absolute;
  top: 100%;
  left: calc(var(--space-gutter) * -1);
  right: calc(var(--space-gutter) * -1);
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-s) var(--space-gutter) var(--space-m);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-weight: var(--weight-strong);
  font-size: var(--text-body);
}

.nav-links > a,
.nav-trigger {
  display: flex;
  align-items: center;
  min-height: var(--tap-target);
  color: var(--ink);
  font-weight: var(--weight-strong);
  transition: color var(--duration-fast);
}

.nav-links > a:hover,
.nav-trigger:hover,
.nav-links > a.is-current,
.nav-trigger.is-current {
  color: var(--brand-accent);
}

.nav-message-mobile {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-target);
  color: var(--brand-secondary);
  font-weight: var(--weight-strong);
}

.nav-message-mobile .icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: currentColor;
}

/* Dropdowns: a tap accordion on mobile. */
.nav-item.has-dropdown {
  position: relative;
}

.nav-trigger {
  justify-content: space-between;
  gap: var(--space-3xs);
  width: 100%;
}

.nav-caret {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform var(--duration-fast);
}

.nav-dropdown {
  display: none;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-3xs) 0 var(--space-2xs) var(--space-s);
  border-left: var(--border-thin) solid var(--hairline);
}

.nav-item.is-open .nav-dropdown {
  display: flex;
}

.nav-item.is-open .nav-caret {
  transform: rotate(180deg);
}

.nav-dropdown a {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-block: var(--space-3xs);
  font-weight: var(--weight-strong);
  font-size: var(--text-small);
}

.nav-dropdown a small {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.nav-dropdown a:hover {
  color: var(--brand-accent);
}

/* --- Utility cluster ----------------------------------------------------- */
.nav-utility {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}

.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition: color var(--duration-fast), background-color var(--duration-fast);
}

.nav-icon:hover {
  color: var(--brand-accent);
  background: var(--brand-tint-soft);
}

.nav-icon .icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-count {
  position: absolute;
  top: var(--space-3xs);
  right: var(--space-3xs);
  display: grid;
  place-items: center;
  min-width: var(--badge-size);
  height: var(--badge-size);
  padding-inline: var(--space-3xs);
  border-radius: var(--radius-pill);
  background: var(--brand-accent);
  color: var(--white);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-strong);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cart-count.is-empty {
  background: var(--brand-tint);
  color: var(--brand-primary);
}

.nav-message {
  display: none;
}

.nav-toggle[aria-expanded="true"] {
  color: var(--brand-accent);
  background: var(--brand-tint-soft);
}

/* Without JavaScript the toggle cannot open the panel, so the menu shows
   as a wrapped row under the logo instead. */
@media (scripting: none) and (max-width: 61.99rem) {
  .site-header-inner {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-s);
    width: 100%;
    font-size: var(--text-small);
  }

  .nav-toggle {
    display: none;
  }
}

/* --- Desktop -------------------------------------------------------------- */
@media (min-width: 62rem) {
  .site-header-inner {
    gap: var(--space-l);
  }

  .nav-links,
  .nav-links.is-open {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-m);
    padding: 0;
    background: none;
    box-shadow: none;
    font-size: var(--text-small);
  }

  .nav-links > a,
  .nav-trigger {
    position: relative;
    width: auto;
    white-space: nowrap;
  }

  /* A short pink underline marks the current page. */
  .nav-links > a.is-current::after,
  .nav-trigger.is-current::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--space-2xs);
    height: var(--border-thin);
    border-radius: var(--radius-pill);
    background: var(--brand-accent);
  }

  .nav-links > .nav-message-mobile {
    display: none;
  }

  .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    display: flex;
    min-width: 14rem;
    padding: var(--space-2xs);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-md);
    transform: translate(-50%, var(--space-2xs));
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast), transform var(--duration-normal) var(--ease-out), visibility var(--duration-fast);
  }

  .nav-dropdown a {
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
  }

  .nav-dropdown a:hover {
    background: var(--brand-tint-soft);
  }

  .nav-item.has-dropdown:hover .nav-dropdown,
  .nav-item.has-dropdown:focus-within .nav-dropdown,
  .nav-item.is-open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .nav-message {
    display: inline-flex;
    margin-inline-start: var(--space-xs);
  }

  .nav-toggle {
    display: none;
  }
}

/* === GINGHAM PAPER BANDS ==================================================
   The design's artwork: lilac gingham with a torn paper edge. Cover-fit so
   the checks never squash; anchored to the torn edge so it always shows. */
.band {
  height: var(--band-trim);
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

.band-top {
  background-image: url('../img/brand/band-top.webp?v=2');
  background-position: center bottom;
}

.band-bottom {
  background-image: url('../img/brand/band-bottom.webp?v=2');
  background-position: center top;
}

/* === FOOTER =============================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding-block: var(--section-space-s) var(--space-l);
  padding-inline: var(--space-gutter);
  font-size: var(--text-small);
}

.site-footer > .container {
  max-width: var(--container-wide);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-l) var(--space-m);
}

.footer-brand {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-s);
}

.footer-logo {
  width: var(--footer-logo-width);
}

.footer-logo img {
  width: 100%;
  height: auto;
}

.footer-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.footer-copy p {
  color: var(--footer-ink);
}

.footer-tagline {
  color: var(--white);
  font-weight: var(--weight-strong);
  font-size: var(--text-body);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  font-style: normal;
}

.footer-contact a {
  width: fit-content;
  font-weight: var(--weight-strong);
  color: var(--white);
}

.footer-contact a:hover,
.footer-col a:hover {
  color: var(--footer-pop);
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: var(--space-2xs);
}

.footer-social a {
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: var(--radius-pill);
  background: var(--footer-chip);
  color: var(--white);
  transition: background-color var(--duration-fast), transform var(--duration-normal) var(--ease-out);
}

.footer-social a:hover {
  background: var(--brand-accent);
  transform: translateY(var(--lift));
}

.footer-social .icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: currentColor;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.footer-col h2 {
  font-size: var(--text-body);
  color: var(--white);
  letter-spacing: 0;
}

.footer-col h2 em {
  color: var(--footer-pop);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.footer-col a {
  color: var(--footer-ink);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding-top: var(--space-m);
  border-top: var(--border-hair) dashed var(--footer-line);
  font-size: var(--text-xs);
}

.site-footer :focus-visible {
  outline-color: var(--footer-pop);
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 62rem) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 0.9fr;
  }

  .footer-brand {
    grid-column: auto;
  }
}
