/*
 * NEXTPredict Live Blog
 * Built on the theme's preset tokens, so it follows the site's mode switch:
 * dark is the :root default, light comes from html.light-mode.
 */

.np-live-blog,
.editor-styles-wrapper {
	--np-accent: var(--wp--preset--color--primary, #ffd100);
	--np-accent-strong: var(--wp--preset--color--primary-alt, #ffdf52);
	--np-surface: var(--wp--preset--color--secondary, #2d2d2f);
	--np-bg: var(--wp--preset--color--base, #232325);
	--np-border: var(--wp--preset--color--border-light, #414144);
	--np-text: var(--wp--preset--color--main, #e7e7e7);
	--np-heading: var(--wp--preset--color--primary-alt-accent, #e0e7f1);
	--np-on-accent: var(--wp--preset--color--tertiary, #0e1015);
	--np-live: #ff3b30;
	--np-radius: 8px;
	--np-label: 600 14px/1.4 var(--wp--preset--font-family--inter, Inter, sans-serif);
	--np-offset: 140px; /* sticky header + section jump bar */
}

html.light-mode .np-live-blog,
html.light-mode .editor-styles-wrapper {
	--np-live: #d92d20;
	--np-on-accent: #0e1015;
}

/* Yellow small text is too light on the light background: use heading ink, keep yellow for fills. */
html.light-mode .np-live-status__latest,
html.light-mode .np-live-daynav > .wp-block-heading {
	color: var(--np-heading);
}

/* ---------- Live status bar ---------- */

.np-live-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem .9rem;
	padding: .7rem .9rem;
	margin-block: 0 1.5rem;
	background: var(--np-surface);
	border: 1px solid var(--np-border);
	border-radius: var(--np-radius);
	font: var(--np-label);
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--np-text);
}

.np-live-pill {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .25rem .65rem;
	border-radius: 4px;
	background: var(--np-live);
	color: #fff;
	font-weight: 700;
	letter-spacing: .06em;
}

.np-live-dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.np-live-status.is-live .np-live-dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: currentColor;
	animation: np-live-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}

.np-live-status.is-scheduled .np-live-pill {
	background: var(--np-accent);
	color: var(--np-on-accent);
}

.np-live-status.is-ended .np-live-pill {
	background: transparent;
	color: var(--np-text);
	box-shadow: inset 0 0 0 1px var(--np-border);
}

.np-live-status__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.np-live-status__latest { color: var(--np-accent); text-decoration: none; font-variant-numeric: tabular-nums; }
.np-live-status__latest:hover,
.np-live-status__latest:focus-visible { text-decoration: underline; }
.np-live-status__sep { opacity: .5; }

@keyframes np-live-ping {
	75%, 100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Day 1 / Day 2 nav ---------- */

.np-live-daynav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1rem;
	padding: .9rem 1rem;
	background: var(--np-surface);
	border: 1px solid var(--np-border);
	border-radius: var(--np-radius);
}

.np-live-daynav > .wp-block-heading {
	margin: 0 !important;
	font: var(--np-label);
	font-size: 14px !important;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--np-accent);
}

.np-live-daynav .wp-block-buttons { gap: .5rem; margin: 0 !important; }

.np-live-daynav .wp-block-button__link {
	padding: .55rem 1rem;
	border: 2px solid var(--np-border);
	border-radius: 4px;
	background: transparent;
	color: var(--np-heading);
	font: var(--np-label);
	letter-spacing: .03em;
	text-transform: uppercase;
	transition: border-color .15s, background-color .15s, color .15s;
}

.np-live-daynav .wp-block-button__link:hover,
.np-live-daynav .wp-block-button__link:focus-visible {
	border-color: var(--np-accent);
	color: var(--np-heading);
}

.np-live-daynav .wp-block-button__link.is-current,
.np-live-daynav .wp-block-button__link[aria-current="page"] {
	background: var(--np-accent);
	border-color: var(--np-accent);
	color: var(--np-on-accent);
}

/* ---------- Key takeaways ---------- */

.np-live-takeaways {
	position: relative;
	padding: 1.25rem 1.4rem 1.1rem !important;
	background: var(--np-surface);
	border: 1px solid var(--np-border);
	border-left: 4px solid var(--np-accent);
	border-radius: var(--np-radius);
}

.np-live-takeaways > .wp-block-heading {
	margin: 0 !important;
	font-size: clamp(22px, 2.2vw, 26px);
	line-height: 1.2;
	color: var(--np-heading);
}

.np-live-takeaways .np-live-refreshed {
	margin: .35rem 0 0 !important;
	font: var(--np-label);
	font-size: 13px;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--np-text);
	opacity: .85;
}

.np-live-takeaways ul {
	margin: .9rem 0 0 !important;
	padding: 0;
	list-style: none;
}

.np-live-takeaways li {
	position: relative;
	padding-left: 1.4rem;
	margin: 0 0 .55rem;
	line-height: 1.5;
}

.np-live-takeaways li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .6em;
	width: 8px;
	height: 8px;
	background: var(--np-accent);
	border-radius: 1px;
}

/* ---------- Updates timeline ---------- */

.np-live-updates-title { scroll-margin-top: var(--np-offset); }

.np-live-update {
	position: relative;
	margin-block: 0 !important;
	padding: 0 0 2rem 1.75rem;
	border-left: 2px solid var(--np-border);
}

.np-live-update + .np-live-update { padding-top: .25rem; }

.np-live-update::before {
	content: "";
	position: absolute;
	left: -8px;
	top: .35rem;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--np-bg);
	box-shadow: inset 0 0 0 3px var(--np-accent);
}

/* Newest update gets the live marker while the blog is live. */
.np-live-is-live .np-live-updates-title + .np-live-update::before {
	background: var(--np-live);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--np-live) 25%, transparent);
}

.np-live-update > * + * { margin-top: .9rem; }

.np-live-update__heading,
.np-live-update > h3.wp-block-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .35rem .65rem;
	margin: 0 !important;
	font-size: clamp(19px, 1.9vw, 22px);
	font-weight: 500;
	line-height: 1.3;
	color: var(--np-heading);
	scroll-margin-top: var(--np-offset);
}

/* Flat layout fallback (H3 + paragraphs without the group wrapper). */
.wp-block-post-content > h3.np-live-update__heading {
	margin-top: 2rem !important;
	padding-top: 1.5rem;
	border-top: 1px solid var(--np-border);
}

.np-live-time {
	flex: none;
	display: inline-flex;
	align-items: center;
	padding: .15rem .5rem;
	border-radius: 4px;
	background: var(--np-accent);
	color: var(--np-on-accent);
	font: var(--np-label);
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
	transform: translateY(-.1em);
}

/* Keeps "HH:MM ET - " in the text for readers/crawlers, but the chip carries it visually. */
.np-live-sep {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.np-live-headline { flex: 1 1 14rem; }

.np-live-share {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 4px;
	color: var(--np-text);
	opacity: .55;
	transition: opacity .15s, color .15s, background-color .15s;
}

.np-live-share:hover,
.np-live-share:focus-visible {
	opacity: 1;
	color: var(--np-accent);
	background: var(--np-surface);
}

@media (hover: hover) {
	.np-live-share { opacity: 0; }
	.np-live-update__heading:hover .np-live-share,
	.np-live-share:focus-visible { opacity: 1; }
}

/* Images inside updates */
.np-live-update .wp-block-image img { border-radius: 6px; height: auto; }
.np-live-update .wp-block-image figcaption,
.np-live-update .wp-element-caption {
	margin-top: .4rem;
	font-size: 13px;
	color: var(--np-text);
	opacity: .8;
	text-align: left;
}

/* Deep-link highlight (#update-1430) */
.np-live-update:has(> :target)::after,
.np-live-update.is-targeted::after {
	content: "";
	position: absolute;
	inset: -.6rem -.75rem .9rem 1rem;
	border-radius: var(--np-radius);
	background: color-mix(in srgb, var(--np-accent) 12%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--np-accent) 45%, transparent);
	pointer-events: none;
	animation: np-live-flash 2.4s ease-out forwards;
}

@keyframes np-live-flash {
	0%, 60% { opacity: 1; }
	100% { opacity: 0; }
}

/* ---------- Floating pill (new updates / link copied) ---------- */

.np-live-toast {
	position: fixed;
	left: 50%;
	bottom: calc(110px + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	padding: .6rem .7rem .6rem 1rem;
	border-radius: 999px;
	background: var(--np-accent);
	color: var(--np-on-accent);
	font: var(--np-label);
	letter-spacing: .03em;
	text-transform: uppercase;
	box-shadow: 0 10px 25px -5px rgb(0 0 0 / .35);
	transform: translate(-50%, 20px);
	opacity: 0;
	pointer-events: none;
	transition: transform .25s ease, opacity .25s ease;
}

.np-live-toast.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.np-live-toast .np-live-dot { color: var(--np-live); }

.np-live-toast button {
	padding: .3rem .7rem;
	border: 0;
	border-radius: 999px;
	background: var(--np-on-accent);
	color: var(--np-accent);
	font: inherit;
	cursor: pointer;
}

.np-live-toast.is-plain { padding-right: 1rem; }

/* ---------- Editor-only validation hints ---------- */

.np-live-heading-invalid {
	outline: 2px dashed #ff3b30;
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.np-live-status.is-live .np-live-dot::after,
	.np-live-update:has(> :target)::after,
	.np-live-update.is-targeted::after { animation: none; }
	.np-live-toast { transition: none; }
}
