/*
 * pages.css: page-level layout in the mockup look. Load after components.css.
 *
 *   .skip-link       visible only on focus
 *   .fixture-banner  TEST FIXTURE banner (fixture builds only)
 *   .section         vertical spacing between page sections
 *   .hero            home hero: .hero__img, .hero__main (.kicker, h1 with .hl yellow number, .until,
 *                    .clock-line), .hero__side (rule, paragraph, link)
 *   .sectionbar      section header: ruled top, h2 and a mono note (.sub)
 *   .index-grid      01 block: .index-grid__summary left (.week-head, .movers), .index-grid__gauge right
 *   .bottom-grid / .feed / .plain-list   outlook and plain lists
 *   .split           two columns on desktop, one below 1000px
 *   .essay / .method thesis teaser and transparency block
 *   .index-figure / .index-number / .band-label   index readout (inner pages and state bar)
 *   .table-wrap / .data-table, .prose, .lead   inner-page parts
 */

/*
 * HOME FOLD BUDGET (desktop, 1440 x 900 viewport). Rule: the whole "01 / The Entropy Index" panel and the whole
 * Week summary are visible with no scrolling. Heights in px at 900px high (vh-based values scale with the window):
 *
 *   masthead (sticky; 7+7 padding, 2-line brand 2.4vh = 21.6px x .95 x 2 = 41) 55
 *   tag strip (4+4 padding, 11px mono x 1.5 + 1px rule)                        26
 *   hero (1 rule + 5+5 padding + 11.6vh = 104 image/content)                  115
 *     hero text stack: kicker 14+2, h1 7.8vh = 70 x .92 = 64, until 12 x 1.2 + 3, clock 14+4 = about 117 (was
 *     about 120 with h1 54px: the bigger headline is paid for by the spacing cuts, the hero is no taller)
 *   gap above the index                                                         4
 *   index row, left column, the taller of the two:
 *     2 rule + sectionbar 5+20+4 = 29 + panel padding 10+8 + 2 border = 20
 *     + gauge 520 wide (cap) x .625 = 325 + footer line 6+17 = 23              399
 *   index row, right column: natural height 2 + head 32 + label 23 + image 36% x 605 / 1.25 = 174
 *     + movers title 36 + 3 rows x 30 + 1 = 91 = 358. Flex column in a stretched grid cell: the movers rows
 *     grow to fill the left column's 399 (rows about 44 each); it never adds to the row height.
 *   INDEX PANEL AND WEEK SUMMARY END AT                                        599
 *   Spare below the fold line                                                  301
 *   02 header (12 margin + 2 rule + 8+6 padding + 24 title = 52)               651
 *   dial row 1 (16 padding + 17 title + 56 dial at 108px wide + 17..35 driver line, no margin)  ~106-124 -> ends 757-775
 *     (dial 88 -> 108px adds 10px, the removed per-card 'Higher = better' note frees 15: each card is no taller;
 *     the one 'Higher = better' sits in the 02 title row, which already has the line height)
 *   dial row 2 (+1 gap + same)                                             ends 844-880   (fits, 20px spare at worst)
 *
 * At 900: BOTH dial rows (all 8 dials) end above the fold (844-880 of 900). The gauge stays at its 520px cap and the
 * week image share is unchanged; the 60px came from the 02 margin (-18), header padding (-12), dial padding (-8 per
 * row) and dial size 100 -> 88px (-7 per row), driver-line margin (-2 per row): about 62 in all.
 *
 * At 1366 x 768: hero image 11.6vh = 89, so chrome is 55+26+100+4 = 185 (h1 7.8vh = 60px, until 11px floor); the
 * 520px gauge (the vh formula allows (88.4vh - 185) / .625 = 788px, so the cap binds) ends the index at
 * 185+74+325 = 584 of 768 (spare 184). 02 header ends at 636; dial row 1 (96-114) ends 732-750, so ONE dial row ends
 * above 768; row 2 (ends 829-865) is below the fold.
 * Gauge number: font-size 184 (2x the old 92) in the same 600 x 375 box, baseline at cy - 16, letter-spacing -12.
 * At 1920 x 1080 both rows fit (about 960 of 1080). Below 1001px wide the two columns stack and below 650px
 * everything flows normally (no fold guarantee); the masthead is sticky only from 651px wide.
 */

.skip-link { position: absolute; left: var(--sp-3); top: -4rem; background: var(--ink); color: #f3ecdd; padding: var(--sp-2) var(--sp-3); z-index: 10; }
.skip-link:focus { top: var(--sp-3); }

/* Shown on every page of a build made with --fixture (tests and previews only). */
.fixture-banner { background: var(--yellow); color: var(--ink); border-bottom: 2px solid var(--ink); text-align: center; padding: 6px 12px; font: 600 12px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.readiness { margin: 4px 0 0; }

.section { margin-top: 30px; }
main.shell > .section:first-child { margin-top: 26px; }

/* ---------- hero ---------- */
.hero { --hero-h: clamp(84px, 11.6vh, 130px); display: grid; grid-template-columns: minmax(130px, 19.5%) minmax(0, 1fr) minmax(190px, 22%); gap: 0 30px; align-items: stretch; padding: 5px 0; border-top: 1px solid var(--ink); margin-top: 0; }
.hero__img { align-self: start; width: 100%; height: var(--hero-h); object-fit: cover; border: 1px solid var(--ink); filter: grayscale(1) contrast(1.1); }
/* No photo: two columns, the headline block and the side note. */
.hero--no-img { grid-template-columns: minmax(0, 1fr) minmax(190px, 22%); }
.hero__main { container-type: inline-size; text-align: center; padding-top: 0; }
.kicker { font: 500 clamp(10px, 1.1vh + 3px, 12px)/1.2 var(--font-mono); letter-spacing: .26em; text-transform: uppercase; margin: 0 0 2px; }
/* The title block is exactly as wide as the headline; .until is stretched to that same width. */
.hero__title { width: fit-content; max-width: 100%; margin: 0 auto; }
.hero h1 { font: 900 clamp(44px, 6.5vw, 100px)/.92 var(--font-display); letter-spacing: -.045em; margin: 0; white-space: nowrap; }
@supports (font-size: 1cqw) { .hero h1 { font-size: min(10.8cqw, 7.8vh); } }
.hl { background: var(--yellow); padding: 0 .08em; margin: 0 .02em; display: inline-block; line-height: .9; font-variant-numeric: tabular-nums; }
.br-m { display: none; }
/* Tracking .22em at 2.5cqw: 29 mono characters come to about 60cqw, inside the headline's roughly 75cqw, so one line. */
.until { width: 0; min-width: 100%; font: 500 clamp(11px, 1.3vw, 17px) var(--font-mono); letter-spacing: .22em; text-transform: uppercase; text-align: justify; text-align-last: justify; margin: 3px 0 0; padding: 0; line-height: 1.2; }
@supports (font-size: 1cqw) { .until { font-size: min(1.75cqw, max(11px, 1.33vh)); } }
.clock-line { font: 500 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 0; }
.clock-line .date-note { display: block; margin-top: 1px; }
.hero__side { border-left: 1px solid var(--ink); padding-left: 18px; align-self: center; text-align: left; }
.hero__side p { font: 400 clamp(12px, 1.55vh, 14px)/1.3 var(--font-body); margin: 0 0 5px; }
.hero__side p:last-child { margin-bottom: 0; }

.band-label { display: inline; }

/* ---------- section bars ---------- */
.section-rule { border-top: 2px solid var(--ink); }
.sectionbar { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 15px; padding: 14px 0 12px; flex-wrap: wrap; }
.sectionbar h2 { font: 900 clamp(19px, 2vw, 24px)/1 var(--font-display); letter-spacing: -.005em; margin: 0; }
.sectionbar h2 .sub { font: 500 clamp(11px, 1.2vw, 14px) var(--font-mono); letter-spacing: .1em; margin-left: .6em; white-space: normal; }
.sectionbar p { font: 500 11px var(--font-mono); margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.sectionbar .signals-polarity { margin-left: auto; text-align: right; }
.case-title { margin-bottom: 8px; }
@media (min-width: 651px) {
  .case-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: clamp(22px, 1.9vw, 27px); }
}
.author-list > li { display: flex; gap: var(--sp-4); align-items: flex-start; }
.author-card__photo { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--ink); flex: 0 0 auto; }
.author-card h3 { margin: 0 0 6px; font-size: 20px; }
.author-card p { margin: 0 0 8px; }

/* ---------- 01: index gauge and week summary ---------- */
.index-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 30px; border-top: 2px solid var(--ink); margin-top: 4px; }
.index-grid__summary, .index-grid__gauge { min-width: 0; }
/* Week summary LEFT (first in the HTML, so first on narrow screens), gauge RIGHT. The vertical rule sits on the
   summary's right edge. The summary column stretches to the gauge panel's height: the movers list takes the spare
   space as even rows. */
.index-grid__summary { border-right: 1px solid var(--ink); padding-right: 24px; display: flex; flex-direction: column; }
.index-grid__summary #moved { flex: 1; display: flex; flex-direction: column; }
.index-grid__summary .movers { flex: 1; display: flex; flex-direction: column; }
.index-grid__summary .movers li { flex: 1; }
.index-grid .sectionbar { padding: 5px 0 4px; }
.index-grid .sectionbar h2 { font-size: 20px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0 4px; }
.week-head h2 { font: 900 20px/1 var(--font-display); margin: 0; letter-spacing: -.005em; }
.week-head span { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.week-head__when { display: flex; align-items: baseline; gap: 14px; }
.week-body { display: grid; grid-template-columns: minmax(100px, 36%) minmax(0, 1fr); gap: 16px; align-items: start; }
.week-body .week-img { align-self: start; width: 100%; height: auto; display: block; border: 1px solid var(--ink); filter: grayscale(1) contrast(1.1); }
/* No photo: the text takes the whole width. */
.week-body--no-img { grid-template-columns: minmax(0, 1fr); }
.week-body h3 { font: 900 clamp(18px, 2.4vh, 24px)/.98 var(--font-display); letter-spacing: -.03em; margin: 0 0 6px; }
/* Home summary headline: larger, and free to wrap to two lines (never cut). The size follows the text column
   (container units). The 01 row height is set by the gauge column, so the extra line costs the fold nothing. */
.index-grid__summary .week-body > div { container-type: inline-size; min-width: 0; }
.index-grid__summary .week-body h3 { font-size: 24px; line-height: 1.02; overflow-wrap: break-word; }
@supports (font-size: 1cqw) { .index-grid__summary .week-body h3 { font-size: clamp(20px, 6cqw, 32px); } }
/* 'Editorial' / 'Computed' label: small, right-aligned under the headline. */
.index-grid__summary .summary-source { margin: 0 0 6px; font-size: 9px; text-align: right; }
.week-body p { font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
.week-body p:last-child { margin-bottom: 0; }
.center-footer { margin: 6px 0 0; font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.center-footer strong { color: var(--ink); font-weight: 600; }
.movers-title { font: 900 18px/1 var(--font-display); letter-spacing: -.01em; margin: 12px 0 6px; padding-bottom: 0; }
.movers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.movers li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--ink); font-size: 14px; line-height: 1.2; }
.movers li > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.movers li svg { width: 18px; height: 18px; display: block; }
.movers .delta { font: 900 20px/1 var(--font-display); letter-spacing: -.02em; text-align: right; }
.movers .up { color: var(--green-text); }
.movers .down { color: var(--red); }
.history-panel { border: 1px solid var(--ink); background: var(--paper); padding: 10px 14px 4px; }
.history-panel svg { display: block; width: 100%; height: auto; }

/* ---------- lists and columns ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.bottom-grid { display: grid; grid-template-columns: 1fr; gap: 26px; margin-top: 30px; }
.feed { border-top: 2px solid var(--ink); }
.outlook-list > li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 11px 0; }
.watch-n { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.feed-meta { font: 500 11px var(--font-mono); letter-spacing: .06em; color: var(--muted); margin-top: 6px; text-transform: uppercase; }
.plain-list { list-style: none; margin: 0 0 var(--sp-4); padding: 0; }
.plain-list > li { padding: 14px 0; border-bottom: 1px solid var(--ink); line-height: 1.4; }
.plain-list > li:first-child { border-top: 1px solid var(--ink); }

/* ---------- thesis and transparency ---------- */
/* Rules sit on an inner element, so they stop at the content column (never in the shell's side padding). */
.essay { margin-top: 36px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 55px; padding-top: 22px; padding-bottom: 12px; }
.essay h2 { font: 900 clamp(30px, 4.2vw, 52px)/.98 var(--font-display); letter-spacing: -.035em; text-transform: uppercase; margin: 0 0 16px; }
.essay p { line-height: 1.5; font-size: 17px; }
.essay .essay__note { font-size: 11px; margin: 0; }
.essay .essay__link { text-align: right; }
.method { background: var(--yellow); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 26px 0; margin-top: 36px; }
.method .shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 35px; align-items: center; }
.method h2 { font: 900 26px/1 var(--font-display); margin: 0 0 8px; text-transform: uppercase; }
.method p { max-width: 720px; font-size: 15px; line-height: 1.45; margin: 0; }
.method .link-arrow { white-space: nowrap; justify-self: end; align-self: center; font-size: 13px; }
.method .link-arrow:hover { background: #fff; }
#newsletter .panel { margin: 30px 0 0; }
#newsletter h2 { font-size: clamp(26px, 3vw, 38px); }

/* ---------- index readout (inner pages) ---------- */
.index-figure { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-3) 0; flex-wrap: wrap; }
.index-number { font: 900 clamp(60px, 8vw, 96px)/.95 var(--font-display); letter-spacing: -.04em; }
.report-head .band-label { display: inline-block; background: var(--pink); font: 900 clamp(22px, 3vw, 32px)/1 var(--font-display); letter-spacing: -.02em; text-transform: uppercase; padding: 4px 12px; }

/* ---------- inner pages ---------- */
.report-head { margin-top: var(--sp-4); }
.table-wrap { overflow-x: auto; margin-bottom: var(--sp-4); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--paper); border: 1px solid var(--ink); }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--soft); }
.data-table thead th { border-bottom: 2px solid var(--ink); text-transform: uppercase; letter-spacing: .12em; font: 600 11px var(--font-mono); background: var(--panel); }

.forecast-label { margin: 8px 0 0; }
.watch-title { font: 900 18px/1 var(--font-display); letter-spacing: -.01em; margin: 22px 0 8px; }
.outlook-chart-panel svg { min-width: 520px; }
.outlook-chart-panel { overflow-x: auto; }
.byline { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.byline__photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ink); flex: 0 0 auto; }
.byline__text { margin: 0; }
.piece-image { display: block; width: 100%; max-width: 760px; height: auto; border: 1px solid var(--ink); margin: 0 0 var(--sp-4); }
.prose { max-width: 46rem; }
.solar-sources { list-style: none; margin: 0 0 var(--sp-4); padding: 0; font-size: 0.875rem; line-height: 1.4; }
.solar-sources > li { padding: 6px 0; overflow-wrap: anywhere; }
.solar-sources a { overflow-wrap: anywhere; }
.lead { font: 900 clamp(22px, 3vw, 30px)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: -.02em; }
main h1.display { margin: 12px 0 var(--sp-4); }
.chart-panel svg, .report-head + h2 + p + svg, article > svg { display: block; width: 100%; max-width: 760px; }
main.shell { padding-bottom: 56px; }

/* ---------- responsive ---------- */
/* Desktop fold: the gauge is capped at 520px wide and shrinks further if the window is short. Its box is 600:375, so
   height = .625 x width. Width = (88.4vh - 185px) / .625: 88.4vh is what remains after the hero image (11.6vh),
   185px is the fixed chrome (masthead, strip, hero padding, gaps) plus the index panel's own text and padding. */
@media (min-width: 1001px) {
  .gauge { max-width: min(520px, max(300px, calc((88.4vh - 185px) / .625))); }
  /* Tighter 02 block so both dial rows clear the fold (see HOME FOLD BUDGET). */
  #signals { margin-top: 12px; }
  #signals .sectionbar { padding: 8px 0 6px; }
  #signals .dial { padding: 8px 18px; min-height: 0; }
  #signals .dial-svg { width: 108px; }
  #signals .dial-line { margin-top: 0; }
}
@media (max-width: 1000px) {
  .split, .essay { grid-template-columns: 1fr; }
  .essay { gap: 10px; }
  .index-grid { grid-template-columns: 1fr; }
  /* Narrow: summary first, rule on its bottom edge instead of its right. */
  .index-grid__summary { border-right: 0; padding-right: 0; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 8px; }
  .hero { grid-template-columns: minmax(110px, 190px) minmax(0, 1fr); }
  .hero--no-img { grid-template-columns: minmax(0, 1fr); }
  .hero__side { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--ink); margin-top: 14px; padding-top: 12px; }
  .method .shell { grid-template-columns: 1fr; gap: 14px; }
  .method .link-arrow { justify-self: start; }
}
@media (max-width: 650px) {
  .link-arrow, .method .link-arrow { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
  .hero { grid-template-columns: 1fr; padding-top: 14px; }
  .hero__img { aspect-ratio: 16 / 7; height: auto; }
  .hero h1 { white-space: normal; font-size: 17cqw; line-height: .95; }
  @supports not (font-size: 1cqw) { .hero h1 { font-size: 16vw; } }
  .br-m { display: inline; }
  .until { letter-spacing: .22em; padding-left: .22em; font-size: 11px; }
  /* No sideways scroll at 390px: nothing may widen the page (wide charts scroll inside their own panel). */
  html, body { overflow-x: clip; }
  .week-body { grid-template-columns: 1fr; }
  .index-grid__summary .week-body h3 { font-size: clamp(22px, 6.5vw, 28px); }
  .movers li { grid-template-columns: 22px minmax(0, 1fr) auto; font-size: 14px; }
  .outlook-list > li { grid-template-columns: 1fr; gap: 2px; }
  /* SVG text is drawn in viewBox units and scales down with the chart: enlarge it so it renders at 12px or more.
     History/line charts: 560-wide box shown at ~343px (x.61), 20 units = 12.2px. Outlook chart: 1100-wide box shown
     at 640px (x.58, see min-width), 21 units = 12.2px. Gauge scale: 600-wide box at ~300px (x.5); 24 units would be
     12px. With letter-spacing 0 the mono labels (0.6em a glyph) fit: EXTINCTION spans x 5-149, 50 / UNCERTAIN
     x 199-401, UTOPIA x 480-566; the two "|" separators (no letter-spacing attribute) would hit them, so they are
     hidden on phones. */
  main svg text[font-size="11"], main svg text[font-size="12"] { font-size: 20px; }
  .outlook-chart-panel svg { min-width: 640px; }
  .outlook-chart-panel svg text[font-size="11"], .outlook-chart-panel svg text[font-size="12"] { font-size: 21px; }
  .gauge svg text[font-size="14"] { font-size: 24px; letter-spacing: 0; }
  .gauge svg text[font-size="14"]:not([letter-spacing]) { display: none; }
}
