/* ==========================================================================
   Shell — NDI Defence Institute header, navigation, mobile tab bar, footer.

   Markup: includes/navbar.php, includes/mobile-bar.php, includes/footer.php.
   Behaviour: assets/js/navigation.js (data-* hooks only; no class coupling).

   Loaded last on every public page (includes/header.php) and unlayered, so
   it wins over app.css. It uses only the Phase 2 tokens from
   src/tailwind.src.css — no colour is defined here. Its own class prefix
   (shell-) keeps the old .site-nav / .site-footer / .app-bar rules in
   app.css and home-hero.css from reaching the new shell.

   Breakpoints (Tailwind's edges):
     < 640     phone: wordmark + menu button; tab bar along the bottom
     640–1023  tablet: wordmark, Enquire Now, menu button
     ≥ 1024    desktop: full navigation; the drawer and menu button go away
   ========================================================================== */

.shell-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.shell-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: #fff;
}

.shell-bar {
  background: var(--color-ndi-navy-950);
  border-bottom: 1px solid rgb(199 208 222 / 0.12);
  transition: box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}
.shell-header.is-scrolled .shell-bar {
  border-bottom-color: rgb(214 174 87 / 0.28);
  box-shadow: 0 12px 28px -20px rgb(0 0 0 / 0.7);
}
.shell-bar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.5rem; /* the height every page's top padding was built around */
}

/* Brand: the approved logo when present, otherwise the wordmark. */
.shell-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}
.shell-brand-logo { display: block; width: auto; height: 2.5rem; }
.shell-wordmark { display: inline-flex; align-items: center; gap: 0.7rem; line-height: 1; }
.shell-wordmark-mark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
}
.shell-wordmark-rule { width: 1px; height: 1.9rem; background: var(--color-ndi-gold-500); }
.shell-wordmark-name {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-ndi-mist);
}

/* Desktop navigation */
.shell-nav { display: none; margin-left: auto; }
.shell-nav-list { display: flex; align-items: center; gap: 0.125rem; margin: 0; padding: 0; list-style: none; }
.shell-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ndi-mist);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}
/* Active state: a gold rule under the label — no pill. */
.shell-nav-link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.45rem;
  height: 2px;
  background: var(--color-ndi-gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-brand);
}
.shell-nav-link:hover { color: #fff; }
.shell-nav-link.is-active { color: #fff; font-weight: 600; }
.shell-nav-link.is-active::after { transform: scaleX(1); }

.shell-actions { display: flex; flex: none; align-items: center; gap: 0.75rem; margin-left: auto; }
.shell-enquire { display: none; }

.shell-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgb(199 208 222 / 0.3);
  border-radius: var(--r-control);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.shell-menu-btn:hover { border-color: var(--color-ndi-gold-400); background: rgb(255 255 255 / 0.04); }

/* Utility strip: Student Portal / Public Quiz. Rendered only when at least
   one address is configured; on smaller screens they live in the drawer. */
.shell-utility {
  display: none;
  background: var(--color-ndi-navy-900);
  border-bottom: 1px solid rgb(199 208 222 / 0.1);
  font-size: var(--text-caption);
}
.shell-utility-inner { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; height: 2.25rem; }
.shell-utility-label { color: var(--color-ndi-steel-300); }
.shell-utility-links { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.shell-utility-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2rem;
  padding: 0 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--color-ndi-gold-400);
  text-decoration: none;
}
.shell-utility-link:hover { color: var(--color-ndi-gold-300); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 640px) {
  .shell-enquire { display: inline-flex; }
}
@media (min-width: 1024px) {
  .shell-nav { display: block; }
  .shell-actions { margin-left: 0.75rem; }
  .shell-bar .shell-menu-btn { display: none; }
  .shell-utility { display: block; }
}
@media (min-width: 1280px) {
  .shell-bar-inner { gap: 1.5rem; }
  .shell-nav-list { gap: 0.25rem; }
  .shell-nav-link { padding-inline: 0.95rem; }
  .shell-nav-link::after { left: 0.95rem; right: 0.95rem; }
}

/* --------------------------------------------------------------------------
   Drawer (phones and tablets)
   -------------------------------------------------------------------------- */
.shell-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-ndi-navy-950);
  color: #fff;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-brand);
}
.shell-drawer[hidden] { display: none; }
.shell-drawer.is-open { opacity: 1; transform: none; }

.shell-drawer-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  padding-inline: var(--gutter);
  border-bottom: 1px solid rgb(199 208 222 / 0.12);
}
.shell-drawer-nav,
.shell-drawer-actions { width: 100%; max-width: 40rem; margin-inline: auto; padding-inline: var(--gutter); }
.shell-drawer-nav { flex: 1; padding-block: 1rem 2rem; }
.shell-drawer-nav ul { margin: 0; padding: 0; list-style: none; }
.shell-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  border-bottom: 1px solid rgb(199 208 222 / 0.12);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #fff;
  text-decoration: none;
}
.shell-drawer-link svg { flex: none; color: var(--color-ndi-steel-300); transition: transform var(--dur-fast) ease; }
.shell-drawer-link:hover svg { transform: translateX(3px); }
.shell-drawer-link.is-active,
.shell-drawer-link.is-active svg { color: var(--color-ndi-gold-400); }

.shell-drawer-actions {
  display: grid;
  gap: 0.6rem;
  padding-block: 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(199 208 222 / 0.12);
}
.shell-drawer-cta { width: 100%; }
.shell-drawer-external { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; }
.shell-drawer-ext { width: 100%; }

/* Links settle in one after another as the drawer opens. */
.shell-drawer.is-open .shell-drawer-nav li {
  animation: shell-rise 360ms var(--ease-brand) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes shell-rise { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 1024px) {
  .shell-drawer { display: none; }
}

/* --------------------------------------------------------------------------
   Mobile tab bar (phones). `display` is set only below 640px: this file is
   unlayered, so an unconditional value would beat the sm:hidden utility.
   -------------------------------------------------------------------------- */
@media (max-width: 639.98px) {
  .shell-tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: block;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--color-ndi-navy-950);
    border-top: 1px solid rgb(199 208 222 / 0.14);
  }
}
.shell-tabbar-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  height: var(--mobile-bar);
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-tabbar-tab,
.shell-tabbar-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  font: 600 0.6875rem/1 var(--font-sans);
  letter-spacing: 0.01em;
  color: var(--color-ndi-steel-300);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shell-tabbar-tab.is-on { color: var(--color-ndi-gold-400); }
.shell-tabbar-action { color: #fff; }
.shell-tabbar-ring {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  margin-top: -1.5rem;
  border-radius: var(--r-pill);
  background: var(--color-ndi-gold-500);
  color: var(--color-ndi-navy-950);
  box-shadow: 0 0 0 4px var(--color-ndi-navy-950);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.shell-footer {
  position: relative;
  background: var(--color-ndi-navy-950);
  border-top: 1px solid rgb(214 174 87 / 0.3);
  color: var(--color-ndi-mist);
}
.shell-footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 2.5rem;
  border-bottom: 1px solid rgb(199 208 222 / 0.12);
}
.shell-footer-cta-text {
  max-width: 34ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
}

.shell-footer-grid { display: grid; gap: 2.5rem; padding-block: 3rem; }
.shell-footer-about { max-width: 36ch; margin: 1.25rem 0 0; font-size: 0.9375rem; line-height: 1.7; color: var(--color-ndi-mist); }
.shell-footer-title {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ndi-gold-400);
}
.shell-footer-col ul,
.shell-footer-contact { display: grid; gap: 0.15rem; margin: 0; padding: 0; list-style: none; }
.shell-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  color: var(--color-ndi-mist);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}
.shell-footer-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--color-ndi-gold-500); }

.shell-footer-contact { margin-top: 1.5rem; gap: 0.6rem; }
.shell-footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9375rem; }
.shell-footer-contact svg { flex: none; margin-top: 0.2rem; color: var(--color-ndi-gold-400); }
.shell-footer-contact a { color: #fff; text-decoration: none; }
.shell-footer-contact a:hover { text-decoration: underline; text-underline-offset: 4px; }
.shell-footer-contact address { font-style: normal; line-height: 1.6; }

.shell-footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid rgb(199 208 222 / 0.12);
  font-size: var(--text-caption);
  color: var(--color-ndi-steel-300);
}
.shell-footer-base p { margin: 0; }
.shell-footer-credit a { font-weight: 600; color: #fff; text-decoration: none; }
.shell-footer-credit a:hover { color: var(--color-ndi-gold-400); }

@media (min-width: 640px) {
  .shell-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell-footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  /* Two link columns, or three when Student access is configured. */
  .shell-footer-grid { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
  .shell-footer-grid.has-external { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
  .shell-footer-brand { grid-column: auto; }
}

/* --------------------------------------------------------------------------
   Reduced motion: no slide, no stagger, no underline sweep.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .shell-drawer,
  .shell-bar,
  .shell-nav-link,
  .shell-nav-link::after,
  .shell-drawer-link svg { transition: none; }
  .shell-drawer { transform: none; }
  .shell-drawer.is-open .shell-drawer-nav li { animation: none; }
}

/* --------------------------------------------------------------------------
   Navigation groups (2026-10-20): dropdown panels on the desktop bar, labelled
   groups in the drawer, legal links in the footer base.
   Behaviour: assets/js/navigation.js ([data-dropdown]).
   -------------------------------------------------------------------------- */
.shell-nav-group { position: relative; }
.shell-nav-chevron { display: inline-flex; margin-left: 0.3rem; color: var(--color-ndi-steel-300); transition: transform var(--dur-fast) ease; }
.shell-nav-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 70;
  min-width: 15rem;
  padding: 0.5rem;
  border: 1px solid rgb(214 174 87 / 0.28);
  border-radius: 6px;
  background: var(--color-ndi-navy-900);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.6);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-brand);
}
/* An invisible bridge over the gap so the pointer can cross to the panel. */
.shell-nav-panel::before { content: ""; position: absolute; inset: -0.5rem 0 auto; height: 0.5rem; }
.shell-nav-panel.is-open { opacity: 1; transform: none; }
.shell-nav-panel[hidden] { display: none; }
.shell-nav-panel ul { margin: 0; padding: 0; list-style: none; }
.shell-nav-sublink {
  display: flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 0.85rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ndi-mist);
  text-decoration: none;
  white-space: nowrap;
}
.shell-nav-sublink:hover,
.shell-nav-sublink:focus-visible { background: rgb(255 255 255 / 0.06); color: #fff; }
.shell-nav-sublink.is-active { color: var(--color-ndi-gold-400); font-weight: 600; }

.shell-drawer-group span {
  display: block;
  padding: 1.5rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ndi-gold-400);
}
.shell-drawer-nav li.is-child .shell-drawer-link { min-height: 3rem; font-size: 1.1rem; }

.shell-footer-legal { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.shell-footer-legal a { color: var(--color-ndi-mist); text-decoration: none; }
.shell-footer-legal a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .shell-nav-panel, .shell-nav-chevron { transition: none; }
}

/* ==========================================================================
   Floating horizontal header (2026-10-20). Overrides the solid navy bar
   above: one rounded white bar floating 12px below the top edge, so the
   page keeps its 4.5rem (12px + 60px) header allowance and no page offset
   changes. Markup: includes/navbar.php.

     ≥1440px  crest, wordmark, all eleven links, Enquire Now (+ phone ≥1600)
     1280–1439  tier 1 + 2 links, the rest under More, Enquire Now
     1024–1279  tier 1 links, the rest under More, Enquire Now
     <1024    crest, wordmark, (≥640) phone + Enquire Now, menu button
   ========================================================================== */
.shell-header {
  padding: 0.75rem 0.75rem 0;
  pointer-events: none;          /* the gap around the bar lets clicks through */
  color: var(--color-ndi-ink-900);
}
.shell-bar {
  pointer-events: auto;
  max-width: 120rem;
  margin-inline: auto;
  background: rgb(255 255 255 / 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgb(255 255 255 / 0.75);
  border-radius: 999px;
  box-shadow: 0 14px 34px -18px rgb(2 10 24 / 0.65), 0 0 0 1px rgb(16 39 70 / 0.05);
}
.shell-header.is-scrolled .shell-bar {
  background: rgb(255 255 255 / 0.98);
  border-color: rgb(214 174 87 / 0.45);
  box-shadow: 0 18px 40px -18px rgb(2 10 24 / 0.7), 0 0 0 1px rgb(16 39 70 / 0.06);
}
.shell-bar-inner {
  height: 3.75rem;
  gap: 0.75rem;
  padding: 0 0.45rem 0 0.4rem;
}

/* Brand */
.shell-bar .shell-brand { gap: 0.6rem; color: var(--color-ndi-navy-950); border-radius: 999px; }
.shell-crest { display: block; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; box-shadow: 0 0 0 1px rgb(16 39 70 / 0.12), 0 6px 14px -8px rgb(16 39 70 / 0.6); }
.shell-bar .shell-wordmark { display: grid; gap: 0.2rem; line-height: 1; }
.shell-bar .shell-wordmark-mark { font-size: 1.2rem; letter-spacing: 0.04em; color: var(--color-ndi-navy-950); }
.shell-bar .shell-wordmark-name { font-size: 0.6rem; letter-spacing: 0.22em; color: var(--color-ndi-gold-700); white-space: nowrap; }

/* Links */
.shell-bar .shell-nav { flex: none; margin-inline: auto; }
.shell-bar .shell-nav-list { flex-wrap: nowrap; gap: 0.1rem; }
.shell-bar .shell-nav-link {
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-ndi-ink-700);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.shell-bar .shell-nav-link::after { display: none; }
.shell-bar .shell-nav-link:hover,
.shell-bar .shell-nav-link[aria-expanded="true"] { background: rgb(16 39 70 / 0.06); color: var(--color-ndi-navy-900); }
.shell-bar .shell-nav-link.is-active {
  background: var(--color-ndi-panel);
  box-shadow: inset 0 0 0 1px rgb(16 39 70 / 0.1);
  color: var(--color-ndi-navy-900);
  font-weight: 600;
}
.shell-bar .shell-nav-link:focus-visible { outline: 2px solid var(--color-ndi-gold-600); outline-offset: 2px; }
.shell-bar .shell-nav-chevron { margin-left: 0.25rem; color: var(--color-ndi-ink-500); }

/* Dropdown panels on the white bar */
.shell-bar .shell-nav-panel {
  top: calc(100% + 0.6rem);
  min-width: 15rem;
  padding: 0.45rem;
  border: 1px solid var(--color-ndi-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 48px -22px rgb(2 10 24 / 0.45);
}
.shell-bar .shell-nav-panel::before { inset: -0.75rem 0 auto; height: 0.75rem; }
.shell-nav-panel--end { left: auto; right: 0; }
.shell-bar .shell-nav-sublink { gap: 0.4rem; justify-content: space-between; border-radius: 9px; color: var(--color-ndi-ink-900); }
.shell-bar .shell-nav-sublink:hover,
.shell-bar .shell-nav-sublink:focus-visible { background: var(--color-ndi-panel); color: var(--color-ndi-navy-900); }
.shell-bar .shell-nav-sublink.is-active { color: var(--color-ndi-gold-700); }
.shell-nav-panel-foot { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px solid var(--color-ndi-line); }
.shell-nav-panel-foot .shell-nav-sublink { font-weight: 600; }

/* Tiers: what the bar shows directly, and what waits under More */
.shell-nav-list > .shell-tier-2,
.shell-nav-list > .shell-tier-3 { display: none; }
@media (min-width: 1280px) {
  .shell-nav-list > .shell-tier-2 { display: list-item; }
  .shell-nav-more li.shell-tier-2 { display: none; }
}
@media (min-width: 1440px) {
  .shell-nav-list > .shell-tier-3 { display: list-item; }
  .shell-nav-more { display: none; }
  .shell-bar .shell-nav-list { gap: 0; }
  .shell-bar .shell-nav-link { padding-inline: 0.52rem; }
}
@media (min-width: 1600px) {
  .shell-bar .shell-nav-list { gap: 0.1rem; }
  .shell-bar .shell-nav-link { padding-inline: 0.78rem; }
}
@media (min-width: 1700px) {
  .shell-bar .shell-nav-list { gap: 0.25rem; }
  .shell-bar .shell-nav-link { font-size: 0.875rem; padding-inline: 0.9rem; }
}

/* Actions */
.shell-bar .shell-actions { margin-left: auto; gap: 0.5rem; }
.shell-bar .shell-nav + .shell-actions { margin-left: 0; }
@media (max-width: 1023.98px) { .shell-bar .shell-nav + .shell-actions { margin-left: auto; } }
.shell-phone {
  display: none;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-ndi-line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--color-ndi-navy-900);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.shell-phone:hover { border-color: var(--color-ndi-gold-500); color: var(--color-ndi-gold-700); }
@media (min-width: 640px) and (max-width: 1023.98px) { .shell-phone { display: inline-grid; } }
.shell-enquire {
  align-items: center;
  gap: 0.45rem;
  flex: none;
  height: 2.75rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-ndi-navy-700), var(--color-ndi-navy-950));
  box-shadow: 0 10px 22px -12px rgb(8 23 47 / 0.8), inset 0 0 0 1px rgb(214 174 87 / 0.35);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  text-decoration: none;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-base) ease;
}
.shell-enquire svg { color: var(--color-ndi-gold-400); transition: transform var(--dur-fast) ease; }
.shell-enquire:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgb(8 23 47 / 0.9), inset 0 0 0 1px rgb(214 174 87 / 0.6); }
.shell-enquire:hover svg { transform: translateX(2px); }
.shell-enquire:focus-visible, .shell-phone:focus-visible, .shell-bar .shell-brand:focus-visible { outline: 2px solid var(--color-ndi-gold-600); outline-offset: 3px; }
.shell-bar .shell-menu-btn { border-color: var(--color-ndi-line-strong); border-radius: 50%; background: #fff; color: var(--color-ndi-navy-900); }
.shell-bar .shell-menu-btn:hover { border-color: var(--color-ndi-gold-500); background: #fff; }

/* Drawer brand */
.shell-drawer-brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.shell-drawer-brand img { border-radius: 50%; }

@media (max-width: 399.98px) {
  .shell-header { padding-inline: 0.5rem; }
  .shell-bar .shell-wordmark-name { letter-spacing: 0.16em; }
}
@media (prefers-reduced-motion: reduce) {
  .shell-bar .shell-nav-link, .shell-enquire, .shell-enquire svg, .shell-phone { transition: none; }
  .shell-enquire:hover { transform: none; }
}

/* ==========================================================================
   Header states (2026-10-20, second pass)

   At the top of a page the header is open: no surface, white type over the
   navy hero, a gold rule under the current page and a gold call to action.
   Once the page scrolls (navigation.js adds .is-scrolled past 24px) the same
   bar settles into a floating frosted-glass capsule with navy type.

   Both states keep identical widths and spacing, so the eleven links never
   reflow when the state changes; only the surface, colours and the bar's
   top offset animate. Total height is 4.5rem in both (72px open; 12px + 60px
   floating), the allowance every page's top padding was built around.
   ========================================================================== */
.shell-header {
  transition: padding var(--dur-base) var(--ease-brand), background-color var(--dur-base) ease;
}
.shell-bar {
  transition: background-color 320ms ease, border-color 320ms ease, box-shadow 320ms ease,
              border-radius 320ms var(--ease-brand), -webkit-backdrop-filter 320ms ease, backdrop-filter 320ms ease;
}
.shell-bar-inner { transition: height 320ms var(--ease-brand); }

/* ---- Open state (top of page) ---- */
.shell-header:not(.is-scrolled) {
  padding-top: 0;
  /* a faint veil keeps white type legible over any hero photograph */
  background: linear-gradient(180deg, rgb(3 10 24 / 0.55), rgb(3 10 24 / 0));
}
.shell-header:not(.is-scrolled) .shell-bar {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.shell-header:not(.is-scrolled) .shell-bar-inner { height: 4.5rem; }
.shell-header:not(.is-scrolled) .shell-crest { box-shadow: 0 0 0 3px rgb(214 174 87 / 0.28), 0 8px 22px -10px rgb(0 0 0 / 0.8); }
.shell-header:not(.is-scrolled) .shell-bar .shell-wordmark-mark { color: #fff; }
.shell-header:not(.is-scrolled) .shell-bar .shell-wordmark-name { color: var(--color-ndi-gold-400); }
.shell-header:not(.is-scrolled) .shell-wordmark-tag { color: var(--color-ndi-steel-300); }
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link { color: rgb(226 233 243 / 0.86); }
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link:hover,
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link[aria-expanded="true"] { background: rgb(255 255 255 / 0.07); color: #fff; }
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link.is-active { background: transparent; box-shadow: none; color: #fff; }
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link::after {
  display: block;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-ndi-gold-300), var(--color-ndi-gold-500));
  box-shadow: 0 0 10px rgb(214 174 87 / 0.6);
}
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link.is-active::after { transform: scaleX(1); }
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-chevron { color: var(--color-ndi-steel-300); }
.shell-header:not(.is-scrolled) .shell-phone,
.shell-header:not(.is-scrolled) .shell-bar .shell-menu-btn {
  border-color: rgb(255 255 255 / 0.28);
  background: rgb(255 255 255 / 0.05);
  color: #fff;
}
.shell-header:not(.is-scrolled) .shell-phone:hover,
.shell-header:not(.is-scrolled) .shell-bar .shell-menu-btn:hover { border-color: var(--color-ndi-gold-400); background: rgb(255 255 255 / 0.1); color: var(--color-ndi-gold-300); }

/* ---- Floating state (scrolled) ---- */
.shell-header.is-scrolled .shell-bar {
  background: rgb(246 249 253 / 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-color: rgb(255 255 255 / 0.7);
  box-shadow: 0 18px 44px -20px rgb(2 10 24 / 0.75), 0 0 0 1px rgb(16 39 70 / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.9);
}

/* ---- Call to action: gold in both states ---- */
.shell-enquire {
  background: linear-gradient(135deg, #ecca78 0%, var(--color-ndi-gold-500) 52%, #b8913a 100%);
  color: var(--color-ndi-navy-950);
  box-shadow: 0 12px 28px -12px rgb(214 174 87 / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.45);
}
.shell-enquire svg { color: var(--color-ndi-navy-950); }
.shell-enquire:hover { box-shadow: 0 16px 34px -12px rgb(214 174 87 / 0.95), inset 0 1px 0 rgb(255 255 255 / 0.55); filter: brightness(1.04); }

/* ---- Brand tagline, only where the row has room for it ---- */
.shell-wordmark-tag { display: none; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.02em; color: var(--color-ndi-ink-500); white-space: nowrap; }
@media (min-width: 1800px) {
  .shell-wordmark-tag { display: block; margin-top: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .shell-header, .shell-bar, .shell-bar-inner { transition: none; }
}

/* Search (opens the NDI Assistant) and the open header's hairline
   (reference design, 2026-10-20). Search shows where the row has room. */
.shell-search {
  display: none;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-ndi-line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--color-ndi-navy-900);
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.shell-search[hidden] { display: none !important; }
.shell-search:hover { border-color: var(--color-ndi-gold-500); color: var(--color-ndi-gold-700); }
.shell-search:focus-visible { outline: 2px solid var(--color-ndi-gold-600); outline-offset: 3px; }
@media (min-width: 1600px) { .shell-search { display: inline-grid; } }
.shell-header:not(.is-scrolled) .shell-search { border-color: rgb(255 255 255 / 0.3); background: rgb(255 255 255 / 0.04); color: #fff; }
.shell-header:not(.is-scrolled) .shell-search:hover { border-color: var(--color-ndi-gold-400); color: var(--color-ndi-gold-300); }
.shell-header:not(.is-scrolled) .shell-bar { border-bottom: 1px solid rgb(199 208 222 / 0.14); }
@media (prefers-reduced-motion: reduce) { .shell-search { transition: none; } }

/* ==========================================================================
   Mega menus: Courses and Course Details (2026-10-20, reference design).
   A wide white panel centred under the bar, photo cards with a title, a gold
   kicker, a short line and "Explore", and a footer row of links. The panel
   anchors to the bar (not to its menu item) so it can sit centred; it is
   still a child of the menu item, so hover and focus keep it open.
   Markup: includes/navbar.php. Behaviour: navigation.js [data-dropdown].
   ========================================================================== */
.shell-bar .shell-bar-inner { position: relative; }
.shell-bar .shell-nav-group:has(> .shell-mega) { position: static; }
.shell-bar .shell-nav-panel.shell-mega {
  --mega-w: min(60rem, calc(100vw - 2rem));
  left: calc(50% - var(--mega-w) / 2);
  right: auto;
  width: var(--mega-w);
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgb(16 39 70 / 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  box-shadow: 0 34px 70px -28px rgb(2 10 24 / 0.6), 0 0 0 1px rgb(214 174 87 / 0.18);
}
.shell-bar .shell-nav-panel.shell-mega::before { inset: -1rem 0 auto; height: 1rem; }
.shell-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-mega-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #edf3fa;
  color: var(--color-ndi-ink-900);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-brand), box-shadow var(--dur-base) var(--ease-brand), background-color var(--dur-fast) ease;
}
.shell-mega-card:hover,
.shell-mega-card:focus-visible { background: #e4edf8; transform: translateY(-2px); box-shadow: 0 16px 30px -20px rgb(8 23 47 / 0.55); }
.shell-mega-card:focus-visible { outline: 2px solid var(--color-ndi-gold-600); outline-offset: 2px; }
.shell-mega-card.is-active { box-shadow: inset 0 0 0 2px var(--color-ndi-gold-500); }
.shell-mega-media { display: block; height: 9.5rem; overflow: hidden; background: var(--color-ndi-navy-900); }
.shell-mega-media img, .shell-mega-media picture { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-brand); }
.shell-mega-card:hover .shell-mega-media img { transform: scale(1.05); }
.shell-mega-body { display: flex; flex-direction: column; flex: 1; gap: 0.35rem; padding: 0.95rem 1.05rem 1.05rem; }
.shell-mega-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.25; color: var(--color-ndi-navy-950); }
.shell-mega-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-ndi-gold-700); }
.shell-mega-text { margin-top: 0.15rem; font-size: 0.86rem; line-height: 1.5; color: var(--color-ndi-ink-700); }
.shell-mega-go { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; font-size: 0.88rem; font-weight: 700; color: var(--color-ndi-navy-800); }
.shell-mega-go svg { transition: transform var(--dur-fast) ease; }
.shell-mega-card:hover .shell-mega-go svg { transform: translateX(3px); }

/* Course Details: more cards, so smaller photos */
.shell-mega--details .shell-mega-media { height: 6.25rem; }
.shell-mega--details .shell-mega-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.shell-mega-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--color-ndi-line); }
.shell-mega-foot a {
  display: flex;
  flex: 1 1 16rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ndi-navy-950);
  text-decoration: none;
  transition: background-color var(--dur-fast) ease;
}
.shell-mega-foot a strong { color: var(--color-ndi-gold-700); font-weight: 700; }
.shell-mega-foot a svg { flex: none; color: var(--color-ndi-navy-800); transition: transform var(--dur-fast) ease; }
.shell-mega-foot a:hover { background: #edf3fa; }
.shell-mega-foot a:hover svg { transform: translateX(3px); }
.shell-mega-foot a:focus-visible { outline: 2px solid var(--color-ndi-gold-600); outline-offset: 2px; }

/* Short screens: keep the whole panel in view */
@media (max-height: 820px) {
  .shell-mega-media { height: 7rem; }
  .shell-mega--details .shell-mega-media { height: 4.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shell-mega-card, .shell-mega-media img, .shell-mega-go svg, .shell-mega-foot a svg { transition: none; }
  .shell-mega-card:hover, .shell-mega-card:focus-visible { transform: none; }
  .shell-mega-card:hover .shell-mega-media img { transform: none; }
}
