/* ============================================================
   "ALS NÄCHSTES" — [sws_next_event] on the front page and on top of the season list (DESIGN-POLISH §7)
   Paper card with the red top edge: photo or lake chart left, the name in the Duo style, the date at display
   size, the countdown (start sequence of the signals module), Startkarte and .ics. Stacked below 860 px.
   This is the only events CSS the front page loads (AUDIT P2-1).
   ============================================================ */
.sws-next {
	box-sizing: border-box;
	width: 100%;
	padding: var(--wp--preset--spacing--70) var(--wp--custom--gutter);
	color: var(--wp--preset--color--ink);
}

.sws-next *,
.sws-next *::before,
.sws-next *::after {
	box-sizing: border-box;
}

.sws-next :where(h2, h3, p, dl, dd) {
	margin: 0;
}

.sws-next__card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	max-width: 1320px;
	margin: 0 auto;
	overflow: hidden;
	background: var(--wp--preset--color--bg-alt);
	border-top: var(--wp--custom--edge) solid var(--wp--preset--color--red);
	border-radius: 0 0 var(--wp--custom--radius--card) var(--wp--custom--radius--card);
	box-shadow: 0 0 0 1px var(--wp--preset--color--line-soft), var(--wp--preset--shadow--card);
}

.sws-next__card--plain {
	grid-template-columns: minmax(0, 1fr);
}

.sws-next__media {
	position: relative;
	min-height: 22rem;
	background: var(--wp--preset--color--paper-deep);
}

.sws-next__media > .sws-ev-media {
	position: absolute;
	inset: 0;
}

.sws-next__media .sws-ev-media--chart {
	background: var(--wp--preset--color--paper-deep);
}

/* A Swiss Tour regatta shows its teaser (Eric 29.11.2026): a square at the full width of the left column, the card
   split 50/50 (660 × 660 at the 1320 px card). When the text beside it is taller, the teaser grows with it (the
   photo covers, lettering on top, logos at the bottom), so no strip of paper is left under it. */
@media (min-width: 861px) {
	.sws-next__card:has(.sws-ev-media--teaser) {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

.sws-next__media:has(.sws-ev-media--teaser) {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.sws-next__media > .sws-ev-media--teaser {
	position: relative;
	inset: auto;
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
}

.sws-next__media .sws-teaser {
	flex: 1 0 auto;
}

.sws-next__body {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70) var(--wp--preset--spacing--60) var(--wp--preset--spacing--60);
}

.sws-next__topline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
}

.sws-next__label {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow);
	text-transform: uppercase;
	color: var(--wp--preset--color--red);
}

.sws-next__label::before {
	content: "";
	width: var(--wp--custom--eyebrow-bar);
	height: var(--wp--custom--edge);
	background: currentColor;
}

/* Duo: the regatta heavy and narrow, the series light and wide. */
.sws-next .sws-next__name {
	font-size: var(--wp--preset--font-size--h-1);
	line-height: 0.98;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy-deep);
	text-wrap: balance;
	-webkit-hyphens: auto;
	hyphens: auto; /* "Generalversamm-lung", not a bare break in the middle of the word */
}

/* A word over 12 letters (render-overview.php): one step smaller, so it fits where the browser cannot hyphenate. */
.sws-next .sws-next__name.sws-next__name--long {
	font-size: var(--wp--preset--font-size--h-2);
}

.sws-next__name-main {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	letter-spacing: -0.005em;
}

.sws-next__name-sub {
	display: block;
	margin-top: 0.35rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--navy);
}

.sws-next__venue {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink-soft);
}

.sws-next__venue .sws-icon {
	color: var(--wp--preset--color--red);
}

.sws-next__date {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--navy);
}

.sws-next__date-range {
	font-family: var(--wp--preset--font-family--display);
	font-size: min(var(--wp--preset--font-size--display), 7.5rem);
	font-weight: 800;
	line-height: 0.88;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

.sws-next__date-year {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--lead);
	color: var(--wp--preset--color--ink-soft);
}

.sws-next__aside {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px dashed var(--wp--preset--color--line-strong);
}

/* Plain countdown "in 12 Tagen" in mono (the signals module may replace it with the start sequence). */
.sws-next__countdown {
	display: flex;
	align-items: baseline;
	gap: var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--mono);
	color: var(--wp--preset--color--ink);
}

.sws-next__countdown .sws-next__cd-pre,
.sws-next__countdown .sws-next__cd-unit {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--ink-soft);
}

.sws-next__countdown .sws-next__cd-num {
	font-size: var(--wp--preset--font-size--h-2);
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--red);
}

/* The start sequence (signals module): a navy signal board on the paper; its count reads "IN 10 TAGEN". */
.sws-next .sws-seq__count {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--wp--preset--spacing--20);
}

.sws-next .sws-seq .sws-next__cd-pre,
.sws-next .sws-seq .sws-next__cd-unit {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--white) 85%, transparent);
}

.sws-next .sws-seq .sws-next__cd-num {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h-1);
	font-weight: 800;
	line-height: 1;
	color: var(--wp--preset--color--white);
}

.sws-next__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

/* ---------- Off-season: one compact band (Eric 28.10.2026) ----------
   Phones: a tidy stack (chip, season line, stat, full-width buttons). From 900 px: one row — chip and season line
   left, the stat beside them, the buttons on the right. */
.sws-next--off {
	padding-block: var(--wp--preset--spacing--50);
}

.sws-next__card--off {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--50);
}

.sws-next__off-head {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
}

.sws-next__off-label::before {
	content: none;
}

.sws-next__off-flag {
	display: inline-flex;
	flex: none;
}

.sws-next__off-flag svg {
	display: block;
	width: auto;
	height: 1.125rem;
	box-shadow: 0 0 0 1px var(--wp--custom--signal--edge);
}

.sws-next .sws-next__off-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--navy-deep);
	line-height: 1;
}

.sws-next__off-season {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h-2);
	font-weight: 800;
	text-transform: uppercase;
}

.sws-next__off-next {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	color: var(--wp--preset--color--navy);
}

.sws-next__off-stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
}

.sws-next__off-stat {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.sws-next__off-stat dt {
	max-width: 12ch; /* "AUSGETRAGEN" in one line, not into the next number */
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
}

.sws-next__off-stat dd {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h-1);
	font-weight: 800;
	line-height: 0.85;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--navy);
}

@media (min-width: 900px) {
	.sws-next__card--off {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
		padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	}

	.sws-next__off-stats {
		padding-inline-start: var(--wp--preset--spacing--60);
		border-inline-start: 1px dashed var(--wp--preset--color--line-strong);
	}

	.sws-next__off-actions {
		margin-inline-start: auto;
	}
}

/* The front page's next slot is paper: its focus ring is the navy one (theme.css lists .sws-front-next as dark). */
.sws-front-next .sws-next :focus-visible {
	outline: var(--wp--custom--focus-ring);
}

/* Live: the card wakes up. */
.sws-next--live .sws-next__card {
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--red) 35%, transparent), var(--wp--preset--shadow--card-hover);
}

@media (max-width: 860px) {
	.sws-next {
		padding-block: var(--wp--preset--spacing--60);
	}

	.sws-next__card {
		grid-template-columns: minmax(0, 1fr);
	}

	.sws-next__media {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}

	.sws-next__media:has(.sws-ev-media--teaser) {
		aspect-ratio: auto; /* The teaser is its own square, full width above the text. */
	}

	.sws-next__body {
		padding: var(--wp--preset--spacing--50);
	}

	.sws-next__date-range {
		font-size: clamp(3rem, 17vw, 4.5rem);
	}

	.sws-next__actions,
	.sws-next__actions .sws-ev-btn {
		flex: 1 1 100%;
	}
}
