/* Research article: structure only. Loaded before the theme's theme.css.
   Everything here is what the format needs to work (depths, the reading grid,
   figure fallbacks, print); colour, type and spacing belong to the theme. */

/* Depths. Shared content has no layer class and shows at both. */
html[data-depth="general"] .layer-technical { display: none; }
html[data-depth="technical"] .layer-general { display: none; }
html:not([data-depth]) .layer-general { display: none; }   /* no scripts: the technical depth */
html:not([data-depth]) .depth-bar { display: none; }

*, *::before, *::after { box-sizing: border-box; }
[id] { scroll-margin-top: 4.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* One reading column (--measure) with figures allowed up to --wide. */
.article { max-width: var(--wide, 960px); margin-inline: auto; }
.article-header, .article-end, .depth-bar { max-width: var(--measure, 42rem); margin-inline: auto; }
/* :where() keeps these at the specificity of .article-body, below the depth rules above. */
.article-body, :where(.article-body > div.layer-technical, .article-body > div.layer-general) {
  display: grid;
  grid-template-columns: [full-start] minmax(0, 1fr) [text-start] minmax(0, var(--measure, 42rem)) [text-end] minmax(0, 1fr) [full-end];
}
.article-body > *, :where(.article-body > div.layer-technical, .article-body > div.layer-general) > * { grid-column: text; min-width: 0; }
.article-body > .layer-technical, .article-body > .layer-general,
.article-body > .figure, .article-body > div.layer-technical > .figure, .article-body > div.layer-general > .figure { grid-column: full; }
.depth-bar { position: sticky; top: 0; z-index: 2; }

/* Figures. A figure drawn by the build carries one SVG per layout width; the
   container's width picks one. A still image is used where no drawing exists. */
.figure { margin-inline: auto; width: 100%; max-width: calc(var(--figure-width, 1) * var(--wide, 960px)); }
.figure-body { container-type: inline-size; }
.figure-static { display: block; width: 100%; height: auto; }
/* The study's own image (a panel that cannot be redrawn) is shown as a framed light print in
   every theme and scheme: its white paper is part of the image, so it gets a deliberate mount
   rather than a blend or filter, which would change its data colours. */
.figure-still { display: block; background: #ffffff; padding: 14px; border: 1px solid var(--rule, #dcdee2);
  border-radius: var(--fig-radius, 6px); box-shadow: 0 0 0 4px var(--surface, #f4f5f7); margin-inline: 4px; }
.figure-crop { display: block; overflow: hidden; }
.figure-crop > img { display: block; width: 100%; height: auto; }
svg.fig { width: 100%; height: auto; overflow: visible; }
.fig-draw > svg.fig-variant { display: none; }
.fig-draw > svg.fig-variant--s { display: block; }
@container (min-width: 470px) { .fig-draw > svg.fig-variant--s { display: none; } .fig-draw > svg.fig-variant--m { display: block; } }
@container (min-width: 720px) { .fig-draw > svg.fig-variant--m { display: none; } .fig-draw > svg.fig-variant--l { display: block; } }
.table-scroll { overflow-x: auto; }
/* Scroll shadows: a soft edge shows only where a wide table continues out of view. */
.table-scroll {
  background:
    linear-gradient(to right, var(--bg, #fff) 30%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg, #fff) 30%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)) right / 12px 100% no-repeat scroll;
}

/* Figure marks. The meaning of a mark is its class; a theme sets only the tokens. */
svg.fig text { font-family: var(--fig-font, inherit); fill: var(--fig-muted, #5b5f66); }
svg.fig .fig-strong { fill: var(--fig-ink, #16181b); }
.fig-grid { stroke: var(--fig-grid, #eceef1); fill: none; }
.fig-axis { stroke: var(--fig-axis, #9a9ea6); fill: none; }
.fig-band { fill: var(--fig-band, #e4e6ea); }
.fig-mark-a { fill: var(--fig-a, #0070dc); stroke: var(--fig-a, #0070dc); }
.fig-mark-b { fill: var(--fig-b, #74bff8); stroke: var(--fig-b-edge, #0070dc); }
.fig-mark-ink { fill: var(--fig-ink, #16181b); stroke: var(--fig-ink, #16181b); }
.fig-mark-muted { fill: var(--fig-band, #e4e6ea); stroke: var(--fig-axis, #9a9ea6); }
/* Series 1 to 6: categorical colours (the palette's --data-1..6, through the theme's --fig-1..6). */
.fig-series-1 { fill: var(--fig-1, #0070dc); stroke: var(--fig-1, #0070dc); }
.fig-series-2 { fill: var(--fig-2, #d55e00); stroke: var(--fig-2, #d55e00); }
.fig-series-3 { fill: var(--fig-3, #009e73); stroke: var(--fig-3, #009e73); }
.fig-series-4 { fill: var(--fig-4, #cc79a7); stroke: var(--fig-4, #cc79a7); }
.fig-series-5 { fill: var(--fig-5, #7b5cc4); stroke: var(--fig-5, #7b5cc4); }
.fig-series-6 { fill: var(--fig-6, #74bff8); stroke: var(--fig-6, #74bff8); }
/* Ramp steps 0 to 4 (light to strong): the palette's --seq-0..4, through --fig-seq-0..4. */
.fig-seq-0 { fill: var(--fig-seq-0, #dcebfb); } .fig-seq-1 { fill: var(--fig-seq-1, #a9d0f7); }
.fig-seq-2 { fill: var(--fig-seq-2, #74bff8); } .fig-seq-3 { fill: var(--fig-seq-3, #2e8be6); }
.fig-seq-4 { fill: var(--fig-seq-4, #0057ad); }
.fig-hollow { fill: var(--fig-bg, #fff); }
/* A halo in the background colour around a filled mark: coincident marks read as stacked discs. */
svg.fig .fig-halo { stroke: var(--fig-bg, #fff); }
/* A see-through filled mark: where models coincide, the overlap shows darker. */
svg.fig .fig-see-through { fill-opacity: .78; }
/* A label that may cross a line: set on a halo of the background colour. */
svg.fig .fig-label { paint-order: stroke; stroke: var(--fig-bg, #fff); stroke-width: 3px; stroke-linejoin: round; }
.fig-line-ink { stroke: var(--fig-ink, #16181b); fill: none; }
.fig-line-muted { stroke: var(--fig-muted, #5b5f66); fill: none; }
.fig-line-a { stroke: var(--fig-a, #0070dc); fill: none; }
.fig-line-b { stroke: var(--fig-b, #74bff8); fill: none; }
.fig-line-6 { stroke: var(--fig-6, #74bff8); fill: none; }
.fig-area-a { fill: var(--fig-a, #0070dc); stroke: none; }
.fig-area-b { fill: var(--fig-b, #74bff8); stroke: none; }
.fig-limit { stroke: var(--fig-ink, #16181b); stroke-dasharray: 5 4; fill: none; }
.fig-ring { fill: none; stroke: var(--fig-ink, #16181b); }
svg.fig .fig-on-a { fill: #ffffff; }
svg.fig .fig-on-b { fill: #0b1a2a; }
svg.fig .fig-on-ink { fill: var(--fig-bg, #fff); }
svg.fig .is-dim { opacity: .16; }
svg.fig .fig-sel { fill: none; stroke: var(--fig-ink, #16181b); stroke-width: 1.5; }
/* Interaction layers (added by a figure's interactive module, never by the drawing): live text
   replaces the drawn notes only on screen; print and the PDF always show the drawing as drawn. */
svg.fig .fig-live { display: none; }
svg.fig.is-live .fig-live { display: inline; }
svg.fig.is-live .fig-note { display: none; }
@media (prefers-reduced-motion: no-preference) {
  svg.fig .fig-pt, svg.fig .fig-band, svg.fig .fig-last, svg.fig text { transition: opacity .18s ease; }
}
.figure--table td, .figure--table th { white-space: nowrap; }

@media print {
  .depth-bar, .skip-link, .chart-controls, .chart-readout, .chart-panel, .site-header, .site-footer, .article-pdf { display: none !important; }
  svg.fig .is-dim { opacity: 1 !important; }
  svg.fig * { transition: none !important; }
  svg.fig .fig-live, svg.fig .fig-sel { display: none !important; }
  svg.fig.is-live .fig-note { display: inline !important; }
  /* One column on paper: grid containers do not break across pages cleanly. */
  .article-body, html div.layer-technical { display: block !important; }
  html li.layer-technical { display: list-item !important; }
  html .layer-general { display: none !important; }
  .figure-body { container-type: normal; }
  .fig-draw > svg.fig-variant { display: none !important; }
  .fig-draw > svg.fig-variant--l { display: block !important; }
  .figure, pre, .fig, tr { break-inside: avoid; }
  .figure { margin-inline: 0; }
  h2, h3 { break-after: avoid; }
  pre { white-space: pre-wrap; overflow: visible; }
  .table-scroll { overflow: visible; }
}
@page { margin: 16mm 15mm; }
