/* ============================================================
   Act 1 — The Years Before  ·  act1-correlation.css  (light mode)
   ============================================================ */

/* ── Ripple panel ─────────────────────────────────────────────── */
.act1-ripple-container {
  display:      flex;
  justify-content: center;
  align-items:  center;
  width:        100%;
  aspect-ratio: 1 / 1;
  max-height:   520px;
  overflow:     hidden;
}

#act1RippleCanvas {
  display:      block;
  max-width:    100%;
  max-height:   100%;
}

/* ── User step controls ───────────────────────────────────────── */
.act1-ripple-controls {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             1.1rem;
  margin-top:      0.85rem;
}

.act1-ripple-btn {
  background:    none;
  border:        1px solid rgba(26,40,16,0.28);
  border-radius: 4px;
  padding:       0.26rem 0.62rem;
  cursor:        pointer;
  font-family:   var(--act-font-mono);
  font-size:     0.84rem;
  color:         rgba(26,40,16,0.60);
  line-height:   1;
  transition:    border-color 140ms ease, color 140ms ease;
}

.act1-ripple-btn:hover:not(:disabled) {
  border-color: rgba(26,40,16,0.55);
  color:        rgba(26,40,16,0.88);
}

.act1-ripple-btn:disabled {
  opacity: 0.30;
  cursor:  default;
}

.act1-ripple-info {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            0.18rem;
  min-width:      200px;
  text-align:     center;
}

.act1-ripple-year {
  font-family:   var(--act-font-mono);
  font-size:     0.88rem;
  font-weight:   600;
  letter-spacing: 0.04em;
  color:         var(--act-text-primary);
  transition:    color 300ms ease;
}

.act1-ripple-lbl {
  font-family:   var(--act-font-mono);
  font-size:     0.60rem;
  color:         var(--act-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height:   1.4;
}

/* ── Line graph panel ─────────────────────────────────────────── */
.act1-graph-container {
  width:        100%;
  overflow:     hidden;
}

.act1-graph-container svg {
  display:      block;
  width:        100%;
  height:       auto;
  overflow:     visible;
}

.act1-graph-note {
  margin:       0.6rem 0 0;
  font-family:  var(--act-font-mono);
  font-size:    0.62rem;
  color:        rgba(26, 40, 16, 0.45);
  line-height:  1.55;
  letter-spacing: 0.02em;
  max-width:    52ch;
}

/* ── NDVI thumbnail strip ─────────────────────────────────────── */
.act1-thumbs-section {
  padding:      0 var(--act-gutter) var(--act-section-pad-v);
  max-width:    1400px;
  margin:       0 auto;
}

.act1-thumbs-title {
  font-family:  var(--act-font-mono);
  font-size:    var(--act-label-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:        rgba(26, 40, 16, 0.48);
  margin:       0 0 1.2rem;
}

.act1-thumbs-grid {
  display:      grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:          1rem;
}

.act1-thumb {
  display:      flex;
  flex-direction: column;
  gap:          0.5rem;
}

.act1-thumb__img-wrap {
  position:     relative;
  overflow:     hidden;
  border-radius: 5px;
  border:       1px solid rgba(26, 40, 16, 0.12);
  aspect-ratio: 1.3 / 1;
  background:   #1A2810;   /* dark placeholder behind satellite images */
}

.act1-thumb__img-wrap img {
  width:        100%;
  height:       100%;
  max-width:    100%;
  min-width:    0;
  object-fit:   cover;
  display:      block;
  filter:       brightness(0.82) saturate(1.05);
  transition:   filter 250ms ease;
}

.act1-thumb:hover .act1-thumb__img-wrap img {
  filter:       brightness(1) saturate(1.1);
}

/* Stat overlay — stays dark (it's over the satellite image) */
.act1-thumb__overlay {
  position:     absolute;
  bottom:       0;
  left:         0;
  right:        0;
  padding:      0.3rem 0.5rem;
  background:   linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  display:      flex;
  flex-direction: column;
  gap:          0.1rem;
}

.act1-thumb__stat {
  font-family:  var(--act-font-mono);
  font-size:    0.6rem;
  color:        rgba(255, 255, 255, 0.80);
  line-height:  1.2;
}

.act1-thumb__stat-bar {
  height:       2px;
  border-radius: 1px;
  margin-top:   0.2rem;
  background:   rgba(255,255,255,0.18);
  overflow:     hidden;
}

.act1-thumb__stat-bar-fill {
  height:       100%;
  border-radius: inherit;
  background:   var(--colour-critical);
}

/* Label below image — light mode text */
.act1-thumb__label {
  display:      flex;
  flex-direction: column;
  gap:          0.1em;
}

.act1-thumb__year {
  font-family:  var(--act-font-mono);
  font-size:    0.88rem;
  color:        var(--act-text-primary);
  font-weight:  600;
  letter-spacing: 0.04em;
  line-height:  1;
}

.act1-thumb__sub {
  font-family:  var(--font-family);
  font-size:    0.72rem;
  font-style:   italic;
  color:        var(--act-text-muted);
  line-height:  1.3;
}




/* ── "The collapse had already begun" standalone emphasis ─────── */
.act1-collapse-line {
  font-style:  italic;
  font-weight: 600;
  font-size:   1.08em;
  color:       var(--act-text-primary);
}


/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .act1-thumbs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .act1-ripple-container {
    max-height: 300px;
  }

  .act1-ripple-legend {
    gap: 0.4rem 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .act1-thumb__img-wrap img {
    filter:     brightness(0.85);
    transition: none;
  }
}


/* ── ξ tooltip trigger ────────────────────────────────────────── */

.act1-xi-wrap {
  position:       relative;
  display:        inline-block;
  cursor:         help;
  outline:        none;
}

.act1-xi-term {
  border-bottom:  1.5px dotted rgba(45, 106, 27, 0.50);
  padding-bottom: 1px;
  transition:     color 180ms ease, border-color 180ms ease;
}

.act1-xi-wrap:hover .act1-xi-term,
.act1-xi-wrap:focus-visible .act1-xi-term {
  color:               #2D6A1B;
  border-bottom-color: #2D6A1B;
}

/* ── ξ tooltip bubble ─────────────────────────────────────────── */

.act1-xi-tooltip {
  position:         absolute;
  bottom:           calc(100% + 12px);
  left:             0;               /* JS sets exact px on every hover */
  transform:        translateY(8px);
  width:            340px;
  max-width:        calc(100vw - 24px);
  padding:          1rem 1.15rem 0.9rem;
  background:       rgba(10, 18, 7, 0.97);
  backdrop-filter:  blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border:           1px solid rgba(45, 106, 27, 0.30);
  border-radius:    10px;
  box-shadow:       0 16px 48px rgba(0, 0, 0, 0.40),
                    0 4px 12px rgba(0, 0, 0, 0.28);
  color:            rgba(235, 248, 228, 0.87);
  font-family:      Georgia, 'Times New Roman', serif;
  font-size:        0.76rem;
  font-style:       normal;
  font-weight:      normal;
  line-height:      1.70;
  letter-spacing:   0.01em;
  pointer-events:   none;
  opacity:          0;
  transition:       opacity 200ms ease,
                    transform 240ms cubic-bezier(0.34, 1.38, 0.64, 1);
  z-index:          200;
  white-space:      normal;
  text-align:       left;
}

/* Border arrow — JS drives horizontal position via --_tip-arrow */
.act1-xi-tooltip::before {
  content:          '';
  position:         absolute;
  top:              100%;
  left:             var(--_tip-arrow, 50%);
  transform:        translateX(-50%);
  border:           8px solid transparent;
  border-top-color: rgba(45, 106, 27, 0.30);
  border-bottom-width: 0;
}

/* Fill arrow (background colour, 1 px raised to cover border seam) */
.act1-xi-tooltip::after {
  content:          '';
  position:         absolute;
  top:              calc(100% - 1px);
  left:             var(--_tip-arrow, 50%);
  transform:        translateX(-50%);
  border:           7px solid transparent;
  border-top-color: rgba(10, 18, 7, 0.97);
  border-bottom-width: 0;
}

/* Shown — fade in + spring upward */
.act1-xi-wrap:hover .act1-xi-tooltip,
.act1-xi-wrap:focus-visible .act1-xi-tooltip {
  opacity:   1;
  transform: translateY(0);
}

/* KaTeX inline within tooltip */
.act1-xi-tooltip .katex {
  font-size:      0.84rem !important;
  color:          rgba(255, 255, 255, 0.96);
  vertical-align: middle;
}

/* Narrow screen: shrink width; JS still handles left/arrow */
@media (max-width: 600px) {
  .act1-xi-tooltip {
    width:     min(280px, calc(100vw - 24px));
    font-size: 0.70rem;
  }
}
