:root{
  --story-bg: #070b16;
  --story-panel: rgba(12,18,35,.72);
  --story-border: rgba(148,163,184,.18);
  --story-text: #e5e7eb;
  --story-muted: #a7b0c0;
  --story-accent: rgba(239,68,68,.9);
}

body { background: var(--story-bg); color: var(--story-text); }

/* Topbar like StoryMaps */
.story-topbar{
  position: sticky;
  top: 56px; /* below your main nav */
  z-index: 12;
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.story-topbar-title{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  font-size: 16px;
  color: rgba(255,255,255,.88);
}

/* Tabs row */
.story-tabs{
  position: sticky;
  top: 96px; /* nav + topbar */
  z-index: 11;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 18px;
  background: rgba(10,14,28,.78);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.story-tabs .tab{
  color: rgba(255,255,255,.82);
  padding: 8px 10px;
  border-radius: 999px;
}
.story-tabs .tab:hover{
  background: rgba(255,255,255,.08);
}

/* HERO */
.hero{
  position: relative;
  height: min(72vh, 720px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.hero-media{
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 50% 40%, rgba(0,0,0,.15), rgba(0,0,0,.78)),
    url("/images/geospatial-data-science-hero.png");
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}
.hero-inner{
  position: relative;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  display: grid;
  place-content: center;
  text-align: center;
}
.hero h1{
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-weight: 800;
  font-size: clamp(44px, 5vw, 74px);
  margin: 0 0 10px;
  letter-spacing: .2px;
}
.hero-sub{
  font-size: clamp(18px, 2vw, 26px);
  color: rgba(255,255,255,.86);
  margin: 0 0 14px;
}
.hero-meta, .hero-date{
  color: rgba(255,255,255,.78);
  margin: 6px 0 0;
}

/* Body */
.story{
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 18px 80px;
}

.story-section{
  padding: 44px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.story-section-inner{
  max-width: 860px;
  margin: 0 auto;
}
.story-section h2{
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: clamp(34px, 3.3vw, 52px);
  margin: 0 0 18px;
}
.story-section h3{
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 28px;
  margin: 18px 0 10px;
}
.story-section p{
  line-height: 1.85;
  font-size: 18px;
  color: rgba(255,255,255,.88);
}
.story-section a{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Map blocks */
.story-map{
  margin: 22px 0 28px;
}
.story-map-title{
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0 0 6px;
}
.story-map-caption{
  color: var(--story-muted);
  margin: 0 0 12px;
  font-size: 14px;
}
.map-shell{
  position: relative;
  border: 1px solid var(--story-border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10,14,28,.55);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.map{
  height: 520px;
}
.legend{
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-width: 220px;
  max-width: 360px;
  background: rgba(10,14,28,.85);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 10px 12px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  backdrop-filter: blur(10px);
}
.legend .lg-title{
  font-weight: 700;
  margin-bottom: 8px;
}
.legend .lg-item{
  display:flex; gap:10px; align-items:center;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.legend .lg-swatch{
  width: 16px; height: 10px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.18);
}
.hover{
  position: absolute;
  pointer-events: none;
  z-index: 10;
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 10px 12px;
  max-width: 320px;
  font-size: 12px;
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
}
.hover .h-title{
  font-weight: 700;
  margin-bottom: 6px;
}
.hover .h-row{
  display:flex; justify-content:space-between; gap:10px;
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 6px;
  margin-top: 6px;
}
.hover .h-k{ color: rgba(255,255,255,.70); }

/* Callout */
.callout{
  margin: 18px 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(12,18,35,.55);
}
.callout-title{ font-weight: 800; margin-bottom: 6px; }
.callout-body{ color: rgba(255,255,255,.85); }

/* Video */
.video-card{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(12,18,35,.55);
  padding: 16px;
}
.video-title{ font-weight: 800; margin-bottom: 10px; }
.video-frame{
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-frame iframe{
  width: 100%;
  height: 100%;
}

/* Footer */
.story-footer{
  padding-top: 18px;
  text-align: center;
  color: var(--story-muted);
}

/* Make MapLibre controls match */
.maplibregl-ctrl-group{
  border-radius: 12px !important;
  overflow: hidden;
}

/* Mobile */
@media (max-width: 720px){
  .map{ height: 420px; }
  .legend{ left: 12px; bottom: 12px; }
}
