/* Venezuela relief reports — design tokens */
:root {
  --mar: #0d2830;        /* deep Caribbean sea-ink */
  --mar-deep: #081b21;
  --espuma: #edf2f1;     /* cool foam white — page ground */
  --blanco: #ffffff;
  --tinta: #16323c;      /* text ink */
  --tinta-suave: #4d6570;
  --oro: #d9a50f;        /* Venezuelan-flag gold */
  --oro-claro: #f0c447;
  --fringe: #4fb3a9;     /* interferogram teal */
  --coral: #c2482f;
  --display: "Newsreader", Georgia, serif;
  --body: "Albert Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --measure: 62ch;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--tinta);
  background: var(--espuma);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--oro); text-underline-offset: 3px; }
a:hover { color: var(--oro-claro); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; cursor: pointer; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--mar-deep);
  color: var(--espuma);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem var(--pad);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9db8bd;
}
.lang-switch {
  display: inline-flex;
  border: 1px solid #35525b;
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: none;
  color: #b9cdd1;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.95rem;
}
.lang-btn[aria-pressed="true"] {
  background: var(--oro);
  color: var(--mar-deep);
}
.lang-btn:not([aria-pressed="true"]):hover { color: var(--blanco); }

/* ---------- hero (slideshow) ---------- */
.hero {
  position: relative;
  min-height: min(82vh, 48rem);
  min-height: min(82svh, 48rem); /* svh: stable under mobile browser toolbars */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--mar-deep);
  color: var(--blanco);
}
.hero-slides { position: absolute; inset: 0; }
.hero-inner {
  position: relative;
  z-index: 2;
  pointer-events: none;
  padding: clamp(3rem, 8vh, 6rem) var(--pad) clamp(1.4rem, 4vh, 2.6rem);
  max-width: 54rem;
  margin-bottom: 3rem; /* keeps the lede clear of the slider bar */
}
.hero-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(8, 27, 33, 0.8);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-lede {
  margin-top: 1.2rem;
  max-width: 44rem;
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  color: #dbe7e6;
  text-shadow: 0 1px 12px rgba(8, 27, 33, 0.9);
  animation: rise 0.9s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- seismic trace divider (signature) ---------- */
.trace {
  background: var(--mar-deep);
  line-height: 0;
}
.trace svg { width: 100%; height: 60px; }
.trace-small { background: transparent; }
.trace-small svg { height: 34px; }
.trace-line {
  stroke: var(--fringe);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw 2.4s 0.3s ease-out forwards;
}
.trace-small .trace-line { stroke: #b4c9c6; animation-duration: 1.6s; }
.trace-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--oro);
  letter-spacing: 0.1em;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- sections ---------- */
.section {
  padding: clamp(3rem, 7vw, 5rem) var(--pad);
  max-width: 68rem;
  margin: 0 auto;
}
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fringe);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 2px;
  background: var(--oro);
  vertical-align: middle;
  margin-right: 0.6rem;
}
.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1.4rem;
  text-wrap: balance;
}
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1rem; }
.prose p { font-size: 1.04rem; }

/* "what happened": faint USGS shakemap as section backdrop */
#quake { position: relative; }
#quake::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/usgs-watermark.jpg") right -6rem top / auto 100% no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
#quake > * { position: relative; }

/* impact-assessment map figures */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.6rem;
  margin-top: 2.2rem;
  align-items: start;
}
.map-fig-wide { grid-column: 1 / -1; }
.map-zoom {
  border: 1px solid #d5dedd;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
  width: 100%;
  background: var(--blanco);
  box-shadow: 0 6px 22px rgba(13, 40, 48, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.map-zoom:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(13, 40, 48, 0.2);
}
.map-zoom img { width: 100%; height: auto; }
.map-fig figcaption {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--tinta-suave);
}
.map-fig .credit {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: #7d959d;
}
@media (max-width: 46rem) {
  .map-fig-wide { grid-column: auto; }
  #quake::before { background-size: auto 60%; opacity: 0.05; }
}

/* "what we are doing" collage (admin-managed) */
.work-collage { margin-top: 2.4rem; }
.work-collage-note {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--tinta-suave);
  border-left: 3px solid var(--fringe);
  padding-left: 1.2rem;
  max-width: 42rem;
}

/* photo slider (hero slideshow + report media) */
.slider {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(13, 40, 48, 0.18);
  background: var(--mar);
}
.slider-viewport { overflow: hidden; }
.slider-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.slide {
  flex: 0 0 100%;
  min-width: 100%;
}
.slide-zoom {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  cursor: zoom-in;
  background: var(--mar);
}
/* Letterbox frame: fixed shape for layout stability; the photo fits whole
   (contain — never cropped) over a blurred copy of itself filling the rest. */
.slide-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--mar-deep);
}
.slider-compact .slide-frame { aspect-ratio: 4 / 3; }
.slide-frame .slide-fg,
.slide-frame .slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.slide-frame .slide-fg { object-fit: contain; }
.slide-bg {
  object-fit: cover;
  filter: blur(24px) saturate(0.85) brightness(0.45);
  transform: scale(1.15); /* hide blur's soft edges */
}
.slider-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0.9rem;
  background: var(--mar-deep);
  color: #b9cdd1;
}
.slider-counter {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--oro);
  white-space: nowrap;
}
.slider-cap {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.45;
}
.slider-controls { display: flex; gap: 0.4rem; }
.slider-btn {
  background: rgba(237, 242, 241, 0.08);
  border: 1px solid rgba(237, 242, 241, 0.25);
  color: var(--espuma);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.slider-btn:hover { background: rgba(217, 165, 15, 0.35); }
.report .slider { margin-top: 1rem; box-shadow: none; border: 1px solid #dfe7e5; }

/* hero variant: slides fill the hero, controls in a bottom bar */
.slider-hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: none;
}
.slider-hero .slider-viewport { position: relative; flex: 1; }
.slider-hero .slider-track { height: 100%; }
.slider-hero .slide, .slider-hero .slide-zoom { height: 100%; width: 100%; }
.slider-hero .slide-frame {
  height: 100%;
  aspect-ratio: auto; /* fills the hero; the photo letterboxes inside it */
}
.slider-hero .slider-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(8, 27, 33, 0.82) 0%, rgba(8, 27, 33, 0.38) 42%, rgba(8, 27, 33, 0.18) 100%);
}
.slider-hero .slider-bar { position: relative; z-index: 3; }

@media (max-width: 40rem) {
  .slider-bar { flex-wrap: wrap; }
  .slider-cap { flex-basis: 100%; order: 3; }

  /* Phones: title rides the hero's top letterbox band, lede the bottom one,
     leaving the photo visible in between. */
  .hero-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 1.4rem;
    margin-bottom: 4.6rem;
  }
  .hero-title { font-size: 2.1rem; }
  .hero-lede { font-size: 0.95rem; }

  /* Phone-shaped frames: 4/3 default; taller when the lead photo is portrait */
  .slide-frame { aspect-ratio: 4 / 3; }
  .slider-portrait:not(.slider-hero) .slide-frame { aspect-ratio: 4 / 5; }
  .slider-hero .slide-frame { aspect-ratio: auto; }

  /* comfortable tap targets */
  .slider-btn { width: 2.75rem; height: 2.75rem; }
  .lang-btn { padding: 0.5rem 1.1rem; }
  .masthead { padding: 0.65rem var(--pad); }
  .eyebrow { font-size: 0.64rem; }
}

/* pillars */
.pillars {
  list-style: none;
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.4rem;
}
.pillars li {
  border-top: 2px solid var(--oro);
  padding-top: 0.8rem;
}
.pillar-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mar);
  margin-bottom: 0.35rem;
}
.pillar-text { font-size: 0.95rem; color: var(--tinta-suave); }

/* scripture */
.verse {
  margin: 2.8rem 0 0;
  max-width: 46rem;
  border-left: 3px solid var(--oro);
  padding-left: 1.4rem;
}
.verse p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.4;
  color: var(--mar);
}
.verse cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

/* ---------- feed ---------- */
.feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.feed-updated {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--tinta-suave);
  padding-bottom: 0.4rem;
}
.feed-note {
  font-size: 0.92rem;
  color: var(--tinta-suave);
  max-width: var(--measure);
  margin-bottom: 2rem;
}
.feed { display: grid; gap: 1.8rem; }
.feed-loading, .feed-empty, .feed-error {
  font-size: 0.95rem;
  color: var(--tinta-suave);
  padding: 2rem 0;
}
.feed-error { color: var(--coral); }

.report {
  background: var(--blanco);
  border-radius: 12px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: 0 4px 18px rgba(13, 40, 48, 0.08);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.report.visible { opacity: 1; transform: none; }
.report-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--tinta-suave);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.report-num { color: var(--oro); font-weight: 500; }
.report-sample {
  background: var(--coral);
  color: var(--blanco);
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.report-media {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}
.report-media.cols-2 { grid-template-columns: 1fr 1fr; }
.report-media img, .report-media video {
  width: 100%;
  border-radius: 8px;
  background: var(--espuma);
}
.report-media button {
  border: none;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}
.report-caption {
  margin-top: 1rem;
  max-width: var(--measure);
  font-size: 1rem;
}
.report-audio { margin-top: 0.8rem; }
.report-audio audio { width: 100%; max-width: 34rem; display: block; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem;
  background: var(--mar-deep);
  color: #b9cdd1;
  text-align: center;
  padding: 3rem var(--pad) 3.4rem;
}
.stars { width: 150px; color: var(--oro); margin-bottom: 1.2rem; }
.footer-org { font-size: 0.92rem; color: var(--espuma); margin-bottom: 1rem; }
.footer-line { font-size: 0.85rem; max-width: 46rem; margin: 0.25rem auto; }
.footer-verse {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--espuma);
  max-width: 40rem;
  margin: 1.6rem auto 0;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 27, 33, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-figure {
  max-width: min(92vw, 90rem);
  max-height: 92vh;
  max-height: 92svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
#lb-img {
  max-width: 100%;
  max-height: 82vh;
  max-height: 82svh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}
#lb-cap {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #b9cdd1;
  text-align: center;
  max-width: 60rem;
  padding: 0 1rem;
}
.lb-close, .lb-nav {
  position: fixed;
  background: rgba(237, 242, 241, 0.08);
  border: 1px solid rgba(237, 242, 241, 0.25);
  color: var(--espuma);
  border-radius: 999px;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lb-close:hover, .lb-nav:hover { background: rgba(217, 165, 15, 0.35); }
.lb-close { top: 1rem; right: 1rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-nav[disabled] { opacity: 0.25; cursor: default; }

/* ---------- small screens & motion ---------- */
@media (max-width: 40rem) {
  .report-media.cols-2 { grid-template-columns: 1fr; }
  .lb-nav { top: auto; bottom: 1rem; transform: none; }
  /* keep the photo and caption clear of the bottom-docked nav buttons */
  #lb-img { max-height: 70svh; }
  .lb-figure { padding-bottom: 4.4rem; }
  /* report captions repeat the card text — don't let them fill the screen */
  #lb-cap {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title, .hero-lede { animation: none; }
  .trace-line { animation: none; stroke-dashoffset: 0; }
  .report { opacity: 1; transform: none; transition: none; }
  .slider-track { transition: none; }
}
