/*
 * Niyama Vartha broadsheet format.
 * Styles the nvb- building blocks that Gemini writes into posts.
 * Uses the theme's colour tokens, so posts follow the theme (and dark mode).
 */

.nvb {
	--nvb-size: calc(var(--article-size, 19px) - 2px);
	font-size: var(--nvb-size);
	line-height: 1.85;
	color: var(--ink);
}
.nvb > * { margin-top: 0; margin-bottom: 0; }
.nvb > * + *,
.nvb-body > * + * { margin-top: 24px; }
.nvb-body > * { margin-bottom: 0; }
.nvb p { margin: 0 0 .75em; }
.nvb p:last-child { margin-bottom: 0; }
.nvb a { color: var(--tape); }
.nvb strong { font-weight: 700; }

/* Citation strip: court, neutral citation, LOK citation, case number, date, bench */
.nvb-edition {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px;
	padding-bottom: 10px; border-bottom: 2px solid var(--ink);
	font-size: 14px; line-height: 1.6; font-weight: 700;
}
.nvb-edition > * { margin: 0; }
.nvb-court {
	display: inline-block; background: var(--tape); color: #fff; padding: 1px 9px; margin-right: 8px;
	border-radius: 2px; font-size: 13px;
}
.nvb-cite { white-space: nowrap; }

/* Kicker above the headline */
.nvb-lead > .nvb-kicker,
.nvb-kicker {
	display: inline-block; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700;
	line-height: 1.6; padding: 3px 11px; border-radius: 2px; margin-bottom: 10px;
}
.nvb-kicker--red { background: var(--tape); }

.nvb-headline {
	font-family: var(--f-head); font-weight: 800; font-size: clamp(27px, 4.1vw, 44px);
	line-height: 1.36; margin: 0 0 12px; letter-spacing: -0.005em; color: var(--ink);
}
.nvb-deck {
	font-size: 19px; font-weight: 700; line-height: 1.6; color: var(--tape);
	border-left: 4px solid var(--tape); padding-left: 14px; margin: 0 0 18px !important;
}
.nvb-lead { padding-bottom: 20px; border-bottom: 2px solid var(--ink); }

/* Images */
.nvb-hero, .nvb figure { margin: 0 0 18px; border: 1px solid var(--rule); background: var(--sheet); }
.nvb-hero img, .nvb figure img { display: block; width: 100%; height: auto; }
.nvb figcaption {
	padding: 7px 12px; font-size: 14px; line-height: 1.6; color: var(--muted);
	background: var(--file); border-top: 1px solid var(--rule);
}

/* Story text in newspaper columns */
.nvb-columns { column-gap: 30px; column-rule: 1px solid var(--rule); }
@media (min-width: 760px) { .nvb-columns { column-count: 2; } }
@media (min-width: 1100px) { .nvb-columns { column-count: 3; } }
.nvb-columns p { break-inside: avoid-column; }
.nvb-dateline { font-weight: 700; color: var(--tape); }

/* Key figures */
.nvb-stats {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	background: var(--navy); color: #fff; padding: 6px 4px; border-radius: 3px;
}
.nvb-stat { padding: 10px 16px; border-left: 1px solid rgba(255,255,255,.18); }
.nvb-stat:first-child { border-left: 0; }
.nvb-stat-value { font-size: 22px; font-weight: 700; line-height: 1.35; color: #fde68a; }
.nvb-stat-label { font-size: 14px; line-height: 1.55; color: #dde3ea; margin-top: 2px; }
@media (max-width: 599px) {
	.nvb-stat { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
	.nvb-stat:first-child { border-top: 0; }
}

/* Statute in focus */
.nvb-statute {
	display: grid; gap: 18px; align-items: start;
	background: var(--bs-blue); border: 1px solid var(--bs-blue-line); border-top: 4px solid var(--navy); padding: 16px 18px;
}
@media (min-width: 800px) { .nvb-statute:has(> figure) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.nvb-statute figure { margin: 0; }

/* Key legal principles */
.nvb-principles {
	background: var(--bs-red); border-top: 4px solid var(--tape); border-bottom: 2px solid var(--tape); padding: 16px 18px;
}
.nvb-principles-title {
	font-family: var(--f-head); font-size: 22px; font-weight: 700; line-height: 1.45; color: var(--tape); margin: 0 0 10px;
}

/* Story cards */
.nvb-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nvb-card { border-top: 3px solid var(--navy); padding-top: 12px; }
.nvb-card--compare { background: var(--bs-gold); border: 1px solid var(--bs-gold-line); border-top: 4px solid #b8860b; padding: 12px 15px; }
.nvb-card--background { background: var(--bs-blue); border: 1px solid var(--bs-blue-line); border-top: 4px solid var(--navy-2); padding: 12px 15px; }
.nvb-card-title, .nvb-statute h3, .nvb h3.nvb-card-title {
	font-family: var(--f-head); font-size: 19px; font-weight: 700; line-height: 1.5; margin: 0 0 8px; color: var(--ink);
}
.nvb-text { font-size: calc(var(--nvb-size) - 1px); }

/* Reference band (tables, precedents, timeline) */
.nvb-reference { border-top: 4px double var(--ink); padding-top: 18px; }
.nvb-reference-head {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
	background: var(--navy); color: #fff; padding: 10px 16px; margin-bottom: 16px;
}
.nvb-reference-head h2 { font-family: var(--f-head); font-size: 18px; font-weight: 700; line-height: 1.5; margin: 0; color: #fff; }
.nvb-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.nvb-pills button {
	font: inherit; font-size: 14px; line-height: 1.5; padding: 2px 12px; border-radius: 999px; cursor: pointer;
	background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4);
}
.nvb-pills button[aria-pressed="true"], .nvb-pills button:hover { background: var(--tape); border-color: var(--tape); }
.nvb-rails { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nvb-rail { border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 12px 15px; background: var(--sheet); }
.nvb-rail[hidden] { display: none; }
.nvb-rail--accent { border-top: 4px solid var(--tape); }
.nvb-rail-title {
	font-family: var(--f-head); font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--tape);
	margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.nvb-facts { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.7; }
.nvb-facts li { padding: 8px 0; border-bottom: 1px dashed var(--rule); margin: 0; }
.nvb-facts li:last-child { border-bottom: 0; }
.nvb-fact-label { display: block; font-size: 13px; font-weight: 700; color: var(--navy-2); }
html[data-theme="dark"] .nvb-fact-label { color: #9cc3f0; }

/* Tables inside the format */
.nvb table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.nvb th, .nvb td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; vertical-align: top; }
.nvb th { background: var(--file); }
.nvb td.num, .nvb th.num { text-align: right; white-space: nowrap; }

/* Sources */
.nvb-source {
	display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
	border-top: 1px solid var(--rule); padding-top: 12px; font-size: 14px; line-height: 1.6; color: var(--muted);
}
.nvb-source > * { margin: 0; }
.nvb-source a { font-weight: 700; }

/* Members box after the free part of a broadsheet post */
.nvb + .nv-paywall { margin-top: 28px !important; }

@media print {
	.nvb-columns { column-count: 2; }
	.nvb-pills { display: none; }
	.nvb-rail[hidden] { display: block !important; }
	.nvb-stats { background: #fff !important; color: #000; border: 1px solid #000; }
	.nvb-stat-value, .nvb-stat-label { color: #000 !important; }
	.nvb-reference-head { background: #fff; color: #000; border-bottom: 2px solid #000; }
	.nvb-reference-head h2 { color: #000; }
}

/* Dark mode: red text needs a lighter red to stay readable */
html[data-theme="dark"] .nvb-principles-title,
html[data-theme="dark"] .nvb-deck,
html[data-theme="dark"] .nvb-dateline,
html[data-theme="dark"] .nvb-rail-title,
html[data-theme="dark"] .nvb a { color: #f3909c; }
html[data-theme="dark"] .nvb-deck { border-left-color: #f3909c; }
