/* 261117_212000 lane B (plan 261117_204600 doc 03 §1 / §7): the public homepage "Today's highlights" carousel, inside the hero of
   public/home.jsp. Uses the public site's colour / type tokens (public_site.css :root). No fixed height anywhere: every slide shares
   ONE grid cell, so the carousel is exactly as tall as its tallest slide at any width or zoom (nothing is clipped, the Short text is
   never cut) and the CTA below does not move while slides change. Inactive slides are visibility:hidden (and inert, set by the
   script): out of view, out of the tab order and out of the accessibility tree. Without the script only the introduction exists. */

.home-carousel {
	display: flex;
	flex-direction: column;
	margin: 0 auto 30px;
	max-width: 46rem;
}

.home-carousel-slides {
	display: grid;
}

.home-carousel-slide {
	grid-area: 1 / 1;
	min-width: 0;
}

.home-carousel-slide:not(.is-current) {
	visibility: hidden;
}

/* the introduction keeps the hero's own h1 / lead rules; it only loses the lead's bottom margin inside the carousel */
.home-carousel.is-active .home-carousel-intro .lead {
	margin-bottom: 8px;
}

.home-carousel-story {
	text-align: center;
	color: var(--pewter-head);
}

.home-carousel-kicker {
	margin: 0 0 6px;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pewter-muted);
}

.home-carousel-title {
	margin: 0 0 12px;
	font-size: 1.6rem;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.home-carousel-short {
	max-width: 40rem;
	margin: 0 auto 12px;
	font-size: 1.05rem;
	line-height: 1.55;
	text-align: left;
	color: var(--pewter-text);
	overflow-wrap: break-word;
}

.home-carousel-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 4px 14px;
	font-size: 0.9rem;
	color: var(--pewter-muted);
}

/* "Sources (N)": discreet but legible — a text button, underlined on hover / focus */
.home-carousel-sources-toggle,
.home-carousel-sources-close {
	min-height: 2.25rem;
	padding: 4px 6px;
	border: 0;
	background: transparent;
	color: var(--link-light-bg);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.home-carousel-sources {
	max-width: 40rem;
	margin: 8px auto 0;
	padding: 10px 14px;
	text-align: left;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid #d5e4ea;
	border-radius: 6px;
	font-size: 0.92rem;
}

.home-carousel-source-list {
	margin: 0 0 6px;
	padding-left: 1.1rem;
}

.home-carousel-source-list li {
	margin: 4px 0;
	overflow-wrap: anywhere;
}

.home-carousel-publisher {
	font-weight: 600;
	color: var(--pewter-head);
}

.home-carousel-source-list a {
	color: var(--link-light-bg);
}

.home-carousel-source-more {
	margin: 0 0 6px;
	color: var(--pewter-muted);
}

/* minimal player: Play / Pause / Replay, a thin progress bar and the elapsed / total time */
.home-carousel-audio {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

/* 261118_123200 (plan 261118_054458 doc 02 §7): a hidden player (audio OFF, or a card without a recording) KEEPS its row's footprint so
   audio OFF → ON on an already-open page does not push the CTA down (it moved 56 px at 1280 px on .134). visibility:hidden keeps it
   invisible, out of the tab order and out of the accessibility tree. Scoped to this row only — the generic [hidden] rule is untouched. */
.home-carousel-audio[hidden] {
	display: flex;
	visibility: hidden;
}

.home-carousel-play {
	min-width: 5.5rem;
	min-height: 2.75rem;
	padding: 8px 18px;
	border: 2px solid var(--btn);
	border-radius: 999px;
	background: #fff;
	color: var(--btn);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.home-carousel-story.is-playing .home-carousel-play {
	background: var(--btn);
	color: var(--btn-label);
}

.home-carousel-progress {
	width: min(12rem, 40vw);
	height: 6px;
	accent-color: var(--btn);
}

/* 261118_031900 (review F2): a failed attempt shows "Audio unavailable" + Retry; the meaningless progress bar gives its room to
   the message so the row stays on one line at 320 px */
.home-carousel-audio.has-error .home-carousel-progress {
	display: none;
}

.home-carousel-audio.has-error .home-carousel-clock {
	min-width: 0;
	white-space: nowrap;
}

.home-carousel-clock {
	min-width: 5.5rem;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	color: var(--pewter-muted);
	text-align: left;
}

/* controls: below the slides visually, first in the DOM (the rotation control leads the tab order, W3C APG) */
.home-carousel-controls {
	order: 2;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: nowrap; /* fix round 1: one line at every width, whichever label the rotation control shows */
	gap: 8px;
	margin-top: 14px;
}

.home-carousel-controls button {
	white-space: nowrap;
}

/* fix round 1: the server-rendered, invisible placeholders that reserve the live carousel's height (no CTA jump) */
.home-carousel-ssr,
.home-carousel-controls-ssr {
	visibility: hidden;
}

/* the reserved / live box is as tall as the tallest story at every width (orchestrator decision, fix round 1): the introduction
   sits vertically centred in it, so a taller box reads as one composed hero rather than a heading with a gap under it */
.home-carousel-intro {
	align-self: center;
}

.home-carousel-slides {
	order: 1;
}

.home-carousel-controls button {
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 6px 12px;
	border: 1px solid #b9c7d4;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.85);
	color: var(--pewter-head);
	font: inherit;
	font-size: 0.92rem;
	cursor: pointer;
}

.home-carousel-prev,
.home-carousel-next {
	font-size: 1.3rem !important;
	line-height: 1;
}

.home-carousel-position {
	min-width: 3.2rem;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
	color: var(--pewter-muted);
}

.home-carousel-media {
	display: none;
}

/* a gentle fade for an automatic change only; reduced motion = no animation at all */
.home-carousel-slide.is-animated {
	animation: home-carousel-fade 0.35s ease-out;
}

@keyframes home-carousel-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-carousel-slide.is-animated {
		animation: none;
	}
}

@media (max-width: 640px) {
	.home-carousel-title {
		font-size: 1.35rem;
	}

	.home-carousel-short {
		font-size: 1rem;
	}

	.home-carousel-controls button {
		padding: 6px 10px;
	}
}

@media (max-width: 380px) {
	.home-carousel-controls {
		gap: 4px;
	}

	.home-carousel-controls button {
		padding: 6px 8px;
		font-size: 0.85rem;
	}

	.home-carousel-position {
		min-width: 2.4rem;
		font-size: 0.85rem;
	}
}

/* ------------------------------------------------------------------ 261126_091300 lane A: FULL text, update notice, video, game */

/* the accepted full story: a bounded, keyboard-scrollable reading pane (title and actions stay outside it); readable line length */
.home-carousel-full-label {
	margin: -6px 0 6px;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pewter-muted);
}

.home-carousel-full {
	max-width: 40rem;
	max-height: min(42vh, 22rem);
	margin: 0 auto 12px;
	padding: 4px 12px 4px 4px;
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: left;
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--pewter-text);
	overflow-wrap: break-word;
	border-top: 1px solid #d5e4ea;
	border-bottom: 1px solid #d5e4ea;
}

.home-carousel-full p {
	margin: 0 0 0.8em;
}

.home-carousel-full:focus-visible {
	outline: 2px solid var(--link-light-bg);
	outline-offset: 2px;
}

/* on phones the pane must never trap the page: a page swipe outside it scrolls the page, and it stays short */
@media (max-width: 600px) {
	.home-carousel-full {
		max-height: min(38vh, 16rem);
		overscroll-behavior: auto;
	}
}

.home-carousel-open {
	color: var(--link-light-bg);
	font-size: 0.9rem;
	text-underline-offset: 3px;
}

.home-carousel-update {
	max-width: 40rem;
	margin: 0 auto 10px;
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff6dc;
	border: 1px solid #ecd9a0;
	font-size: 0.9rem;
	color: var(--pewter-text);
}

.home-carousel-update button {
	min-height: 2.25rem;
	border: 0;
	background: transparent;
	color: var(--link-light-bg);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.home-carousel-story.is-stale .home-carousel-text {
	opacity: 0.8;
}

.home-carousel-video {
	max-width: 40rem;
	margin: 0 auto 8px;
}

/* the promoted video: explicit Play inside a 16:9 stage that is never under 200 px tall (YouTube's minimum player viewport) */
.home-carousel-promo {
	text-align: center;
	color: var(--pewter-head);
}

.home-carousel-promo-stage {
	position: relative;
	width: min(100%, 36rem);
	aspect-ratio: 16 / 9;
	min-height: 200px;
	margin: 0 auto 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1d2a30;
	border-radius: 6px;
	overflow: hidden;
}

.home-carousel-promo-stage iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.home-carousel-promo-play,
.home-carousel-game-play {
	min-height: 44px;
	min-width: 44px;
	padding: 10px 22px;
	border: 0;
	border-radius: 22px;
	background: #fff;
	color: #1d2a30;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.home-carousel-promo-link,
.home-carousel-game-page,
.home-carousel-game-signin {
	display: inline-block;
	min-height: 2.25rem;
	padding: 6px 4px;
	color: var(--link-light-bg);
	font-size: 0.9rem;
	text-underline-offset: 3px;
}

/* the game: a compact cover until Start (the stage grows only on the visitor's own action) */
.home-carousel-game {
	text-align: center;
	color: var(--pewter-head);
}

.home-carousel-game-stage {
	width: min(100%, 36rem);
	min-height: 200px;
	/* defensive bound: the game view sizes its canvas from its stage; never let it grow the hero without limit */
	max-height: 82vh;
	overflow: hidden;
	margin: 0 auto 8px;
}

.home-carousel-game-cover {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 200px;
	padding: 14px;
	border-radius: 6px;
	background: linear-gradient(160deg, #ffb347 0%, #ff7a3d 55%, #b9461f 100%);
	color: #2b1408;
}

/* the cover goes away once the game is mounted (display: flex above would otherwise override the hidden attribute) */
.home-carousel-game-cover[hidden],
.home-carousel-video[hidden] {
	display: none;
}

.home-carousel-game-cover .home-carousel-game-signin,
.home-carousel-game-cover .home-carousel-game-page {
	color: #2b1408;
	font-weight: 600;
}

.home-carousel-game-blurb {
	max-width: 30rem;
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.45;
}

.home-carousel-game-message {
	margin: 0;
	font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
	.home-carousel-full {
		scroll-behavior: auto;
	}
}
