/* ==========================================================================
   StudentHPC — Site chrome
   Utility bar, masthead, primary nav, footer. Shared by every page.
   Depends on: tokens.css, base.css, components.css
   ========================================================================== */

/* ==========================================================================
   UTILITY BAR — the thin institutional strip above the masthead.
   Carries the things a .edu visitor checks before anything else: who we are,
   and whether the cluster is up.
   ========================================================================== */
.utility-bar {
  background: var(--slate-950);
  color: var(--white);
  font-size: var(--fs-2xs);
  border-bottom: 1px solid var(--slate-800);
}
.utility-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--utilbar-h);
  flex-wrap: wrap;
}
.utility-bar__org { color: var(--slate-300); letter-spacing: var(--ls-wide); }
.utility-bar__org strong { color: var(--white); font-weight: var(--fw-semibold); }
.utility-bar__links { display: flex; align-items: center; gap: var(--sp-5); }
.utility-bar a {
  color: var(--slate-300);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease);
}
.utility-bar a:hover { color: var(--white); text-decoration: underline; }

/* Status pill sits inline in the utility bar and again in the docs top bar. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: var(--pine-300);
  text-decoration: none;
}
.status-pill:hover { color: var(--pine-200); }

/* ==========================================================================
   MASTHEAD
   ========================================================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: 1px solid var(--border-base);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  min-height: var(--topbar-h);
}

/* --- Wordmark ---------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.wordmark:hover { color: var(--text); text-decoration: none; }
.wordmark__mark { flex-shrink: 0; }
.wordmark__text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark__name {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
}
.wordmark__name .is-light { font-weight: var(--fw-regular); }
.wordmark__sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Primary nav ------------------------------------------------------- */
.nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav__link {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-1);
  transition: color var(--motion-fast) var(--ease), background-color var(--motion-fast) var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-subtle); text-decoration: none; }
.nav__link[aria-current='page'] {
  color: var(--text-brand);
  font-weight: var(--fw-semibold);
  box-shadow: inset 0 -2px 0 var(--border-brand);
  border-radius: 0;
}

.masthead__actions { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }

/* --- Mobile toggle ----------------------------------------------------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border-base);
  border-radius: var(--r-1);
  color: var(--text);
}
.nav-toggle:hover { background: var(--surface-subtle); }
.nav-toggle__bars { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.nav-toggle__bars span {
  display: block; height: 2px; width: 100%;
  background: currentColor; border-radius: 1px;
  transition: transform var(--motion-base) var(--ease), opacity var(--motion-fast) var(--ease);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   FOOTER — deep pine, multi-column, institutional
   ========================================================================== */
.footer {
  background: var(--surface-brand-dk);
  color: var(--text-invert);
  padding-block: var(--sp-16) var(--sp-8);
  border-top: 3px solid var(--pine-600);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  padding-bottom: var(--sp-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer__brand { max-width: 34ch; }
.footer__wordmark { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.footer__wordmark .wordmark__name { color: var(--white); font-size: var(--fs-lg); }
.footer__blurb { font-size: var(--fs-sm); line-height: var(--lh-relaxed); color: var(--pine-200); }

.footer__col-title {
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--white);
  margin-bottom: var(--sp-4);
}
.footer__list { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer__list a {
  font-size: var(--fs-sm);
  color: var(--pine-200);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease);
}
.footer__list a:hover { color: var(--white); text-decoration: underline; }

.footer__legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding-top: var(--sp-6);
  font-size: var(--fs-xs);
  color: var(--pine-200);
}
.footer__legal a { color: var(--pine-200); }
.footer__legal a:hover { color: var(--white); }
.footer__ein { font-family: var(--font-mono); font-size: var(--fs-2xs); }

@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .footer__brand { grid-column: 1 / -1; max-width: 52ch; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .masthead__inner { flex-wrap: wrap; }
  .nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: var(--sp-2) var(--sp-4);
    border-top: 1px solid var(--border-hair);
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: var(--sp-3) var(--sp-2); border-radius: 0; }
  .nav__link[aria-current='page'] { box-shadow: inset 3px 0 0 var(--border-brand); }
  .utility-bar__org { display: none; }
  .utility-bar__inner { justify-content: center; }
}

@media (max-width: 600px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__legal { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .masthead__actions .btn span.is-long { display: none; }
}

/* Bare footer variant — used on pages with no footer nav (e.g. the form). */
.footer__legal--bare { padding-top: 0; border-top: none; }

/* At 390px the utility bar's three links wrap into a ragged block. Keep the
   status pill (the one thing a returning user checks) and drop the rest --
   both destinations are in the masthead nav directly below. */
@media (max-width: 600px) {
  .utility-bar__links a:not(.status-pill) { display: none; }
  .utility-bar__links { gap: var(--sp-3); }
  .utility-bar__inner { min-height: 30px; }
}

/* Policy row in the site footer's legal block. */
.footer__policy { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }

/* Organisation contact block in the footer. <address> is italic by default. */
.footer__address {
  font-style: normal;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--pine-200);
  margin-top: var(--sp-4);
}
.footer__address a { color: var(--pine-200); }
.footer__address a:hover { color: var(--white); }
