
/* ── Skip to content link (accessibility) ─────────────────────── */
/* Uses clip-rect pattern — position:absolute with clip, NOT top:-100%.
   Lighthouse requires the element to be in the normal flow when focused. */
.aff-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  z-index: 9999;
  text-decoration: none;
}
.aff-skip-link:focus,
.aff-skip-link:focus-visible {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  background: var(--aff-dark, #0f172a);
  color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
/* ============================================================
   AFF — Header + Search  (assets/header.css)
   ============================================================ */

/* ── CSS custom properties (shared tokens) ─────────────────── */
:root {
  --aff-header-h:    62px;
  --aff-dark:        #0f172a;
  --aff-dark-2:      #1e293b;
  --aff-blue:        #2563eb;
  --aff-blue-lt:     #3b82f6;
  --aff-sky:         #38bdf8;
  --aff-green:       #15803d;
  --aff-white:       #ffffff;
  --aff-bg:          #f8fafc;
  --aff-border:      #e2e8f0;
  --aff-slate:       #0f172a;
  --aff-muted:       #64748b;
  --aff-shadow:      0 2px 12px rgba(15,23,42,.08);
  --aff-radius:      8px;
  --aff-radius-lg:   12px;
}

/* ── Header shell ──────────────────────────────────────────── */
.aff-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--aff-header-h);
  background: var(--aff-dark);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .25s;
}
.aff-header--scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.aff-header__inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 20px;
}

/* Spacer below fixed header */
.aff-header-spacer { height: var(--aff-header-h); }

/* ── Logo ──────────────────────────────────────────────────── */
.aff-header__logo {
  display: flex; align-items: center; flex-shrink: 0;
  text-decoration: none; gap: 10px;
}
.aff-header__logo-img {
  height: 34px; width: auto; display: block;
}
.aff-header__logo-text {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 17px; font-weight: 800; color: #fff;
  letter-spacing: -.3px; white-space: nowrap;
}

/* ── Primary nav ───────────────────────────────────────────── */
.aff-nav { display: flex; align-items: center; }
.aff-nav__list {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.aff-nav__list li a {
  display: block; padding: 8px 14px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.75);
  text-decoration: none; border-radius: 6px;
  transition: background .18s, color .18s;
}
.aff-nav__list li a:hover,
.aff-nav__list li.current-menu-item > a,
.aff-nav__list li.current-page-ancestor > a {
  background: rgba(255,255,255,.09); color: #fff;
}

/* ── Desktop search bar ────────────────────────────────────── */
.aff-header__search {
  flex: 1; max-width: 380px; margin-left: auto; position: relative;
}
.aff-search-form { position: relative; }
.aff-search-form__wrap {
  display: flex; align-items: center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  transition: background .2s, border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.aff-search-form__wrap:focus-within {
  background: rgba(255,255,255,.15);
  border-color: var(--aff-blue-lt);
  box-shadow: 0 0 0 3px rgba(59,130,246,.20);
}
.aff-search-form__icon {
  display: flex; align-items: center; padding: 0 10px 0 13px;
  color: rgba(255,255,255,.50); flex-shrink: 0; pointer-events: none;
}
.aff-search-form__input {
  flex: 1; border: none; background: transparent; outline: none;
  padding: 9px 6px; color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 500;
  min-width: 0;
}
.aff-search-form__input::placeholder { color: rgba(255,255,255,.55); }
.aff-search-form__input::-webkit-search-cancel-button { display: none; }
.aff-search-form__clear {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 100%; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.50); transition: color .15s;
}
.aff-search-form__clear:hover { color: #fff; }

/* ── Suggestions dropdown ──────────────────────────────────── */
.aff-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--aff-white); border: 1px solid var(--aff-border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(15,23,42,.18);
  z-index: 2000; animation: affDropIn .14s ease;
}
@keyframes affDropIn {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}
.aff-sd-list { list-style: none; margin: 0; padding: 6px 0; }
.aff-sd-item { margin: 0; }
.aff-sd-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none; color: var(--aff-slate);
  transition: background .14s;
}
.aff-sd-link:hover,
.aff-sd-link:focus { background: #eff6ff; outline: none; }
.aff-sd-icon { font-size: 16px; flex-shrink: 0; color: var(--aff-muted); }
.aff-sd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aff-sd-title {
  font-size: 13.5px; font-weight: 600; color: var(--aff-slate);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aff-sd-cat {
  font-size: 11px; font-weight: 500; color: var(--aff-muted);
}
.aff-sd-arrow { color: var(--aff-muted); font-size: 14px; flex-shrink: 0; }
.aff-sd-empty {
  padding: 14px 16px; font-size: 13px; color: var(--aff-muted); text-align: center;
}
.aff-sd-footer {
  border-top: 1px solid var(--aff-border); padding: 9px 14px;
  background: var(--aff-bg);
}
.aff-sd-all {
  font-size: 12.5px; font-weight: 600; color: var(--aff-blue);
  text-decoration: none; display: block; text-align: center;
}
.aff-sd-all:hover { text-decoration: underline; }

/* ── Mobile controls ───────────────────────────────────────── */
.aff-header__mobile-controls {
  display: none; align-items: center; gap: 4px; margin-left: auto;
}
/* Higher specificity to override Astra/WP core button resets */
.aff-header .aff-header__icon-btn,
button.aff-header__icon-btn {
  display: flex !important; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.85) !important;
  cursor: pointer; transition: background .18s, color .18s;
  padding: 0; outline: none; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
.aff-header .aff-header__icon-btn svg,
button.aff-header__icon-btn svg {
  stroke: rgba(255,255,255,.85); /* explicit SVG colour — not inherited in all browsers */
  display: block; flex-shrink: 0;
}
.aff-header .aff-header__icon-btn:hover,
button.aff-header__icon-btn:hover {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
}
.aff-header .aff-header__icon-btn:hover svg,
button.aff-header__icon-btn:hover svg { stroke: #fff; }
.aff-header .aff-header__icon-btn:focus-visible,
button.aff-header__icon-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,.5) !important;
  outline-offset: 2px;
  border-color: rgba(255,255,255,.3) !important;
  box-shadow: none !important;
}

/* Hamburger lines */
.aff-hamburger { flex-direction: column; gap: 4px; }
.aff-hamburger span {
  display: block; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.aff-hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.aff-hamburger.is-open span:nth-child(2) { opacity: 0; }
.aff-hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Icon button tooltips (visible label on hover/focus) ───── */
.aff-header .aff-header__icon-btn {
  position: relative;
}
.aff-header .aff-header__icon-btn::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.95);
  color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 100;
}
.aff-header .aff-header__icon-btn:hover::after,
.aff-header .aff-header__icon-btn:focus-visible::after {
  opacity: 1;
}

/* ── Mobile search panel ───────────────────────────────────── */
.aff-mobile-search {
  background: var(--aff-dark-2);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 10px 16px 12px;
}
.aff-search-form--mobile .aff-search-form__wrap {
  border-radius: 8px;
}

/* ── Mobile nav drawer ─────────────────────────────────────── */
/* Hidden by default — JS removes [hidden] to show it */
.aff-mobile-nav {
  display: none;  /* default: hidden */
  background: var(--aff-dark-2);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 8px 0 14px;
}
/* When [hidden] is absent (JS removed it), show the nav */
.aff-mobile-nav:not([hidden]) {
  display: block !important;
}
/* Mobile search panel: same pattern */
.aff-mobile-search {
  display: none;
}
.aff-mobile-search:not([hidden]) {
  display: block !important;
}
.aff-mobile-nav__list { list-style: none; margin: 0; padding: 0; }
.aff-mobile-nav__list li a {
  display: block; padding: 12px 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,.80);
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s, color .15s;
}
.aff-mobile-nav__list li a:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .aff-nav,
  .aff-header__search          { display: none; }
  .aff-header__mobile-controls { display: flex; }
}
@media (max-width: 480px) {
  .aff-header__inner { padding: 0 14px; }
  .aff-header__logo-text { font-size: 15px; }
}
