/* ==========================================================================
   Header / Navigation / Footer
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(7, 21, 16, 0.94);
  border-bottom: 1px solid var(--line-1);
  /* NOTE: intentionally no backdrop-filter/filter/transform here.
     Any of those on this element would create a new "containing
     block" for the position:fixed mobile nav below, trapping its
     fixed positioning inside this header's own small box instead
     of the full viewport — that was the cause of the mobile menu
     only showing "Home" and cutting off. Don't reintroduce one
     without moving .main-nav out from under it. */
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  color: var(--text-0);
  font-weight: 600;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 6px;
  background: linear-gradient(155deg, var(--stp-primary), #0A3A20);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--stp-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-2); letter-spacing: 0.06em; font-weight: 400; }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.6vw, 1.6rem);
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-1);
  padding: 0.5rem 0.15rem;
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--stp-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.main-nav a:hover { color: var(--text-0); }
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--stp-secondary); }

.header-actions { display: flex; align-items: center; gap: 0.85rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  width: 42px; height: 42px;
  color: var(--text-0);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

html.nav-locked,
html.nav-locked body {
  overflow: hidden;
  height: 100%;
}

@media (max-width: 980px) {
  .main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--bg-0);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem var(--gutter);
    gap: 0.25rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
    overflow-y: auto;
  }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { width: 100%; padding: 0.9rem 0; border-bottom: 1px solid var(--line-1); font-size: 1.05rem; }
  /* The desktop underline (::after, positioned just below each link) has
     no room to sit cleanly between stacked full-width rows on mobile —
     it was overlapping the item below. Mobile rows already show hover/
     active state via color change + their own border-bottom separator,
     which is the correct pattern for a vertical list, so the underline
     is simply turned off here rather than repositioned. */
  .main-nav a::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-outline { display: none; }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line-1);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  margin-top: clamp(4rem, 8vw, 7rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-about p { color: var(--text-2); font-size: var(--step--1); max-width: 30ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { color: var(--text-1); font-size: var(--step--1); transition: color var(--dur-fast) var(--ease); }
.footer-col a:hover { color: var(--stp-secondary); }

.footer-social { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.social-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.social-icon:hover { border-color: var(--stp-secondary); color: var(--stp-secondary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-1);
  font-size: 0.82rem;
  color: var(--text-3);
}
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--stp-secondary); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---- Page hero (interior pages) ---- */
.page-hero {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line-1);
}
.page-hero h1 { max-width: 16ch; }
.page-hero .lede { font-size: var(--step-1); color: var(--text-2); max-width: 62ch; margin-top: 1rem; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--stp-secondary); }

/* ---- Page hero with background photo (About, Facilities) ---- */
.page-hero.has-media { position: relative; overflow: hidden; }
.page-hero-media { position: absolute; inset: 0; z-index: 0; }
.page-hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: grayscale(0.15);
}
.page-hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,21,16,0.5) 0%, var(--bg-0) 92%);
}
.page-hero.has-media .container { position: relative; z-index: 1; }

/* ---- Section spacing rhythm ---- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-alt { background: var(--bg-1); }
.section-border-top { border-top: 1px solid var(--line-1); }
