/* =========================================================================
   Melissa Kampers Live Desk — front-end styles
   Liveblog in the suite's console language. Theme-independent, light/dark
   aware. The pulse is the only animation, and it stops under reduced motion.
   ========================================================================= */

.mklive,
.mklive-banner {
	--mkl-text: #1d2027;
	--mkl-muted: #565d69;
	--mkl-border: #dcdfe6;
	--mkl-border-soft: #e9e7df;
	--mkl-card: #ffffff;
	--mkl-accent: #2742e0;
	--mkl-accent-2: #0b7b86;
	--mkl-live: #b3173d;
	--mkl-focus: #2742e0;
	--mkl-shadow: 0 1px 2px rgba(22, 23, 28, 0.04), 0 10px 28px rgba(22, 23, 28, 0.06);
}

[data-theme="dark"] .mklive,
[data-theme="dark"] .mklive-banner {
	--mkl-text: #e8ebf2;
	--mkl-muted: #9aa4b5;
	--mkl-border: rgba(141, 164, 255, 0.16);
	--mkl-border-soft: #1d2331;
	--mkl-card: #11141d;
	--mkl-accent: #8da4ff;
	--mkl-accent-2: #34d8c5;
	--mkl-live: #ff8095;
	--mkl-focus: #8da4ff;
	--mkl-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(5, 8, 18, 0.3);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .mklive,
	:root:not([data-theme="light"]) .mklive-banner {
		--mkl-text: #e8ebf2;
		--mkl-muted: #9aa4b5;
		--mkl-border: rgba(141, 164, 255, 0.16);
		--mkl-border-soft: #1d2331;
		--mkl-card: #11141d;
		--mkl-accent: #8da4ff;
		--mkl-accent-2: #34d8c5;
		--mkl-live: #ff8095;
		--mkl-focus: #8da4ff;
		--mkl-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(5, 8, 18, 0.3);
	}
}

/* The control bar ----------------------------------------------------------- */
.mklive {
	margin-top: 1.75rem;
}

.mklive__bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	padding: 0.7rem 0 1rem;
	border-bottom: 1px solid var(--mkl-border);
	margin-bottom: 0.5rem;
}

.mklive__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.2rem 0.7rem;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.mklive__badge--live {
	color: #ffffff;
	background: var(--mkl-live);
}

.mklive__badge--ended {
	color: var(--mkl-muted);
	border: 1px solid var(--mkl-border);
}

.mklive__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 0 currentColor;
	animation: mklive-pulse 2s ease-out infinite;
}

@keyframes mklive-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
	70%  { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.mklive__auto,
.mklive__latest {
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mkl-muted);
}

.mklive__latest {
	margin-left: auto;
}

.mklive__pause {
	font: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mkl-text);
	background: transparent;
	border: 1px solid var(--mkl-border);
	border-radius: 999px;
	padding: 0.3rem 0.85rem;
	cursor: pointer;
	transition: border-color 160ms ease, color 160ms ease;
}

.mklive__pause:hover {
	border-color: var(--mkl-accent);
	color: var(--mkl-accent);
}

.mklive__pause:focus-visible {
	outline: 2px solid var(--mkl-focus);
	outline-offset: 2px;
}

/* The update stream --------------------------------------------------------- */
.mklive__stream {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mklive__update {
	display: grid;
	grid-template-columns: 7rem 1fr;
	gap: 0 1.4rem;
	padding: 1.3rem 0;
	border-bottom: 1px solid var(--mkl-border-soft);
	position: relative;
}

.mklive__update::before {
	content: "";
	position: absolute;
	left: calc(7rem - 0.7rem);
	top: 1.7rem;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--mkl-border);
	transform: translateX(-50%);
}

.mklive__update--key::before {
	background: var(--mkl-live);
}

.mklive__stamp {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	text-align: right;
	padding-right: 1.1rem;
	border-right: 1px solid var(--mkl-border-soft);
}

.mklive__stamp time {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--mkl-text);
}

.mklive__date {
	font-size: 0.65rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mkl-muted);
}

.mklive__keymark {
	margin-top: 0.2rem;
	font-size: 0.6rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mkl-live);
}

.mklive__utitle {
	margin: 0 0 0.4rem;
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.3;
}

.mklive__text {
	font-size: 0.975rem;
	line-height: 1.65;
	color: var(--mkl-text);
}

.mklive__text p { margin: 0 0 0.7rem; }
.mklive__text p:last-child { margin-bottom: 0; }

.mklive__text a {
	color: var(--mkl-accent);
	text-underline-offset: 0.18em;
}

/* Key moments get a soft accent panel. */
.mklive__update--key {
	background: linear-gradient(90deg, rgba(179, 23, 61, 0.05), transparent 60%);
	border-radius: 12px;
	padding-inline: 1rem;
	margin-inline: -1rem;
}

[data-theme="dark"] .mklive__update--key {
	background: linear-gradient(90deg, rgba(255, 128, 149, 0.08), transparent 60%);
}

/* Freshly polled-in updates: a brief, quiet highlight. */
.mklive__update--fresh {
	animation: mklive-fresh 2.4s ease-out;
}

@keyframes mklive-fresh {
	0%   { background-color: rgba(39, 66, 224, 0.1); }
	100% { background-color: transparent; }
}

.mklive__closed {
	margin-top: 1.25rem;
	font-size: 0.85rem;
	color: var(--mkl-muted);
	font-style: italic;
}

/* Mobile: timeline collapses to a single column. */
@media (max-width: 600px) {
	.mklive__update {
		grid-template-columns: 1fr;
		gap: 0.4rem;
		padding: 1.1rem 0;
	}

	.mklive__update::before { display: none; }

	.mklive__stamp {
		flex-direction: row;
		align-items: baseline;
		gap: 0.6rem;
		text-align: left;
		padding-right: 0;
		border-right: none;
	}

	.mklive__update--key {
		margin-inline: 0;
	}
}

/* The homepage "Live now" banner -------------------------------------------- */
.mklive-banner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6rem 1.25rem;
	/* border-box so the padding is included in the 76rem — matching the
	   Latest Edition banner and the Radar / World Signal panels exactly. */
	box-sizing: border-box;
	width: min(76rem, calc(100vw - 2 * clamp(1rem, 3vw, 1.5rem)));
	margin: 1.25em auto;
	padding: 0.85rem 1.25rem;
	background: var(--mkl-card);
	border: 1px solid var(--mkl-live);
	border-radius: 16px;
	text-decoration: none;
	color: var(--mkl-text);
	/* A faint red halo so the whole strip reads as "alert". */
	box-shadow: var(--mkl-shadow), 0 0 26px rgba(179, 23, 61, 0.18);
	transition: transform 200ms ease, box-shadow 200ms ease;
}

.mklive-banner:hover,
.mklive-banner:focus-visible {
	box-shadow: var(--mkl-shadow), 0 0 30px rgba(179, 23, 61, 0.3);
}

.mklive-banner:hover,
.mklive-banner:focus-visible {
	transform: translateY(-2px);
}

.mklive-banner:focus-visible {
	outline: 2px solid var(--mkl-focus);
	outline-offset: 3px;
}

.mklive-banner__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex-shrink: 0;
	padding: 0.22rem 0.75rem;
	border-radius: 999px;
	background: #d11f44;
	color: #ffffff;
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/* The "on air" glow: a pulsing red halo. Static base remains under
	   reduced motion so it still stands out. */
	box-shadow: 0 0 10px rgba(209, 31, 68, 0.6);
	animation: mklive-badge-glow 1.8s ease-in-out infinite;
}

@keyframes mklive-badge-glow {
	0%, 100% { box-shadow: 0 0 7px rgba(209, 31, 68, 0.45); }
	50%      { box-shadow: 0 0 20px 3px rgba(209, 31, 68, 0.85); }
}

.mklive-banner__body {
	flex: 1 1 22rem;
	min-width: 0;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.mklive-banner__teaser {
	color: var(--mkl-muted);
}

.mklive-banner__cta {
	flex-shrink: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--mkl-live);
	white-space: nowrap;
}

.mklive-banner:hover .mklive-banner__cta {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

@media (max-width: 640px) {
	.mklive-banner__teaser { display: none; }
}

/* Reduced motion: no pulse, no fresh-flash, no hover lift. */
@media (prefers-reduced-motion: reduce) {
	.mklive__dot { animation: none; }
	.mklive__update--fresh { animation: none; }
	.mklive-banner__badge { animation: none; } /* Static glow remains. */
	.mklive-banner { transition: none; }
	.mklive-banner:hover { transform: none; }
}

/* Print: the record prints; the live chrome does not. */
@media print {
	.mklive__bar,
	.mklive-banner {
		display: none;
	}
}
