/* Virtual runs: calendar (template-vrun-calendar.php) + single (single-virtual_run.php).
   Loaded only on those two templates (jrl_template_assets map, inc/groups/vrun.php).
   Builds on main.css components: page-header, filter-bar, tile-grid, race-list, race-card, facts,
   register-cta, photo-grid, share-block, promo-banner, empty-state. Mobile first. */

/* ---------- Calendar ---------- */
.vrun-cal__filters { margin-bottom: var(--sp-5); }

.vrun-featured { margin: 0 0 var(--sp-6); }
.vrun-featured__head { border-bottom-color: var(--jrl-gold-border, #e0b84f); }
.vrun-featured__head .section-head__title { display: inline-flex; align-items: center; gap: .4em; }
/* Even tile count (2 or 4 per row): the calendar passes an even number of featured runs. */
.vrun-featured__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .vrun-featured__grid, .layout--full .vrun-featured__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.vrun-cal__list, .vrun-cal__closed { margin: 0 0 var(--sp-6); }
.vrun-cal__count .section-head__title { font-size: var(--fs-lg); }
.vrun-list > .month-group:first-child > .month-head { margin-top: 0; } /* one <section class="month-group"> per month (pass 5) */
.vrun-list__rows { margin-bottom: 0; }
/* Featured rows: the same single divider and spacing as race rows (main.css .race-list + shared.css):
   no margin, the gold hairline replaces the row rules around it, same padding as other rows. */
.vrun-list__rows > li > .race-card.is-featured { margin: 0; }
.vrun-list__rows > li:has(> .race-card.is-featured) + li:has(> .race-card.is-featured) { margin-top: 0; border-top-color: var(--c-line); } /* same rule as race rows (shared.css, 29 Nov 2026) */
.race-list > li.race-list__ad, .race-list > li.race-list__promo { padding: var(--sp-3) 0; }
.race-list__promo .promo-banner { margin: 0; }

.vrun-cal__closed .race-card.is-past .date-badge { opacity: .8; }

.vrun-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2) var(--sp-5); margin: var(--sp-5) 0 0; padding: var(--sp-4) 0 0; border-top: 1px solid var(--c-line); list-style: none; }

/* ---------- Single ---------- */
/* Header (identity row, facts strip, CTA) + section nav: main.css "Event header" (pass 6). */
.vrun-body { margin-top: var(--sp-5); }
.vrun-section { margin: 0 0 var(--sp-6); }
.vrun-section > h2 { display: flex; align-items: center; gap: .4em; margin: 0 0 var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--c-line); font-size: var(--fs-xl); }
.vrun-section h3, .vrun-gallery .gallery-block__title { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-lg); }
.vrun-section > h2 + h3 { margin-top: var(--sp-3); }
.vrun-section__empty { color: var(--c-muted); }

/* Entitlement photos are products (medals, tees): shown whole at their own aspect ratio, no box
   (main.css ":is(.event-body, .vrun-body) .photo-grid"). */
.vrun-gallery { margin: 0 0 var(--sp-3); }

.vrun-fees__img, .vrun-explainer__img { margin: var(--sp-3) 0; }
.vrun-fees__img a { display: inline-block; max-width: 100%; }
.vrun-fees__img img, .vrun-explainer__img img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.entry-content figure.vrun-explainer__img { max-width: 420px !important; margin-inline: 0; } /* !important: beats the article rule "figure { max-width: 100% !important }" */ /* three small pictograms, not a hero */

.vrun-info__links { margin: var(--sp-3) 0 0; }

.vrun-newsletter { margin: var(--sp-6) 0; }


.vrun-more { margin: var(--sp-6) 0; }

.vrun-disclaimer { margin: var(--sp-6) 0 0; color: var(--c-subtle); font-size: var(--fs-xs); line-height: 1.5; }
.vrun-disclaimer__title { margin: 0 0 var(--sp-1); font-weight: 700; }
.vrun-disclaimer ul { margin: 0; padding-left: 1.1em; }
.vrun-disclaimer li + li { margin-top: var(--sp-1); }

/* Tile variant of the vrun card carries .race-card too (template-parts/cards/vrun.php), and the later
   .race-card grid rule in main.css (3 columns: 64px | 1fr | auto) beat .tile, squeezing tiles into a
   64px image + a 36px text column. Restore the tile layout for featured / "more open" grids. */
.race-card.tile { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; opacity: 1; }
.race-card.tile:hover, .race-card.tile:focus-within { background: none; }
@media (min-width: 768px) { .race-card.tile { grid-template-columns: none; gap: var(--sp-2); } }
.race-card.tile .tile__chip { white-space: nowrap; text-overflow: ellipsis; line-height: 1.25; } /* one line; a long distance list ends in "…", the full list is the chip's title (owner, 1 Dec 2026) */

/* Row meta lines (icon + text nowrap): in main.css for every .race-card variant. */

/* ---------- Pass 4: deadline, filters (27 Nov 2026; results-upload window removed in pass 5) ---------- */
/* Filters: same .cal-filters markup as the race calendar (that CSS lives in races.css, not loaded here). */
.vrun-filters { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-5); padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-bg-soft); }
.vrun-filters .cal-filters__row { display: grid; gap: var(--sp-2); min-width: 0; }
.vrun-filters .cal-filters__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.vrun-filters .cal-filters__nav { min-width: 0; }
.vrun-filters .cal-filters__chips { margin: 0; }
.vrun-filters .cal-filters__chips .chip { min-height: var(--tap, 44px); white-space: nowrap; }
.vrun-filters .chip .flag { width: 16px; height: 16px; }
.vrun-filters .chip__count { min-width: 1.5em; padding: 0 .4em; border-radius: var(--radius-pill); background: var(--c-bg-muted); color: var(--c-muted); font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.vrun-filters .chip--active .chip__count { background: rgba(255,255,255,.2); color: #fff; }
.vrun-filters .cal-filters__clear { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.vrun-filters .cal-filters__clear a { display: inline-flex; align-items: center; gap: .35em; min-height: var(--tap, 44px); }
@media (min-width: 768px) {
	.vrun-filters .cal-filters__row { grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
	.vrun-filters .cal-filters__chips { flex-wrap: wrap; overflow: visible; mask-image: none; }
	.vrun-filters .cal-filters__chips .chip { min-height: 36px; }
}
@media (pointer: coarse) { .vrun-filters .cal-filters__chips .chip { min-height: var(--tap, 44px); } }
/* Format + Distance pair: stacked with the usual rule between them; one line only when the filter box itself
   is wide enough for both (container query: the sidebar makes the column narrower than the screen). */
.vrun-filters { container-type: inline-size; }
.vrun-filters > .cal-filters__pair { display: grid; gap: var(--sp-3); min-width: 0; padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
.vrun-filters > .cal-filters__pair:first-child { padding-top: 0; border-top: 0; }
.vrun-filters .cal-filters__pair > .cal-filters__row + .cal-filters__row { padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
@container (min-width: 780px) {
	/* Side by side, each label above its chips (labels on the left would need ~1000px). */
	.vrun-filters > .cal-filters__pair { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-5); align-items: start; }
	.vrun-filters .cal-filters__pair .cal-filters__chips { gap: 6px; }
	.vrun-filters .cal-filters__pair > .cal-filters__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
	.vrun-filters .cal-filters__pair > .cal-filters__row + .cal-filters__row { padding-top: 0; border-top: 0; }
}

.vrun-cal__note { margin: 0 0 var(--sp-3); color: var(--c-muted); font-size: var(--fs-sm); }

/* Card states (template-parts/vrun/card.php): open (green date badge) / ended (muted). Never red (R1). */
.badge--soon { text-transform: none; }
.tile__chip--soon { display: inline-flex; align-items: center; gap: .3em; background: rgba(0,0,0,.82); }
.race-card.tile .tile__meta { display: flex; align-items: flex-start; gap: .35em; font-size: var(--fs-xs); line-height: 1.35; }
.race-card.tile .tile__meta .icon { flex: none; margin-top: .1em; color: var(--c-subtle); }
.race-card.tile .vrun-card__deadline { color: var(--c-ink); font-weight: 600; }


/* Header: "Submit a virtual run" is the outlined button of the race calendars ("Add a race"), level with
   the first line of the H1 (owner, 29 Nov 2026). */
.page-header:has(> .page-header__actions .vrun-cal__submit) { align-items: flex-start; }
.page-header__actions:has(.vrun-cal__submit) { margin-top: 4px; }
.page-header__actions .vrun-cal__submit { min-height: 44px; }
