/* ==========================================================================
   GeoGrain project page: brand tokens and page components.
   The shared components (layout, nav, hero, section heads, figures, tabs,
   chip pickers, tables, disclosures, key points, lightbox, BibTeX, footer)
   are in family.css, which this file follows. The accent is the purple of
   the logo's "Grain" (#4F3F95), the hue of the paper's table rows for
   GeoGrain (RoyalPurple!5, which PDF viewers show as #F5F1F9, the tint
   below); the logo's "Geo" blue only marks "Remote Sensing" in the title.
   The gallery and compare dialog follow the PanBase and GeoCR pages.
   ========================================================================== */

/* ---------- 1. Brand tokens ---------------------------------------------- */
:root {
  --accent: #4F3F95;           /* the logo's "Grain" purple: rules, borders, icons, text (8.5:1 on white) */
  --accent-text: #4F3F95;      /* small text and white-on-purple fills (7.6:1 on the tint) */
  --accent-strong: #362175;    /* hover (12.9:1) */
  --accent-soft: #F5F1F9;      /* tinted fills: the paper's GeoGrain rows (RoyalPurple!5) */
  --accent-line: #D2CBEE;      /* tinted borders */
  --geo: #2F6FB1;              /* the logo's "Geo" blue (5.2:1 on white) */
  --logo-k: 1.308;             /* hero logo height factor: the wordmark gets the series' cap height */

  /* tile roles in comparison strips */
  --tile-input: #8a92a0;
  --tile-ref: #2a303b;
}
.hero-accent--geo { color: var(--geo); }
.wordmark { color: var(--geo); }         /* "Geo" blue and "Grain" purple, as in the logo */

/* ---------- 2. Gallery: carousel of tile strips -------------------------- */
.carousel { position: relative; }
.carousel-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.carousel-status { min-width: 0; margin: 0; font-size: .875rem; line-height: 1.3; }
.carousel-counter { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.carousel-title { margin-left: 8px; color: var(--muted); }
.carousel-nav { flex: none; display: flex; align-items: center; gap: 6px; }
.carousel-dots { display: flex; align-items: center; margin-right: 4px; }
.carousel-dot {
  width: 20px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.carousel-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 4px; background: var(--border-strong);
  transition: width .25s var(--ease), background-color .2s;
}
.carousel-dot:hover::before { background: var(--muted); }
.carousel-dot[aria-current="true"] { width: 30px; }
.carousel-dot[aria-current="true"]::before { width: 20px; background: var(--accent); }
.carousel-viewport { overflow: hidden; touch-action: pan-y; margin: -6px; padding: 6px; }
.carousel-track { display: flex; align-items: flex-start; transition: transform .5s var(--ease); }
.carousel.is-dragging .carousel-track { transition: none; }
.carousel-slide { flex: 0 0 100%; min-width: 0; padding: 0 6px; }
.carousel-slide + .carousel-slide { margin-left: 12px; }
.carousel:focus-visible { outline-offset: 8px; border-radius: var(--radius); }
.carousel-hint { margin: 12px 0 0; text-align: center; font-size: .8125rem; color: var(--faint); }
/* previous / next: large round buttons either side of the tiles, half way down them; out in
   the page margin when it has room for them, else in a gutter the tiles leave free */
.carousel-stage { position: relative; }
.carousel-side {
  position: absolute; top: 50%; z-index: 2;
  width: 48px; height: 48px; margin-top: -24px;
  border-color: var(--border); box-shadow: var(--shadow-m);
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease);
}
.carousel-side .icon { width: 22px; height: 22px; stroke-width: 2.3; }
.carousel-side.carousel-prev { right: calc(100% + 20px); }
.carousel-side.carousel-next { left: calc(100% + 20px); }
.carousel-side:hover { background: var(--accent-text); border-color: var(--accent-text); color: #fff; box-shadow: var(--shadow-m); }
.carousel-side:active { transform: scale(.94); }
.carousel-btn--bar { display: none; }
@media (max-width: 1415px) {
  .carousel-stage { padding-inline: 62px; }
  .carousel-side.carousel-prev { right: auto; left: 0; }
  .carousel-side.carousel-next { left: auto; right: 0; }
}
/* phones: no room at the sides, so the small pair in the bar above the tiles */
@media (max-width: 640px) {
  .carousel-stage { padding-inline: 0; }
  .carousel-side { display: none; }
  .carousel-btn--bar { display: grid; }
}
/* the hint draws the buttons as they look, centred on the line's lower-case letters */
.hint-btns { display: inline-flex; gap: 3px; margin-inline: 2px; vertical-align: middle; }
.hint-btns > span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
}
.hint-btns .icon { width: 11px; height: 11px; stroke-width: 2.6; }
@media (max-width: 480px) {
  .carousel-dots { display: none; }
  .carousel-title { display: block; margin: 2px 0 0; }
}
@media (pointer: coarse) {
  .carousel-dot { position: relative; }
  .carousel-dot::after { content: ""; position: absolute; inset: -10px -3px; }
}

/* ---------- 3. Tile legend, class legend and tile strip ------------------ */
.gallery-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 28px;
  margin: -6px 0 18px;
}
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
  font-size: .8125rem; color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-swatch { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--bg); }
.legend-swatch--input { border-style: dashed; border-color: var(--tile-input); }
.legend-swatch--ours { border: 2px solid var(--accent); background: var(--accent-soft); }
.legend-swatch--gt { border: 2px solid var(--tile-ref); }
@media (max-width: 480px) {   /* phones: 2 + 2 instead of 3 + 1 */
  .legend { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; }
}
/* the object classes of an example, with the colour of their boxes in the images */
.class-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  margin: 14px 0 0; font-size: .8125rem; color: var(--muted);
}
.class-legend-label { font: 700 .6875rem/1.3 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.cls { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.cls-sw { width: 15px; height: 11px; border-radius: 2px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }

.strip {
  --tile-min: 140px;          /* smallest tile width */
  --tile-gap-x: 10px;
  display: grid; gap: 12px var(--tile-gap-x);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min), calc(50% - 5px)), 1fr));
}
.strip[data-cols] {                /* set by main.js: balanced rows, last row centred */
  display: flex; flex-wrap: wrap; justify-content: center;
}
.strip[data-cols] > .tile { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--tile-gap-x)) / var(--cols)); }
/* never enlarge a tile past --tile-max (set per strip by build_site.py) */
.strip[data-cols] > .tile { max-width: var(--tile-max, none); }
.tile {
  margin: 0; min-width: 0;
  display: flex; flex-direction: column; gap: 7px;
  padding: 5px 5px 7px; border-radius: 11px;
  border: 1px solid transparent;
  transition: background-color .15s, box-shadow .15s;
}
.tile-btn {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; margin: 0;
  background: var(--bg-sunken); border-radius: 7px; overflow: hidden; cursor: zoom-in;
}
/* every tile of an example comes from one sheet: the ten 512 px tiles side by side, in page order
   (static/gallery/<set>/<example>_tiles.jpg). The sheet is ten tiles wide; a tile slides it left by
   its index --i, so the ten tiles of an example cost one request. */
.tile-btn img {
  position: absolute; top: 0; left: calc(var(--i, 0) * -100%);
  width: 1000%; max-width: none; height: 100%; object-fit: fill;
  opacity: 1; transition: opacity .25s;
}
.tile-btn img[data-src], .tile-btn img.is-loading { opacity: 0; }
.tile-btn::after {
  content: ""; position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(17, 21, 28, .72) no-repeat center / 15px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M8 8l-4 4 4 4M16 8l4 4-4 4'/%3E%3C/svg%3E");
  opacity: 0; transition: opacity .15s;
}
.tile-btn:hover::after, .tile-btn:focus-visible::after { opacity: 1; }
.tile-btn:focus-visible { outline-offset: 2px; }
.tile:hover { background: var(--bg); }
.tile figcaption {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center; line-height: 1.2;
}
.tile-m { font-size: .8125rem; font-weight: 600; color: var(--text); text-wrap: balance; }
.tile-v { font-size: .6875rem; font-weight: 500; color: var(--faint); letter-spacing: .01em; }

.tile--input { border: 1px dashed var(--border-strong); }
.tile--input .tile-v, .tile--gt .tile-v {
  padding: 2px 7px; border-radius: var(--radius-pill); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; font-size: .6875rem;
}
.tile--input .tile-v { background: var(--bg-sunken); color: var(--muted); }
.tile--gt { border-color: var(--tile-ref); box-shadow: 0 0 0 1px var(--tile-ref); }
.tile--gt .tile-v { background: var(--tile-ref); color: #fff; }
.tile--ours { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile--ours:hover { background: color-mix(in srgb, var(--accent) 10%, #fff); }
.tile--ours .tile-m { color: var(--accent-text); }
.tile--ours .tile-v {
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--accent-text); color: var(--on-accent); font-weight: 600; font-size: .6875rem;
}
.gallery-noscript { text-align: center; color: var(--muted); font-size: .9375rem; }
.panel-intro { max-width: 760px; margin: 0 auto 14px; text-align: center; font-size: .875rem; line-height: 1.55; color: var(--muted); }

/* ---------- 4. Compare dialog (left vs right) ------------------------------ */
dialog.cmp {
  max-width: none; max-height: calc(100dvh - 24px);
  margin: auto; padding: 0; border: 0; border-radius: var(--radius-l);
  background: var(--bg); color: var(--text-2); box-shadow: var(--shadow-l);
  overflow: auto; overscroll-behavior: contain;
  /* sized from the image (1024 px), capped by the viewport */
  width: min(max(600px, calc(var(--cmp-w, 400px) + 48px)), calc(100% - 24px));
}
dialog.cmp::backdrop { background: rgba(10, 12, 16, .7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cmp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 14px 14px 22px; border-bottom: 1px solid var(--border);
}
.cmp-kicker { margin: 0; font: 700 .6875rem/1.3 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cmp-title { margin: 5px 0 0; font: 600 1.0625rem/1.3 var(--font-sans); color: var(--text); }
.cmp-title .vs { margin: 0 2px; font-weight: 500; color: var(--faint); }
.icon-btn {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--bg-band); }
.icon-btn .icon { width: 18px; height: 18px; stroke-width: 2; }
.cmp-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 22px 20px; }
.cmp-stage {
  position: relative; aspect-ratio: 1;
  width: min(var(--cmp-w, 400px), 100%, calc(100vh - 330px));
  border-radius: 8px; overflow: hidden; background: var(--bg-sunken);
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px var(--border);
}
@supports (height: 100dvh) {
  .cmp-stage { width: min(var(--cmp-w, 400px), 100%, calc(100dvh - 330px)); }
}
.cmp-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none; -webkit-user-drag: none;
  transition: opacity .2s;
}
/* each side opens on its 1024 px image (fetched ahead as a rule); only when that takes longer than
   0.3 s, or the request fails, does the tile from the example's sheet stand in (.cmp-ph.is-shown) */
.cmp-img.is-loading { opacity: 0; }
.cmp-ph {
  position: absolute; inset: 0; pointer-events: none;
  background: no-repeat 0 0 / 1000% 100%;
  opacity: 0; transition: opacity .15s;
}
.cmp-ph.is-shown { opacity: 1; }
.cmp-img--a, .cmp-ph--a { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .22); pointer-events: none;
}
.cmp-knob {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.cmp-knob .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.cmp-range:focus-visible ~ .cmp-stage .cmp-knob { outline: 3px solid var(--accent); outline-offset: 2px; }
.cmp-label {
  position: absolute; top: 8px; max-width: calc(50% - 12px);
  padding: 4px 9px; border-radius: var(--radius-pill);
  background: rgba(14, 17, 23, .74); color: #fff;
  font: 600 .75rem/1.25 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.cmp-label--a { left: 8px; }
.cmp-label--b { right: 8px; }
.cmp-label.is-ours { background: var(--accent-text); }
.cmp-note { margin: -2px 0 0; max-width: 560px; font-size: .75rem; line-height: 1.45; color: var(--faint); text-align: center; }
/* left / right menus with a swap button between them */
.cmp-pickers { display: flex; align-items: flex-end; justify-content: center; gap: 10px; width: 100%; }
.cmp-pick { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 0 1 250px; }
.cmp-pick-label { font: 700 .6875rem/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cmp-select {
  width: 100%; height: 38px; padding: 0 34px 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg) no-repeat right 11px center / 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6373' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5L12 15l5.5-5.5'/%3E%3C/svg%3E");
  -webkit-appearance: none; appearance: none;
  font: 500 .875rem/1 var(--font-sans); color: var(--text); cursor: pointer;
  text-overflow: ellipsis;
}
.cmp-select:hover { border-color: var(--text); }
.cmp-select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cmp-hint { margin: 0; font-size: .8125rem; color: var(--faint); text-align: center; }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  font: 600 .6875rem/1.4 var(--font-sans); color: var(--muted); background: var(--bg);
}
@media (max-width: 600px) {
  .cmp-body { padding: 14px 14px 18px; }
  .cmp-head { padding: 14px 12px 12px 16px; }
  .cmp-pickers { gap: 6px; }
  .cmp-stage { width: min(var(--cmp-w, 400px), 100%, calc(100dvh - 290px)); }
}
@media (pointer: coarse) {    /* touch: menus and buttons as large as the page's other controls */
  .cmp-select { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}

/* ---------- 5. Figure widths ------------------------------------------------ */
/* The width is set on the <figure>, so the image card and its caption share one width
   (section 8 fits the caption to it). The teaser is large but never taller than the
   viewport, so the whole figure can be seen at once. */
.figure { width: 100%; max-width: var(--fig-w, none); margin-inline: auto; }
.teaser { --fig-w: min(100%, max(760px, calc((100vh - 120px) * 2.5586))); }
@supports (height: 100svh) {
  .teaser { --fig-w: min(100%, max(760px, calc((100svh - 120px) * 2.5586))); }
}
.figure--narrow { --fig-w: 820px; }
.figure--motivation { --fig-w: 668px; }

/* ---------- 6. Paper figures ----------------------------------------------- */
.method-figs { display: grid; gap: clamp(28px, 4vw, 44px); }
/* The paper figures are white and cropped to their content, so no frame may sit on their
   edge. On a white section (the teaser) a figure stands on the page with no frame at all;
   on a tinted band it lies on a white sheet with a margin all round and no outline, so the
   sheet's edge never touches the figure's own labels and panel lines. */
.teaser .figure-media { border: 0; border-radius: 0; background: transparent; }
.section--band .figure-media {
  padding: clamp(12px, 1.8vw, 22px);
  border-color: transparent; border-radius: var(--radius-l);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px -6px rgba(16, 24, 40, .1);
}
/* bold maths in the key points: family.css makes every <b> there a block (the item's title), so the symbols are spans */
.m-bf { font-weight: 700; }
.keypoints sub { font-size: .75em; line-height: 0; }

/* ---------- 7. Tables (classes written by tex_tables.py) -------------------- */
.results sub, .results sup, .table-figure figcaption sub, .table-figure figcaption sup { font-size: .72em; line-height: 0; }
.results .col-venue { white-space: nowrap; }
.results td.col-method.indent { padding-left: 26px; }        /* "+ Synthetic 25%" under "Real 100%" */
.m-up { font-style: normal; }                                  /* upright maths: bold Q, R, x and roman subscripts */
.m-sqrt { border-top: 1px solid currentColor; padding-top: 1px; }   /* the radicand of the square root of wh */
.results td.yes { color: var(--text); font-weight: 600; }     /* check marks of the ablation tables */
.results td.no { color: var(--faint); }
.results--checks tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--ours-bar); }   /* no method column there */
/* Table 15: GeoGrain built on SiamLayout, the paper's SkyBlue!5 row (#F7FCFD) next to the purple GeoGrain row */
.results tr.ours.ours--alt { --ours-bg: #F7FCFD; --ours-bg-hover: #EAF5FA; --ours-bar: var(--geo); --ours-ink: #2A5F97; }
.results tr.ours--alt td.col-method { font-weight: 600; }
/* Tables 2-3: the dataset band also carries the size-range labels under "AP by object size" */
.results tr.group--subhead th.sub { background: var(--bg-band); padding-block: 7px; }
.results tr.ref td { background: var(--bg-band); }            /* Table 6: the real-only reference row */
.results tr.gap-above td { padding-top: 15px; }               /* Table 20: \addlinespace between blocks */
.table-figure--wide .table-meta, .table-figure--wide .table-frame { max-width: none; }
@media (max-width: 820px) { .results :is(th, td) { padding-inline: 9px; } }

/* ---------- 8. Text alignment ------------------------------------------------
   One rule for every block of text (it overrides family.css): a block that runs over
   more than one line is justified to both edges of its box; a block that fits on one
   line is centred (its box shrinks to the line, width: fit-content). Words are never
   hyphenated automatically: some browsers can and some cannot (the desktop app's
   browser has no hyphenation dictionaries), so the lines would break differently from
   one reader to the next. Without it, every browser with the page's fonts breaks the
   lines alike, and the measures below are chosen for those breaks. That covers the section leads, the gallery
   intros and hints, the abstract, the key points, the table notes and every caption.
   - A caption is exactly as wide as its figure or table (the width is set on the
     <figure>, section 5), so a long caption's edges are the figure's edges, as in the
     paper.
   - The hero (title, authors, affiliation, notes) and the section titles are display
     lines: centred on balanced lines.
   - Names with a hyphen (AI-TOD-R, Layout-to-Image, TerraDiT-Ω) and number ranges never
     break at the hyphen or dash: they are wrapped in <span class="nowrap"> in index.html.
   - Below 1100 px, where the measures follow the width of the window and cannot be
     chosen line by line, the same blocks are flush left (end of this section); the key
     points, whose columns follow the window up to 1304 px, are flush left below that. */
.hero-affil, .hero-notes > span { text-wrap: balance; }

.section-head .lead, .panel-intro, .carousel-hint, .cmp-note,
.figure > figcaption, .table-figure > figcaption, .table-note, .abstract p, .keypoints li, .lb-caption {
  text-align: justify; text-wrap: wrap;   /* "pretty" would pull words down and leave a loose justified line */
  -webkit-hyphens: manual; hyphens: manual;
}
/* one line: centred; more: the full measure, justified */
.section-head .lead, .panel-intro, .carousel-hint, .cmp-note,
.figure > figcaption, .table-figure > figcaption { box-sizing: border-box; width: fit-content; }
.section-head .lead { margin-inline: auto; }
.panel-intro, .carousel-hint, .cmp-note { margin-inline: auto; }
.carousel-hint { max-width: 100%; }
.figure > figcaption, .table-figure > figcaption { max-width: 100%; }
.figure > figcaption { margin: 14px auto 0; }
.table-figure > figcaption { margin: 0 auto 10px; }
.table-note { max-width: none; }
/* sub- and superscripts (Q_ij, 10^3) do not open up the line they sit on */
figcaption :is(sub, sup), .table-note :is(sub, sup), .keypoints :is(sub, sup) { line-height: 0; }

/* Measures chosen line by line (no line of a justified block stretched more than about
   2 px per word space, no stub last line), each in the middle of a range of widths that
   all give the same breaks, so a pixel either way changes nothing: the section leads at
   920 px, the gallery intros at 786 px, the abstract panel at 862 px (with soft hyphens in
   three of its words in index.html) and Fig. 2 at 668 px (its caption; section 5). */
.section-head, .section--headline .section-head { max-width: 920px; }
.section-head .lead { max-width: none; }
.panel-intro { max-width: 786px; }
.abstract-toggle { max-width: 862px; }
/* A caption whose last line would be a stub of a word or two: main.js tightens its word
   space a touch when that is all it takes to lose the stub (cap-tight); a two-line caption
   that still has one is set on two balanced, centred lines (cap-balanced). */
.figure > figcaption.cap-tight, .table-figure > figcaption.cap-tight { word-spacing: -.05em; }
.figure > figcaption.cap-balanced, .table-figure > figcaption.cap-balanced { text-align: center; text-wrap: balance; }
/* and a one-line caption within 3 % of its figure's width is stretched to both edges */
.figure > figcaption.cap-full, .table-figure > figcaption.cap-full { width: 100%; text-align-last: justify; }
/* the key points: a column gap at which no column ends on a single word; their titles stay
   flush left, and below 1304 px, where the columns follow the window, so does their text */
@media (min-width: 761px) { .keypoints { column-gap: 24px; } }
.keypoints b, .keypoints .kp-num { text-align: left; }
@media (max-width: 1303px) { .keypoints li { text-align: left; text-wrap: pretty; } }

/* Table 1: three columns of a few short values, so narrower than the results tables (its
   caption still on one line); each dataset's four size classes form one aligned block
   (class, lower bound, dash, upper bound) centred in the dataset's column */
#table-1 { max-width: 880px; margin-inline: auto; }
@media (min-width: 720px) {
  #table-1 .results { table-layout: fixed; }
  #table-1 .results thead th:first-child { width: 30%; }
}
#table-1 .ranges { display: inline-grid; grid-template-columns: repeat(4, auto); align-items: baseline; row-gap: 6px; text-align: left; }
#table-1 .ranges .rc { padding-right: 1em; color: var(--text); }
#table-1 .ranges .lo { justify-self: end; }
#table-1 .ranges .dash { padding-inline: .2em; }

/* BibTeX: the colours GitHub gives the same entry in the repository's README (its light
   theme): the entry type red, the key purple, the fields and their values dark blue */
.bibtex pre { color: #1f2328; }
.bib-k { color: #cf222e; }
.bib-en { color: #6639ba; }
.bib-s { color: #0a3069; }

/* the hero notes: the e-mail addresses on one line, the † note on its own line just under them */
.hero-notes { flex-direction: column; align-items: center; gap: 0; }
.hero-notes > :not(.mail) { order: 1; margin-top: 6px; }

/* the footer on the same 1240 px axis as the nav and the sections */
.footer > .container { max-width: calc(var(--w-wide) + 2 * var(--gutter)); }

/* phones: a measure this short cannot be justified without gaps between words, so
   reading text and captions are flush left there (no hyphenation) */
@media (max-width: 1100px) {
  .section-head .lead, .panel-intro, .carousel-hint, .cmp-note, .figure > figcaption, .table-figure > figcaption,
  .table-note, .abstract p, .keypoints li, .lb-caption {
    text-align: left; text-wrap: pretty;
  }
}

/* hero buttons, navigation button and footer share one order and one set of colours with the
   badges of the code repository's README: the link to the other home (here Code, there the
   project page) in the logo's purple, arXiv in the red of the logo's car, Paper in the "Geo"
   blue, Gallery in the teal of the logo's fine tokens and BibTeX in ink. The four hues are set
   one step lighter than the logo, all at one lightness (OKLCH L 0.55), so no button outweighs
   another and white text keeps at least 4.6:1; ink is a soft charcoal (10.9:1). Hover deepens
   each colour. A link that is not public yet (arXiv placeholder, data-soon) keeps its colour,
   so the row reads as one set, and carries the "soon" chip until the real link is set. */
.btn--code    { --b: #6F64B3; --bh: #594D99; }
.btn--arxiv   { --b: #B74751; --bh: #9B2D3B; --t: #FBEFF0; --tl: #EECBCF; --ti: #A83F49; }
.btn--paper   { --b: #3A74B2; --bh: #215D99; --t: #EEF3FA; --tl: #C9D9EE; --ti: #336AA4; }
.btn--gallery { --b: #178378; --bh: #006B61; }
.btn--bib     { --b: #353D4D; --bh: #1D2433; }
.btn-row .btn[class*="btn--"] { background: var(--b); color: #fff; border-color: transparent; }
.btn-row .btn[class*="btn--"]:hover { background: var(--bh); color: #fff; }
.btn-row .btn[class*="btn--"][data-soon], .btn-row .btn[class*="btn--"][href*="/XXXX.XXXX"],
.btn-row .btn[class*="btn--"][data-soon]:hover, .btn-row .btn[class*="btn--"][href*="/XXXX.XXXX"]:hover,
.btn-row .btn[class*="btn--"][data-soon]:active, .btn-row .btn[class*="btn--"][href*="/XXXX.XXXX"]:active {
  background: var(--b); color: #fff; border-color: transparent; transform: none; box-shadow: none;
}
.btn-row .btn[class*="btn--"][data-soon]::after, .btn-row .btn[class*="btn--"][href*="/XXXX.XXXX"]::after {
  background: rgba(255, 255, 255, .2); color: #fff;
}
.topnav-cta[class*="btn--"] { background: var(--b); color: #fff; }
.topnav-cta[class*="btn--"]:hover { background: var(--bh); color: #fff; }
.topnav-cta[class*="btn--"][href*="/XXXX.XXXX"], .topnav-cta[class*="btn--"][data-soon],
.topnav-cta[class*="btn--"][href*="/XXXX.XXXX"]:hover, .topnav-cta[class*="btn--"][data-soon]:hover {
  background: var(--t); color: var(--ti); box-shadow: inset 0 0 0 1px var(--tl);
}
