/* Shared site header. Single source: worker/partials/header.html for the markup,
   this file for the styling. Loaded by every page; the Worker injects the markup. */

/* =================== Header / nav ============================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.82);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 28px;
}
.nav-left { display: flex; align-items: center; gap: 28px; }
.brand img { height: 24px; width: auto; }
/* width/height attributes reserve space (no layout shift); CSS still sizes the image. */
img[width][height] { height: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--teal); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-right .school-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gold-deep, #8a6a10);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(235, 195, 81, 0.14);
  border: 1px solid rgba(235, 195, 81, 0.32);
  white-space: nowrap;
}
.nav-right .school-link:hover { background: rgba(235, 195, 81, 0.22); }
.nav-right .signin {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 12px;
  white-space: nowrap;
}
.nav-right .signin:hover { color: var(--teal); }

@media (max-width: 880px) {
  .nav-links, .nav-right .school-link, .nav-right .signin { display: none; }
  .site-header .container { padding-inline: 16px; }
  .site-header .nav { justify-content: space-between; gap: 16px; }
  .site-header .nav-left,
  .site-header .brand,
  .site-header .nav-right { flex: 0 0 auto; }
  .site-header .nav-right { margin-left: auto; }
  .site-header .nav-right > .btn-primary { display: none !important; }
}

/* --- Header elevation on scroll --- */
.site-header { transition: box-shadow 0.25s ease, background 0.25s ease; }
.site-header.scrolled {
  background: rgba(251, 250, 247, 0.94);
  box-shadow: 0 8px 24px -16px rgba(15, 26, 24, 0.22);
}
.brand img { transition: transform 0.25s ease; }
.brand:hover img { transform: scale(1.05) rotate(-2deg); }

/* --- Nav link underline sweep --- */
.nav-links a { position: relative; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: -5px;
  height: 1.5px;
  background: var(--teal);
  transition: right 0.25s ease;
}
.nav-links a:hover::after { right: 0; }

/* --- Mobile menu --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md, 12px);
  background: transparent;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .mobile-menu { padding-inline: 16px !important; }
}
.mobile-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 24px 48px -24px rgba(15, 26, 24, 0.25);
  padding: 10px var(--gutter) 22px;
  display: none;
  flex-direction: column;
  gap: 2px;
  transform-origin: top;
}
.mobile-menu.open { display: flex; animation: menuDrop 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes menuDrop {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.mobile-menu a {
  padding: 13px 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
}
.mobile-menu a:last-of-type { border-bottom: 0; }
.mobile-menu a:active { color: var(--teal); }
.mobile-menu .mobile-cta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 0;
  padding: 0;
}
.mobile-menu .mobile-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md, 12px);
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}
.mobile-menu .mobile-cta .school-link {
  background: rgba(235, 195, 81, 0.14);
  border-color: rgba(235, 195, 81, 0.38);
  color: var(--gold-deep, #8a6a10);
}
.mobile-menu .mobile-cta .btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 26, 24, 0.06));
}
