/* ============================================================
   Johnson Gambit — Arctic Theme
   Loaded AFTER css/main.css: overrides the legacy palette and
   restyles shared components. Palette from the arctic scene spec:
   cool blue / slate grey / frost white / luminescent cyan.
   ============================================================ */

:root {
  /* Core arctic palette */
  --arctic-ice-blue: #2E5E8C;      /* cool blue — primary */
  --arctic-deep: #16324A;          /* deep slate blue — contrast */
  --arctic-cyan: #0E7490;          /* readable cyan — accents on light bg */
  --arctic-glow: #67E8F9;          /* luminescent cyan — glows, borders */
  --arctic-slate: #64748B;         /* slate grey — secondary text */
  --arctic-frost: #EFF5F9;         /* frost white — surfaces */
  --arctic-ink: #102437;           /* near-black blue — body text */

  /* RGB triplets for rgba() borders/shadows/glows — themes override
     these (see css/savanna.css) to re-tint every surface at once */
  --line-rgb: 46, 94, 140;         /* border lines (= ice blue) */
  --glow-rgb: 103, 232, 249;       /* luminous accents (= glow) */
  --shadow-rgb: 22, 50, 74;        /* drop shadows (= deep) */
  --accent-rgb: 14, 116, 144;      /* CTA glow (= cyan) */

  /* Remap the legacy variables so every page inherits the theme */
  --jg-primary: var(--arctic-ice-blue);
  --jg-secondary: var(--arctic-deep);
  --jg-accent: var(--arctic-cyan);
  --jg-accplat: #DCE7EF;
  --jg-tertiary: var(--arctic-slate);
  --jg-dark: var(--arctic-frost);
  --jg-light: var(--arctic-ink);
  --jg-nav-bg: rgba(239, 245, 249, 0.92);
  --jg-border: rgba(var(--line-rgb), 0.18);
  --jg-warm-gold: var(--arctic-cyan);
  --jg-soft-white: #F7FAFC;
  --jg-creamy: #EDF3F8;
  --jg-off-white: #E7EFF5;

  /* Sharper type: Inter everywhere, Orbitron reserved for the logo */
  --jg-font-family-primary: 'Inter', sans-serif;
}

/* ---------- Base ---------- */

body {
  background: transparent; /* the arctic scene sits behind everything */
  color: var(--arctic-ink);
}

html {
  background: var(--arctic-frost); /* fallback + overscroll colour */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--arctic-deep);
}

::selection {
  background: rgba(var(--glow-rgb), 0.4);
}

/* Keep the skip link fully off-screen until focused */
.skip-link {
  top: -100px;
}

.skip-link:focus {
  top: 6px;
}

/* Retire the legacy gold glow on hero headings */
.hero-section h1 {
  color: var(--arctic-deep);
  text-shadow: none;
}

main {
  position: relative;
  z-index: 1;
}

/* ---------- Navigation ---------- */

.nav-container {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--line-rgb), 0.22);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(var(--shadow-rgb), 0.12), 0 0 0 1px rgba(var(--glow-rgb), 0.08);
  max-width: 1200px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  color: var(--arctic-deep);
  letter-spacing: 1px;
  font-weight: 700;
}

.logo .logo-accent {
  color: var(--arctic-cyan);
}

.push-nav > ul {
  gap: 1.4rem;
}

.push-nav a.nav-active {
  color: var(--arctic-cyan);
}

/* Support call-to-action in the nav */
.push-nav li.nav-cta > a {
  background: linear-gradient(120deg, var(--arctic-ice-blue), var(--arctic-cyan));
  color: #fff !important;
  border-radius: 10px;
  padding: 0.5rem 1.1rem !important;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.35);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.push-nav li.nav-cta > a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(var(--glow-rgb), 0.5);
  color: #fff;
}

@media (max-width: 1023px) {
  .push-nav li.nav-cta > a {
    display: block;
    width: auto;
    margin: 0.75rem 1.25rem;
    text-align: center;
  }
}

/* ---------- Theme toggle (arctic ⇄ savanna) ---------- */

.theme-toggle {
  position: relative;
  width: 62px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(var(--line-rgb), 0.35);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover {
  border-color: rgba(var(--glow-rgb), 0.9);
  box-shadow: 0 0 12px rgba(var(--glow-rgb), 0.45);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--arctic-cyan);
  outline-offset: 2px;
}

.theme-toggle .tt-ice,
.theme-toggle .tt-sun {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  transition: opacity 0.3s ease;
}

.theme-toggle .tt-ice { left: 9px; color: #38BDF8; }
.theme-toggle .tt-sun { right: 9px; color: #F59E0B; opacity: 0.35; }

[data-theme="savanna"] .theme-toggle .tt-ice { opacity: 0.35; }
[data-theme="savanna"] .theme-toggle .tt-sun { opacity: 1; }

.theme-toggle .tt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(140deg, #FFFFFF, #D5EDF7);
  box-shadow: 0 1px 6px rgba(var(--shadow-rgb), 0.4), 0 0 10px rgba(var(--glow-rgb), 0.5);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
}

[data-theme="savanna"] .theme-toggle .tt-knob {
  transform: translateX(32px);
  background: linear-gradient(140deg, #FDE68A, #F59E0B);
}

@media (max-width: 1023px) {
  .theme-toggle { margin-right: 0.5rem; }
}

@media (min-width: 1024px) {
  /* Desktop: menu first, toggle at the far right beside the Support CTA */
  .theme-toggle { order: 2; margin-left: 0.75rem; }
}

/* Circular-reveal theme switch (View Transitions API; safely ignored elsewhere) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 2rem));
  animation: themeReveal 0.65s ease-in-out forwards;
}

@keyframes themeReveal {
  to { clip-path: circle(150% at var(--vt-x, 90%) var(--vt-y, 2rem)); }
}

/* Mobile drawer gets the frost treatment */
.push-nav {
  background: rgba(247, 250, 252, 0.97);
  backdrop-filter: blur(16px);
}

@media (min-width: 1024px) {
  .push-nav {
    background: transparent;
    backdrop-filter: none;
  }

  .push-submenu,
  .push-submenu .push-submenu {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.16);
  }
}

/* ---------- Content surfaces: frosted panels ---------- */

.event-container,
.thanks-container,
.journey-container,
.charter-container,
.history-event-card,
.content-container,
.gallery-container,
.promise-section {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(var(--shadow-rgb), 0.08);
}

.hero-section {
  background-attachment: scroll; /* fixed backgrounds fight the scene parallax */
}

.hero-content {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 16px 50px rgba(var(--shadow-rgb), 0.1);
}

/* Buttons */
.cta-button {
  background: linear-gradient(120deg, var(--arctic-ice-blue), var(--arctic-cyan));
  color: #fff;
  border-radius: 10px;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}

.cta-button:hover {
  color: #fff;
  box-shadow: 0 8px 26px rgba(var(--glow-rgb), 0.45);
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--arctic-cyan);
  margin-bottom: 0.75rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cta-button--ghost {
  background: rgba(255, 255, 255, 0.8);
  color: var(--arctic-ice-blue);
  border: 1px solid rgba(var(--line-rgb), 0.4);
  box-shadow: none;
}

.cta-button--ghost:hover {
  color: var(--arctic-deep);
  border-color: var(--arctic-cyan);
  box-shadow: 0 4px 16px rgba(var(--glow-rgb), 0.3);
}

/* Homepage section cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.home-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--line-rgb), 0.16);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: var(--arctic-ink);
  box-shadow: 0 8px 30px rgba(var(--shadow-rgb), 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--glow-rgb), 0.7);
  box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.14);
  color: var(--arctic-ink);
}

.home-card i {
  font-size: 1.8rem;
  color: var(--arctic-cyan);
  margin-bottom: 0.9rem;
}

.home-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.home-card p {
  font-size: 0.9rem;
  color: var(--arctic-slate);
  margin-bottom: 0;
}

.home-card--accent {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(207, 240, 249, 0.85));
}

/* ---------- Footer ---------- */

.footer.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) 1rem;
  border-top: 1px solid rgba(var(--glow-rgb), 0.35);
  background: linear-gradient(180deg, rgba(var(--shadow-rgb), 0.94), rgba(11, 25, 38, 0.97));
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
  text-align: center;
}

.footer.site-footer::before { content: none; }

.footer.site-footer .punch-line {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--arctic-glow);
  text-shadow: 0 0 18px rgba(var(--glow-rgb), 0.45);
  letter-spacing: 3px;
}

.footer.site-footer .footer-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer.site-footer .footer-links a {
  color: #B8CBDA;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.footer.site-footer .footer-links a:hover {
  color: var(--arctic-glow);
}

.footer.site-footer .footer-social a {
  color: #B8CBDA;
}

.footer.site-footer .footer-social a:hover {
  color: var(--arctic-glow);
}

.footer.site-footer .footer-copy {
  margin-top: 1rem;
  color: #6E8496;
  font-size: 0.8rem;
}

/* ---------- Legacy contrast overrides re-tinted ---------- */

.thanks-text p,
.intro-text p,
.event-text p,
.left-content p,
.charter-container p,
.hero-content p,
.weekly-text p {
  color: var(--arctic-ink) !important;
}

.tag {
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: var(--arctic-cyan);
}

/* ============================================================
   Arctic scene (built by js/arctic-bg.js)
   ============================================================ */

.arctic-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg,
      #C9DAE7 0%,      /* overcast sky */
      #DCE9F2 34%,
      #EAF2F8 58%,     /* atmospheric haze band */
      #F3F8FB 78%,     /* snow field */
      #EDF4F9 100%);
  pointer-events: none;
}

.arctic-scene svg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max(100vw, 1400px);
  height: auto;
  display: block;
}

.arctic-layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* Slow ambient drift = the "camera" from the scene spec */
@media (prefers-reduced-motion: no-preference) {
  .arctic-drift {
    animation: arcticDrift 90s ease-in-out infinite alternate;
  }

  @keyframes arcticDrift {
    from { transform: translateX(-0.6%) scale(1.02); }
    to   { transform: translateX(0.6%) scale(1.02); }
  }

  /* Luminescent pulse between the igloo blocks */
  .igloo-glow {
    animation: iglooPulse 7s ease-in-out infinite;
  }

  @keyframes iglooPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
  }

  /* Ground mist flowing horizontally */
  .arctic-mist {
    position: absolute;
    left: -30%;
    width: 160%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(240, 247, 251, 0.85) 0%, rgba(240, 247, 251, 0) 70%);
    filter: blur(14px);
    animation: mistFlow linear infinite;
  }

  @keyframes mistFlow {
    from { transform: translateX(-6%); }
    to   { transform: translateX(6%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .arctic-mist { display: none; }
  .arctic-snow-canvas { display: none; }
}

.arctic-snow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================
   Media feed (Gallery / Brian / Kina) — js/media-feed.js
   ============================================================ */

.media-feed {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.feed-header {
  text-align: center;
  margin-bottom: 2rem;
}

.feed-header h1 {
  margin-bottom: 0.5rem;
}

.feed-header .feed-sub {
  color: var(--arctic-slate);
  max-width: 560px;
  margin: 0 auto;
}

.feed-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 30px rgba(var(--shadow-rgb), 0.07);
}

.feed-search {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feed-controls label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--arctic-cyan);
}

.feed-controls input[type="search"],
.feed-controls select {
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(var(--line-rgb), 0.25);
  border-radius: 9px;
  background: #fff;
  color: var(--arctic-ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feed-controls input[type="search"]:focus,
.feed-controls select:focus {
  border-color: var(--arctic-cyan);
  box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.3);
}

.feed-filter {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feed-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.feed-tag-chip {
  border: 1px solid rgba(var(--line-rgb), 0.3);
  background: rgba(255, 255, 255, 0.7);
  color: var(--arctic-slate);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feed-tag-chip:hover {
  border-color: var(--arctic-cyan);
  color: var(--arctic-cyan);
}

.feed-tag-chip.active {
  background: var(--arctic-cyan);
  border-color: var(--arctic-cyan);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
}

.feed-count {
  color: var(--arctic-slate);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feed-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 6px 24px rgba(var(--shadow-rgb), 0.07);
}

.feed-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--glow-rgb), 0.7);
  box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.14), 0 0 0 1px rgba(var(--glow-rgb), 0.25);
}

.feed-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: var(--jg-accplat);
}

.feed-card-body {
  padding: 1rem 1.1rem 1.15rem;
}

.feed-card-title {
  font-weight: 600;
  color: var(--arctic-deep);
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.feed-card-meta {
  display: flex;
  gap: 0.9rem;
  color: var(--arctic-slate);
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.feed-card-meta i {
  color: var(--arctic-cyan);
  margin-right: 0.3rem;
}

.feed-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.feed-card-tags .tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.feed-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--arctic-slate);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(var(--line-rgb), 0.3);
  border-radius: 14px;
}

/* Lightbox */
.feed-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(11, 25, 38, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.feed-lightbox[hidden] { display: none; }

.feed-lightbox figure {
  max-width: min(1000px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.feed-lightbox img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(var(--glow-rgb), 0.2);
}

.feed-lightbox figcaption {
  color: #DCE7EF;
  text-align: center;
  padding: 1rem 0 0;
  font-size: 0.95rem;
}

.feed-lightbox figcaption .lb-meta {
  color: #8FA8BC;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.feed-lightbox .lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #DCE7EF;
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.feed-lightbox .lb-close:hover { color: var(--arctic-glow); }

/* Profile hero used on Brian / Kina pages */
.profile-hero {
  max-width: 860px;
  margin: 2.5rem auto 1rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(var(--shadow-rgb), 0.1);
}

.profile-hero .profile-kicker {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--arctic-cyan);
  margin-bottom: 0.5rem;
}

.profile-hero img.profile-photo {
  max-width: min(420px, 100%);
  border-radius: 14px;
  margin: 1.25rem auto;
  display: block;
  box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.18);
}

.profile-hero .profile-quote {
  font-size: 1.15rem;
  color: var(--arctic-deep);
  font-style: italic;
}

.profile-hero .profile-context {
  color: var(--arctic-slate);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Kid corner cards */
.kids-cards .kid-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--line-rgb), 0.18);
  border-radius: 16px;
  color: var(--arctic-ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.kids-cards .kid-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--glow-rgb), 0.7);
  box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.14);
  background: #fff;
}

.kids-cards .kid-card h3 {
  font-family: 'Inter', sans-serif;
  color: var(--arctic-deep);
}
