/* ==========================================================================
   Shared extras, loaded on every front-end page after main.css (inc/assets.php).
   Small, cross-template pieces added in the Nov 2026 review round:
     1. Logo frame (jrl_logo_frame(): no-crop logos everywhere)
     2. Race list fixes (empty ad rows, row alignment, status labels)
     3. Newsletter slot (.nl-slot: styles the form the jrl-core module prints)
     4. Thin calendars (organiser CTA, "Upcoming in Asia", promo line)
     5. Featured tile "Tickets" pill
     6. Phone polish (footer tap targets + social icons, breadcrumbs, "Add a race" link)
     7. Alignment sweep (section heads, meta rows, icon + text) + compact share slots
     8. Pass 3: empty in-feed ad wrappers in every list, table of contents, "Upcoming races near
        you" widget (+ .date-chip), calendar switcher panel clamp, tap targets
   Tokens come from main.css :root. Mobile first.
   ========================================================================== */

/* 1. Logo frame ============================================================= */
/* Fixed box + object-fit: contain, so square, landscape, very wide and tall logos all show whole,
   centred on white with a subtle border. width/height attributes stay on the <img> (no CLS). */
.logo-frame {
	--logo-pad: 8%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	overflow: hidden;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	background: #fff;
	aspect-ratio: 4 / 3;
}
.logo-frame .logo-frame__img {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	padding: var(--logo-pad);
	border: 0;
	border-radius: 0;
	background: transparent;
	object-fit: contain;
	object-position: center;
	aspect-ratio: auto;
}
/* Very wide wordmarks: less side padding so the text stays legible. Tall crests: less top/bottom. */
.logo-frame.is-wide { --logo-pad: 4% 5%; }
.logo-frame.is-tall { --logo-pad: 5% 10%; }
.logo-frame .img-ph { width: 100%; height: 100%; border-radius: 0; }

/* card: row thumbs (race calendar / race DB rows). */
.logo-frame--card { width: 100%; }
/* md: directory singles, organiser pages, discount codes. */
.logo-frame--md { width: min(260px, 100%); aspect-ratio: 3 / 2; }
/* hero: race / virtual-run singles. Box follows the logo (1:1 … 2.5:1, --logo-ar), height capped. */
.logo-frame--hero { width: 100%; aspect-ratio: var(--logo-ar, 3 / 2); max-height: 360px; border-radius: var(--radius); }
.logo-frame--hero .logo-frame__img { --logo-pad: 6%; }
/* fill: the parent box sets the shape (square tiles, card media, directory rows). */
.logo-frame--fill { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: inherit; }

.logo-frame__link { display: block; border-radius: var(--radius); }
/* Phones: a single page's own logo (figure.logo-row: directory heads, club logo, discount-code brand)
   gets a full-width row without the frame's box, border and padding, like the event header logo
   (.event-logo, main.css). A landscape logo (ratio 1.25 or wider) fills the width at its own height;
   a square or tall one is capped at 140px high and sits left. Owner, 29 Nov 2026. */
@media (max-width: 479.98px) {
	figure.logo-row { width: 100%; max-width: 100%; }
	figure.logo-row .logo-frame { display: block; width: 100%; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; background: none; }
	figure.logo-row .logo-frame__img { width: 100%; height: auto; padding: 0; }
	figure.logo-row .logo-frame:is(.is-square, .is-tall) .logo-frame__img { width: auto; max-width: 100%; max-height: 140px; }
}
.logo-frame__link:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Existing slots that held a bare <img>: the frame replaces their border/contain rules. */
.race-card__thumb .logo-frame { border-radius: var(--radius-sm); }
/* Row thumbs (owner, 29 Nov 2026): one fixed gap between the frame and the logo for every shape
   (the 8% / is-wide / is-tall percentages made each row look different), and a larger thumb from
   1024px, where the text column has room, so titles and meta lines do not start wrapping. */
/* Tight frames (owner, 29 Nov 2026): the border wraps the logo itself, for every ratio, on race rows
   (logo frame) and on virtual-run / sports-event rows (plain <img>). The image keeps its own shape,
   as wide as the thumb column and never taller than it is wide; it sits centred in the column. */
.race-card__thumb { --thumb: 64px; text-align: center; }
.race-card__thumb .logo-frame { display: inline-block; width: auto; max-width: 100%; aspect-ratio: auto; vertical-align: top; }
.race-card__thumb .logo-frame .logo-frame__img { --logo-pad: 0; }
.race-card__thumb .logo-frame .logo-frame__img, .race-card__thumb > img { display: block; width: auto; height: auto; max-width: var(--thumb); max-height: var(--thumb); aspect-ratio: var(--logo-ar, auto); object-fit: contain; } /* px limits, not %: a % of the shrink-wrapped frame distorts the image. --logo-ar (the real ratio, set in PHP): lazy images with sizes=auto have no ratio of their own in CSS */
.race-card__thumb > img { margin-inline: auto; }
@media (min-width: 768px) { .race-card__thumb { --thumb: 96px; } }
@media (min-width: 1024px) {
	.race-card:not(.race-card--compact, .race-card--tile, .tile) { grid-template-columns: 76px minmax(0, 1fr) 120px; }
	.race-card:not(.race-card--compact, .race-card--tile, .tile) > .race-card__thumb { width: 120px; --thumb: 120px; }
}
.card__media:has(> .logo-frame--fill), .dir-row__media:has(> .logo-frame--fill) { border: 1px solid var(--c-line); background: #fff; }
.dir-row.fit-logo .dir-row__media { border: 1px solid var(--c-line); background: #fff; }

/* 2. Race lists =============================================================== */
/* In-feed ad rows: the ads module hides an unfilled / empty unit (.jrl-ad display:none) but the
   <li class="race-list__ad"> wrapper kept its padding and top border: a divider, an empty gap, then
   the next row's divider (owner screenshot: the gap above a featured row). Collapse the wrapper. */
.race-list > li.race-list__ad:not(:has(.jrl-ad)),
.race-list > li.race-list__ad:has(> .jrl-ad[data-jrl-status="unfilled"]) { display: none; } /* only the status ads.js sets: it collapses a unit only while it is still below the screen (no layout shift) */
.race-list > li.race-list__ad + li { border-top: 1px solid var(--c-line); }
/* Featured rows: same single divider and spacing as every other row (no margin / extra border). */
.race-list > li > .race-card.is-featured { margin: 0; }
/* Two featured rows in a row (pinned featured rows, home widget): a small gap so the two gold
   hairlines never touch; the row rule between them is dropped (main.css). */
.race-list > li:has(> .race-card.is-featured) + li:has(> .race-card.is-featured) { margin-top: 0; border-top-color: var(--c-line); } /* back-to-back featured rows: the normal row rule between them, so the gold washes do not merge into one block (owner, 29 Nov 2026) */
/* Pinned featured rows (1–2 featured: calendar-list / vrun calendar-list 'pinned') sit above the first month. */
.cal-list__pinned, .vrun-list__pinned { margin: var(--sp-3) 0 0; }
/* Rows (pass 5): the date chip sits level with the TITLE, on every row incl. featured ones. The
   cards print the title first in .race-card__body (badge row below it), the grid aligns items to
   the start, so the chip's top edge = the title's line-box top (offset 0). The title's cap height
   then starts ~3px lower (half-leading of line-height 1.3 at 18–20px), matching the chip's 6px
   top padding before its first text line. The logo frame stays centred against the text block. */
.race-card--row > .date-badge, .race-card--db > .date-badge,
.race-card--compact > .date-badge, .race-card > .date-badge-link { align-self: start; }
.race-card--row > .race-card__thumb, .race-card--db > .race-card__thumb { align-self: center; }
.race-card__thumb { line-height: 0; }
.race-card__badges .badge, .tile__badges .badge { max-width: 100%; }
.race-card.has-status-cancelled .race-card__title a { color: var(--c-muted); }


/* 3. Newsletter slot ======================================================== */
/* Styles the plain form the newsletter module prints (label, email input, button, privacy line)
   without depending on its exact class names. */
.nl-slot { margin: var(--sp-6) 0; }
.site-sidebar .nl-slot, .nl-slot--sidebar { margin: 0 0 var(--sp-5); }
.nl-slot--subscribe_page { margin: var(--sp-4) 0; }
.nl-slot:not(.nl-slot--fallback) > :first-child {
	padding: var(--sp-5);
	border: 1px solid var(--c-line); /* full hairline + soft tint (R2: no coloured top stripe) */
	border-radius: var(--radius);
	background: var(--c-bg-soft);
	box-shadow: var(--shadow-sm);
}
.nl-slot h2, .nl-slot h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-lg); line-height: var(--lh-tight); }
.nl-slot p { margin: 0 0 var(--sp-3); color: var(--c-muted); font-size: var(--fs-sm); }
.nl-slot form { display: grid; gap: var(--sp-2); margin: 0; }
.nl-slot label { display: block; color: var(--c-ink); font-size: var(--fs-sm); font-weight: 700; }
.nl-slot input[type="email"], .nl-slot input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--tap);
	padding: 10px 14px;
	border: 1px solid var(--c-field-border); /* 3.4:1 field outline (WCAG 1.4.11) */
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--c-text);
	font: inherit;
	font-size: var(--fs-base); /* 16px: no iOS zoom on focus */
}
.nl-slot input[type="email"]:focus-visible, .nl-slot input[type="text"]:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 1px; border-color: var(--c-ink); }
.nl-slot button[type="submit"], .nl-slot input[type="submit"] {
	min-height: var(--tap);
	padding: 10px 20px;
	border: 0;
	border-radius: var(--btn-radius, var(--radius-sm));
	background: var(--c-ink); /* dark ink, not red: subscribing is a secondary action everywhere (owner, 27 Nov 2026) */
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.nl-slot button[type="submit"]:hover, .nl-slot input[type="submit"]:hover { background: #333; }
/* On the dark footer an ink button would vanish: white with ink text there. */
.site-footer .nl-slot button[type="submit"], .site-footer .nl-slot input[type="submit"] { background: #fff; color: var(--c-ink); }
.site-footer .nl-slot button[type="submit"]:hover, .site-footer .nl-slot input[type="submit"]:hover { background: #e9e9e9; }
.nl-slot button[type="submit"]:focus-visible, .nl-slot input[type="submit"]:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.nl-slot small, .nl-slot .privacy, .nl-slot [class*="privacy"] { display: block; margin: 0; color: var(--c-subtle); font-size: var(--fs-xs); line-height: 1.4; }
.nl-slot [class*="privacy"] a, .nl-slot small a { color: inherit; text-decoration: underline; }
/* Wider slots (home band, after article, footer, calendar): email + button on one row. */
@media (min-width: 600px) {
	.nl-slot--home form:not(.jrl-nl__form), .nl-slot--after_content form:not(.jrl-nl__form), .nl-slot--footer form:not(.jrl-nl__form), .nl-slot--calendar form:not(.jrl-nl__form), .nl-slot--subscribe_page form:not(.jrl-nl__form) {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
	}
	.nl-slot--home form:not(.jrl-nl__form) > :not(input):not(button):not(label), .nl-slot--after_content form:not(.jrl-nl__form) > :not(input):not(button):not(label),
	.nl-slot--footer form:not(.jrl-nl__form) > :not(input):not(button):not(label), .nl-slot--calendar form:not(.jrl-nl__form) > :not(input):not(button):not(label),
	.nl-slot--subscribe_page form:not(.jrl-nl__form) > :not(input):not(button):not(label) { grid-column: 1 / -1; }
	.nl-slot--home form:not(.jrl-nl__form) > label, .nl-slot--after_content form:not(.jrl-nl__form) > label, .nl-slot--footer form:not(.jrl-nl__form) > label,
	.nl-slot--calendar form:not(.jrl-nl__form) > label, .nl-slot--subscribe_page form:not(.jrl-nl__form) > label { grid-column: 1 / -1; }
}
/* Footer: on the dark background. */
.site-footer__newsletter { border-bottom: 1px solid rgba(255,255,255,.12); }
.site-footer__newsletter .nl-slot { margin: 0; padding: var(--sp-6) 0; }
.site-footer__newsletter .nl-slot > :first-child { padding: 0; border: 0; background: transparent; }
.site-footer__newsletter .nl-slot h2, .site-footer__newsletter .nl-slot h3, .site-footer__newsletter .nl-slot label { color: #fff; }
.site-footer__newsletter .nl-slot p, .site-footer__newsletter .nl-slot small, .site-footer__newsletter .nl-slot [class*="privacy"] { color: #cfcfcf; }
@media (min-width: 1024px) { .site-footer__newsletter .nl-slot > :first-child { max-width: 760px; } }

/* 4. Thin calendars ========================================================= */
.cal-organisers {
	margin: var(--sp-5) 0;
	padding: var(--sp-4) var(--sp-5);
	border: 1px dashed var(--c-line-strong);
	border-radius: var(--radius);
	background: var(--c-bg-soft);
}
.cal-organisers__title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); font-size: var(--fs-lg); }
.cal-organisers p { margin: 0 0 var(--sp-3); color: var(--c-muted); }
.cal-organisers__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.cal-elsewhere { margin: var(--sp-6) 0; }
.cal-elsewhere .cal-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.cal-elsewhere__list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
.cal-elsewhere__list > li { margin: 0; border-bottom: 1px solid var(--c-line); }
@media (min-width: 768px) { .cal-elsewhere__list { grid-template-columns: 1fr 1fr; column-gap: var(--sp-5); } }
.cal-promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin: var(--sp-5) 0; padding: var(--sp-3) 0; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm); }
.cal-promo__text { margin: 0; }

/* 5. Featured tile "Tickets" pill =========================================== */
/* Sits above the tile's stretched link so it is its own tap target. */
.tile__tickets { position: relative; z-index: 2; margin-top: var(--sp-2); }

/* 6. Phone polish =========================================================== */
/* Footer links: at least 32px tall tap areas (were 17px). Social icons excluded: this rule used to
   hit .social a too (inline-flex + padding-block), pushing the icon off-centre in its 44px circle. */
.site-footer__col li { margin-bottom: 0; }
.site-footer__col ul:not(.social) li > a, .site-footer__learn a, .site-footer__bottom .menu a, .site-footer__bottom-links a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding-block: 4px;
}
@media (max-width: 1023px) { .site-footer__col ul:not(.social) li > a, .site-footer__learn a, .site-footer__bottom .menu a, .site-footer__bottom-links a { min-height: var(--tap); } }
.site-footer .social { gap: var(--sp-2); }
.site-footer .social a { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; line-height: 0; }
.site-footer .social a .icon { display: block; width: 20px; height: 20px; margin: 0; }
.site-footer__bottom nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-4); }
.site-footer__bottom .menu--footer { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); }
.site-footer__bottom .menu--footer li { margin: 0; }
.site-footer__bottom-links { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); margin: 0; padding: 0; list-style: none; }
.site-footer__bottom-links li { margin: 0; }
/* Breadcrumbs: the last crumb (current page = the H1) hidden below 600px; JSON-LD unchanged. */
@media (max-width: 599px) {
	.breadcrumbs-slot .breadcrumbs__item--current { display: none; }
}
/* "Add a race" on calendars: a plain text link on phones, outlined button from 600px. */
@media (max-width: 599px) {
	.page-header__actions .cal-add-race { --btn-bg: transparent; --btn-bg-h: transparent; --btn-bd: transparent; --btn-bd-h: transparent; --btn-fg: var(--c-red); --btn-fg-h: var(--c-red-dark); padding-inline: 0; text-decoration: underline; text-underline-offset: 3px; }
}

/* 7. Alignment sweep ======================================================== */
/* Section heading + right-side link: centred on one line, wraps neatly on phones (link keeps right). */
.section-head { flex-wrap: wrap; align-items: center; row-gap: var(--sp-1); }
.section-head__title { min-width: 0; }
.section-head__link { margin-left: auto; }
.cal-featured__head { align-items: center; }
.cal-section__head .btn--link { --btn-fg: #fff; --btn-fg-h: #fff; }
/* Icon + text pairs: icons sized in em, centred on the first line. */
:is(.cal-section__title, .cal-featured__title, .cal-organisers__title, .share-block__title) { display: flex; align-items: center; gap: .45em; }
:is(.cal-section__title, .cal-featured__title, .cal-organisers__title) > .icon { width: 1em; height: 1em; flex: none; }
.card__meta > .icon, .tile__meta .icon { width: 1em; height: 1em; }
.badge > .icon { width: 1em; height: 1em; }
/* Equal-height tiles; CTA pinned to the bottom of each tile. */
.tile-grid > li { display: flex; flex-direction: column; min-width: 0; }
.tile-grid > li > .tile { flex: 1 1 auto; }
.tile .tile__body { display: flex; flex-direction: column; gap: var(--sp-1); flex: 1 1 auto; }
.tile .tile__tickets { margin-top: auto; align-self: flex-start; }
/* Button rows inside cards / rows: same height, aligned on one line. */
.race-card__actions { align-items: center; }
/* Post header meta row: byline left, compact share right; share drops under the byline on phones. */
.entry-header__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); }
.entry-header__meta .byline { margin-top: 0; min-width: 0; }
.entry-header__share { flex: none; }
.share-slot .jrl-share { margin: 0; }
.share-block--compact { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.share-block--compact .share-block__title { margin: 0; font-size: var(--fs-md); }


/* 8. Pass 3 (27 Nov 2026) ===================================================== */

/* 8a. Empty in-feed ad wrappers, every list: the wrapper is hidden when it holds no ad unit, when
   the module marked the unit unfilled / empty, or when AdSense reports "unfilled". */
:is(li, div)[class$="__ad"]:not(:has(.jrl-ad)),
:is(li, div)[class$="__ad"]:has(> .jrl-ad[data-jrl-status="unfilled"]),
:is(li, div)[class$="__ad"]:has(> .jrl-ad[hidden]),
:is(.post-list__ad, .post-grid__ad, .ed-list__ad, .dir-list__ad, .tile-grid__ad, .racedb-grid__ad, .people-grid__ad, .home-blocks__ad):empty { display: none; }

/* 8b. Table of contents (posts + long pages). Sidebar nav: hairline panel, current section marked
   by main.js ([data-toc] a.is-active) with a gold dot + bold, never red (R1/R2: no side stripe). */
.toc { border: 1px solid var(--c-line); background: var(--c-bg-soft); }
.toc__list { padding-left: 0; list-style: none; counter-reset: toc; }
.toc__item { margin: 0; }
.toc__item--h3 { margin-left: var(--sp-4); list-style: none; }
.toc a { display: flex; align-items: flex-start; gap: .5em; min-height: 32px; padding: 6px 0; color: var(--c-text); line-height: 1.35; text-decoration: none; }
.toc a::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .5em; border-radius: 50%; background: var(--c-line-strong); }
.toc__item--h3 a { font-size: .95em; color: var(--c-muted); }
.toc a:hover { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }
.toc a.is-active, .toc a[aria-current="true"] { color: var(--c-ink); font-weight: 700; text-decoration: none; }
.toc a.is-active::before, .toc a[aria-current="true"]::before { background: var(--jrl-gold-accent); box-shadow: 0 0 0 3px var(--jrl-gold-tint); }
.toc a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.toc--nav { overflow-y: auto; overscroll-behavior: contain; }
/* Phones: collapsible "In this article" after the intro. */
.toc--details { margin: var(--sp-5) 0; padding: 0; }
.toc--details > summary.toc__summary { display: flex; align-items: center; gap: .5em; min-height: var(--tap); padding: var(--sp-2) var(--sp-4); cursor: pointer; list-style: none; text-transform: none; letter-spacing: 0; font-size: var(--fs-base); }
.toc--details > summary::-webkit-details-marker { display: none; }
.toc--details > summary:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius); }
.toc--details .toc__chev { margin-left: auto; transition: transform .15s; }
.toc--details[open] .toc__chev { transform: rotate(180deg); }
.toc--details[open] summary { margin-bottom: 0; border-bottom: 1px solid var(--c-line); }
.toc--details nav { padding: var(--sp-2) var(--sp-4) var(--sp-3); }
.entry-content .toc { font-size: var(--fs-sm); }
.entry-content .toc ol { margin: 0; padding: 0; }
.entry-content .toc a { text-decoration: none; }
@media (min-width: 1024px) { .layout--sidebar .toc--details { display: none; } }
/* Headings reached from the TOC land below the sticky header: html { scroll-padding-top } in
   main.css is the only offset (header + 16px); a scroll-margin here would add to it (pass 5). */

/* 8c. "Upcoming races near you" (template-parts/components/upcoming-near.php) + date chip. */
.upcoming-near { padding: var(--sp-4); border: 1px solid var(--c-line); background: #fff; }
.upcoming-near__title { margin-bottom: var(--sp-1); }
.upcoming-near__where { display: flex; align-items: center; gap: .4em; margin: 0 0 var(--sp-2); color: var(--c-muted); font-size: var(--fs-sm); }
.upcoming-near__where .flag { width: 16px; height: 16px; margin: 0; }
.upcoming-near__list { margin: 0; padding: 0; list-style: none; }
.upcoming-near__item + .upcoming-near__item { border-top: 1px solid var(--c-line); }
.upcoming-near__link { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: var(--sp-2) 0; color: var(--c-ink); text-decoration: none; }
.upcoming-near__link:hover .upcoming-near__name { text-decoration: underline; text-underline-offset: 3px; }
.upcoming-near__link:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.upcoming-near__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upcoming-near__name { font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.upcoming-near__meta { display: flex; flex-wrap: wrap; gap: 0 var(--sp-2); color: var(--c-muted); font-size: var(--fs-xs); }
.upcoming-near__country { display: inline-flex; align-items: center; gap: .3em; }
.upcoming-near__country .flag { width: 14px; height: 14px; margin: 0; }
.upcoming-near__all { margin-top: var(--sp-2); }
.date-chip { display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 48px; min-height: 48px; padding: 4px 0; border: 1px solid var(--c-line-strong); border-radius: var(--radius); background: var(--c-bg-soft); color: var(--c-ink); line-height: 1; text-align: center; }
.date-chip__day { font-size: 1.125rem; font-weight: 800; }
.date-chip__mon { margin-top: 2px; color: var(--c-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* 8d. Calendar switcher panel: never wider than the screen, kept inside the filter card (the
   component script shifts it left when it would overflow). */
.cal-switch > .cal-switch__panel { width: min(320px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }

/* 8e. Tap targets >= 32px. */
.chip--category { min-height: 32px; display: inline-flex; align-items: center; }
.site-logo { display: inline-flex; align-items: center; min-height: 32px; }
.site-footer__logo { display: inline-flex; align-items: center; min-height: 32px; }
.dir-link, .facts a[href^="tel:"], .facts a[href^="mailto:"] { display: inline-flex; align-items: center; gap: .35em; min-height: 32px; max-width: 100%; overflow-wrap: anywhere; }

/* 8f. One look for the sidebar boxes (TOC, More news, Upcoming near you): white,
   full hairline border, same radius and padding, same title style. No side stripes (R2). */
.site-sidebar :is(.toc--nav, .panel, .upcoming-near) { padding: var(--sp-4); border: 1px solid var(--c-line); border-radius: var(--radius-lg); background: #fff; box-shadow: none; }
.site-sidebar :is(.toc__title, .panel > h2, .panel > h3, .side-list__title, .upcoming-near__title) { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.3; }
.site-sidebar .toc--nav { max-height: calc(100vh - var(--header-stick) - 48px); }

/* 9. Pass 6: calendar filter panel (race / sports / virtual-run calendars, every .cal-filters card).
   a) A neutral full-width hairline between groups (not a side stripe, R2).
   b) Desktop: labels TOP-aligned with the first row of chips (the label box is as tall as one chip /
      the select / the switcher, text centred in it), never centred on a wrapped block.
   c) Collapsible "Calendars" group (assets/js/cal-filters.js, data-jrl-collapse): one row + a
      "+N more" chip on desktop, one scrolling row + "+ more" on phones. Hidden chips stay in the DOM
      (crawlable); without JS the full list shows. */
.cal-filters > .cal-filters__row + .cal-filters__row { padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
@media (min-width: 768px) {
	.cal-filters > div.cal-filters__row, .cal-filters > form.cal-filters__row { align-items: start; }
	.cal-filters > .cal-filters__row > .cal-filters__label { display: flex; align-items: center; min-height: 36px; }
	.cal-filters > .cal-filters__state > .cal-filters__label,
	.cal-filters > .cal-filters__row--switch > .cal-filters__label { min-height: var(--tap); }
}
@media (min-width: 768px) and (pointer: coarse) {
	.cal-filters > .cal-filters__row > .cal-filters__label { min-height: var(--tap); }
}
.cal-filters__nav.has-more { display: flex; align-items: flex-start; gap: var(--sp-2); }
.cal-filters__nav.has-more > .cal-filters__chips { flex: 1 1 auto; min-width: 0; }
.cal-filters__nav.has-more.is-expanded { flex-direction: column; }
.cal-filters__nav.has-more.is-expanded > .cal-filters__chips { flex-wrap: wrap; overflow: visible; mask-image: none; }
.cal-filters__chips.is-collapsed > li.is-overflow { display: none; }
.cal-filters__more { flex: none; min-height: var(--tap); font-family: inherit; cursor: pointer; }
.cal-filters__more:hover { border-color: var(--c-ink); }
.cal-filters__more:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
@media (min-width: 768px) { .cal-filters__more { min-height: 36px; } }
@media (min-width: 768px) and (pointer: coarse) { .cal-filters__more { min-height: var(--tap); } }
@media print { .cal-filters__more { display: none; } .cal-filters__chips.is-collapsed > li.is-overflow { display: list-item; } }

/* 3b. Wide newsletter bands (home, after article, calendar, subscribe page): compact, not
   stretched (owner, 27 Nov 2026). Desktop: text left, form right; the form is one row
   (email | name | Subscribe) with the privacy line under it. Phones: stacked, button full width. */
.nl-slot--home .jrl-nl *, .nl-slot--after_content .jrl-nl *, .nl-slot--calendar .jrl-nl * { text-align: left; }
.nl-slot--home .jrl-nl, .nl-slot--after_content .jrl-nl, .nl-slot--calendar .jrl-nl { padding: var(--sp-5); text-align: left; }
.nl-slot .jrl-nl__title { margin: 0 0 var(--sp-1); font-size: var(--fs-lg, 1.25rem); letter-spacing: 0; text-transform: none; }
.nl-slot .jrl-nl__copy { margin: 0 0 var(--sp-3); color: var(--c-muted); font-size: var(--fs-sm); }
@media (min-width: 600px) {
	.nl-slot--home .jrl-nl__form, .nl-slot--after_content .jrl-nl__form, .nl-slot--calendar .jrl-nl__form {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: start; column-gap: var(--sp-2); /* top-aligned row: section 9 */
	}
	.nl-slot .jrl-nl__form .jrl-nl__field, .nl-slot .jrl-nl__form .jrl-nl__btn { grid-column: auto; }
	.nl-slot .jrl-nl__form .jrl-nl__btn { width: auto; min-width: 128px; padding-inline: var(--sp-5); }
	.nl-slot .jrl-nl__form .jrl-nl__privacy { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
	.nl-slot--home .jrl-nl, .nl-slot--calendar .jrl-nl {
		display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--sp-6); align-items: center;
	}
	.nl-slot--home .jrl-nl__title, .nl-slot--home .jrl-nl__copy, .nl-slot--calendar .jrl-nl__title, .nl-slot--calendar .jrl-nl__copy { grid-column: 1; }
	.nl-slot--home .jrl-nl__copy, .nl-slot--calendar .jrl-nl__copy { margin: 0; }
	.nl-slot--home .jrl-nl__form, .nl-slot--home .jrl-nl__done, .nl-slot--calendar .jrl-nl__form, .nl-slot--calendar .jrl-nl__done { grid-column: 2; grid-row: 1 / span 2; }
}

/* 9. Form rows (27 Nov 2026) ================================================== */
/* One rule for every horizontal row of fields (newsletter bands, filter bars, race DB filters,
   directory filters, search forms, Formidable rows): labels and controls TOP-aligned on the same
   lines, never bottom-aligned (align-items: end let anything after a control shift its field:
   the 4px "Email higher than Name" in the newsletter band was a password-manager icon <div>
   injected after the email input, which added one grid gap to that field only).
     - a field = label (fixed box: --label-fs × --label-lh + --label-gap) then the control; no gap
       between children, so extra nodes injected after a control (LastPass, 1Password, Grammarly)
       change nothing above them;
     - every single-line control is exactly --control-h (44px): inputs incl. date, selects,
       jrl-select buttons, submit buttons (date inputs and inherited line-heights made 44.8px);
     - a label-less button in a labelled row drops by --label-box, so it lines up with the
       controls, not the labels (.form-row > .btn for new rows; listed containers below).
   Tokens: main.css :root (--control-h, --label-fs, --label-lh, --label-gap, --label-box). */
:is(.jrl-nl__field, .filter-bar .filter:not(.filter--checkbox):not(.filter--pills), .form-row__field) { display: flex; flex-direction: column; justify-content: flex-start; gap: 0; min-width: 0; }
:is(.jrl-nl__field, .filter-bar .filter:not(.filter--checkbox):not(.filter--pills), .form-row__field) > label {
	display: block; margin: 0 0 var(--label-gap); font-size: var(--label-fs); line-height: var(--label-lh);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; /* one line: the label box stays the same height in every column */
}
:is(.nl-slot, .filter-bar, .form-row, .search-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]):not([type="image"]), select, .jrl-select__button) {
	box-sizing: border-box; height: var(--control-h); min-height: var(--control-h);
}
:is(.nl-slot, .filter-bar, .form-row, .search-form) :is(button[type="submit"], input[type="submit"], .btn:not(.btn--link):not(.chip)) {
	box-sizing: border-box; height: var(--control-h); min-height: var(--control-h); line-height: 1.15;
}
.form-row { display: grid; gap: var(--sp-3) var(--sp-2); align-items: start; }
@media (min-width: 600px) {
	.form-row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
	.form-row > :is(.btn, button) { grid-column: auto; margin-top: var(--label-box); }
	:is(.nl-slot--home, .nl-slot--after_content, .nl-slot--calendar) .jrl-nl__form > .jrl-nl__btn { align-self: start; margin-top: var(--label-box); } /* the one-row bands (3b) */
	.filter-bar__fields { align-items: start; }
}

/* 10. (Removed 27 Nov 2026: the featured "spotlight" cards. 1–2 featured items are now pinned rows at
   the top of the list; owner: too large, no gold tint.) */

/* Country on its own row line (owner, 29 Nov 2026): the flag takes the place of the row icon. */
.race-card__place.race-card__ctry { display: flex; padding-left: 0; }
.race-card__ctry .race-card__country .flag { width: 1em; height: 1em; margin-right: .4em; }
