/* Research page media kit. Loaded only by research.html; see _components.html for copy-paste examples. */

/* Wider column so figures and movies have room; text stays at a readable width */

/* Jump list under the page title: bold cardinal pills */
.toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; font: 600 14.5px/1 var(--sans); }
.toc a { color: var(--accent); background: var(--accent-soft); border: 1px solid #ecd6d6; text-decoration: none;
  padding: 10px 16px; border-radius: 999px; transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s; }
.toc a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.toc a.secondary { color: var(--text-2); background: var(--card); border-color: var(--rule); font-weight: 500; }
.toc a.secondary:hover { color: #fff; background: var(--text-2); border-color: var(--text-2); }

/* Figures: image, video, or embed + caption */
.fig { margin: 16px 0 28px; }
.fig img, .fig video, .fig iframe { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--rule); background: #f6f6f6; }
.fig iframe { aspect-ratio: 16 / 9; height: auto; }
.fig figcaption { color: var(--muted); font: 14.5px/1.5 var(--sans); margin-top: 8px; }
.fig figcaption b { color: var(--text); font-weight: 600; }
.fig.zoom img, .fig.zoom video { cursor: zoom-in; }

/* Side-by-side media: <div class="fig-row"> <figure class="fig">…</figure> … </div> */
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.fig-row .fig { margin: 16px 0 8px; }

/* Text beside a figure: <div class="split"> <div>text</div> <figure class="fig">…</figure> </div> */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: center; margin: 16px 0 28px; }
.split.flip > :first-child { order: 2; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }

/* Before/after slider: <div class="compare"> <img> <img> </div>; the second image is revealed by dragging */
.compare { position: relative; overflow: hidden; border-radius: 6px; border: 1px solid var(--rule);
  --pos: 50%; touch-action: pan-y; user-select: none; cursor: ew-resize; }
.compare img { display: block; width: 100%; pointer-events: none; }
.compare img:nth-of-type(2) { position: absolute; inset: 0; height: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--pos)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center;
  font: 16px/1 var(--sans); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.compare .tag { position: absolute; top: 10px; font: 12px/1 var(--sans); color: #fff; background: rgba(0,0,0,.55);
  padding: 5px 8px; border-radius: 4px; }
.compare .tag.l { left: 10px; } .compare .tag.r { right: 10px; }

/* Key numbers row: <div class="stats"><div><strong>9.0 m</strong>water-table rise</div>…</div> */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 16px 0 28px; }
.stats > div { border-top: 2px solid var(--accent); padding-top: 8px; font: 14px/1.4 var(--sans); color: var(--muted); }
.stats strong { display: block; font: 1.7rem/1.2 Georgia, serif; color: var(--text); font-weight: normal; }

/* Scroll reveal (only when JS is on and the visitor allows motion) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(12,12,14,.92); display: none;
  align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 88vh; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .cap { position: absolute; bottom: 14px; left: 24px; right: 24px; text-align: center; color: #ddd; font: 14px/1.4 var(--sans); }
.lightbox .x { position: absolute; top: 12px; right: 18px; color: #fff; font: 28px/1 var(--sans); background: none; border: 0; cursor: pointer; }

/* ---------- Research directions (story layout) ---------- */
.direction { margin: 0 0 72px; padding-top: 8px; }
.direction .step { display: inline-block; font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px; }
.direction h3 { font-size: clamp(1.6rem, 2.8vw, 1.95rem); line-height: 1.2; margin-bottom: 6px; }
.direction .tagline { font: italic 400 1.2rem/1.5 var(--serif); color: var(--text-2); margin: 0 0 18px; }
.direction .fig { margin: 22px 0 18px; }
.related { background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 22px 14px; }
.related h4 { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { font-size: 16px; line-height: 1.55; margin: 0 0 10px; color: var(--text-2); }
.related li a { color: var(--text); font-weight: 600; text-decoration: none; }
.related li a:hover { color: var(--accent); text-decoration: underline; }
.related .award { display: inline-block; font: 500 12px/1 var(--sans); color: var(--accent); background: var(--accent-soft);
  padding: 4px 8px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.resources { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.resources a { font: 600 13.5px/1 var(--sans); color: var(--accent); text-decoration: none; border: 1px solid #ecd6d6;
  background: var(--accent-soft); padding: 8px 13px; border-radius: 999px; transition: background .2s, color .2s; }
.resources a:hover { background: var(--accent); color: #fff; }

/* ---------- Earlier projects: thumbnail cards ---------- */
.earlier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-top: 24px; }
.ecard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px 18px 18px; transition: box-shadow .25s, transform .25s; }
.ecard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.ecard .fig { margin: 0 0 14px; }
.ecard .fig img { aspect-ratio: 16 / 10; object-fit: contain; background: #fff; border: 0; }
.ecard h3 { font-size: 1.15rem; margin-bottom: 6px; }
.ecard p { font-size: 15.5px; line-height: 1.6; color: var(--text-2); flex: 1; margin-bottom: 12px; }
.ecard .cite { font: 500 13.5px/1.3 var(--sans); color: var(--accent); text-decoration: none; }
.ecard .cite:hover { text-decoration: underline; }

/* Collaborative cards: extra meta line, multiple links, text tile */
.ecard .meta { font: 500 13px/1.45 var(--sans); color: var(--muted); margin: -4px 0 12px; flex: 0; }
.ecard .cites { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tile { aspect-ratio: 16 / 10; margin: 0 0 14px; border-radius: 6px; background: linear-gradient(135deg, var(--accent-soft), #fff);
  border: 1px solid #ecd6d6; display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; }
.tile span { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.tile strong { font: 600 1.35rem/1.3 var(--serif); color: var(--text); }
.related .seealso { font: 400 14.5px/1.5 var(--sans); color: var(--muted); margin: 6px 0 0; }
.earlier-grid.two-col { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .earlier-grid.two-col { grid-template-columns: 1fr; } }
.tile em { font: 400 14px/1.4 var(--sans); color: var(--muted); margin-top: 6px; font-style: normal; }

/* Research overview: numbered chain instead of pill tags */
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 32px; margin: 36px 0 18px; }
.chain a { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--rule);
  color: var(--text); text-decoration: none; transition: border-color .25s; }
.chain .n { font: 600 12.5px/1 var(--sans); letter-spacing: .1em; color: var(--accent); }
.chain strong { font: 600 1.3rem/1.3 var(--serif); letter-spacing: -.01em; transition: color .2s; }
.chain .why { font: 400 14.5px/1.55 var(--sans); color: var(--text-2); flex: 1; }
.chain .go { font: 500 13.5px/1.3 var(--sans); color: var(--accent); margin-top: 6px; }
.chain a:hover { border-top-color: var(--accent); }
.chain a:hover strong { color: var(--accent); }
@media (max-width: 800px) { .chain { grid-template-columns: 1fr 1fr; gap: 20px 24px; } }
.also { font: 400 14.5px/1.5 var(--sans); color: var(--muted); margin: 8px 0 0; }
.also a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.also a:hover { color: var(--accent); border-color: var(--accent); }

.ecard .fig video { aspect-ratio: 16 / 9; object-fit: cover; background: #f3f3f3; border: 0; }
.ecard .fig figcaption.credit { font-size: 12.5px; margin-top: 6px; }

/* ---------- Collaborative projects slider ---------- */
.slider { position: relative; margin-top: 24px; }
.sl-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 22px) / 2); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sl-track::-webkit-scrollbar { display: none; }
.sl-track > .ecard { scroll-snap-align: start; }
.sl-track > .ecard:hover { transform: none; }
@media (max-width: 700px) { .sl-track { grid-auto-columns: 88%; } }
.sl-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 14px; }
.sl-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--card); color: var(--text-2);
  font: 500 17px/1 var(--sans); cursor: pointer; transition: background .2s, color .2s, border-color .2s, opacity .2s; }
.sl-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.sl-btn:disabled { opacity: .35; cursor: default; }
.sl-dots { display: flex; gap: 8px; }
.sl-dots button { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: #d8d3cc; cursor: pointer;
  transition: width .3s, background .3s; }
.sl-dots button[aria-selected="true"] { width: 24px; background: var(--accent); }

.earlier-grid.four-col { grid-template-columns: repeat(4, 1fr); gap: 18px; }
.earlier-grid.four-col .ecard { padding: 12px 14px 16px; }
.earlier-grid.four-col .ecard h3 { font-size: 1.05rem; }
.earlier-grid.four-col .ecard p { font-size: 14.5px; }
@media (max-width: 1000px) { .earlier-grid.four-col { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .earlier-grid.four-col { grid-template-columns: 1fr; } }

/* Subsections inside a research direction */
.subgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 6px 0 22px; }
@media (max-width: 700px) { .subgrid { grid-template-columns: 1fr; } }
.sub { display: flex; flex-direction: column; padding: 16px 20px 16px; background: var(--card); border: 1px solid var(--rule);
  border-top: 2px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); }
.sub h4 { font: 600 1.12rem/1.3 var(--serif); color: var(--text); margin: 0 0 8px; }
.sub p { font-size: 15.5px; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; flex: 1; }
.sub .status { align-self: flex-start; font: 500 12.5px/1.4 var(--sans); color: var(--muted); background: #f3f1ed;
  padding: 5px 10px; border-radius: 999px; }
.sub .status.done { color: var(--accent); background: var(--accent-soft); }
.sub .status a { color: inherit; }

/* Space between the overview and the first research direction */
.also { margin-bottom: 64px !important; }

.chain .go { white-space: nowrap; font-size: 13px; }
@media (max-width: 1100px) { .chain .go { white-space: normal; } }

/* Fiber-optic subsections: four figure cards in a 2x2 grid */
.subgrid.four { grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 700px) { .subgrid.four { grid-template-columns: 1fr; } }
.subgrid.four .sub { padding: 16px 20px 18px; }
.subgrid.four .sub h4 { font-size: 1.2rem; }
.subgrid.four .sub p { font-size: 15.5px; }
.sub-fig { margin: 0 0 12px !important; }
.sub-fig img { aspect-ratio: 16 / 10; object-fit: contain; background: #fff; border: 0 !important; }
.sub-fig.missing { aspect-ratio: 16 / 10; border-radius: 6px; border: 1px dashed #e2cfcf;
  background: linear-gradient(135deg, var(--accent-soft), #fff); display: flex; align-items: center; justify-content: center; }
.sub-fig.missing::after { content: attr(data-label); font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); opacity: .7; }

/* Fiber-optic subsections: one per row, figure on the left */
.subgrid.rows { grid-template-columns: 1fr; gap: 18px; }
.subgrid.rows .sub { display: grid; grid-template-columns: minmax(240px, 36%) 1fr; grid-template-rows: auto 1fr auto;
  column-gap: 28px; align-items: start; padding: 18px 22px; }
.subgrid.rows .sub-fig { grid-column: 1; grid-row: 1 / span 3; margin: 0 !important; }
.subgrid.rows .sub h4 { grid-column: 2; font-size: 1.25rem; margin-top: 2px; }
.subgrid.rows .sub p { grid-column: 2; font-size: 16px; }
.subgrid.rows .sub .status { grid-column: 2; justify-self: start; align-self: end; }
@media (max-width: 700px) {
  .subgrid.rows .sub { grid-template-columns: 1fr; }
  .subgrid.rows .sub-fig { grid-row: auto; margin-bottom: 12px !important; }
  .subgrid.rows .sub h4, .subgrid.rows .sub p, .subgrid.rows .sub .status { grid-column: 1; }
}

/* Two figures side by side (e.g., prior samples -> posterior) */
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin: 22px 0 18px; }
.fig-pair .fig { margin: 0 !important; }
@media (max-width: 760px) { .fig-pair { grid-template-columns: 1fr; } }

/* Medium-width figure, centered (for tall figures) */
.fig.fig-md { max-width: 820px; margin-left: auto; margin-right: auto; }
.fig.fig-md figcaption { text-align: left; }

/* FWI workflow movie */
.overview-movie { margin: 28px 0; }
.overview-movie video { display: block; width: 80%; margin: 0 auto; height: auto; border-radius: 14px; background: #0e0e11; }

/* landscape illustration under the intro */
.scene-fig { margin: 28px 0 8px; }
.scene-fig svg, .scene-fig .scene-movie { display: block; width: 92%; height: auto; margin: 0 auto; }
.scene-fig svg text { font-family: var(--sans); }
.scene-fig figcaption { max-width: 72ch; margin: 6px auto 0; text-align: center; color: var(--muted); font: 14.5px/1.5 var(--sans); }

/* two figures stacked top and bottom */
.fig-stack { max-width: 820px; margin: 22px auto 18px; display: grid; gap: 26px; }
.fig-stack .fig { margin: 0 !important; }

/* Fiber-Optic Seismology rows: larger figure, figure at its own aspect ratio */
@media (min-width: 701px) { .subgrid.rows .sub { grid-template-columns: minmax(280px, 56%) 1fr; } }
.subgrid.rows .sub-fig img { aspect-ratio: auto; height: auto; }
.subgrid.rows .sub p { font-size: 15.5px; }

/* numbered legend under the landscape illustration, matching the badges */
.scene-legend { list-style: none; counter-reset: scene; margin: 14px auto 0; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 28px; text-align: left;
  font: 400 14px/1.45 var(--sans); color: var(--text-2); }
.scene-legend li { counter-increment: scene; position: relative; padding-left: 32px; min-height: 22px; }
.scene-legend li::before { content: counter(scene); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: #8c1515;
  color: #fff; font: 700 12px/22px var(--sans); text-align: center; }
.scene-legend b { color: var(--text); font-weight: 600; }
@media (max-width: 800px) { .scene-legend { grid-template-columns: 1fr 1fr; max-width: 100%; } }
@media (max-width: 520px) { .scene-legend { grid-template-columns: 1fr; } }
.scene-fig figcaption { max-width: none; }
/* smaller figure, same column width, so the text lines up with the other cards */
@media (min-width: 701px) { .subgrid.rows .sub.narrow-fig .sub-fig { width: 76%; justify-self: center; } }
/* Fiber-Optic Seismology cards: closer to body text size, figure centered beside the text */
.subgrid.rows .sub p { font-size: 16.5px; line-height: 1.6; }
.subgrid.rows .sub h4 { font-size: 1.3rem; }
@media (min-width: 701px) { .subgrid.rows .sub-fig { align-self: center; } }
/* Code page: smaller figures than the research cards */
@media (min-width: 701px) { .code-list .subgrid.rows .sub { grid-template-columns: minmax(260px, 44%) 1fr; } }
.fig.fig-sm { max-width: 640px; }
/* Code page: two-column cards, figure on top */
.code-list .subgrid.rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: stretch; }
.code-list .subgrid.rows .sub { display: flex; flex-direction: column; grid-template-columns: none; padding: 18px 20px 20px; }
.code-list .subgrid.rows .sub-fig { width: 100%; margin: 0 0 14px !important; align-self: stretch; }
.code-list .subgrid.rows .sub-fig img { aspect-ratio: 16 / 9; object-fit: contain; background: #fff; }
.code-list .subgrid.rows .sub h4 { font-size: 1.15rem; margin: 0 0 8px; }
.code-list .subgrid.rows .sub p { font-size: 15.5px; flex: 1; }
.code-list .subgrid.rows .sub .status { align-self: flex-start; }
@media (max-width: 760px) { .code-list .subgrid.rows { grid-template-columns: 1fr; } }
.code-list .sub h4 a { color: inherit; text-decoration: none; transition: color .2s; }
.code-list .sub h4 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* legend: title on its own line, description below */
.scene-legend b { display: block; margin-bottom: 2px; white-space: nowrap; }
/* Fiber-Optic Seismology: two columns of cards, figure on top */
#fiber-optic-seismology .subgrid.rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: stretch; }
#fiber-optic-seismology .subgrid.rows .sub { display: flex; flex-direction: column; grid-template-columns: none; padding: 18px 20px 20px; }
#fiber-optic-seismology .subgrid.rows .sub-fig { width: 100% !important; margin: 0 0 14px !important; align-self: stretch; }
#fiber-optic-seismology .subgrid.rows .sub-fig img { aspect-ratio: 16 / 10; object-fit: contain; background: #fff; }
#fiber-optic-seismology .subgrid.rows .sub p { flex: 1; font-size: 15.5px; }
#fiber-optic-seismology .subgrid.rows .sub h4 { font-size: 1.2rem; }
#fiber-optic-seismology .subgrid.rows .sub .status { align-self: flex-start; }
@media (max-width: 760px) { #fiber-optic-seismology .subgrid.rows { grid-template-columns: 1fr; } }

/* ===== Research page opening: one grid, one rhythm =====
   intro at a readable measure, illustration + legend as one framed panel,
   the 01-04 cards on the same full width, even vertical spacing */
body .wrap > .subtitle { max-width: 900px; font-size: 1.2rem; line-height: 1.7; color: var(--text-2); margin-bottom: 0; }

.scene-fig { margin: 40px 0 0; padding: 30px 34px 26px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); }
.scene-fig svg, .scene-fig .scene-movie { width: 100%; max-width: 1040px; }
.scene-legend { max-width: none; margin: 22px 0 0; padding-top: 22px; border-top: 1px solid var(--rule);
  grid-template-columns: repeat(3, 1fr); gap: 18px 40px; }

.chain { margin: 48px 0 0; gap: 0 28px; }
.also { margin-top: 18px; }

@media (max-width: 800px) {
  .scene-fig { padding: 18px 16px 18px; border-radius: 14px; }
  .scene-legend { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
}
@media (max-width: 520px) { .scene-legend { grid-template-columns: 1fr; } }
/* intro: wider, centered block, justified with no broken words (like the Home bio) */
body .wrap > .subtitle { max-width: none; margin-left: auto; margin-right: auto; text-align: justify;
  hyphens: manual; -webkit-hyphens: manual; text-wrap: pretty; }
@media (max-width: 560px) { body .wrap > .subtitle { text-align: left; } }
/* section descriptions: justified, no broken words */
.direction > p:not(.tagline) { text-align: justify; hyphens: manual; -webkit-hyphens: manual; text-wrap: pretty; }
@media (max-width: 560px) { .direction > p:not(.tagline) { text-align: left; } }
/* card descriptions: justified, no broken words */
#fiber-optic-seismology .sub p { text-align: justify; hyphens: manual; -webkit-hyphens: manual; text-wrap: pretty; }
@media (max-width: 560px) { #fiber-optic-seismology .sub p { text-align: left; } }
/* fiber cards: uniform figure panels so figures of different shapes sit evenly */
#fiber-optic-seismology .subgrid.rows .sub-fig { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  background: transparent; border-radius: 0; padding: 0; box-sizing: border-box; overflow: hidden; }
#fiber-optic-seismology .subgrid.rows .sub-fig img { aspect-ratio: auto !important; width: 100%; height: 100%; object-fit: contain;
  background: transparent; border: 0 !important; border-radius: 4px; }
#fiber-optic-seismology .subgrid.rows .sub h4 { margin: 4px 0 8px; }
/* FWI: workflow movie (method) beside the monitoring cube (result), equal heights */
.fwi-pair { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; margin: 26px 0 18px; }
.fwi-pair .fig { margin: 0 !important; }
.fwi-pair video { display: block; width: 100%; height: auto; border-radius: 12px; background: #0e0e11; border: 0; }
.fwi-pair .fwi-cube img { display: block; width: 100%; height: auto; border: 0; background: transparent; }
@media (max-width: 760px) { .fwi-pair { grid-template-columns: 1fr; } }
/* GBI: prior-samples movie and posterior figure side by side, equal image heights, full content width */
.gbi-pair { display: grid; grid-template-columns: 2.03fr 1.37fr; gap: 24px; align-items: start; margin: 26px 0 18px; }
.gbi-pair .fig { margin: 0 !important; }
.gbi-pair img, .gbi-pair video { display: block; width: 100%; height: auto; }
.gbi-pair figcaption { font-size: 14px; }
@media (max-width: 760px) { .gbi-pair { grid-template-columns: 1fr; } }

/* ===== 1. one figure system: every figure spans the content width ===== */
.overview-movie video { width: 100% !important; }
/* ===== 2. one caption style: left, 14px, gray ===== */
.fig figcaption, .fig.fig-md figcaption, .gbi-pair figcaption { text-align: left; font: 400 14px/1.55 var(--sans); color: var(--muted);
  max-width: none; margin: 10px 0 0; }
/* ===== 3. less red: neutral borders; red kept for links, step labels, badges ===== */
.sub { border-top-color: #d9d4cc !important; }
.related { border-left-color: #d9d4cc !important; }
.stats > div { border-top-color: #d9d4cc; }
/* Code cards: justified descriptions, no broken words */
.code-list .sub p { text-align: justify; hyphens: manual; -webkit-hyphens: manual; text-wrap: pretty; }
@media (max-width: 560px) { .code-list .sub p { text-align: left; } }
/* interactive 3D plume (Plotly) in a framed panel */
.plume-fig iframe.plume-3d { display: block; width: 100%; height: 520px; border: 1px solid var(--rule) !important;
  border-radius: 12px; background: #fff; }
@media (max-width: 760px) { .plume-fig iframe.plume-3d { height: 480px; } }

/* Prerendered plume animation avoids loading the 3D renderer on the research page. */
.plume-fig video.plume-3d { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
