/* Step 3a: masthead and navigation bar (from the approved mockup). Scoped to our templates. */
.ai-site .skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 3px; font-weight: 700; }
.ai-site .skip-link:focus { top: 12px; }

.ai-site .masthead { background: var(--ink); color: var(--on-ink); }
.ai-site .masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.ai-site .brand { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.ai-site .brand .mascot { width: 52px; height: auto; flex: none; }
.ai-site .brand .wordmark { flex: 0 1 360px; width: 100%; max-width: 360px; min-width: 0; height: auto; }
.ai-site .mast-right { display: flex; align-items: center; gap: 24px; flex: none; }
.ai-site .dateline { text-align: right; font-size: 13px; color: var(--on-ink-muted); }
.ai-site .dateline .tagline { display: block; font-family: var(--display); font-style: italic; font-size: 17px; color: var(--on-ink); }
.ai-site .account { display: flex; align-items: center; gap: 12px; }

.ai-site .nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
/* Sticky only works when no parent is a scroll box. "hidden" (which tagDiv may set) creates one; "clip" stops sideways
   scrolling without that side effect. */
html:has(body.ai-site), body.ai-site { overflow-x: clip !important; overflow-y: visible !important; }
/* Logged-in staff: stick below the WordPress admin bar instead of behind it. */
body.admin-bar.ai-site .nav { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { body.admin-bar.ai-site .nav { top: 0; } }
.ai-site .nav .wrap { display: flex; align-items: center; gap: 6px; }
.ai-site .nav-bar { position: relative; }
.ai-site .nav .nav-row { position: relative; list-style: none; margin: 0; padding: 0; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.ai-site .nav .nav-row::-webkit-scrollbar { display: none; }
.ai-site .nav-row a { display: block; padding: 17px 13px 15px; font-weight: 600; font-size: 14.5px; white-space: nowrap; color: var(--muted); transition: color .2s; }
.ai-site .nav-row a:hover, .ai-site .nav-row a.active { color: var(--text); }
.ai-site .glide { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--sky); border-radius: 3px 3px 0 0; transition: transform .35s cubic-bezier(.3,.8,.2,1), width .35s cubic-bezier(.3,.8,.2,1); pointer-events: none; }
.ai-site .nav .paper-link { background: var(--ink); color: var(--on-ink); border-radius: 3px; padding: 7px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; margin-left: 8px; }
.ai-site .nav .search { flex: none; display: grid; place-items: center; padding: 10px; color: var(--text); }

/* Toggle icons: moon in light mode, sun in dark mode, with a short turn. */
.ai-site .theme-toggle { margin-left: 6px; flex: none; transition: background-color .2s; }
.ai-site .theme-toggle:hover { background: color-mix(in srgb, var(--sky) 25%, var(--paper-2)); }
.ai-site .theme-toggle svg { grid-area: 1 / 1; transition: transform .45s cubic-bezier(.3,.8,.2,1), opacity .3s; }
.ai-site .theme-toggle .i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
.ai-site.is-dark .theme-toggle .i-sun { opacity: 1; transform: none; }
.ai-site.is-dark .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
body.ai-site, .ai-site .nav { transition: background-color .35s ease, color .35s ease; }

@media (max-width: 960px) {
  .ai-site .mast-right .dateline { display: none; }
}
@media (max-width: 640px) {
  .ai-site .masthead .wrap { gap: 10px; padding-block: 10px; }
  .ai-site .brand .mascot { display: none; }
  .ai-site .account .btn { padding: 6px 10px; font-size: 12px; }
  .ai-site .nav .paper-link { display: none; }
  .ai-site .nav .nav-row { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-site .glide, .ai-site .theme-toggle svg, body.ai-site, .ai-site .nav { transition: none; }
}
@media print {
  .ai-site .nav { position: static; }
}

/* Step 3b: Menu button (two-line "burger" that turns into a cross). */
.ai-site .index-btn { flex: none; display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 14px 10px 0; margin-right: 6px; font: 700 14.5px var(--body); color: var(--text); cursor: pointer; border-right: 1px solid var(--rule); }
.ai-site .burger { position: relative; width: 22px; height: 12px; display: inline-block; }
.ai-site .burger i { position: absolute; left: 0; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .35s cubic-bezier(.3,.8,.2,1), width .35s, top .35s; }
.ai-site .burger i:first-child { top: 0; width: 22px; }
.ai-site .burger i:last-child { top: 9.5px; width: 14px; }
.ai-site .index-btn:hover .burger i:last-child { width: 22px; }
.ai-site .burger.open i { top: 5px; width: 22px; }
.ai-site .burger.open i:first-child { transform: rotate(45deg); }
.ai-site .burger.open i:last-child { transform: rotate(-45deg); }
@media (max-width: 640px) {
  .ai-site .index-word { display: none; }
  .ai-site .index-btn { padding-right: 10px; }
}
