diff --git a/frontend/src/styles/components.css b/frontend/src/styles/components.css index c21f07c..32c7d01 100644 --- a/frontend/src/styles/components.css +++ b/frontend/src/styles/components.css @@ -331,6 +331,44 @@ padding: var(--sp-2) 0 var(--sp-5) 3.5rem; } +/* Subgrid: promotes the summary's columns to `.year-rows` so every row's + * figures share the same tracks — the timeline and figure columns then + * line up across years instead of each row's `auto` column sizing to its + * own text. Engines without subgrid keep the independent per-row grid + * above. */ +@supports (grid-template-columns: subgrid) { + .year-rows { + display: grid; + grid-template-columns: 3.5rem minmax(0, 1fr) auto auto auto var(--icon-sm); + column-gap: var(--sp-4); + } + + .year-row { + grid-column: 1 / -1; + display: grid; + grid-template-columns: subgrid; + } + + .year-row__summary { + grid-column: 1 / -1; + display: grid; + grid-template-columns: subgrid; + } + + .year-row__summary::after { + grid-column: 6; + } + + .year-row__body { + grid-column: 1 / -1; + } + + .year-row__figures { + grid-column: 3 / 6; + grid-template-columns: subgrid; + } +} + .year-row__table { width: auto; margin-bottom: var(--sp-4); diff --git a/frontend/src/styles/responsive.css b/frontend/src/styles/responsive.css index 572d28c..6347506 100644 --- a/frontend/src/styles/responsive.css +++ b/frontend/src/styles/responsive.css @@ -91,6 +91,17 @@ gap: var(--sp-4) var(--sp-6); } + /* Undo the subgrid promotion (components.css) — mobile keeps each row's + * own independent layout below, not the shared per-year-list tracks. */ + .year-rows { + display: flex; + flex-direction: column; + } + + .year-row { + display: block; + } + .year-row__summary { grid-template-columns: 3rem minmax(0, 1fr) var(--icon-sm); }