/* Public masthead and navigation. Keep long school names out of the menu row. */
.site-header {
  position: relative;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px #19334404;
}
.site-header .header-inner {
  min-height: 112px;
  padding-block: 20px;
  gap: 24px;
  flex-wrap: nowrap;
}
.site-header .brand { gap: 18px; min-width: 0; }
.site-header .brand-logo,
.site-header .brand-mark { width: 64px; height: 64px; flex-shrink: 0; }
.site-header .brand-copy { display: block; min-width: 0; }
.site-header .brand strong {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.5;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.site-header .brand-affiliation {
  display: block;
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: .82rem;
  line-height: 1.6;
}
.site-header .brand small {
  display: block;
  margin-top: 5px;
  font-size: .65rem;
  line-height: 1.6;
  letter-spacing: .15em;
  overflow-wrap: anywhere;
  color: #6b7f88;
}
.navigation-bar {
  background: #f8faf9;
  background: color-mix(in srgb, var(--school-accent) 4%, white);
  border-top: 1px solid #eaf0ec;
}
.site-header .main-navigation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-block: 8px;
  font-size: .9rem;
  font-weight: 500;
}
.site-header .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--foreground);
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.site-header .nav-link:hover,
.site-header .nav-details[open] > summary {
  background: #fff;
  color: var(--school-accent);
}
.site-header .nav-link.is-active,
.site-header .nav-details.is-active > summary {
  color: var(--school-accent);
  background: #fff;
  border-color: #dce5df;
  border-color: color-mix(in srgb, var(--school-accent) 22%, white);
  box-shadow: 0 2px 5px #19334405;
  font-weight: 600;
}
.nav-home-icon { width: 18px; height: 18px; flex-shrink: 0; }
.site-header .nav-details { position: relative; flex-shrink: 0; }
.site-header .nav-details > summary { cursor: pointer; list-style: none; }
.site-header .nav-details > summary::-webkit-details-marker { display: none; }
.nav-chevron { width: 16px; height: 16px; flex-shrink: 0; transition: transform .16s ease; }
.nav-details[open] > summary .nav-chevron { transform: rotate(180deg); }
.site-header .nav-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: var(--popup-shift, 0px);
  z-index: 50;
  width: 310px;
  min-width: 0;
  max-width: calc(100vw - 32px);
  max-height: min(480px, 65vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 40px #1933441c, 0 3px 8px #19334408;
}
.site-header .nav-popup a {
  display: block;
  padding: 11px 13px;
  min-height: 44px;
  border-radius: 7px;
  font-size: .875rem;
  line-height: 1.65;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
}
.site-header .nav-popup a:hover,
.site-header .nav-popup a[aria-current="page"] {
  background: #f0f5f2;
  background: color-mix(in srgb, var(--school-accent) 8%, white);
  color: var(--school-accent);
}
.site-header .nav-popup .nav-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  font-weight: 600;
}
.site-header summary:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
.site-header .nav-popup a:focus-visible { outline-offset: -3px; }
.site-header .mobile-menu-button { display: none; }
@media (max-width: 1000px) and (min-width: 761px) {
  .site-header .nav-link { padding-inline: 14px; }
  .site-header .main-navigation { gap: 4px; }
}
@media (max-width: 760px) {
  .site-header .header-inner { min-height: 96px; padding-block: 16px; gap: 12px; }
  .site-header .brand { gap: 12px; flex: 1; }
  .site-header .brand-logo,
  .site-header .brand-mark { width: 48px; height: 54px; }
  .site-header .brand strong { font-size: 1.05rem; line-height: 1.55; }
  .site-header .brand-affiliation { font-size: .7rem; margin-top: 3px; }
  .site-header .brand small { font-size: .55rem; letter-spacing: .09em; margin-top: 5px; }
  .site-header .mobile-menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    min-width: 54px;
    min-height: 54px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--foreground);
    font-size: .65rem;
    line-height: 1.4;
  }
  .mobile-menu-button svg { width: 22px; height: 22px; }
  .mobile-menu-button path { transform-origin: center; transition: transform .16s ease, opacity .16s ease; }
  .mobile-menu-button[aria-expanded="true"] { background: #f0f5f2; color: var(--school-accent); }
  .mobile-menu-button[aria-expanded="true"] .menu-line-top { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-button[aria-expanded="true"] .menu-line-middle { opacity: 0; }
  .mobile-menu-button[aria-expanded="true"] .menu-line-bottom { transform: translateY(-6px) rotate(-45deg); }
  .site-header .main-navigation { flex-direction: column; align-items: stretch; gap: 5px; padding-block: 12px; }
  .site-header .main-navigation.is-enhanced { display: none; }
  .site-header .main-navigation.open { display: flex; }
  .site-header .nav-link { display: flex; justify-content: flex-start; width: 100%; min-height: 48px; padding: 12px 16px; white-space: normal; overflow-wrap: anywhere; }
  .site-header .nav-link > span { min-width: 0; }
  .site-header .nav-chevron { margin-left: auto; }
  .site-header .nav-details { width: 100%; }
  .site-header .nav-popup {
    position: static;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    margin: 5px 0 8px 18px;
    padding: 6px;
    border-radius: 8px;
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .nav-link, .nav-chevron, .mobile-menu-button path { transition: none; }
}
