/* header.css — masthead, wordmark + underline + sub-wordmark + 2px rule + 1px hairline */

.wh-masthead {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-ink);
  transition: padding 0.2s ease;
  padding: 0;
}
.wh-masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gutter);
  min-height: 72px;
  padding: 18px 0 14px;
  transition: min-height 0.2s ease, padding 0.2s ease;
}

.wh-wordmark-wrap { display: flex; flex-direction: column; gap: 4px; }
.wh-wordmark {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--c-accent);
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
  border-bottom: 0;
  padding-bottom: 0;
}
.wh-wordmark:hover { color: var(--c-saffron-dp); border-bottom: 0; }

.wh-subwordmark {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--c-stone);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 6px;
}
.wh-masthead-rule { border-top: 1px solid var(--c-stone); margin: 0; opacity: 0.6; }

/* Nav */
.wh-nav { display: flex; gap: 24px; align-items: center; }
.wh-nav a {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--c-ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
}
.wh-nav a:hover, .wh-nav a.is-current { color: var(--c-accent); border-bottom-color: var(--c-accent); }

.wh-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--c-ink);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  color: var(--c-ink); cursor: pointer;
  position: relative;
  z-index: 102; /* always on top — so it's clickable even if nav z-index goes wrong */
  min-width: 72px;
  text-align: center;
}
.wh-nav-toggle-open, .wh-nav-toggle-close { display: inline-block; }
.wh-nav-toggle-close { display: none; }
.wh-nav-toggle[aria-expanded="true"] { background: var(--c-accent); color: var(--c-paper); border-color: var(--c-accent); }
.wh-nav-toggle[aria-expanded="true"] .wh-nav-toggle-open { display: none; }
.wh-nav-toggle[aria-expanded="true"] .wh-nav-toggle-close { display: inline-block; }

/* Sticky shrunk state */
.wh-masthead.is-shrunk .wh-masthead-inner { min-height: 52px; padding: 10px 0; }
.wh-masthead.is-shrunk .wh-wordmark { font-size: 1.4rem; }
.wh-masthead.is-shrunk .wh-subwordmark { display: none; }
.wh-masthead.is-shrunk .wh-masthead-rule { display: none; }

/* Affiliate banner (above masthead) */
.wh-affiliate-banner {
  background: var(--c-paper-alt);
  border-bottom: 1px solid var(--c-ink);
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--c-ink);
}
.wh-affiliate-banner-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}
.wh-affiliate-banner a { color: var(--c-accent); font-weight: 500; }
.wh-affiliate-banner.is-dismissed { display: none; }

/* Mobile nav — position: fixed instead of absolute so it follows sticky masthead on scroll */
@media (max-width: 768px) {
  .wh-nav {
    display: none;
    position: fixed;
    top: var(--wh-masthead-h, 72px);
    right: 0; left: 0;
    background: var(--c-paper);
    border-top: 1px solid var(--c-stone);
    border-bottom: 1px solid var(--c-ink);
    flex-direction: column; gap: 0;
    padding: 8px 0;
    max-height: calc(100dvh - var(--wh-masthead-h, 72px));
    overflow-y: auto;
    z-index: 99; /* BELOW sticky masthead (z:100) so the toggle button stays clickable */
    box-shadow: 0 8px 16px rgba(23, 21, 19, 0.08);
  }
  .wh-nav.is-open { display: flex; }
  .wh-nav a {
    display: block;
    padding: 14px var(--gutter-m);
    width: 100%;
    border-bottom: 1px solid var(--c-stone);
  }
  .wh-nav a:last-child { border-bottom: 0; }
  .wh-nav-toggle { display: inline-block; }
  .wh-wordmark { font-size: 1.5rem; }
}

/* Page remains scrollable behind mobile menu — sticky masthead stays functional. */
