/* ═══════════════════════════════════════════════
   Cruiser Milwaukee Sea Cadets — Global Stylesheet
   ═══════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --ink:       #060e1a;
  --navy:      #0a1628;
  --navy-mid:  #1e2d42;
  --gold:      #c8922a;
  --gold-lt:   #e8b84b;
  --gold-dark: #8a5f12;
  --steel:     #b8ccde;
  --chalk:     #f0f4f8;

  --f-display: 'Bebas Neue', sans-serif;
  --f-label:   'Barlow Condensed', sans-serif;
  --f-body:    'Barlow', sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--ink);
  color: var(--chalk);
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-lt); }

/* ── TYPOGRAPHY UTILITIES ── */
.display { font-family: var(--f-display); }
.label   { font-family: var(--f-label); }

/* H1 & H2 — Bebas Neue per brand guidelines */
h1, h2 { font-family: var(--f-display); letter-spacing: .04em; }

/* H3, H4, H5 — Barlow Condensed Bold per brand guidelines (card titles, subheadings) */
h3, h4, h5 {
  font-family: var(--f-label);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(6,14,26,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  border-bottom: 1px solid rgba(200,146,42,.15);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.nav-seal {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-seal img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
}

.nav-logo-text {
  font-family: var(--f-display);
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: .06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--f-label);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--chalk); }

.nav-links a.active { color: var(--gold); }

.nav-cta {
  background: var(--gold);
  color: var(--ink) !important;
  padding: .45rem 1.2rem;
  border-radius: 3px;
  transition: background .2s, transform .2s !important;
}

.nav-cta:hover {
  background: var(--gold-lt) !important;
  transform: translateY(-1px);
}

/* ── MOBILE NAV TOGGLE ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--chalk);
  border-radius: 2px;
  transition: all .25s;
}

/* Hamburger → ✕ when open */
.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;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── CONTAINER ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

/* ── PAGE HERO ── */
.page-hero {
  background: var(--navy);
  padding: 7rem 2.5rem 4rem;
  border-bottom: 1px solid rgba(200,146,42,.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(200,146,42,.08) 0%, transparent 65%);
  pointer-events: none;
}

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--f-label);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}

.eyebrow-line {
  width: 32px;
  height: 1.5px;
  background: var(--gold);
}

.page-hero h1 {
  font-family: var(--f-display);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .95;
  letter-spacing: .02em;
  color: var(--chalk);
  margin-bottom: 1.2rem;
}

.page-hero h1 span { color: var(--gold); }

.page-hero-sub {
  font-family: var(--f-body);
  font-size: 1.1rem;
  color: var(--steel);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── SECTION HEADINGS ── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--f-label);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: .95;
  color: var(--chalk);
  margin-bottom: 1rem;
}

.section-title span { color: var(--gold); }

.section-body {
  font-size: 1rem;
  color: var(--steel);
  line-height: 1.75;
  max-width: 640px;
}

/* ── GOLD RULE ── */
.gold-rule {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 1.2rem 0;
}

/* ── CARDS ── */
.card {
  background: var(--navy-mid);
  border: 1px solid rgba(200,146,42,.12);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color .2s, transform .2s;
}

.card:hover {
  border-color: rgba(200,146,42,.35);
  transform: translateY(-3px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-family: var(--f-display);
  font-size: 1.6rem;
  color: var(--chalk);
  margin-bottom: .5rem;
}

.card p {
  font-size: .92rem;
  color: var(--steel);
  line-height: 1.7;
}

/* ── GRID UTILITIES ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ── BLOCKQUOTE ── */
blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem;
  background: rgba(200,146,42,.06);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--chalk);
  line-height: 1.7;
  margin: 2rem 0;
}

blockquote footer {
  margin-top: .6rem;
  font-style: normal;
  font-family: var(--f-label);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--gold);
  background: none;
  padding: 0;
  border: none;
}

/* ── BUTTONS ── */
.btn-gold {
  display: inline-block;
  font-family: var(--f-label);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--ink);
  padding: .85rem 2.2rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background .2s, transform .2s;
  cursor: pointer;
  border: none;
}

.btn-gold:hover {
  background: var(--gold-lt);
  color: var(--ink);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-block;
  font-family: var(--f-label);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: transparent;
  color: var(--chalk);
  padding: .85rem 2.2rem;
  border-radius: 3px;
  border: 1.5px solid rgba(240,244,248,.25);
  text-decoration: none;
  transition: border-color .2s, color .2s, transform .2s;
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--chalk);
  color: var(--chalk);
  transform: translateY(-2px);
}

/* ── STAT BAR ── */
.stat-bar {
  display: flex;
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid rgba(200,146,42,.12);
  border-bottom: 1px solid rgba(200,146,42,.12);
  flex-wrap: wrap;
}

.stat-item { text-align: center; flex: 1; min-width: 120px; }

.stat-num {
  font-family: var(--f-display);
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  display: block;
}

.stat-label {
  font-family: var(--f-label);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: .3rem;
  display: block;
}

/* ── CTA BAND ── */
.cta-band {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 100%);
  padding: 4rem 2.5rem;
  text-align: center;
}

.cta-band h2 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--ink);
  margin-bottom: .8rem;
}

.cta-band p {
  font-size: 1rem;
  color: rgba(6,14,26,.7);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-dark {
  display: inline-block;
  font-family: var(--f-label);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--chalk);
  padding: .85rem 2.2rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background .2s, transform .2s;
  margin: 0 .4rem;
}

.btn-dark:hover {
  background: var(--navy);
  color: var(--chalk);
  transform: translateY(-2px);
}

/* ── FOOTER ── */
/* These rules mirror the inline footer CSS on index.html so every page
   that loads global.css renders the footer identically to the home page. */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(200,146,42,.12);
  padding: 4rem 5vw 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: .88rem;
  color: var(--steel);
  line-height: 1.75;
  max-width: 280px;
  margin: .8rem 0 1.5rem;
}

.footer-brand-name {
  font-family: var(--f-display);
  font-size: 1.3rem;
  color: var(--gold);
  display: block;
  margin-bottom: .1rem;
}

.footer-brand-sub {
  font-family: var(--f-label);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--steel);
}

.footer-logos {
  display: flex;
  gap: .8rem;
  align-items: center;
}

.footer-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 1px solid rgba(200,146,42,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.footer-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.socials {
  display: flex;
  gap: .6rem;
  margin-top: 1rem;
}

.social-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(143,163,184,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--steel);
  text-decoration: none;
  font-size: .85rem;
  font-family: var(--f-label);
  font-weight: 700;
  transition: border-color .2s, color .2s, background .2s;
}

.social-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200,146,42,.08);
}

.footer-col h5 {
  font-family: var(--f-label);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--chalk);
  margin-bottom: 1.2rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.footer-col ul a {
  font-size: .88rem;
  color: var(--steel);
  text-decoration: none;
  transition: color .2s;
}

.footer-col ul a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: .8rem;
  color: rgba(143,163,184,.5);
}

/* ── SIMPLIFIED FOOTER (404 only) ── */
/* Selectors are scoped to `.footer-inner` so they don't override the
   regular footer-brand/footer-* classes used on every other page. */
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-inner .footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-inner .footer-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
}

.footer-inner .footer-name {
  font-family: var(--f-display);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: .05em;
}

.footer-inner .footer-sub {
  font-family: var(--f-label);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--steel);
  margin-top: .2rem;
}

.footer-inner .footer-cols {
  display: flex;
  gap: 3rem;
}

.footer-inner .footer-heading {
  font-family: var(--f-label);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-inner .footer-links { list-style: none; }

.footer-inner .footer-links li { margin-bottom: .55rem; }

.footer-inner .footer-links a {
  font-size: .88rem;
  color: var(--steel);
  text-decoration: none;
  transition: color .2s;
}

.footer-inner .footer-links a:hover { color: var(--chalk); }

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--f-label);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .6rem 1.4rem;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus {
  top: 0;
}

/* ── FOCUS STYLES (WCAG 2.1 AA) ── */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Remove default outline only when :focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── SCREEN READER ONLY ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── FADE-UP ANIMATION ── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s ease, transform .65s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── SVG Icon System ───────────────────────────────── */
.icon-box {
  width: 44px;
  height: 44px;
  background: rgba(200,146,42,.08);
  border: 1px solid rgba(200,146,42,.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box svg {
  width: 22px;
  height: 22px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-box-sm {
  width: 36px;
  height: 36px;
  background: rgba(200,146,42,.08);
  border: 1px solid rgba(200,146,42,.2);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box-sm svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid rgba(200,146,42,.15);
    z-index: 999;
  }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .stat-bar { gap: 1.5rem; }
  .container, .container-sm { padding: 3rem 1.25rem; }
  .page-hero { padding: 6rem 1.25rem 3rem; }
}

/* ── MOBILE OVERRIDES FOR INLINE-STYLED LAYOUTS ── */
/* Many pages use inline style attributes with hardcoded grids and spacing.
   These rules force them to behave on mobile. !important is required because
   inline styles otherwise win. */
@media (max-width: 640px) {
  /* Force any inline multi-column grid to a single column */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Collapse large inline gaps */
  [style*="gap:5rem"], [style*="gap: 5rem"],
  [style*="gap:4rem"], [style*="gap: 4rem"],
  [style*="gap:3rem"], [style*="gap: 3rem"] {
    gap: 1.5rem !important;
  }

  /* Reduce oversized inline padding (matches start of value) */
  [style*="padding:5rem"], [style*="padding: 5rem"],
  [style*="padding:4rem"], [style*="padding: 4rem"] {
    padding: 2rem 1.25rem !important;
  }
  [style*="padding:3rem"], [style*="padding: 3rem"],
  [style*="padding:2.5rem"], [style*="padding: 2.5rem"] {
    padding: 1.5rem 1.25rem !important;
  }

  /* Nav: tighter horizontal padding so logo + hamburger fit comfortably */
  nav { padding: 0 1.25rem; }
  .nav-logo-text { font-size: 1rem; }

  /* Footer: stack and tighten — matches home page mobile layout */
  footer { padding: 3rem 1.25rem 2rem; }
  .footer-top { gap: 2rem; }
  .footer-inner { padding: 3rem 1.25rem 2rem; flex-direction: column; gap: 1.5rem; }
  .footer-inner .footer-cols { flex-direction: column; gap: 1.5rem; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: .5rem;
  }

  /* CTA band */
  .cta-band { padding: 3rem 1.25rem; }
  .cta-band h2 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .btn-dark { margin: .35rem .25rem; }

  /* Stat bar — keep horizontal but tighten */
  .stat-bar { padding: 2rem 0; }
  .stat-num { font-size: 2.4rem; }
  .stat-label { font-size: .68rem; }

  /* Cards: less padding */
  .card { padding: 1.5rem; }

  /* Typography breathing room */
  body { line-height: 1.6; }

  /* Generic: any <section> that doesn't use .container/.container-sm
     still gets reasonable side padding so content isn't flush to the edge */
  section { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ── HOVER UTILITY CLASSES (replaces inline onmouseover/onmouseout) ── */

/* Photo gallery / strip image zoom */
.gallery-img {
  transition: transform .5s ease;
}
.gallery-img:hover {
  transform: scale(1.05);
}

/* Social/media card lift + border brighten */
.media-card {
  transition: border-color .2s, transform .2s;
}
.media-card:hover {
  border-color: rgba(200,146,42,.4) !important;
  transform: translateY(-4px);
}

/* Resources jump-link pills */
.pill-link {
  transition: background .2s, color .2s;
}
.pill-link:hover {
  background: var(--gold) !important;
  color: var(--ink) !important;
}

/* Cadet profile back breadcrumb */
.back-link {
  color: var(--steel);
  transition: color .2s;
}
.back-link:hover {
  color: var(--gold);
}

/* ── BACK-TO-TOP BUTTON ── */
#back-to-top {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  transform: translateY(8px);
  z-index: 9700;
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
#back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (min-width: 641px) {
  #back-to-top { display: none; }
}
