/*
 * Snow Before You Go template (OWR-2558). Loaded only on that post (inc/sbyg.php).
 * Plain CSS rather than new tw- utilities so it works without a Tailwind rebuild.
 * Colours come from the theme's --ots-* tokens (sass/tailwind-input.css).
 */
.sbyg {
	--sbyg-rule: hsl(var(--ots-border, 214 32% 91%));
	--sbyg-muted: hsl(var(--ots-muted-foreground, 220 13% 41%));
	--sbyg-ink: hsl(var(--ots-secondary, 220 29% 30%));
	--sbyg-blue: hsl(var(--ots-primary, 202 100% 34%));
	--sbyg-sky: #e6f1f9;
	--sbyg-live: #e5322d;
}

.sbyg-byline { flex-wrap: wrap; }

/* ---- Summary strip ---- */
.sbyg-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 1px;
	margin: 20px 0 0;
	background: var(--sbyg-rule);
	border: 1px solid var(--sbyg-rule);
	border-radius: 8px;
	overflow: hidden;
}
.sbyg-strip__cell { background: #fff; padding: 10px 14px; margin: 0; }
.sbyg-strip dt {
	font-family: Poppins, sans-serif;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--sbyg-muted);
	margin: 0;
}
.sbyg-strip dd {
	font-family: Poppins, sans-serif;
	font-size: 17px;
	font-weight: 600;
	color: var(--sbyg-ink);
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
	margin: 2px 0 0;
}
.sbyg-strip dd small { font-size: 12px; font-weight: 500; color: var(--sbyg-muted); }

/* ---- Jump links ---- */
.sbyg-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sbyg-jump a {
	font-family: Poppins, sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--sbyg-blue);
	background: var(--sbyg-sky);
	padding: 5px 10px;
	border-radius: 999px;
	text-decoration: none;
}
.sbyg-jump a:hover,
.sbyg-jump a:focus-visible { background: var(--sbyg-blue); color: #fff; text-decoration: none; }

/* Clear the sticky main nav when jumping to a section. */
.sbyg .entry-content h2[id] { scroll-margin-top: 90px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Ad slots inserted in the body ---- */
.sbyg-ad { margin: 24px 0; text-align: center; }
.sbyg-ad:empty { display: none; }

/* ---- OnTheSnow TV card ("Now showing") ---- */
.sbyg-tv {
	display: block;
	background: #fff;
	border: 1px solid var(--sbyg-rule);
	border-radius: 10px;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
}
.sbyg-tv:hover,
.sbyg-tv:focus { text-decoration: none; color: inherit; }
.sbyg-tv:focus-visible { outline: 3px solid var(--sbyg-blue); outline-offset: 3px; }
.sbyg-tv__hdr {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--sbyg-rule);
}
.sbyg-tv__title { font-family: Poppins, sans-serif; font-size: 13px; font-weight: 700; color: var(--sbyg-ink); }
.sbyg-tv__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0b1a33; }
.sbyg-tv__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px 12px;
	font-size: 12px;
	color: var(--sbyg-muted);
}
.sbyg-tv__cta { font-family: Poppins, sans-serif; font-weight: 600; color: var(--sbyg-blue); white-space: nowrap; }
.sbyg-tv:hover .sbyg-tv__cta { text-decoration: underline; }

.sbyg-live {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: Poppins, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #fff;
	background: var(--sbyg-live);
	padding: 4px 8px 4px 7px;
	border-radius: 4px;
	line-height: 1;
}
.sbyg-live::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #fff;
	animation: sbyg-blink 1.4s infinite;
}
@keyframes sbyg-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .sbyg-live::before { animation: none; } }

/* Sidebar card sits above Recent Posts. */
.sbyg-side-tv { margin-bottom: 28px; }

/* Inline card: phones/tablets only. Sidebar card: desktop only
   (below 1024px the sidebar stacks under a long article, so the inline
   card does the job and the 390 KB GIF isn't loaded twice). */
.sbyg-inline-tv { display: none; max-width: 340px; margin: 24px auto; }
@media (max-width: 1023.98px) {
	.sbyg-inline-tv { display: block; }
	.sbyg-side-tv { display: none; }
}

/* ---- In-article blocks used by the SBYG body ----
   Not scoped to .sbyg and with colour fallbacks, so they also render if the
   post is shown through another template (e.g. the app webview). The
   .entry-content prefix beats the theme's prose list/paragraph styles. */
.entry-content .sbyg-tip {
	background: #e6f1f9;
	border-left: 4px solid hsl(var(--ots-primary, 202 100% 34%));
	border-radius: 0 8px 8px 0;
	padding: 14px 18px;
	margin: 18px 0;
}
.entry-content .sbyg-chart {
	border: 1px solid hsl(var(--ots-border, 214 32% 91%));
	border-radius: 8px;
	background: #f3f8fc;
	padding: 16px 18px;
	margin: 20px 0;
}
.entry-content .sbyg-chart__eyebrow {
	font-family: Poppins, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: hsl(var(--ots-primary, 202 100% 34%));
	margin: 0;
	line-height: 1.4;
}
.entry-content .sbyg-chart__title {
	font-family: Poppins, sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: hsl(var(--ots-secondary, 220 29% 30%));
	margin: 2px 0 12px;
	line-height: 1.3;
}
.entry-content ul.sbyg-chart__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entry-content ul.sbyg-chart__rows > li {
	display: grid;
	grid-template-columns: minmax(110px, 150px) 1fr 52px;
	gap: 12px;
	align-items: center;
	font-size: 13px;
	line-height: 1.3;
	color: hsl(var(--ots-muted-foreground, 220 13% 41%));
	margin: 0;
	padding: 0;
}
.entry-content ul.sbyg-chart__rows > li::before,
.entry-content ul.sbyg-chart__rows > li::marker { content: none; }
.entry-content .sbyg-chart__bar { display: block; height: 6px; border-radius: 3px; background: rgba(0, 110, 173, .12); overflow: hidden; }
.entry-content .sbyg-chart__fill { display: block; height: 100%; border-radius: 3px; background: hsl(var(--ots-primary, 202 100% 34%)); }
.entry-content .sbyg-chart__val { text-align: right; font-variant-numeric: tabular-nums; color: hsl(var(--ots-secondary, 220 29% 30%)); font-weight: 600; white-space: nowrap; }
.entry-content .sbyg-chart__src { font-size: 12px; color: hsl(var(--ots-muted-foreground, 220 13% 41%)); margin: 12px 0 0; }
@media (max-width: 480px) {
	.entry-content ul.sbyg-chart__rows > li { grid-template-columns: 1fr 52px; gap: 4px 12px; }
	.entry-content .sbyg-chart__bar { grid-column: 1 / -1; grid-row: 2; }
}
