/*
 * BB.news redesigned homepage (v0.21.0). Loaded only on pages that use the "BB.news ::
 * Homepage A", "Homepage B" or "All stories" template (inc/homepage.php), after assets/bar.css,
 * which holds the bar, the Latest strip and the section tabs (moved there in 0.21.0 so every
 * page can carry the bar). Every rule here sits under body.bb-home so nothing reaches other
 * pages, and the scope outranks the theme's global element styles (h1, a, ul) without !important.
 *
 * Palette from the design deck: navy, gold, red, paper. Headlines Source Serif 4, Georgia
 * fallback; body the system sans. Both draw lining figures by default (read in the renders),
 * which results numbers need; the lining-nums rule below only reaches text without its own
 * font shorthand.
 */

body.bb-home {
	--bbh-navy: #0d1b2a;
	--bbh-gold: #c8860a;
	--bbh-gold-ink: #9a6607; /* gold for text on white: 4.6:1, the bar gold fails small text */
	--bbh-red: #d93025;
	--bbh-red-dark: #b3261d;
	--bbh-accent: #e97132; /* the live site's category colour (td_theme_color, READ 27 Oct); 3.0:1 on white, the client's own choice */
	--bbh-paper: #fff; /* white page (client, 30 Oct: back to white); was #f5f2ee */
	--bbh-ink: #1d2733;
	--bbh-body: #3a4a5c;
	--bbh-meta: #5f6e80;
	--bbh-rule: #e8e4dc;
	--bbh-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--bbh-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--bbh-paper);
}

/* the theme header block is hidden and the wrapper's overflow clipped by bar.css (body.bb-bar) */

body.bb-home .bbh {
	color: var(--bbh-body);
	font: 16px/1.55 var(--bbh-sans);
	font-variant-numeric: lining-nums;
	-webkit-font-smoothing: antialiased;
}
body.bb-home .bbh *,
body.bb-home .bbh *::before,
body.bb-home .bbh *::after {
	box-sizing: border-box;
}
body.bb-home .bbh a {
	color: inherit;
	text-decoration: none;
}
body.bb-home .bbh a:focus-visible,
body.bb-home .bbh summary:focus-visible,
body.bb-home .bbh input:focus-visible {
	outline: 2px solid var(--bbh-gold);
	outline-offset: 3px;
}
body.bb-home .bbh img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}
body.bb-home .bbh ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
body.bb-home .bbh li {
	margin: 0; /* the theme indents every li */
}
body.bb-home .bbh h1,
body.bb-home .bbh h2,
body.bb-home .bbh h3 {
	font-family: var(--bbh-serif);
	text-transform: none;
	letter-spacing: 0;
}
body.bb-home .bbh .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- bar, Latest strip, section tabs: assets/bar.css (body.bb-bar) ---------- */

/* ---------- main ---------- */
body.bb-home .bbh-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 28px 24px 64px;
}
/* category labels: plain orange text, as the live site shows them (Azlan, 26 Oct: no colour per
   category, no highlight or box); the .bbh-cat-<slug> class stays on each label for later styling */
body.bb-home .bbh .bbh-pill {
	display: inline-block;
	align-self: flex-start;
	margin: 0 0 10px;
	padding: 0;
	color: var(--bbh-accent);
	font: 700 13px/1.2 var(--bbh-sans);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
body.bb-home .bbh .bbh-pill:hover {
	text-decoration: underline;
}
body.bb-home .bbh .bbh-all {
	display: inline-block;
	margin-top: 10px;
	padding: 6px 0;
	color: var(--bbh-gold-ink);
	font: 600 14px/1.3 var(--bbh-sans);
}
body.bb-home .bbh .bbh-all:hover {
	color: var(--bbh-navy);
}
body.bb-home .bbh-meta {
	margin: 0;
	color: var(--bbh-meta);
	font-size: 13px;
	line-height: 1.4;
}
body.bb-home .bbh .bbh-more {
	display: inline-block;
	margin-top: 16px;
	color: var(--bbh-gold-ink);
	font: 600 15px/1 var(--bbh-sans);
}
body.bb-home .bbh .bbh-more:hover {
	color: var(--bbh-navy);
}

/* lead, variant A: image left 65%, headline and summary right */
body.bb-home .bbh-lead {
	display: grid;
	grid-template-columns: 65fr 35fr;
	background: #fff;
	border-top: 3px solid var(--bbh-navy);
}
body.bb-home .bbh-lead-img {
	display: block;
	aspect-ratio: 16 / 9;
	background: #dde3e9;
	overflow: hidden;
}
body.bb-home .bbh-lead-txt {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 28px 32px 28px 30px;
}
body.bb-home .bbh .bbh-lead h1 {
	margin: 0 0 14px;
	color: var(--bbh-navy);
	font: 700 30px/1.15 var(--bbh-serif);
	letter-spacing: -0.01em;
}
body.bb-home .bbh-lead .bbh-sum {
	display: -webkit-box;
	margin: 0 0 14px;
	overflow: hidden;
	color: var(--bbh-body);
	font-size: 16px;
	line-height: 1.55;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
}

body.bb-home .bbh .bbh-card .bbh-pill,
body.bb-home .bbh .bbh-top .bbh-pill {
	justify-self: start;
	margin: 0 0 6px;
	font-size: 12px;
}

/* ---------- lead, variant B: the front page in three tiers ---------- */
/* the lead: its image whole, its headline on a navy band under it (a TV lower third), so the
   title text inside BB images stays readable; three Top stories beside it */
body.bb-home .bbh-front {
	display: grid;
	grid-template-columns: 65fr 35fr;
	gap: 32px;
	margin-bottom: 44px;
}
body.bb-home .bbh-hero {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--bbh-navy);
	color: #fff;
}
body.bb-home .bbh-hero-img {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #dde3e9;
}
body.bb-home .bbh-band {
	flex: 1;
	padding: 0 28px 22px;
	border-top: 4px solid var(--bbh-red);
}
/* the section label sits inside the band, over the headline (orange on navy: 5.7:1); the 0.20.1 tab
   on the red edge needed a box, which the labels no longer have */
body.bb-home .bbh .bbh-band .bbh-pill {
	display: table; /* block level, so the headline starts on its own line */
	margin: 12px 0 6px;
}
/* the label now takes a line inside the band, so the band starts 8 px higher and the headline runs
   to 38ch (two lines for most titles) to keep its last line above a 650 px fold at 1280 wide */
body.bb-home .bbh-b .bbh-main {
	padding-top: 12px;
}
body.bb-home .bbh .bbh-band h1 {
	max-width: 38ch;
	margin: 0 0 10px;
	color: #fff;
	font: 700 32px/1.15 var(--bbh-serif);
	letter-spacing: -0.01em;
}
body.bb-home .bbh-band h1 a:hover {
	color: #f0b54a;
}
body.bb-home .bbh-band .bbh-sum {
	display: -webkit-box;
	max-width: 68ch;
	margin: 0 0 14px;
	overflow: hidden;
	color: #c9d2dc;
	font-size: 16px;
	line-height: 1.5;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
body.bb-home .bbh-band .bbh-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 22px;
	color: #aab6c3;
}
body.bb-home .bbh .bbh-band .bbh-more {
	margin: 0;
	color: #f0b54a;
}
body.bb-home .bbh .bbh-band .bbh-more:hover {
	color: #fff;
}
body.bb-home .bbh-top {
	min-width: 0;
	border-top: 3px solid var(--bbh-navy);
}
body.bb-home .bbh-top-item {
	display: grid;
	grid-template-columns: 132px 1fr;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--bbh-rule);
}
body.bb-home .bbh-top-item:first-of-type {
	grid-template-columns: 1fr;
	gap: 12px;
	padding-top: 0;
}
body.bb-home .bbh-top-img {
	display: block;
	align-self: start;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #dde3e9;
}
body.bb-home .bbh-top-txt {
	min-width: 0;
}
body.bb-home .bbh .bbh-top h3 {
	margin: 0 0 6px;
	color: var(--bbh-ink);
	font: 700 17px/1.25 var(--bbh-serif);
}
body.bb-home .bbh .bbh-top-item:first-of-type h3 {
	font-size: 21px;
}
body.bb-home .bbh-top h3 a:hover {
	color: var(--bbh-red);
}

/* columns: Latest news grid and More news list */
body.bb-home .bbh-cols {
	display: grid;
	grid-template-columns: 8fr 4fr;
	gap: 40px;
	margin-top: 40px;
}
body.bb-home .bbh-b .bbh-cols {
	grid-template-columns: 65fr 35fr;
	gap: 32px;
	margin-top: 0;
}
body.bb-home .bbh .bbh-cols h2 {
	position: relative;
	margin: 0 0 18px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--bbh-rule);
	color: var(--bbh-navy);
	font: 700 22px/1.2 var(--bbh-serif);
}
body.bb-home .bbh .bbh-cols h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 48px;
	height: 3px;
	background: var(--bbh-gold);
}
body.bb-home .bbh-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px 24px;
}
body.bb-home .bbh-b .bbh-card .bbh-sum {
	display: none; /* B: the cards carry label, headline and time only, as in the deck */
}
body.bb-home .bbh-card {
	min-width: 0;
}
body.bb-home .bbh-card-img {
	display: block;
	aspect-ratio: 16 / 9;
	margin-bottom: 12px;
	overflow: hidden;
	background: #dde3e9;
}
body.bb-home .bbh .bbh-card h3 {
	margin: 0 0 8px;
	color: var(--bbh-ink);
	font: 700 18px/1.25 var(--bbh-serif);
}
body.bb-home .bbh-card h3 a:hover,
body.bb-home .bbh-side a:hover strong,
body.bb-home .bbh-lead h1 a:hover {
	color: var(--bbh-red);
}
body.bb-home .bbh-card .bbh-sum {
	display: -webkit-box;
	margin: 0 0 8px;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.5;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}
body.bb-home .bbh-side {
	min-width: 0;
}
body.bb-home .bbh-side li + li {
	border-top: 1px solid var(--bbh-rule);
}
body.bb-home .bbh-side li a {
	display: block;
	padding: 14px 0;
}
body.bb-home .bbh-side strong {
	display: block;
	margin-bottom: 4px;
	color: var(--bbh-ink);
	font: 700 16px/1.3 var(--bbh-serif);
}
body.bb-home .bbh-side time {
	color: var(--bbh-meta);
	font-size: 12px;
}

/* ---------- All stories page: one text column ---------- */
body.bb-home .bbh-list .bbh-main {
	max-width: 760px;
}
body.bb-home .bbh.bbh-list h1 {
	margin: 8px 0 6px;
	color: var(--bbh-navy);
	font: 700 34px/1.15 var(--bbh-serif);
}
body.bb-home .bbh-locked {
	max-width: 520px;
	min-height: 50vh;
}
body.bb-home .bbh-locked input[type="password"] {
	display: block;
	width: 100%;
	height: 44px;
	margin: 8px 0 12px;
	padding: 0 12px;
	border: 1px solid var(--bbh-rule);
	border-radius: 4px;
	font: 16px/1 var(--bbh-sans);
}
body.bb-home .bbh-locked input[type="submit"] {
	height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: 4px;
	background: var(--bbh-navy);
	color: #fff;
	font: 600 15px/1 var(--bbh-sans);
	cursor: pointer;
}
body.bb-home .bbh-count {
	margin-bottom: 18px;
}
body.bb-home .bbh-stories li {
	padding: 18px 0;
	border-top: 1px solid var(--bbh-rule);
}
body.bb-home .bbh .bbh-stories h2 {
	margin: 0 0 6px;
	color: var(--bbh-ink);
	font: 700 20px/1.3 var(--bbh-serif);
}
body.bb-home .bbh-stories h2 a:hover {
	color: var(--bbh-red);
}
body.bb-home .bbh-stories .bbh-sum {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.55;
}
body.bb-home .bbh .bbh-stories .bbh-meta a {
	color: var(--bbh-meta);
	text-decoration: underline;
	text-underline-offset: 2px;
}
body.bb-home .bbh-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--bbh-rule);
}
body.bb-home .bbh .bbh-pages .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 10px 12px;
	border: 1px solid var(--bbh-rule);
	border-radius: 4px;
	background: #fff;
	color: var(--bbh-navy);
	font: 600 14px/1 var(--bbh-sans);
	text-align: center;
}
body.bb-home .bbh .bbh-pages .page-numbers.current {
	background: var(--bbh-navy);
	border-color: var(--bbh-navy);
	color: #fff;
}
body.bb-home .bbh .bbh-pages .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------- B under 1024 px: the lead and its band take the full width; Top stories follow ---------- */
@media (max-width: 1023px) {
	body.bb-home .bbh-front {
		grid-template-columns: 1fr;
		gap: 0;
		margin-bottom: 32px;
	}
	body.bb-home .bbh-top {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 20px;
		padding: 20px 0 0;
		border-top: 0;
	}
	body.bb-home .bbh-top-item,
	body.bb-home .bbh-top-item:first-of-type {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 0;
		border-bottom: 0;
	}
	body.bb-home .bbh .bbh-top-item:first-of-type h3 {
		font-size: 17px;
	}
}

/* ---------- tablet: the lead stacks, the grid takes two columns ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
	body.bb-home .bbh-lead {
		grid-template-columns: 1fr;
	}
	body.bb-home .bbh-lead .bbh-sum {
		-webkit-line-clamp: 3;
	}
	body.bb-home .bbh-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ---------- phone ---------- */
@media (max-width: 767px) {
	body.bb-home .bbh-main {
		padding: 0 0 48px;
	}
	body.bb-home .bbh-lead {
		grid-template-columns: 1fr;
		border-top: 0;
	}
	body.bb-home .bbh-lead-txt {
		padding: 18px 16px 22px;
	}
	body.bb-home .bbh .bbh-lead h1 {
		font-size: 25px;
	}
	body.bb-home .bbh-lead .bbh-sum {
		-webkit-line-clamp: 3;
	}

	body.bb-home .bbh-cols,
	body.bb-home .bbh-b .bbh-cols {
		grid-template-columns: 1fr;
		gap: 28px;
		margin-top: 24px;
	}
	body.bb-home .bbh-b .bbh-cols {
		margin-top: 0;
	}
	body.bb-home .bbh-latest,
	body.bb-home .bbh-side {
		padding: 0 16px;
	}
	body.bb-home .bbh-list .bbh-main {
		padding: 16px 16px 48px;
	}
	body.bb-home .bbh.bbh-list h1 {
		font-size: 28px;
	}
	body.bb-home .bbh-grid,
	body.bb-home .bbh-b .bbh-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
	body.bb-home .bbh-card {
		display: grid;
		grid-template-columns: 112px 1fr;
		gap: 4px 14px;
		padding: 14px 0;
		border-top: 1px solid var(--bbh-rule);
	}
	body.bb-home .bbh-card-img {
		grid-row: span 3;
		align-self: start;
		aspect-ratio: 4 / 3;
		margin: 0;
	}
	body.bb-home .bbh .bbh-card h3 {
		margin: 0;
		font-size: 16px;
	}
	body.bb-home .bbh-card .bbh-sum {
		display: none;
	}

	body.bb-home .bbh-band {
		padding: 0 16px 20px;
	}
	body.bb-home .bbh .bbh-band h1 {
		font-size: 25px;
	}
	body.bb-home .bbh-band .bbh-sum {
		-webkit-line-clamp: 3;
	}
	/* Top stories on the phone: the same rows as Latest news, on white under the lead */
	body.bb-home .bbh-front {
		margin-bottom: 24px;
	}
	body.bb-home .bbh-top {
		display: block;
		padding: 0 16px;
		background: #fff;
	}
	body.bb-home .bbh-top-item,
	body.bb-home .bbh-top-item:first-of-type {
		grid-template-columns: 112px 1fr;
		gap: 14px;
		padding: 14px 0;
		border-bottom: 1px solid var(--bbh-rule);
	}
	body.bb-home .bbh-top-item:last-of-type {
		border-bottom: 0;
	}
	body.bb-home .bbh-top-img {
		aspect-ratio: 4 / 3;
	}
	body.bb-home .bbh .bbh-top h3,
	body.bb-home .bbh .bbh-top-item:first-of-type h3 {
		font-size: 16px;
	}
}
