/* Space Coast Chronicles — Design System
   Based on scc_style_guide.html (authoritative reference)
   Light mode is DEFAULT. Dark mode via data-theme="dark" or system preference.
*/

:root {
  /* ══════════════════════════════════════════════════════════════
     BACKGROUNDS
  ══════════════════════════════════════════════════════════════ */
  --bg-page:       #f7f6f1;   /* warm off-white, main page bg */
  --bg-surface:    #ffffff;   /* cards, nav, pure white */
  --bg-hero:       #f6f5f0;   /* hero section bg */
  --bg-band:       #faf9f5;   /* year bands, subtle sections */
  --bg-input:      #f7f6f1;   /* form inputs */

  /* ══════════════════════════════════════════════════════════════
     BORDERS — ALL 0.5px SOLID, NEVER 1px
  ══════════════════════════════════════════════════════════════ */
  --border:        #e8e4dc;   /* default border */
  --border-subtle: #f0ede4;   /* entry row separators */
  --border-strong: #d4d0c8;   /* hover, emphasis */

  /* ══════════════════════════════════════════════════════════════
     TEXT
  ══════════════════════════════════════════════════════════════ */
  --text-primary:  #111111;   /* Georgia headlines, strong body */
  --text-secondary:#888888;   /* body copy, descriptions */
  --text-muted:    #bbbbbb;   /* labels, meta */
  --text-ghost:    #dddddd;   /* year numerals, decorative */

  /* ══════════════════════════════════════════════════════════════
     BRAND ACCENTS — USE PURPOSEFULLY
  ══════════════════════════════════════════════════════════════ */
  --mono-blue:     #5d7982;   /* timestamps & vehicle IDs ONLY — ISS ocean teal */
  --exhaust:       #8890c8;   /* active states, focus, accent */
  --flame:         #b89040;   /* purchase CTAs ONLY */
  --active-pill:   #6870a8;   /* active filters, links */

  /* ══════════════════════════════════════════════════════════════
     SPACING (PRECISE VALUES FROM STYLE GUIDE)
  ══════════════════════════════════════════════════════════════ */
  --nav-h:         44px;      /* nav bar height */
  --page-pad:      24px;      /* horizontal page padding */
  --entry-pad:     22px;      /* archive entry left padding */
  --gutter-w:      58px;      /* date gutter width */

  /* ══════════════════════════════════════════════════════════════
     BORDER RADIUS
  ══════════════════════════════════════════════════════════════ */
  --r-sm:          2px;       /* chips, tags, badges */
  --r-md:          4px;       /* inputs, small cards */
  --r-lg:          8px;       /* main cards, containers */

  /* ══════════════════════════════════════════════════════════════
     TYPOGRAPHY
  ══════════════════════════════════════════════════════════════ */
  --font-serif:    'Georgia', 'Times New Roman', serif;
  --font-sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'SF Mono', 'Fira Code', 'Fira Mono', monospace;

  /* ══════════════════════════════════════════════════════════════
     LEGACY VARIABLE ALIASES (for HTML inline styles)
  ══════════════════════════════════════════════════════════════ */
  /* Dynamic aliases — reference canonical vars so they update with theme */
  --color-surface:             var(--bg-surface);
  --color-border:              var(--border);
  --color-text:                var(--text-primary);
  --color-text-primary:        var(--text-primary);
  --color-text-secondary:      var(--text-secondary);
  --color-text-tertiary:       var(--text-muted);
  --color-bg-hero:             var(--bg-hero);
  --color-bg-page:             var(--bg-page);
  --color-accent:              var(--exhaust);
  --color-cta-gold:            var(--flame);
  --color-filter-active:       var(--active-pill);
  --color-text-mono:           var(--mono-blue);
  --color-border-subtle:       var(--border-subtle);
  --color-bg:                  var(--bg-page);
  --color-bg-year-band:        var(--bg-band);
  /* Dark-context aliases (used inside html[data-theme="dark"] selectors) */
  --color-dark-surface:        var(--bg-surface);
  --color-dark-bg-page:        var(--bg-page);
  --color-dark-bg-hero:        var(--bg-hero);
  --color-dark-text-primary:   var(--text-primary);
  --color-dark-text-secondary: var(--text-secondary);
  --color-dark-text-mono:      var(--mono-blue);
  --color-dark-border:         var(--border);
  /* Static values — these don't change with theme */
  --border-width:              0.5px;
  --spacing-xs:                4px;
  --spacing-sm:                8px;
  --spacing-md:                12px;
  --spacing-lg:                16px;
  --spacing-xl:                24px;
  --spacing-2xl:               32px;
  --font-size-wordmark:        14px;
  --font-size-sm:              10px;
  --font-size-sm-label:        9px;
  --font-size-body:            12px;
  --font-size-body-lg:         13px;
  --font-size-mission:         11px;
  --font-size-mission-title:   14px;
  --font-size-headline-lg:     28px;
  --fw-normal:                 400;
  --fw-medium:                 500;
  --line-height-relaxed:       1.65;
  --letter-spacing-caps:       0.16em;
  --letter-spacing-button:     0.16em;
  --transition-fast:           0.15s;
  --transition-normal:         0.3s;
  --border-radius-chip:        4px;
  --border-radius-card:        8px;
  --border-radius-card-lg:     8px;
}

/* Dark mode overrides */
html[data-theme="dark"],
html.dark {
  --bg-page:       #0a1218;   /* ocean-atmosphere tint */
  --bg-surface:    #060e14;   /* elevated surface for visibility */
  --bg-hero:       #05060c;
  --bg-band:       #080914;
  --bg-input:      #08091a;
  --border:        #12202a;   /* teal-tinted */
  --border-subtle: #0e1820;
  --border-strong: #1a2e38;
  --text-primary:  #c8bfa8;   /* parchment — warm on cool black */
  --text-secondary:#7a7898;   /* readable on void */
  --text-muted:    #404060;
  --text-ghost:    #181830;
  --mono-blue:     #5d7982;   /* ISS ocean teal */
  --exhaust:       #4858a8;   /* deep indigo — new accent */
  --flame:         #b89040;
  --active-pill:   #4858a8;
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.2s, color 0.2s;
}

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.wordmark-sub {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Hero headline */
.hero-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Mission titles (archive) */
.mission-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
}

/* Section titles (all-caps label) */
.section-title {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Timestamps & vehicle IDs */
.timestamp, .vehicle-id {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mono-blue);
}

/* Body copy */
body, p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Caption (italic) */
.caption {
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   LINKS
══════════════════════════════════════════════════════════════ */

a {
  color: inherit;
  text-decoration: none;
  border: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--exhaust);
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════════════════ */

nav.navbar {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
  z-index: 1000;
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
}

.navbar-logo {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  border: none;
  letter-spacing: -0.01em;
}

.navbar-logo:hover {
  color: var(--exhaust);
  border: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar-menu a {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  transition: color 0.15s;
}

.navbar-menu a:hover {
  color: var(--exhaust);
}

.navbar-menu a.active {
  color: var(--active-pill);
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS & FORM CONTROLS
══════════════════════════════════════════════════════════════ */

button {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border: 0.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}

button:hover {
  border-color: var(--border-strong);
  color: var(--exhaust);
}

/* Purchase CTA (flame gold ONLY) */
.cta-purchase {
  background: transparent;
  border: 0.5px solid var(--border-strong);
  color: var(--flame);
  padding: 6px 14px;
}

.cta-purchase:hover {
  border-color: var(--flame);
  color: var(--flame);
}

/* Filter pills */
.pill {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 0.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.pill.active {
  border-color: var(--active-pill);
  color: var(--active-pill);
  background: rgba(104, 112, 168, 0.06);
}

/* Form inputs */
input, textarea, select {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--exhaust);
}

input::placeholder, textarea::placeholder {
  color: var(--text-ghost);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   CARDS & CONTAINERS
══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border-strong);
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.grid {
  display: grid;
  gap: var(--page-pad);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ══════════════════════════════════════════════════════════════
   SPACING UTILITIES
══════════════════════════════════════════════════════════════ */

.p-sm { padding: 8px; }
.p-md { padding: 12px; }
.p-lg { padding: 16px; }
.p-xl { padding: 24px; }

.m-sm { margin: 8px; }
.m-md { margin: 12px; }
.m-lg { margin: 16px; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mb-xl { margin-bottom: 24px; }

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--exhaust); }

.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;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

/* Hamburger menu — hidden on desktop */
.nav-burger {
  display: none;
  width: 28px;
  height: 22px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.nav-burger.open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--page-pad);
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Mobile navigation */
  .nav-burger {
    display: flex;
  }

  .navbar-content {
    padding: 12px 16px;
  }

  .navbar-right {
    gap: 12px;
  }

  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-surface);
    border-bottom: 0.5px solid var(--border);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .navbar-menu.open {
    max-height: 400px;
    border-top: 0.5px solid var(--border);
  }

  .navbar-menu li {
    border-bottom: 0.5px solid var(--border);
  }

  .navbar-menu li:last-child {
    border-bottom: none;
  }

  .navbar-menu a {
    display: block;
    padding: 16px 24px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 11px;
  }

  .container {
    padding: 0 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 4, 9, 0.94);
  z-index: 2000;
  overflow-y: auto;
  padding: 40px 20px;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 900px;
  width: 100%;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #ccc;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mono-blue);
  margin-bottom: 8px;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: #c8bfa8;
  margin-bottom: 16px;
}

.lightbox-image {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 16px;
  border-radius: 4px;
}

.lightbox-caption {
  font-family: var(--font-serif);
  font-size: 12px;
  font-style: italic;
  color: #999;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.lightbox-metadata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.lightbox-meta-text {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #999;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lightbox-nav {
  background: none;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 9px;
  border-radius: 2px;
  transition: all 0.15s;
}

.lightbox-nav:hover {
  border-color: #b89040;
  color: #b89040;
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-order-btn {
  background: #b89040;
  border: 0.5px solid #b89040;
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}

.lightbox-order-btn:hover {
  background: transparent;
  color: #b89040;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER CARTOGRAPHY
══════════════════════════════════════════════════════════════ */

.footer-cartography svg {
  stroke: #cccccc;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-cartography .coastline {
  stroke-width: 0.8px;
}

.footer-cartography .ksc-pin-circle {
  fill: #cccccc;
}

.footer-cartography .ksc-leader {
  stroke-width: 0.5px;
  stroke-dasharray: 2,2;
  opacity: 0.6;
}

.footer-cartography .ksc-label {
  font-family: var(--font-mono);
  font-size: 6px;
  fill: #cccccc;
  letter-spacing: 0.05em;
}

html[data-theme="dark"] .footer-cartography svg {
  stroke: #1a1a28;
}

html[data-theme="dark"] .footer-cartography .ksc-pin-circle {
  fill: #1a1a28;
}

html[data-theme="dark"] .footer-cartography .ksc-leader {
  stroke: #1a1a28;
}

html[data-theme="dark"] .footer-cartography .ksc-label {
  fill: #1a1a28;
}
