/* ============================================
   STOREGGA TSUNAMI — Editorial Article
   the Disaster that Shaped Nordoyane

   Shared building blocks (author bar, sections,
   headings, prose, figures, closing, sources)
   live in article-shared.css.
   This file holds only article-unique overrides.
   ============================================ */

/* ============================================
   HERO — Sticky cinematic (adapted from Christmas Beer)
   ============================================ */
.stg-hero-wrapper {
  position: relative;
  height: 140vh;
}

.stg-hero {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--color-midnight, #0a1628);
}

.stg-hero__media {
  position: absolute;
  inset: 0;
}

.stg-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  will-change: transform;
  animation: stgHeroKB 40s ease-out forwards;
}

@keyframes stgHeroKB {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.stg-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg,
      rgba(10, 22, 40, 0.05) 0%,
      rgba(10, 22, 40, 0) 20%,
      rgba(45, 74, 94, 0.25) 50%,
      rgba(10, 22, 40, 0.8) 80%,
      rgba(10, 22, 40, 1) 100%
    );
}

/* Vignette */
.stg-hero__overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 22, 40, 0.45) 100%);
}

/* Depth shimmer — ambient light effect */
.stg-hero__overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(143, 184, 202, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 35%, rgba(45, 74, 94, 0.08) 0%, transparent 45%);
  animation: stgDepthShimmer 15s ease-in-out infinite;
}

@keyframes stgDepthShimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

.stg-hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-xl) var(--space-5xl);
  padding-left: clamp(48px, 8vw, 120px);
  color: var(--color-warm-white, #FBF9F6);
  text-align: left;
}

.stg-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  opacity: 0;
  animation: stgFadeUp 1s ease-out 0.3s forwards;
}

@keyframes stgFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.stg-hero__category {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-lg);
  background: linear-gradient(135deg, var(--color-fjord, #2d4a5e), #1d3a4e);
  color: var(--color-warm-white, #FBF9F6);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 4px 20px rgba(45, 74, 94, 0.4);
}

.stg-hero__divider {
  width: 4px;
  height: 4px;
  background: var(--color-glacier, #8fb8ca);
  border-radius: 50%;
  opacity: 0.6;
}

.stg-hero__region {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-lg);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full, 9999px);
}

.stg-hero__title {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  text-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: stgFadeUp 1s ease-out 0.5s forwards;
}

.stg-hero__subtitle {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-glacier, #8fb8ca);
  line-height: 1.5;
  opacity: 0;
  animation: stgFadeUp 1s ease-out 0.7s forwards;
}

/* Left accent line */
.stg-hero__content::before {
  content: '';
  position: absolute;
  left: clamp(24px, 5vw, 80px);
  top: 50%;
  width: 2px;
  height: 120px;
  transform: translateY(-50%);
  background: linear-gradient(to bottom, transparent, var(--color-glacier, #8fb8ca), transparent);
  opacity: 0.5;
}


/* ============================================
   SECTION — Abyss variant (article-unique)
   ============================================ */
.stg-section--abyss {
  background: linear-gradient(180deg, #060f1e 0%, var(--color-midnight, #0a1628) 100%);
  position: relative;
  overflow: hidden;
}

.stg-section--abyss::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(45, 74, 94, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(143, 184, 202, 0.04) 0%, transparent 40%);
  pointer-events: none;
}

/* Ensure inner content sits above abyss pseudo-elements */
.stg-section--abyss .art-section__inner {
  position: relative;
  z-index: 1;
}


/* ============================================
   INTRO — Curved transition from author bar
   ============================================ */
#intro {
  position: relative;
}

#intro::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 100px;
  background: var(--color-midnight, #0a1628);
  clip-path: ellipse(70% 100% at 50% 0%);
  z-index: 0;
}

#intro .art-section__inner {
  padding-top: var(--space-3xl);
}


/* ============================================
   INTRO — Lead paragraph
   ============================================ */
.stg-lead {
  position: relative;
  font-size: var(--text-xl, 1.25rem);
  font-weight: 500;
  line-height: 1.8;
  color: var(--color-text-primary, #1a1a1a);
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--color-mist, #e8e5e0);
  margin-bottom: var(--space-xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.stg-lead::first-letter {
  font-family: 'Cormorant Garamond', var(--font-display), serif;
  font-weight: 600;
  color: var(--color-fjord, #2d4a5e);
  initial-letter: 2;
  -webkit-initial-letter: 2;
  margin-right: 0.05em;
}

.stg-lead a {
  color: var(--color-pine, #2d6a3f);
  text-decoration: underline;
  text-decoration-color: var(--color-aurora, #7dd3c0);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s, color 0.3s;
}

.stg-lead a:hover {
  color: var(--color-forest, #1a4d2e);
  text-decoration-color: var(--color-pine, #2d6a3f);
}


/* ============================================
   EPOCH MARKERS — Geological emphasis
   ============================================ */
.stg-epoch {
  display: inline;
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-weight: 600;
  font-size: 1.05em;
  color: var(--color-fjord, #2d4a5e);
  letter-spacing: 0.02em;
  border-bottom: 2px solid rgba(45, 74, 94, 0.25);
  padding-bottom: 1px;
}

.art-prose--light .stg-epoch {
  color: var(--color-glacier, #8fb8ca);
  border-bottom-color: rgba(143, 184, 202, 0.3);
}

.stg-lead .stg-epoch {
  color: var(--color-fjord, #2d4a5e);
  border-bottom-color: rgba(45, 74, 94, 0.25);
}


/* ============================================
   KEY FACTS INFOGRAPHIC — Horizontal grid
   ============================================ */
.stg-infographic {
  max-width: 960px;
  margin: var(--space-3xl) auto var(--space-xl);
  padding: var(--space-2xl) var(--space-xl);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl, 12px);
}

.stg-infographic__item {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  position: relative;
}

.stg-infographic__item + .stg-infographic__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.stg-infographic__value {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--color-glacier, #8fb8ca);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stg-infographic__unit {
  display: block;
  font-size: var(--text-sm, 0.875rem);
  color: rgba(251, 249, 246, 0.55);
  margin-bottom: var(--space-xs);
}

.stg-infographic__label {
  font-size: var(--text-xs, 0.75rem);
  color: rgba(251, 249, 246, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.4;
}


/* ============================================
   FIGURE OVERRIDES — Article-unique variants
   (Base figure styles live in article-shared.css)
   ============================================ */

/* Figcaption link styling */
.art-figure figcaption a {
  color: var(--color-pine, #2d6a3f);
  text-decoration: underline;
  text-decoration-color: var(--color-aurora, #7dd3c0);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* On dark backgrounds, lighten figcaption + links */
.stg-section--abyss .art-figure figcaption,
.art-section--utility .art-figure figcaption {
  color: rgba(251, 249, 246, 0.5);
}

.stg-section--abyss .art-figure figcaption a,
.art-section--utility .art-figure figcaption a {
  color: var(--color-glacier, #8fb8ca);
  text-decoration-color: rgba(143, 184, 202, 0.4);
}

.stg-section--abyss .art-figure figcaption a:hover,
.art-section--utility .art-figure figcaption a:hover {
  color: #b0d4e2;
  text-decoration-color: var(--color-glacier, #8fb8ca);
}

/* Cinematic variant — full-bleed breakout */
.stg-figure--cinematic {
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 0;
}

.stg-figure--cinematic .art-figure__img-wrap {
  border-radius: 0;
  aspect-ratio: 21 / 9;
}

.stg-figure--cinematic .art-figure__img-wrap img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stg-figure--cinematic figcaption {
  max-width: 800px;
  margin: var(--space-lg) auto 0;
  padding: 0 var(--space-xl);
}

/* Diagram variant — no Ken Burns, clean frame */
.stg-figure--diagram {
  max-width: 900px;
}

.stg-figure--diagram .art-figure__img-wrap {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(143, 184, 202, 0.15);
  padding: var(--space-md);
  box-shadow: none;
}

.stg-figure--diagram .art-figure__img-wrap img {
  border-radius: var(--radius-md, 8px);
  animation: none;
}

.stg-figure--diagram figcaption {
  font-style: normal;
  text-align: left;
  padding-left: var(--space-md);
  border-left: 2px solid rgba(143, 184, 202, 0.3);
}


/* ============================================
   RESPONSIVE — Tablet (768px)
   ============================================ */
@media (max-width: 768px) {
  .stg-hero-wrapper {
    height: 120vh;
  }

  .stg-hero__content {
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
    text-align: center;
  }

  .stg-hero__meta {
    justify-content: center;
  }

  .stg-hero__content::before {
    display: none;
  }

  .stg-hero__title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  #intro::before {
    height: 60px;
  }

  .stg-lead {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .stg-figure--cinematic .art-figure__img-wrap {
    aspect-ratio: 16 / 9;
  }

  .stg-infographic {
    grid-template-columns: repeat(2, 1fr);
    margin-left: var(--space-lg);
    margin-right: var(--space-lg);
  }

  .stg-infographic__item:nth-child(3)::before {
    display: none;
  }

  .stg-infographic__item:nth-child(n+3) {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}


/* ============================================
   RESPONSIVE — Mobile (480px)
   ============================================ */
@media (max-width: 480px) {
  .stg-hero {
    min-height: 480px;
  }

  .stg-infographic {
    grid-template-columns: 1fr;
  }

  .stg-infographic__item + .stg-infographic__item::before {
    display: none;
  }

  .stg-infographic__item + .stg-infographic__item {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}


/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .stg-hero__media img {
    animation: none;
    transform: none;
  }

  .stg-hero__meta,
  .stg-hero__title,
  .stg-hero__subtitle {
    opacity: 1;
    animation: none;
  }

  .stg-hero__overlay::after {
    animation: none;
    opacity: 0.5;
  }
}
