/*!
 * Brimco guide.
 *
 * Loaded after single-news.css, which already carries the column system, the
 * prose, the rail, the writer card and the cards. Only the parts a guide has
 * and an article does not live here.
 *
 * The whole visible difference is the cover: news keeps its headline on paper
 * with the photograph beneath, a guide sets the headline over the photograph.
 * Same tokens, different composition, no new colour.
 */

/* ---------- the cover ---------- */

.bn--guide .bn-crumbs { padding-bottom: 6px; }

.bn-cover {
	position: relative;
	margin-top: 16px;
	background: var(--band);
	/* Height is set directly. aspect-ratio together with a max-height caps the
	   WIDTH to preserve the ratio, which leaves the picture short of the right
	   edge on a wide screen. clamp() gives the same wide band and never
	   touches the width. The ceiling keeps the headline and the opening
	   paragraphs on one screen; a full-height cover is a poster, not a page. */
	width: 100%;
	/* min-height, not height. A fixed height with overflow:hidden clipped
	   the byline off the bottom edge as soon as the headline ran to three
	   lines. The band keeps its presence and can grow when the words need
	   it, which is the whole difference between a cover and a crop. */
	min-height: clamp(440px, 46vw, 620px);
	display: grid;
	align-items: end;
	overflow: hidden;
}

.bn-cover__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The scrim is why type over an arbitrary photograph is safe here: dense
   where the words sit, clear where they do not, so the headline holds against
   whatever an editor uploads. */
.bn-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top,
		rgba(0, 0, 0, .88) 0%,
		rgba(0, 0, 0, .72) 34%,
		rgba(0, 0, 0, .34) 62%,
		rgba(0, 0, 0, .12) 100%);
}

/* No photograph, no gamble: the cover runs on ink and the scrim stands down,
   so a guide without a featured image is quieter rather than broken. */
.bn-cover--bare { height: auto; min-height: 0; }
.bn-cover--bare::after { display: none; }

.bn-cover .bn-wrap {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-top: 64px;
	padding-bottom: 52px;
}

.bn-cover__lead { max-width: 820px; margin-left: 0; }

.bn-cover__credit {
	position: absolute;
	right: 24px;
	top: 20px;
	z-index: 1;
	margin: 0;
	font: 500 11px/1.4 var(--label);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .62);
	max-width: 40ch;
	text-align: right;
}

/* ---------- the cover inverts what the article sets on paper ---------- */

.bn--guide .bn-kicker a {
	background: var(--paper);
	color: var(--band);
}

.bn--guide .bn-kicker a:hover { background: var(--accent); color: var(--band); }
.bn--guide .bn-kicker__eyebrow { color: rgba(255, 255, 255, .62); }
.bn--guide .bn-headline { color: var(--paper); }
.bn--guide .bn-standfirst { color: rgba(255, 255, 255, .82); }

.bn--guide .bn-byline {
	border-top-color: rgba(255, 255, 255, .35);
	color: rgba(255, 255, 255, .72);
}

.bn--guide .bn-byline a { color: var(--paper); }
.bn--guide .bn-byline a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
.bn--guide .bn-byline__dot { color: rgba(255, 255, 255, .4); opacity: 1; }
.bn--guide .bn-byline__reviewed { color: var(--paper); font-weight: 500; }

@media (max-width: 700px) {
	/* A 21:9 crop on a phone is a letterbox with nothing in it. */
	.bn-cover { height: auto; min-height: 420px; }
	.bn-cover .bn-wrap { padding-top: 220px; }
	.bn-cover--bare .bn-wrap { padding-top: 40px; }
	.bn-cover__credit { position: static; text-align: left; padding: 16px 24px 0; }
}

/* ---------- numbered sections ----------
   No rule between them. The numeral in the margin marks the break on its own,
   set in the display face at a size that reads as a marker rather than a
   label. Rules here would be the news article's grammar borrowed without a
   reason: news uses them because a pull quote has to interrupt. */

.bn--guide .bn-step__head {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 16px;
	align-items: baseline;
	margin-top: 2.8em;
}

.bn--guide .bn-step__n {
	font: 600 40px/1 var(--serif);
	font-variant-numeric: tabular-nums;
	color: var(--ink);
	opacity: .22;
	letter-spacing: -.02em;
}

.bn--guide .bn-step__head h2 {
	font-size: 25px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0;
}

@media (max-width: 620px) {
	.bn--guide .bn-step__head { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- contents ---------- */

.bn-toc {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.bn-toc li { display: block; }

.bn-toc a {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 10px;
	/* The highlight is exactly the width of the rail, no overhang either
	   side. Bleeding past it on the left read as a mistake; bleeding past it
	   on both sides read as sloppy against the 2px rule above, which is rail
	   width to the pixel. Sitting inside it, the fill lines up with the rule
	   and the label carries a normal inset. */
	padding: 11px 12px;
	margin-inline: 0;
	font-size: 15px;
	line-height: 1.4;
	font-family: var(--sans);
	color: var(--text);
	text-decoration: none;
	transition: background-color .16s var(--ease), color .16s var(--ease);
}

.bn-toc a span {
	font: 600 12px/1.4 var(--label);
	font-variant-numeric: tabular-nums;
}

/* Two states doing two different jobs, and they must not look alike.
   Hover is the accent: a fill that follows the pointer and disappears with
   it. Current is an ink bar with no fill at all: it stays put, marking where
   the reader is. Giving both a fill was the mistake, because then the rail
   appears to have two current sections. */
.bn-toc a:hover,
.bn-toc a:focus-visible { background: var(--accent); color: var(--ink); }

/* Prefixed with the article class because a rail rule further up the cascade
   was still setting the link colour, and the current section was reading as
   grey with an ink bar beside it. */
.bn--guide .bn-rail .bn-toc a[aria-current="true"] {
	background: transparent;
	color: var(--ink);
	font-weight: 500;
	box-shadow: inset 2px 0 0 var(--ink);
}

/* The pointer still wins while it is over the link. */
.bn--guide .bn-rail .bn-toc a[aria-current="true"]:hover { background: var(--accent); }

/* The numeral is a marker, not a label: quiet on its own row, and quieter
   still on the rows the reader is not in. */
.bn-toc a span { color: var(--text); opacity: .55; }
.bn--guide .bn-rail .bn-toc a[aria-current="true"] span { color: var(--ink); opacity: 1; }

/* ---------- where to go next ---------- */

.bn-next { padding-top: 52px; }
.bn-next__head { font-size: 26px; font-weight: 600; margin: 0 0 22px; }

.bn-next__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
}

@media (max-width: 860px) { .bn-next__grid { grid-template-columns: 1fr; } }

.bn-next__item {
	border-top: 2px solid var(--ink);
	padding-top: 14px;
	display: grid;
	gap: 10px;
	align-content: start;
}

.bn-next__shot {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--surface);
}

.bn-next__shot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s var(--ease);
}

.bn-next__item:hover .bn-next__shot img { transform: scale(1.03); }

@media (prefers-reduced-motion: reduce) {
	.bn-next__item:hover .bn-next__shot img { transform: none; }
}

.bn-next__item .bn-label { color: var(--link); }

.bn-next__item a {
	font-family: var(--serif);
	font-size: 18px;
	line-height: 1.35;
	color: var(--ink);
	text-decoration: none;
}

.bn-next__item a:hover { color: var(--link); }
.bn-next__item p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text); }


/* ---------- the foot of the page ----------
   The onward links are the last thing on a guide and the footer is black, so
   the page needs a gap here or the two run together. The writer card had the
   same problem when it sat last, which is what this space was first for. */

.bn--guide .bn-next {
	padding-bottom: 80px;
}

@media (max-width: 700px) {
	.bn--guide .bn-next { padding-bottom: 56px; }
}
