/*
Theme Name: Yarudor
Description: Block theme for an analytical reference publication: lime accent on cool graphite, Public Sans and IBM Plex Mono, self-hosted fonts.
Text Domain: yarudor
Requires at least: 7.0
Requires PHP: 8.1
Version: 0.1.19
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Update URI: false
*/

/* Tokens that theme.json does not cover. Colours, fonts, sizes and spacing live in theme.json.
   Lime (#6bd039) is 1.96:1 on white: it is a fill only, with coal text on it (9.1:1). Text, links
   and focus on light surfaces use fern (#3a7110, 5.9:1 on white); on night surfaces lime itself is 9.5:1. */
:root {
	--yrd-focus: var(--wp--preset--color--fern);
	--yrd-focus-dark: var(--wp--preset--color--lime);
	--yrd-r-control: 2px;
	--yrd-r-card: 4px;
	--yrd-bar-h: 0rem; /* The header is one bar and is not sticky: no anchor offset. Raise it if that changes. */
	--yrd-gridpaper: linear-gradient(var(--wp--preset--color--grid) 1px, transparent 1px) 0 0 / 1.5rem 1.5rem,
		linear-gradient(90deg, var(--wp--preset--color--grid) 1px, transparent 1px) 0 0 / 1.5rem 1.5rem,
		var(--wp--preset--color--vellum);
}

html { scroll-padding-top: calc(var(--yrd-bar-h) + 1.5rem); -webkit-text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img, svg { height: auto; max-width: 100%; }
a { text-decoration-thickness: 0.08em; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 0.14em; }

/* Keyboard focus: a visible ring everywhere, lime on every night surface. */
:focus-visible { outline: 3px solid var(--yrd-focus); outline-offset: 3px; }
.has-night-background-color :focus-visible { outline-color: var(--yrd-focus-dark); }

/* Graph-paper panel behind the lead figure; the lines are decoration only. */
.yrd-gridpaper { background: var(--yrd-gridpaper); }

/* Figures, dates and table cells align on tabular digits; running text keeps Public Sans. */
.yrd-num, .yrd-table, .wp-block-table table { font-variant-numeric: tabular-nums; }
.yrd-num { font-family: var(--wp--preset--font-family--data); }

/* Data tables scroll inside their own block, never the page (360 px). */
.wp-block-table { -webkit-overflow-scrolling: touch; overflow-x: auto; }
.wp-block-table th, .wp-block-table td { padding: 0.5rem 0.75rem; }
.wp-block-table thead th { background: var(--wp--preset--color--grid); text-align: left; }
.wp-block-table tbody tr:nth-child(even) { background: var(--wp--preset--color--vellum); }
.wp-block-table figcaption { color: var(--wp--preset--color--pewter); font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--caption); margin-top: 0.5rem; }

/* Header: one light bar with a hairline; the descriptor shows from 80rem, the current section is bold and underlined, never colour alone. */
.yrd-bar { border-bottom: 1px solid var(--wp--preset--color--hairline); }
.yrd-bar-row { align-items: center; min-height: calc(3.5rem - 1px); } /* the bar is 56 px on a phone and 64 px from 64rem, the 1 px hairline included (design system); the height comes from the row, not from padding around it; the 44 px targets are invisible, so the 12 px clearance is measured from the visible edge of the glyph or border */
@media (min-width: 64rem) { .yrd-bar-row { min-height: calc(4rem - 1px); } }
/* Visually hidden, still read by screen readers: the search heading on an empty search. */
.yrd-visually-hidden { border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
.yrd-bar .wp-block-navigation a { text-decoration: none; white-space: nowrap; } /* 1200-1279 px: a label never breaks, the row wraps whole items instead */
.yrd-bar .wp-block-site-title { white-space: nowrap; }
/* The open phone menu: core paints it pure white with pure black text, and theme.json sits in :where(), so coal text needs a rule that out-ranks core's own. */
.yrd-bar .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) { background-color: var(--wp--preset--color--vellum); color: var(--wp--preset--color--coal); }
/* Open menu as a panel: the mark above the list, weight 600, 48 px rows and a 48 px close button. */
.yrd-bar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content::before { background: url("assets/brand/mark.svg") center / contain no-repeat; content: ""; display: block; height: 2rem; margin-block-end: var(--wp--preset--spacing--md); width: 2rem; }
.yrd-bar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a { font-size: var(--wp--preset--font-size--intro); font-weight: 600; min-height: 3rem; }
.yrd-bar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { align-items: center; display: inline-flex; justify-content: center; min-height: 3rem; min-width: 3rem; }
.yrd-bar .wp-block-navigation .current-menu-item > a, .yrd-bar .wp-block-navigation a[aria-current] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.2em; }

/* Footer: lockup, two link columns and the publisher in one grid on vellum (every heading on one row), then the small print in pewter. */
.yrd-foot { border-top: 1px solid var(--wp--preset--color--hairline); }
.yrd-foot a { color: var(--wp--preset--color--fern); }
.yrd-foot-h { font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--caption); font-weight: 600; margin: 0 0 var(--wp--preset--spacing--xs); }
.yrd-foot-grid { align-items: start; display: grid; gap: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--xl); grid-template-columns: minmax(0, 1fr); }
.yrd-foot-grid > * { margin: 0; min-width: 0; }
.yrd-foot-nav > * { margin-block: 0; }
.yrd-foot-list { list-style: none; margin: 0; padding: 0; }
.yrd-foot-list li { margin: 0; }
.yrd-foot-lockup { margin: 0; }
.yrd-foot-lockup a { color: var(--wp--preset--color--coal); text-decoration: none; }
.yrd-foot-base { border-top: 1px solid var(--wp--preset--color--hairline); margin-top: var(--wp--preset--spacing--xl); padding-top: var(--wp--preset--spacing--md); }
.yrd-foot-base p, .yrd-copyright { color: var(--wp--preset--color--pewter); margin: 0; }
@media (min-width: 40rem) { .yrd-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 40rem) and (max-width: 63.99rem) { .yrd-foot-lockup { grid-column: 1 / -1; } } /* three cells in two columns would leave a dead cell */
@media (min-width: 64rem) { .yrd-foot-grid { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); } }

/* Dated rows: lists and the Deal Desk table. A date column plus the headline; dividers instead of boxes. */
.yrd-row { border-top: 1px solid var(--wp--preset--color--hairline); display: grid; gap: 0.25rem var(--wp--preset--spacing--lg); grid-template-columns: 7rem minmax(0, 1fr); padding-block: var(--wp--preset--spacing--sm); }
.yrd-row { align-items: baseline; } /* the date shares the baseline of the headline's first line, not the top edge of its box */
.yrd-row .wp-block-post-title a { display: block; } /* core makes the link inline-block, whose baseline is its LAST line: a wrapped headline would pull the date down to it */
.yrd-row > * { margin: 0; }
.yrd-row:has(.yrd-amount:not(:empty)) { grid-template-columns: 7rem minmax(0, 1fr) auto; }
.yrd-amount { text-align: right; }
.yrd-deals li:last-child > .yrd-row { border-bottom: 1px solid var(--wp--preset--color--hairline); } /* one 1 px line between rows: each row owns its top line, only the last one closes the table */
.yrd-ledger .wp-block-post-excerpt, .yrd-deals .wp-block-post-excerpt { max-width: 38rem; } /* about 85 characters a line */
.category .yrd-ledger .wp-block-post-terms { display: none; } /* the section name above every row of its own list says nothing */
.yrd-numeral { line-height: 1; margin: 0; }
.yrd-label { font-family: var(--wp--preset--font-family--data); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--wp--preset--spacing--sm); }
.yrd-panel { border: 1px solid var(--wp--preset--color--hairline); border-radius: var(--yrd-r-card); }
.yrd-numeral:empty, .yrd-chip:empty, .yrd-num:empty { display: none; }
.yrd-figure:has(.yrd-numeral:empty), .yrd-stage:has(.yrd-chip:empty) { display: none; }

/* Dossier card with a stage chip; the scale above the grid lists the four stages in order. */
.yrd-dossier { background: var(--wp--preset--color--chalk); border: 1px solid var(--wp--preset--color--hairline); border-radius: var(--yrd-r-card); padding: var(--wp--preset--spacing--md); }
.yrd-dossier > * { margin: 0; }
.yrd-meta { align-items: center; display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--sm); }
.yrd-meta > * { margin: 0; }
.yrd-chip { background: var(--wp--preset--color--lime-tint); border-radius: var(--yrd-r-control); color: var(--wp--preset--color--coal); font-family: var(--wp--preset--font-family--data); font-weight: 600; letter-spacing: 0.04em; padding: 0.125rem 0.5rem; text-transform: uppercase; width: fit-content; }
.yrd-scale { color: var(--wp--preset--color--steel); display: flex; flex-wrap: wrap; font-family: var(--wp--preset--font-family--data); gap: 0.25rem var(--wp--preset--spacing--lg); list-style-position: inside; margin: var(--wp--preset--spacing--xs) 0 var(--wp--preset--spacing--md); padding: 0; }
@media (max-width: 30rem) { .yrd-row, .yrd-row:has(.yrd-amount:not(:empty)) { grid-template-columns: minmax(0, 1fr); } .yrd-amount { text-align: left; } }
/* Ledger rows with a section label (search, mixed lists): the date sits on the headline's first line, the label stays above the headline. Rows without a label, and the section lists where the label is hidden, keep the plain row. */
@media (min-width: 30.0625rem) {
	body:not(.category) .yrd-ledger .yrd-row:has(.wp-block-post-terms) > .wp-block-group { display: contents; }
	body:not(.category) .yrd-ledger .yrd-row:has(.wp-block-post-terms) .wp-block-post-terms { grid-column: 2; grid-row: 1; }
	body:not(.category) .yrd-ledger .yrd-row:has(.wp-block-post-terms) > .yrd-num { align-self: baseline; grid-column: 1; grid-row: 2; }
	body:not(.category) .yrd-ledger .yrd-row:has(.wp-block-post-terms) .wp-block-post-title { align-self: baseline; grid-column: 2; grid-row: 2; }
	body:not(.category) .yrd-ledger .yrd-row:has(.wp-block-post-terms) .wp-block-post-excerpt { grid-column: 2; grid-row: 3; }
}

/* Article: the current dossier step is bold and underlined, never colour alone; dates and sources stay quiet. */
.yrd-stage-planning .yrd-stage .yrd-scale li:nth-child(1),
.yrd-stage-consented .yrd-stage .yrd-scale li:nth-child(2),
.yrd-stage-under-construction .yrd-stage .yrd-scale li:nth-child(3),
.yrd-stage-energised .yrd-stage .yrd-scale li:nth-child(4) { color: var(--wp--preset--color--coal); font-weight: 600; text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.2em; text-underline-offset: 0.25em; }
.yrd-updated:not(:has(.wp-block-post-date)) { display: none; } /* core prints no modified date until the post is edited after publishing */
.yrd-dates p, .yrd-dates .wp-block-post-date { margin: 0; }
.yrd-sources h2 { margin: 0; }
.yrd-table td, .yrd-table th { text-align: left; vertical-align: top; }

/* Article: head and body in one column; "The file" card follows the head on narrow screens and becomes a sticky rail from 64rem. */
.yrd-article { display: grid; gap: var(--wp--preset--spacing--lg); grid-template-columns: minmax(0, 1fr); }
.yrd-article > * { margin: 0; min-width: 0; }
.yrd-rail { display: grid; gap: var(--wp--preset--spacing--lg); }
.yrd-rail > * { margin: 0; min-width: 0; }
.yrd-file { background: var(--wp--preset--color--vellum); font-size: var(--wp--preset--font-size--caption); padding: var(--wp--preset--spacing--md); }
.yrd-figure { padding: var(--wp--preset--spacing--md) 0; } /* no tint: the figure starts on the left axis of the headline */
/* Text sits on the left axis of the headline; the line stays short, tables and photos use the whole column. */
.yrd-prose > :where(p, ul, ol, h2, h3, h4, blockquote, pre) { max-width: 44rem; }
.yrd-prose > :where(.wp-block-table, .wp-block-image, .wp-block-gallery, figure) { max-width: none; }
/* A table title ("Table 1. ...") is one bold paragraph right above its table: caption size, not body or heading size. */
.yrd-prose > p:has(> strong:only-child):has(+ .wp-block-table) { font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--caption); line-height: 1.4; margin-bottom: 0.5rem; }
/* "On this page": a list in the rail from 64rem, a folded one under the file card below it (yarudor-views.php prints both). */
.yrd-toc-side { display: none; }
.yrd-toc ol { display: grid; gap: var(--wp--preset--spacing--xxs); list-style: none; margin: 0; padding: 0; }
.yrd-toc-side ol { max-height: 45vh; overflow-y: auto; }
.yrd-toc a { box-sizing: border-box; display: inline-block; min-height: 1.5rem; padding-block: 0.125rem; padding-block: calc((1.5rem - 1lh) / 2); }
.yrd-toc-side .yrd-label { color: var(--wp--preset--color--steel); margin-bottom: var(--wp--preset--spacing--xs); }
.yrd-toc-fold { border-block: 1px solid var(--wp--preset--color--hairline); font-size: var(--wp--preset--font-size--dense); }
.yrd-toc-fold summary { align-items: center; cursor: pointer; display: flex; font-family: var(--wp--preset--font-family--data); font-weight: 600; min-height: 2.75rem; }
.yrd-toc-fold[open] summary { margin-bottom: var(--wp--preset--spacing--xs); }
.yrd-toc-fold ol { padding-bottom: var(--wp--preset--spacing--sm); }
.yrd-file > * { margin: 0; }
.yrd-file .yrd-label { color: var(--wp--preset--color--steel); font-weight: 400; line-height: inherit; } /* an h2 now: keeps the look of the label it replaced */
.yrd-file a { font-weight: 600; }
/* "The file": label and value per row (Format, Published, Updated, Checked, Sources, By); a row with no value is not shown. */
.yrd-facts { margin: 0; padding: 0; } /* printed as <dl> (yarudor-desk.php facts_markup): rows are div.yrd-fact with a <dt> and a <dd> */
.yrd-fact, .yrd-file .yrd-stamp { display: grid; gap: 0 var(--wp--preset--spacing--sm); grid-template-columns: 5.5rem minmax(0, 1fr); }
.yrd-fact > *, .yrd-file .yrd-stamp > *, .yrd-fact-d > * { margin: 0; }
.yrd-fact-v { font-weight: 600; }
.yrd-fact:has(.yrd-fact-v:empty), .yrd-fact:not(:has(.yrd-fact-v)), .yrd-file .yrd-updated:not(:has(.wp-block-post-date)) { display: none; } /* the last one beats the grid rule above: core prints no modified date until an edit */
.yrd-file .yrd-dates { display: grid; gap: var(--wp--preset--spacing--xs); }
.yrd-file > .yrd-label { margin-bottom: var(--wp--preset--spacing--xs); }
.yrd-file .yrd-fact { align-items: baseline; } /* a taller value (the category link) no longer drops below its label */
.yrd-file > p { margin-top: var(--wp--preset--spacing--sm); } /* the two links stand apart from the By row */
@media (max-width: 30rem) {
	.wp-block-post-content :is(ul, ol) { padding-left: 1.25rem; }
}
@media (min-width: 64rem) {
	.yrd-article { column-gap: var(--wp--preset--spacing--xxl); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
	.yrd-article-head, .yrd-article-body { grid-column: 1; }
	.yrd-rail { align-self: start; grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--yrd-bar-h) + 1.5rem); }
	.yrd-toc-side { display: block; }
	.yrd-toc-fold { display: none; }
}
@media (min-width: 80rem) { .yrd-article { grid-template-columns: minmax(0, 1fr) 25.6875rem; } } /* 411 px rail beside the 821 px text column (article layout) */

/* Service pages: text 8/12 on the logo axis and a 4/12 rail of the published pages from 64rem; one column below. */
.yrd-page { display: grid; gap: var(--wp--preset--spacing--xl); grid-template-columns: minmax(0, 1fr); }
.yrd-page > * { margin: 0; min-width: 0; }
.yrd-page-rail { align-self: start; background: var(--wp--preset--color--vellum); padding: var(--wp--preset--spacing--md) var(--wp--preset--spacing--lg); }
.yrd-pages { list-style: none; margin: 0; padding: 0; }
.yrd-pages a { box-sizing: border-box; display: inline-block; min-height: 2.75rem; padding-block: 0.5rem; padding-block: calc((2.75rem - 1lh) / 2); }
/* Page titles wrap in the rail: a table cell is 44 px at least, centres one line and does not grow a wrapped one (block padding added 16 px to every wrapped link). */
.yrd-pages a { block-size: 2.75rem; display: table-cell; padding-block: 0; vertical-align: middle; }
@media (min-width: 64rem) { .yrd-page { column-gap: var(--wp--preset--spacing--xxl); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

/* Deal Desk filters: one quiet row per dimension, the chosen value bold and underlined (not colour alone). */
.yrd-filters { display: grid; gap: var(--wp--preset--spacing--xs); }
.yrd-filters:not(:has(.yrd-filter:not(:empty))) { display: none; }
.yrd-filter { align-items: baseline; display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--md); margin: 0; }
.yrd-filter:empty { display: none; }
.yrd-filter-h { color: var(--wp--preset--color--pewter); font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--micro); font-weight: 600; letter-spacing: 0.08em; min-width: 6rem; text-transform: uppercase; }
.yrd-filter a { display: inline-block; line-height: 1.5rem; min-height: 1.5rem; }
.yrd-filter a[aria-current] { color: var(--wp--preset--color--coal); font-weight: 700; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.2em; }
.yrd-months { columns: 12rem; list-style: none; margin: 0; padding: 0; }
.yrd-months a { display: inline-block; line-height: 1.5rem; min-height: 1.5rem; }

/* Small category links are still a 24 px target (WCAG 2.2 AA, 2.5.8). */
.wp-block-post-terms a { display: inline-block; line-height: 1.5rem; min-height: 1.5rem; }

.yrd-brand { align-items: center; gap: var(--wp--preset--spacing--md); }
.yrd-brand .wp-block-site-title { margin: 0; }
.yrd-descr { border-left: 1px solid var(--wp--preset--color--hairline); display: none; font-family: var(--wp--preset--font-family--data); margin: 0; padding-left: var(--wp--preset--spacing--md); }
@media (min-width: 80rem) { .yrd-descr { display: block; } } /* below 1280 px the nav needs the room */
.yrd-crumbs { color: var(--wp--preset--color--steel); font-size: var(--wp--preset--font-size--caption); }
.yrd-crumbs ol { gap: 0 0.5rem; justify-content: flex-start; list-style: none; margin: 0; padding: 0; }
@media (max-width: 47.99rem) { .yrd-article-head .wp-block-post-title { font-size: var(--wp--preset--font-size--title-m); } } /* a long title takes two lines on a phone, not three */

/* Published / Updated pair under the article head: one quiet mono-weight line that wraps whole stamps. */
.yrd-dates { color: var(--wp--preset--color--pewter); display: flex; flex-wrap: wrap; font-size: var(--wp--preset--font-size--caption); gap: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--md); }
.yrd-stamp { display: flex; gap: var(--wp--preset--spacing--xxs); }

/* Sources note under an article: a vellum panel, small text, tight rhythm. */
section.yrd-sources { background: var(--wp--preset--color--vellum); padding: var(--wp--preset--spacing--md) var(--wp--preset--spacing--lg); }
section.yrd-sources > * + * { margin-block-start: var(--wp--preset--spacing--xs); }
section.yrd-sources h2 { font-size: var(--wp--preset--font-size--title-s); }
section.yrd-sources p { font-size: var(--wp--preset--font-size--dense); }

/* ---- Visual pass (PR c): brand mark, tonal panels, states. Tokens only; no new colours or fonts. ---- */

/* Brand mark before the site title: decorative (the title stays text). The url() lives here because block CSS is inlined and loses relative paths. */
.yrd-bar .wp-block-site-title a::before, .yrd-foot-lockup a::before { background: url("assets/brand/mark.svg") center / contain no-repeat; content: ""; display: inline-block; height: 1.75rem; margin-inline-end: var(--wp--preset--spacing--xs); vertical-align: -0.375rem; width: 1.75rem; }
.yrd-foot-lockup a::before { height: 1.5rem; vertical-align: -0.3125rem; width: 1.5rem; }
@media (min-width: 64rem) { .yrd-bar .wp-block-site-title a::before { height: 2rem; margin-inline-end: var(--wp--preset--spacing--sm); vertical-align: -0.5rem; width: 2rem; } }

/* Header: a 44 px target for every navigation link and the menu button; the hover underline is fern. */
.yrd-bar .wp-block-navigation a { box-sizing: border-box; display: inline-block; min-height: 2.75rem; padding-block: 0.5rem; padding-block: calc((2.75rem - 1lh) / 2); }
/* The menu button: 44 px target, and shown only where core shows it (below 600px); a plain display here would keep it on desktop. */
.yrd-bar .wp-block-navigation__responsive-container-open { align-items: center; justify-content: center; min-height: 2.75rem; min-width: 2.75rem; }
@media (max-width: 599px) { .yrd-bar .wp-block-navigation__responsive-container-open:not(.always-shown) { display: inline-flex; } }

/* The sheet is a flex item of the column-flex main: without a width Chromium sizes it to its content and the dossier grid wraps into too many rows. */
.yrd-sheet { width: 100%; }
.yrd-bar .wp-block-navigation a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.2em; }
.yrd-bar .wp-block-site-title a { text-decoration: none; }
.yrd-bar .wp-block-site-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); }

/* Tonal panels instead of frames: the lead panel and the file card are vellum, no border, no paper grid. */
.yrd-panel { border: 0; }
.yrd-gridpaper { background: var(--wp--preset--color--vellum); }

/* Dossier cards: vellum tile, hover grid; the whole card is one link (the title link is stretched), the title is underlined in fern on hover. */
.yrd-dossier { background: var(--wp--preset--color--vellum); border: 0; position: relative; }
.yrd-dossier:hover { background: var(--wp--preset--color--grid); }
.yrd-dossier .wp-block-post-title a { text-decoration: none; }
.yrd-dossier .wp-block-post-title a::after { content: ""; inset: 0; position: absolute; }
.yrd-dossier .wp-block-post-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.15em; }
.yrd-dossier .wp-block-post-title a:focus-visible { outline: 0; }
.yrd-dossier .wp-block-post-title a:focus-visible::after { outline: 3px solid var(--yrd-focus); outline-offset: 2px; }

/* Tables: no lines, a grid-tone header, vellum/chalk rows, lime-tint on hover, first column sticky in the scrolling block. */
.wp-block-table { border: 0; }
.wp-block-table table { border: 0; border-collapse: collapse; min-width: 38rem; }
.wp-block-table th, .wp-block-table td { border: 0; }
.wp-block-table thead { border: 0; }
.wp-block-table thead th { font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--micro); letter-spacing: 0.08em; text-transform: uppercase; }
.wp-block-table tbody tr { background: var(--wp--preset--color--chalk); }
.wp-block-table tbody tr:nth-child(odd) { background: var(--wp--preset--color--vellum); }
.wp-block-table tbody tr:hover { background: var(--wp--preset--color--lime-tint); }
.wp-block-table td:first-child, .wp-block-table th:first-child { background: inherit; left: 0; position: sticky; }
.wp-block-table thead th:first-child { background: var(--wp--preset--color--grid); }
.wp-block-table:focus-visible { outline: 3px solid var(--yrd-focus); outline-offset: 2px; }
/* Table cells never break mid-word (the body-wide break-word is for long URLs); a first column keeps a readable width. */
.wp-block-table th, .wp-block-table td { hyphens: manual; overflow-wrap: normal; word-break: normal; }
.wp-block-table th:first-child, .wp-block-table td:first-child { min-width: 8rem; }
/* Scroll cue: the right edge fades while more columns are off-screen; the fade is gone once scrolled to the end. */
@property --yrd-fade { inherits: false; initial-value: 0rem; syntax: "<length>"; }
@keyframes yrd-fade-out { from { --yrd-fade: 2rem; } 92% { --yrd-fade: 2rem; } to { --yrd-fade: 0rem; } }
@supports (animation-timeline: scroll(x)) {
	.wp-block-table { animation: yrd-fade-out linear both; animation-timeline: scroll(x self); mask-image: linear-gradient(to right, #000 calc(100% - var(--yrd-fade)), transparent); }
}

/* Quote and primary text: a vellum panel, a fern hexagon node on the left, italic text, source in mono. */
.wp-block-quote { background: var(--wp--preset--color--vellum); border: 0; margin-inline: 0; padding: var(--wp--preset--spacing--md) var(--wp--preset--spacing--lg) var(--wp--preset--spacing--md) 3rem; position: relative; }
.wp-block-quote::before { background: var(--wp--preset--color--fern); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); content: ""; height: 1rem; left: var(--wp--preset--spacing--md); position: absolute; top: 1.25rem; width: 0.875rem; }
.wp-block-quote p { font-size: var(--wp--preset--font-size--title-s); font-style: italic; }
.wp-block-quote cite { color: var(--wp--preset--color--steel); font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--micro); font-style: normal; }

/* Button: one solid lime action; hover lime-deep, active coal with lime text, disabled grid with pewter, 44 px high. */
.wp-block-button__link { align-items: center; display: inline-flex; min-height: 2.75rem; padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--lg); }
.wp-block-button__link:active { background: var(--wp--preset--color--coal); color: var(--wp--preset--color--lime); transform: translateY(1px); }
.wp-block-button__link[aria-disabled="true"], .wp-block-button__link:disabled { background: var(--wp--preset--color--grid); color: var(--wp--preset--color--pewter); cursor: not-allowed; transform: none; }

/* Quiet link: a fern line that ends in a hexagon node (the link arrow of the mark's motif). */
.yrd-more a { font-weight: 600; text-decoration: none; }
.yrd-more a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.15em; }
.yrd-more a::after { background: url("assets/ui/link-node.svg") center / contain no-repeat; content: ""; display: inline-block; height: 0.625rem; margin-inline-start: var(--wp--preset--spacing--xs); width: 1.25rem; }
.yrd-more a:active { color: var(--wp--preset--color--coal); }

/* Footer: a light vellum strip (kept), links in fern with a 44 px target, hover underline; small print stays pewter. */
.yrd-foot a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.15em; }
.yrd-foot-base a, .yrd-foot-h a, .yrd-foot-list a { box-sizing: border-box; display: inline-block; min-height: 2.75rem; padding-block: 0.5rem; padding-block: calc((2.75rem - 1lh) / 2); }
/* Phone: the two link lists stand side by side under the lockup, not one under the other, and the footer keeps tight bands, so it takes under half of the screen. The 44 px link rows stay. */
@media (max-width: 39.99rem) {
	.yrd-foot { --wp--preset--spacing--xxl: 1rem; --wp--preset--spacing--xl: 1rem; }
	.yrd-foot-grid { gap: 0 var(--wp--preset--spacing--md); grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.yrd-foot-grid > .yrd-foot-lockup { grid-column: 1 / -1; }
	.yrd-foot-h { margin-bottom: var(--wp--preset--spacing--xxs); }
	.yrd-foot-base { margin-top: var(--wp--preset--spacing--xs); padding-top: var(--wp--preset--spacing--xxs); }
}

/* Featured image: core/post-featured-image prints nothing without an image, so no placeholder or fallback exists. The ratio is the block's aspectRatio; the crop is cover. */
.wp-block-post-featured-image { margin-block: 0; }
.wp-block-post-featured-image img { max-width: 100%; object-fit: cover; width: 100%; }
.yrd-dossier .wp-block-post-featured-image { margin-block-end: var(--wp--preset--spacing--xs); }
.wp-block-post-featured-image .yrd-ai-caption { color: var(--wp--preset--color--pewter); font-family: var(--wp--preset--font-family--data); font-size: var(--wp--preset--font-size--caption); margin: 0.5rem 0 0; }

@media (prefers-reduced-motion: reduce) { .wp-block-button__link:active { transform: none; } }

/* One card grid on the whole site (home, /dossiers/, Related): one column on a phone, two from 40rem, three from 64rem; cards are equally tall. */
.yrd-related .wp-block-post-template.is-layout-grid, .yrd-dossiers-grid .wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .yrd-related .wp-block-post-template.is-layout-grid, .yrd-dossiers-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .yrd-related .wp-block-post-template.is-layout-grid, .yrd-dossiers-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.yrd-related .wp-block-post-template > li { display: flex; }
.yrd-related .wp-block-post-template > li > .yrd-dossier { flex: 1; }

/* Dossier cards: equal heights; the date comes first, then the stage chip. */
.yrd-dossiers-grid .wp-block-post-template > li { display: flex; }
.yrd-dossiers-grid .wp-block-post-template > li > .yrd-dossier { flex: 1; }

/* Home lead: the story (text 7/12, photo 5/12) and under it "Also today", four short items in one row. On a phone the panel loses its inline padding: everything sits on one left axis. */
.yrd-lead { padding: var(--wp--preset--spacing--md) 0; }
.yrd-lead-cols { align-items: center; margin: 0; }
.yrd-lead-text > *, .yrd-lead-photo > * { margin-block: 0; }
.yrd-lead-text > * + * { margin-block-start: var(--wp--preset--spacing--sm); }
.yrd-lead .wp-block-post-title a { text-decoration: none; }
.yrd-lead .wp-block-post-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--fern); text-decoration-thickness: 0.1em; }
.yrd-today { border-top: 1px solid var(--wp--preset--color--hairline); padding-top: var(--wp--preset--spacing--md); }
.yrd-today .yrd-label { margin: 0; font-weight: 400; line-height: inherit; } /* an h2 (keeps the heading levels in order): looks like the label it replaced */
.yrd-today .wp-block-post-template > li > * { margin-block: 0; }
.yrd-today .wp-block-post-template > li > * + * { margin-block-start: var(--wp--preset--spacing--xxs); }
@media (min-width: 48rem) { .yrd-lead { padding: var(--wp--preset--spacing--xl); } }

/* Search: the submit button is the lime action of the page (coal text, 9.1:1), like every other button; an empty result still fills the screen. */
.wp-block-search__button { min-height: 2.75rem; }
.search main { min-height: 60vh; }
.yrd-browse ul { list-style: none; margin: 0; padding: 0; }
.yrd-browse li { line-height: 1.5; padding-block: 0.25rem; }

/* Every page fills the viewport: a short page (Deal Desk, a section with few rows, 404) ends with the footer on the lower edge of the window, not with a white strip under it. dvh follows the phone address bar; vh is the fallback. */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.wp-site-blocks > main { flex: 1 0 auto; }

/* Tap targets: title, term and page links are at least 24px high. */
.wp-block-post-title a, .wp-block-post-terms a, .wp-block-site-title a, .wp-block-query-pagination-numbers .page-numbers { display: inline-block; min-height: 1.5rem; padding-block: 0.1875rem; box-sizing: border-box; }
/* Page numbers: each number is at least 24px wide (WCAG 2.5.8) with a gap between neighbours, so touch targets do not overlap. */
.wp-block-query-pagination-numbers { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.wp-block-query-pagination-numbers .page-numbers { min-width: 1.5rem; text-align: center; }
.yrd-crumbs li, .yrd-more a { display: inline-block; min-height: 1.5rem; }
.yrd-crumbs a { display: inline-block; min-height: 1.5rem; padding-block: 0.1875rem; box-sizing: border-box; }

/* Phone or touch: the breadcrumb links and the site title (header and footer lockup) are 44 px targets, the page looks the same (Q1).
   The crumb link keeps its 26.8 px of layout (13 px x 1.6 + 6 px padding) through a negative margin of (26.8 - 44) / 2 = -8.6 px, so the row does not grow and the text stays where it was;
   the link box (44 px) reaches over the empty space above and below the row. The site title link gets a 44 px line, the mark keeps its offset from the baseline. */
@media (max-width: 47.99rem), (pointer: coarse) {
	.yrd-crumbs a { line-height: 2.75rem; margin-block: -0.5375rem; min-height: 2.75rem; padding-block: 0; }
	.wp-block-site-title a { line-height: 2.625rem; min-height: 2.75rem; padding-block: 0.125rem 0; }
}

/* Phone or touch: the title links of cards and lists, the section links of a card or a search result, the "more" links and the page numbers are 44 px targets, the page looks the same.
   A text link keeps the layout height it had (its line plus 6 px) through an equal negative margin, as the breadcrumb links above: the 44 px box reaches over the empty space around the text.
   The padding comes from the link's own line height (1lh), so a headline that wraps to two lines is still one box of 44 px or more. The page numbers are real 44 px squares (no flex on a link). */
@media (max-width: 47.99rem), (pointer: coarse) {
	.wp-block-post-title a, .wp-block-post-terms a { margin-block: calc(0.1875rem - (2.75rem - 1lh) / 2); min-height: 2.75rem; padding-block: calc((2.75rem - 1lh) / 2); }
	a.yrd-more, .yrd-more a { box-sizing: border-box; margin-block: -0.625rem; min-height: 2.75rem; padding-block: 0.625rem; }
	.wp-block-query-pagination-numbers .page-numbers { min-height: 2.75rem; min-width: 2.75rem; padding-block: calc((2.75rem - 1lh) / 2); }
}

/* Mobile: tables scroll sideways, so say so. */
@media (max-width: 599px) {
	.wp-block-table:has(:is(td, th):nth-child(3)):not(:has(figcaption))::after {
		content: "Scroll sideways to see all columns";
		display: block;
		position: sticky;
		inset-inline-start: 0;
		font-size: 0.8125rem;
		color: var(--wp--preset--color--pewter);
	}
}

/* Two-column tables (label and value) fit a phone: no minimum width, a narrow first column, the value wraps. */
@media (max-width: 599px) {
	.wp-block-table table:not(:has(:is(td, th):nth-child(3))) { min-width: 0; width: 100%; }
	.wp-block-table table:not(:has(:is(td, th):nth-child(3))) :is(td, th):first-child { min-width: 0; position: static; width: 38%; }
}

/* Phone: panels, cards and the file card lose their tint and inline padding, so headings, text and meta share one left axis (16 px); photos and lines stay full width. */
@media (max-width: 47.99rem) {
	.yrd-lead, .yrd-file, .yrd-page-rail, section.yrd-sources, .yrd-dossier, .yrd-dossier:hover { background: none; border-radius: 0; padding-inline: 0; }
	.yrd-file, .yrd-page-rail, section.yrd-sources, .yrd-dossier { border-top: 1px solid var(--wp--preset--color--hairline); }
	.yrd-dossier { padding-top: var(--wp--preset--spacing--sm); }
}
