/**
 * Foliora: featured stories hero.
 *
 * Shared colour tokens and category pills live in posts.css.
 */

.foliora-hero {
	--foliora-radius: calc(24px * var(--foliora-corner-scale, 1));
	--foliora-gap: 56px;
	--foliora-nav-height: 236px;

	background: var(--foliora-surface);
	color: var(--foliora-text);
	padding: 56px 0;
}

:where(.foliora-hero) a {
	color: inherit;
	text-decoration: none;
}

.foliora-hero__slides {
	position: relative;
}

.foliora-hero__slide {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--foliora-gap);
	min-height: 568px;
}

.foliora-hero__slide[hidden] {
	display: none;
}

.foliora-hero__slide.is-entering {
	animation: foliora-hero-in 0.5s ease both;
}

@keyframes foliora-hero-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* Media */
.foliora-hero__media {
	position: relative;
	border-radius: var(--foliora-radius);
	overflow: hidden;
	background: var(--foliora-media);
}

.foliora-hero__media > a,
.foliora-hero__image {
	display: block;
	width: 100%;
	height: 100%;
}

.foliora-hero__image {
	object-fit: cover;
}

.foliora-hero__counter {
	/* "01 / 03" reads left to right in every language. */
	direction: ltr;
	unicode-bidi: isolate;
	position: absolute;
	top: 24px;
	inset-inline-start: 24px;
	background: var(--foliora-bg);
	color: var(--foliora-text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 8px 14px;
	border-radius: 999px;
	line-height: 1;
}

.foliora-hero__counter span {
	color: var(--foliora-muted);
	font-weight: 500;
}

/* Text */
.foliora-hero__body {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-bottom: var(--foliora-nav-height); /* Room for the "Up next" block. */
	min-width: 0;
}

.foliora-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.foliora-hero__date {
	font-size: 14px;
	color: var(--foliora-muted);
	white-space: nowrap;
}

.foliora-hero__title {
	margin: 0;
	font-size: calc(42px * var(--foliora-heading-scale, 1));
	line-height: 1.18;
	font-weight: var(--foliora-heading-weight, 700);
	letter-spacing: -0.01em;
	color: var(--foliora-text);
}

.foliora-hero__title a:hover {
	color: var(--foliora-link);
}

.foliora-hero__excerpt {
	margin: 0;
	font-weight: 400;
	font-size: calc(18px * var(--foliora-text-scale, 1));
	line-height: calc(1.65 + var(--foliora-leading-adjust, 0));
	color: var(--foliora-body);
	max-width: 520px;
}

.foliora-hero__footer {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px 24px;
	padding-top: 8px;
}

.foliora-hero .foliora-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 0 24px;
	border-radius: var(--foliora-btn-radius, 999px);
	background: var(--foliora-accent);
	color: var(--foliora-on-accent);
	font-size: 15px;
	font-weight: 600;
}

.foliora-hero .foliora-hero__cta:hover {
	background: var(--foliora-link);
	color: var(--foliora-on-accent);
}

/* "Up next" block, pinned to the bottom of the text column on desktop. */
.foliora-hero .container {
	position: relative;
}

.foliora-hero__nav {
	position: absolute;
	inset-inline-end: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
	bottom: 0;
	width: calc((100% - var(--bs-gutter-x, 1.5rem) - var(--foliora-gap)) * 5 / 12);
	display: flex;
	flex-direction: column;
	gap: 16px;
	border-top: 1px solid var(--foliora-line);
	padding-top: 24px;
}

.foliora-hero__nav-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
}

.foliora-hero__label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--foliora-muted);
}

.foliora-hero__controls {
	display: flex;
	gap: 8px;
}

.foliora-hero__controls[hidden] {
	display: none;
}

.foliora-hero__btn {
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 1px solid var(--foliora-line-strong);
	background: var(--foliora-bg);
	color: var(--foliora-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.foliora-hero__btn:hover {
	border-color: var(--foliora-accent);
}

.foliora-hero__btn--primary {
	background: var(--foliora-accent);
	border-color: var(--foliora-accent);
	color: var(--foliora-on-accent);
}

.foliora-hero__btn--primary:hover {
	background: var(--foliora-link);
	border-color: var(--foliora-link);
}

.foliora-hero__icon-play,
.foliora-hero.is-paused .foliora-hero__icon-pause {
	display: none;
}

.foliora-hero.is-paused .foliora-hero__icon-play {
	display: block;
}

.foliora-hero__thumbs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.foliora-hero__thumbs li {
	display: block; /* The template's default.css makes every "ul li" inline-block. */
	margin: 0;
}

.foliora-hero__thumbs li[hidden] {
	display: none;
}

.foliora-hero__thumb {
	color: var(--foliora-text); /* Set directly: the template forces a grey colour on li. */
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: calc(16px * var(--foliora-corner-scale, 1));
	background: var(--foliora-bg);
	min-width: 0;
	height: 100%;
}

/* A custom slide without a link: the same tile as a button. */
button.foliora-hero__thumb {
	width: 100%;
	border: 0;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

.foliora-hero__thumb img {
	width: 72px;
	height: 72px;
	border-radius: calc(12px * var(--foliora-corner-scale, 1));
	object-fit: cover;
	flex-shrink: 0;
}

.foliora-hero__thumb-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.foliora-hero__thumb-cat {
	font-size: 12px;
	font-weight: 600;
	color: var(--foliora-link);
}

.foliora-hero__thumb-title {
	font-size: 14px;
	line-height: 1.4;
	font-weight: 600;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.foliora-hero__thumb:hover .foliora-hero__thumb-title {
	color: var(--foliora-link);
}

.foliora-hero__progress {
	display: flex;
	gap: 8px;
}

.foliora-hero__progress span {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: var(--foliora-line);
}

.foliora-hero__progress span.is-active {
	background: var(--foliora-accent);
}

/* Visible keyboard focus. */
.foliora-hero a:focus-visible,
.foliora-hero button:focus-visible {
	outline: 3px solid var(--foliora-link);
	outline-offset: 3px;
}

/* Laptops: slightly smaller type. */
@media (max-width: 1199px) {
	.foliora-hero {
		--foliora-gap: 40px;
	}

	.foliora-hero__title {
		font-size: calc(34px * var(--foliora-heading-scale, 1));
	}

	.foliora-hero__thumbs {
		grid-template-columns: minmax(0, 1fr);
	}

	.foliora-hero {
		--foliora-nav-height: 320px;
	}
}

/* Tablets and phones: stack image, text and "Up next". Room between the
   photo and the text, and under the progress bars before the next
   section (owner, 17 Nov 2026: was 20px and 32px, too tight). */
@media (max-width: 991px) {
	.foliora-hero {
		padding: 16px 0 48px;
		--foliora-radius: calc(20px * var(--foliora-corner-scale, 1));
	}

	.foliora-hero__slide {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		min-height: 0;
	}

	.foliora-hero__media {
		aspect-ratio: 4 / 3;
	}

	.foliora-hero__body {
		padding-bottom: 0;
		gap: 14px;
	}

	.foliora-hero__title {
		font-size: calc(26px * var(--foliora-heading-scale, 1));
		line-height: 1.25;
	}

	.foliora-hero__excerpt {
		font-size: calc(15px * var(--foliora-text-scale, 1));
	}

	.foliora-hero__nav {
		position: static;
		width: auto;
		margin-top: 24px;
	}

	.foliora-hero__thumbs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.foliora-hero {
		padding-bottom: 40px;
	}

	.foliora-hero__slide {
		gap: 28px;
	}

	.foliora-hero__thumbs {
		grid-template-columns: minmax(0, 1fr);
	}

	.foliora-hero .foliora-hero__cta {
		width: 100%;
		justify-content: center;
		height: 52px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.foliora-hero__slide.is-entering {
		animation: none;
	}
}

/* =====================================================================
   "Centre stage" style (template-parts/home/hero-stage.php)
   One story in the middle, the previous and next peeking at the sides.
   hero.js places each slide with --d (its distance from the centre:
   -1 left, 0 centre, 1 right; it copies the stories until there are at
   least five, so moves are always smooth); without JavaScript the slides
   are a row that scrolls and snaps.
   ===================================================================== */
.foliora-hero.foliora-stage {
	/* Slide width: the smallest of its largest size, the page minus room
	   for the peeks, and what keeps its height within the screen (minus
	   --stage-room for the header and a hint of the page below), never
	   under --stage-min. Breakpoints change these parts, not the formula. */
	--stage-max: 920px;
	--stage-peeks: 240px;
	--stage-room: 340px;
	--stage-min: 420px;
	--stage-w: min(var(--stage-max), calc(var(--foliora-page-w, 100vw) - var(--stage-peeks)), max(calc((100vh - var(--stage-room)) * (var(--stage-ratio))), var(--stage-min)));
	--stage-gap: 16px;
	--stage-ratio: 16 / 9;
	--stage-radius: calc(16px * var(--foliora-corner-scale, 1));
	/* Text on photos is always light on a dark overlay, in both modes. */
	--stage-ink: #fff;
	--stage-scrim: rgb(0 0 0 / 0.42);
	--stage-scrim-side: rgb(0 0 0 / 0.58);

	padding: 32px 0 28px;
	background: var(--foliora-bg);
	overflow: hidden;
}

.foliora-stage__viewport {
	position: relative;
}

/* No JavaScript: a row of slides that scrolls sideways and snaps. */
.foliora-stage__track {
	display: flex;
	gap: var(--stage-gap);
	padding: 0 calc((100% - var(--stage-w)) / 2);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.foliora-stage__slide {
	position: relative;
	flex: 0 0 var(--stage-w);
	aspect-ratio: var(--stage-ratio);
	overflow: hidden;
	border-radius: var(--stage-radius);
	background: var(--foliora-media);
	scroll-snap-align: center;
}

/* With JavaScript: slides sit on top of each other and move with --d. */
.foliora-stage.is-ready .foliora-stage__track {
	display: block;
	position: relative;
	height: calc(var(--stage-w) / (var(--stage-ratio)));
	padding: 0;
	overflow: visible;
}

.foliora-stage.is-ready .foliora-stage__slide {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--stage-w);
	/* Centred (physical left + -50%), then --d slides along the reading
	   direction (--foliora-dir: -1 in RTL puts the next slide on the left). */
	transform: translateX(calc(-50% + var(--d, 0) * var(--foliora-dir, 1) * (var(--stage-w) + var(--stage-gap))));
	transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Further than two steps from the centre (always off-screen): hidden. The
   slides one and two steps out move with a transition, so a story slides
   in from off-screen and out the other side. */
.foliora-stage.is-ready .foliora-stage__slide.is-away {
	visibility: hidden;
}

.foliora-stage.is-ready .foliora-stage__slide.is-jump {
	transition: none;
}

.foliora-stage.is-ready .foliora-stage__slide.is-side {
	cursor: pointer;
}

.foliora-stage__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Overlay: darker on the side slides, which carry no text. */
.foliora-stage__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--stage-scrim);
	transition: background-color 0.6s ease;
	pointer-events: none;
}

.foliora-stage.is-ready .foliora-stage__slide.is-side::after {
	background: var(--stage-scrim-side);
}

.foliora-stage__body {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 48px clamp(24px, 8%, 96px);
	text-align: center;
	color: var(--stage-ink);
	transition: opacity 0.45s ease;
}

.foliora-stage.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	opacity: 0;
}

/* Before hero.js places the slides (it runs once the page is drawn): with
   JavaScript on, the slides after the first already look like side slides
   (no text, the side shade), so text never shows on a side slide and then
   fades away. Without JavaScript the row keeps every slide's text (it is
   the slider then). "Side by side" and "Carousel" show several stories at
   once and are left as they are. */
.foliora-js .foliora-stage:not(.is-ready):not(.foliora-stage--pair):not(.foliora-stage--carousel) .foliora-stage__slide:not(:first-child) .foliora-stage__body {
	opacity: 0;
}

.foliora-js .foliora-stage:not(.is-ready):not(.foliora-stage--pair):not(.foliora-stage--carousel) .foliora-stage__slide:not(:first-child)::after {
	background: var(--stage-scrim-side);
}

/* The first placement (hero.js is-placing): nothing animates. */
.foliora-stage.is-placing .foliora-stage__slide,
.foliora-stage.is-placing .foliora-stage__slide::after,
.foliora-stage.is-placing .foliora-stage__body {
	transition: none !important;
}

.foliora-stage__title {
	max-width: 18em;
	margin: 2px 0 0;
	font-size: calc(40px * var(--foliora-heading-scale, 1));
	line-height: 1.15;
	font-weight: var(--foliora-heading-weight, 700);
	letter-spacing: -0.01em;
	color: var(--stage-ink);
	text-wrap: balance;
	text-shadow: 0 1px 12px rgb(0 0 0 / 0.25);
}

.foliora-stage .foliora-stage__title a {
	color: inherit;
	background-image: none;
	padding-bottom: 0;
}

.foliora-stage__excerpt {
	max-width: 36em;
	margin: 0;
	font-size: calc(17px * var(--foliora-text-scale, 1));
	line-height: calc(1.55 + var(--foliora-leading-adjust, 0));
	font-weight: 400;
	color: rgb(255 255 255 / 0.9);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.foliora-stage .foliora-stage__cta {
	display: inline-flex;
	align-items: center;
	height: 44px;
	margin-top: 8px;
	padding: 0 24px;
	border: 1px solid rgb(255 255 255 / 0.75);
	border-radius: var(--foliora-btn-radius, 999px);
	background: rgb(0 0 0 / 0.12);
	color: var(--stage-ink);
	font-family: var(--foliora-font-heading);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.foliora-stage .foliora-stage__cta:hover {
	border-color: #fff;
	background: #fff;
	color: #14151a;
}

.foliora-stage :focus-visible {
	outline-color: #fff;
}

/* Arrows: on the peeking slides, next to the centre slide's edges. */
.foliora-stage__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 0.7);
	border-radius: 999px;
	background: rgb(0 0 0 / 0.28);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.foliora-stage__arrow:hover {
	background: #fff;
	color: #14151a;
}

.foliora-stage__arrow--prev {
	inset-inline-start: calc(50% - var(--stage-w) / 2 - var(--stage-gap) - 64px);
}

.foliora-stage__arrow--next {
	inset-inline-end: calc(50% - var(--stage-w) / 2 - var(--stage-gap) - 64px);
}

/* Under the slider: pause/play and one dot per story (the current one is
   a longer bar that fills while the story shows). */
.foliora-stage__bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 18px;
}

.foliora-stage__bar[hidden] {
	display: none;
}

.foliora-stage__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--foliora-line-strong);
	border-radius: 999px;
	background: var(--foliora-bg);
	color: var(--foliora-text);
	cursor: pointer;
	position: relative;
}

/* 44px tap area without a bigger button. */
.foliora-stage__toggle::after {
	content: "";
	position: absolute;
	inset: -6px;
}

.foliora-stage__toggle:hover {
	border-color: var(--foliora-text);
}

.foliora-stage__icon-play,
.foliora-stage.is-paused .foliora-stage__icon-pause {
	display: none;
}

.foliora-stage.is-paused .foliora-stage__icon-play {
	display: block;
}

.foliora-stage__dots {
	display: flex;
	align-items: center;
}

.foliora-stage__dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.foliora-stage__dot span {
	position: relative;
	display: block;
	width: 8px;
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--foliora-line-strong);
	transition: width 0.3s ease, background-color 0.3s ease;
}

.foliora-stage__dot:hover span {
	background: var(--foliora-muted);
}

.foliora-stage__dot.is-active {
	width: 40px;
}

.foliora-stage__dot.is-active span {
	width: 28px;
	background: color-mix(in srgb, var(--foliora-text) 22%, var(--foliora-bg));
}

.foliora-stage__dot.is-active span::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--foliora-text);
}

.foliora-stage.is-playing .foliora-stage__dot.is-active span::after {
	transform-origin: var(--foliora-start, left) center;
	animation: foliora-stage-fill var(--stage-delay, 6000ms) linear both;
}

.foliora-stage.is-holding .foliora-stage__dot.is-active span::after {
	animation-play-state: paused;
}

@keyframes foliora-stage-fill {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* Laptops and tablets: a wider centre slide, narrower peeks. */
@media (max-width: 1199px) {
	.foliora-hero.foliora-stage {
		--stage-peeks: 160px;
	}

	.foliora-stage__title {
		font-size: calc(34px * var(--foliora-heading-scale, 1));
	}
}

@media (max-width: 991px) {
	.foliora-hero.foliora-stage {
		--stage-gap: 12px;
	}

	.foliora-stage__arrow--prev {
		inset-inline-start: 10px;
	}

	.foliora-stage__arrow--next {
		inset-inline-end: 10px;
	}
}

/* Phones: a taller slide so the text has room, a thin peek of the
   neighbours (a cue to swipe), and no arrows over the photo. */
@media (max-width: 767px) {
	.foliora-hero.foliora-stage {
		--stage-max: 100vw;
		--stage-peeks: 48px;
		--stage-room: 160px;
		--stage-min: 260px;
		--stage-gap: 8px;
		--stage-ratio: 4 / 5;

		padding: 20px 0 16px;
	}

	.foliora-stage__arrow {
		display: none;
	}

	.foliora-stage__body {
		justify-content: flex-end;
		gap: 12px;
		padding: 28px 22px;
	}

	/* Text sits low on phones, so the overlay darkens towards the bottom. */
	.foliora-stage__slide::after {
		background: linear-gradient(to top, rgb(0 0 0 / 0.72) 0%, rgb(0 0 0 / 0.38) 55%, rgb(0 0 0 / 0.18) 100%);
	}

	.foliora-stage__title {
		font-size: calc(26px * var(--foliora-heading-scale, 1));
		line-height: 1.2;
	}

	.foliora-stage__excerpt {
		font-size: calc(15px * var(--foliora-text-scale, 1));
	}

	.foliora-stage .foliora-stage__cta {
		height: 44px;
		margin-top: 4px;
	}
}

/* ---------- "Gallery strip" (hero-strip.php): Centre stage with the side
   photos in full colour, hairline gaps, a 3:2 centre story and the text at
   its bottom left (button on the right, level with the excerpt). The bottom
   shade is stronger than the reference's so white text stays readable on
   bright photos. ---------- */
.foliora-hero.foliora-stage--strip {
	--stage-max: 780px;
	--stage-gap: 4px;
	--stage-ratio: 3 / 2;
	--stage-radius: calc(6px * var(--foliora-corner-scale, 1));
	--stage-scrim: linear-gradient(to top, rgb(0 0 0 / 0.78) 0%, rgb(0 0 0 / 0.45) 32%, rgb(0 0 0 / 0) 62%);
	--stage-scrim-side: rgb(0 0 0 / 0.06);
}

.foliora-stage--strip .foliora-stage__slide::after {
	background: var(--stage-scrim);
}

.foliora-stage--strip.is-ready .foliora-stage__slide.is-side::after {
	background: var(--stage-scrim-side);
}

.foliora-stage--strip .foliora-stage__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "cat ." "title cta" "excerpt cta";
	align-content: end;
	justify-items: start;
	align-items: end;
	gap: 10px 32px;
	padding: 32px;
	text-align: start;
}

.foliora-stage--strip .foliora-stage__body > .foliora-pill {
	grid-area: cat;
}

.foliora-stage--strip .foliora-stage__title {
	grid-area: title;
	max-width: 22em;
	margin: 0;
	font-size: calc(28px * var(--foliora-heading-scale, 1));
	line-height: 1.2;
	text-wrap: balance;
}

.foliora-stage--strip .foliora-stage__excerpt {
	grid-area: excerpt;
	max-width: 40em;
	font-size: calc(16px * var(--foliora-text-scale, 1));
	-webkit-line-clamp: 1;
}

.foliora-stage--strip .foliora-stage__cta {
	grid-area: cta;
	align-self: end;
	margin: 0;
}

@media (max-width: 1199px) {

	.foliora-stage--strip .foliora-stage__title {
		font-size: calc(26px * var(--foliora-heading-scale, 1));
	}
}

@media (max-width: 991px) {
	/* Portrait tablets: a wider shape, so the slider isn't half the screen. */
	.foliora-hero.foliora-stage--strip {
		--stage-gap: 4px;
		--stage-ratio: 16 / 9;
	}
}

/* Phones: one column, the button under the excerpt. */
@media (max-width: 767px) {
	.foliora-hero.foliora-stage--strip {
		--stage-gap: 4px;
		--stage-ratio: 4 / 5;
		--stage-scrim: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.45) 45%, rgb(0 0 0 / 0) 75%);
	}

	.foliora-stage--strip .foliora-stage__body {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "cat" "title" "excerpt" "cta";
		gap: 10px;
		padding: 22px;
	}

	.foliora-stage--strip .foliora-stage__title {
		font-size: calc(24px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage--strip .foliora-stage__excerpt {
		font-size: calc(15px * var(--foliora-text-scale, 1));
		-webkit-line-clamp: 2;
	}

	.foliora-stage--strip .foliora-stage__cta {
		margin-top: 4px;
	}
}

/* ---------- "Framed card" (hero-card.php): one story at a time in a frame
   as wide as the content (inside .container, so its edges are the page's),
   fading from one to the next. Category, title and date sit on a card in
   the page colour (dark in dark mode). The frame is at most the screen
   height minus --stage-room. ---------- */
.foliora-hero.foliora-stage--card {
	--stage-radius: calc(8px * var(--foliora-corner-scale, 1));
	--stage-scrim: rgb(0 0 0 / 0.16);
}

.foliora-stage--card .foliora-stage__viewport {
	overflow: hidden;
	border-radius: var(--stage-radius);
}

/* No JavaScript: full-width slides that scroll and snap (both fading
   styles: Framed card and Full-bleed). */
.foliora-stage--fade .foliora-stage__track {
	gap: 0;
	padding: 0;
}

.foliora-stage--fade .foliora-stage__slide {
	flex-basis: 100%;
	width: 100%;
	max-height: max(calc(100vh - var(--stage-room)), 220px);
	border-radius: 0;
}

/* With JavaScript: the slides lie on top of each other and fade. The
   frame's height: Framed card from its shape (capped by the screen),
   Full-bleed its own (below). */
.foliora-stage--card.is-ready .foliora-stage__track {
	/* Full width; the height cap then shortens the frame instead of
	   narrowing it to keep the shape. */
	width: 100%;
	height: auto;
	aspect-ratio: var(--stage-ratio);
	max-height: max(calc(100vh - var(--stage-room)), 220px);
}

.foliora-stage--fade.is-ready .foliora-stage__slide {
	inset-inline-start: 0;
	width: 100%;
	height: 100%;
	max-height: none;
	aspect-ratio: auto;
	transform: none;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.6s ease;
}

.foliora-stage--fade.is-ready .foliora-stage__slide.is-current {
	z-index: 1;
	opacity: 1;
	pointer-events: auto;
}

.foliora-stage--fade.is-ready .foliora-stage__slide.is-side {
	cursor: default;
}

.foliora-stage--card .foliora-stage__slide::after,
.foliora-stage--card.is-ready .foliora-stage__slide.is-side::after {
	background: var(--stage-scrim);
}

.foliora-stage--card .foliora-stage__body,
.foliora-stage--card.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	padding: 32px;
	opacity: 1;
}

.foliora-stage__card {
	width: min(600px, 100%);
	padding: 34px 48px 30px;
	border-radius: calc(4px * var(--foliora-corner-scale, 1));
	background: color-mix(in srgb, var(--foliora-bg) 94%, transparent);
	color: var(--foliora-text);
	text-align: center;
}

.foliora-stage__kicker {
	margin: 0 0 14px;
	font-size: 13px;
	font-style: italic;
	color: var(--foliora-muted);
}

.foliora-stage .foliora-stage__cat {
	margin-inline-start: 2px;
	font-family: var(--foliora-font-heading);
	font-size: 12px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	background-image: none;
	padding-bottom: 0;
}

/* Small category links: an invisible strip above and below makes the
   tap area at least 24px tall without changing how the link looks. */
.foliora-stage .foliora-stage__cat,
.foliora-stage .foliora-stage__label {
	position: relative;
}

.foliora-stage .foliora-stage__cat::after,
.foliora-stage .foliora-stage__label::after {
	content: "";
	position: absolute;
	inset: -6px 0;
}

.foliora-stage__cat--1 { color: var(--foliora-cat-1); }
.foliora-stage__cat--2 { color: var(--foliora-cat-2); }
.foliora-stage__cat--3 { color: var(--foliora-cat-3); }
.foliora-stage__cat--4 { color: var(--foliora-cat-4); }
.foliora-stage__cat--5 { color: var(--foliora-cat-5); }
.foliora-stage__cat--6 { color: var(--foliora-cat-6); }
.foliora-stage__cat--7 { color: var(--foliora-cat-7); }
.foliora-stage__cat--8 { color: var(--foliora-cat-8); }
.foliora-stage__cat--9 { color: var(--foliora-cat-9); }
.foliora-stage__cat--10 { color: var(--foliora-cat-10); }

/* Category colours are made for light backgrounds; on the dark card the
   name takes the text colour. */
.foliora-dark .foliora-stage .foliora-stage__cat {
	color: var(--foliora-text);
}

.foliora-stage--card .foliora-stage__title {
	max-width: none;
	font-size: calc(34px * var(--foliora-heading-scale, 1));
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--foliora-text);
	text-shadow: none;
}

.foliora-stage__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 10px;
	margin: 16px 0 0;
	font-family: var(--foliora-font-heading);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--foliora-muted);
}

.foliora-stage--card :focus-visible {
	outline-color: var(--foliora-link);
}

.foliora-stage--card .foliora-stage__arrow:focus-visible {
	outline-color: #fff;
}

/* Arrows inside the frame. */
.foliora-stage--card .foliora-stage__arrow--prev {
	inset-inline-start: 20px;
}

.foliora-stage--card .foliora-stage__arrow--next {
	inset-inline-end: 20px;
}

@media (max-width: 991px) {
	.foliora-stage__card {
		width: min(520px, 100%);
		padding: 28px 32px 24px;
	}

	.foliora-stage--card .foliora-stage__title {
		font-size: calc(28px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage--card .foliora-stage__arrow--prev {
		inset-inline-start: 12px;
	}

	.foliora-stage--card .foliora-stage__arrow--next {
		inset-inline-end: 12px;
	}
}

/* Phones: a taller frame with the card near the bottom. */
@media (max-width: 767px) {
	.foliora-stage--card .foliora-stage__body,
	.foliora-stage--card.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		justify-content: flex-end;
		padding: 16px;
	}

	.foliora-stage--card .foliora-stage__slide::after,
	.foliora-stage--card.is-ready .foliora-stage__slide.is-side::after {
		background: var(--stage-scrim);
	}

	.foliora-stage__card {
		padding: 20px 20px 18px;
	}

	.foliora-stage__kicker {
		margin-bottom: 10px;
	}

	.foliora-stage--card .foliora-stage__title {
		font-size: calc(22px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage__meta {
		margin-top: 12px;
		font-size: 11px;
	}
}

@media (max-height: 560px) {
	.foliora-stage__card {
		padding: 16px 24px 14px;
	}

	.foliora-stage__kicker {
		margin-bottom: 6px;
	}

	.foliora-stage--card .foliora-stage__title {
		font-size: calc(22px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage__meta {
		margin-top: 8px;
	}
}

/* ---------- "Full-bleed" (hero-bold.php): one story at a time across the
   whole width, fading (shared --fade rules above), with its category, a
   large title and the author in the middle, and a strip of photo buttons
   overlapping the bottom edge (the pause button sits in the strip). The
   height follows the screen: never more than 680px or the screen minus
   --stage-room. ---------- */
.foliora-hero:is(.foliora-stage--bold, .foliora-stage--large) {
	--stage-h: clamp(380px, calc(100vh - var(--stage-room)), 680px);
	--stage-scrim: linear-gradient(to bottom, rgb(0 0 0 / 0.34), rgb(0 0 0 / 0.42) 60%, rgb(0 0 0 / 0.55));

	padding: 0 0 28px;
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__slide {
	height: var(--stage-h);
	aspect-ratio: auto;
	border-radius: 0;
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large).is-ready .foliora-stage__track {
	width: 100%;
	height: var(--stage-h);
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__slide::after,
.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large).is-ready .foliora-stage__slide.is-side::after {
	background: var(--stage-scrim);
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__body,
.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large).is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	gap: 16px;
	padding: 48px 48px 96px; /* Room for the photo strip at the bottom. */
	opacity: 1;
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__title {
	max-width: 16em;
	font-size: calc(52px * var(--foliora-heading-scale, 1));
	line-height: 1.1;
}

.foliora-stage__byline {
	margin: 2px 0 0;
	font-family: var(--foliora-font-heading);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgb(255 255 255 / 0.88);
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__arrow--prev {
	inset-inline-start: 24px;
}

.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__arrow--next {
	inset-inline-end: 24px;
}

/* The strip: page colour (dark in dark mode), overlapping the photo. */
.foliora-stage__bar--thumbs {
	position: relative;
	z-index: 3;
	width: fit-content;
	max-width: calc(100% - 32px);
	margin: -62px auto 0;
	padding: 8px;
	gap: 8px;
	border-radius: calc(6px * var(--foliora-corner-scale, 1));
	background: var(--foliora-bg);
	box-shadow: 0 10px 30px -14px rgb(0 0 0 / 0.35);
}

.foliora-stage__bar--thumbs .foliora-stage__toggle {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: 0 4px;
}

.foliora-stage__thumbs {
	display: flex;
	gap: 8px;
	min-width: 0;
}

.foliora-stage__thumb {
	position: relative;
	flex: 0 1 136px;
	min-width: 0;
	aspect-ratio: 3 / 2;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: calc(3px * var(--foliora-corner-scale, 1));
	background: var(--foliora-media);
	cursor: pointer;
}

.foliora-stage__thumb-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.55;
	transition: opacity 0.3s ease;
}

.foliora-stage__thumb:hover .foliora-stage__thumb-image,
.foliora-stage__thumb.is-active .foliora-stage__thumb-image {
	opacity: 1;
}

/* Under the shown story's photo: a bar that fills while it shows. */
.foliora-stage__thumb-bar {
	position: absolute;
	inset-inline-end: 0;
	bottom: 0;
	inset-inline-start: 0;
	z-index: 1;
	height: 3px;
	background: transparent;
}

.foliora-stage__thumb.is-active .foliora-stage__thumb-bar {
	background: rgb(255 255 255 / 0.45);
}

.foliora-stage__thumb.is-active .foliora-stage__thumb-bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--foliora-accent);
}

.foliora-dark .foliora-stage__thumb.is-active .foliora-stage__thumb-bar::after {
	background: var(--foliora-text);
}

.foliora-stage.is-playing .foliora-stage__thumb.is-active .foliora-stage__thumb-bar::after {
	transform-origin: var(--foliora-start, left) center;
	animation: foliora-stage-fill var(--stage-delay, 6000ms) linear both;
}

.foliora-stage.is-holding .foliora-stage__thumb.is-active .foliora-stage__thumb-bar::after {
	animation-play-state: paused;
}

.foliora-stage__thumb:focus-visible {
	outline: 2px solid var(--foliora-link);
	outline-offset: 2px;
}

@media (max-width: 991px) {
	/* Tablets: height from the width too, so a tall portrait screen
	   doesn't get a tall slider. */
	.foliora-hero:is(.foliora-stage--bold, .foliora-stage--large) {
		--stage-h: clamp(360px, min(56vw, calc(100vh - var(--stage-room))), 560px);
	}

	.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__title {
		font-size: calc(40px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__arrow--prev {
		inset-inline-start: 12px;
	}

	.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__arrow--next {
		inset-inline-end: 12px;
	}
}

/* Phones: a taller photo (but never more than the screen allows), smaller
   photo buttons that share the width. */
@media (max-width: 767px) {
	.foliora-hero:is(.foliora-stage--bold, .foliora-stage--large) {
		--stage-h: clamp(340px, min(125vw, calc(100vh - var(--stage-room))), 560px);

		padding-bottom: 20px;
	}

	.foliora-stage--bold .foliora-stage__body,
	.foliora-stage--bold.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		justify-content: center;
		gap: 12px;
		padding: 32px 20px 72px;
	}

	.foliora-stage--bold .foliora-stage__slide::after,
	.foliora-stage--bold.is-ready .foliora-stage__slide.is-side::after {
		background: var(--stage-scrim);
	}

	.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__title {
		font-size: calc(30px * var(--foliora-heading-scale, 1));
		line-height: 1.15;
	}

	.foliora-stage__bar--thumbs {
		width: calc(100% - 32px);
		margin-top: -44px;
		padding: 6px;
		gap: 6px;
	}

	.foliora-stage__bar--thumbs .foliora-stage__toggle {
		width: 36px;
		height: 36px;
		margin: 0 2px;
	}

	.foliora-stage__thumbs {
		flex: 1 1 auto;
		gap: 6px;
	}

	.foliora-stage__thumb {
		flex: 1 1 0;
	}
}

@media (max-height: 560px) {
	/* Short screens (phones held sideways): within the screen. */
	.foliora-hero:is(.foliora-stage--bold, .foliora-stage--large) {
		--stage-h: max(220px, calc(100vh - 110px));
	}

	.foliora-stage:is(.foliora-stage--bold, .foliora-stage--large) .foliora-stage__title {
		font-size: calc(26px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage--bold .foliora-stage__body,
	.foliora-stage--bold.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		padding-bottom: 64px;
	}
}

/* ---------- "Large cover" (hero-large.php): the Full-bleed frame and
   sizes (shared rules above), without the photo strip: category as plain
   capitals, the title, a short line and an outlined "Continue reading".
   The normal pause/dots row sits under the photo. ---------- */
.foliora-hero.foliora-stage--large {
	--stage-scrim: rgb(0 0 0 / 0.42);
}

.foliora-stage.foliora-stage--large .foliora-stage__body,
.foliora-stage.foliora-stage--large.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	gap: 0;
	padding: 48px;
}

.foliora-stage .foliora-stage__label {
	margin-bottom: 18px;
	font-family: var(--foliora-font-heading);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #fff;
	background-image: none;
	padding-bottom: 0;
}

.foliora-stage__rule {
	display: block;
	width: 32px;
	height: 2px;
	margin: 26px 0 30px;
	background: rgb(255 255 255 / 0.85);
}

.foliora-stage--large .foliora-stage__cta {
	margin: 0;
	border-width: 2px;
	letter-spacing: 0.14em;
}

@media (max-width: 767px) {
	.foliora-stage.foliora-stage--large .foliora-stage__body,
	.foliora-stage.foliora-stage--large.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		justify-content: center;
		padding: 32px 20px;
	}

	.foliora-stage .foliora-stage__label {
		margin-bottom: 12px;
	}

	.foliora-stage__rule {
		margin: 18px 0 22px;
	}
}

@media (max-height: 560px) {
	.foliora-stage.foliora-stage--large .foliora-stage__body,
	.foliora-stage.foliora-stage--large.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		padding: 20px;
	}

	.foliora-stage__rule {
		margin: 12px 0 14px;
	}
}

/* ---------- "Side by side" (hero-pair.php): two stories next to each
   other across the whole width (one below 992px), a hairline apart, each
   with a card of category, title and date in the middle of its photo. The
   row slides one story at a time; hero.js reads --stage-visible to know
   how many are in view. The whole photo opens the story. Height comes
   from the shape (--pair-ratio per story), capped by the screen. ---------- */
.foliora-hero.foliora-stage--pair {
	--stage-visible: 2;
	--stage-gap: 3px;
	--pair-ratio: 16 / 9;
	--stage-room: 300px;
	--stage-scrim: rgb(0 0 0 / 0.08);
	--pair-w: calc((100% - (var(--stage-visible) - 1) * var(--stage-gap)) / var(--stage-visible));

	padding: 0 0 28px;
}

/* No JavaScript: a row of stories that scrolls and snaps. */
.foliora-stage--pair .foliora-stage__track {
	padding: 0;
}

.foliora-stage--pair .foliora-stage__slide {
	flex-basis: var(--pair-w);
	aspect-ratio: var(--pair-ratio);
	max-height: max(calc(100vh - var(--stage-room)), 220px);
	border-radius: 0;
	scroll-snap-align: start;
}

/* With JavaScript: the slides lie side by side, --d widths from the left. */
.foliora-stage.foliora-stage--pair.is-ready .foliora-stage__track {
	width: 100%;
	height: auto;
	aspect-ratio: calc(var(--stage-visible) * (var(--pair-ratio)));
	max-height: max(calc(100vh - var(--stage-room)), 220px);
}

.foliora-stage.foliora-stage--pair.is-ready .foliora-stage__slide {
	inset-inline-start: 0;
	width: var(--pair-w);
	height: 100%;
	max-height: none;
	aspect-ratio: auto;
	transform: translateX(calc(var(--d, 0) * var(--foliora-dir, 1) * (100% + var(--stage-gap))));
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.foliora-stage.foliora-stage--pair.is-ready .foliora-stage__slide.is-jump {
	transition: none;
}

.foliora-stage--pair .foliora-stage__slide::after,
.foliora-stage--pair.is-ready .foliora-stage__slide.is-side::after {
	background: var(--stage-scrim);
}

.foliora-stage--pair .foliora-stage__image {
	transition: transform 0.6s ease;
}

.foliora-stage--pair .foliora-stage__slide:hover .foliora-stage__image {
	transform: scale(1.04);
}

.foliora-stage--pair .foliora-stage__body,
.foliora-stage--pair.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	gap: 0;
	padding: 24px;
	opacity: 1;
}

.foliora-stage--pair .foliora-stage__card {
	width: min(400px, 100%);
	padding: 24px 28px 22px;
	background: var(--foliora-bg); /* Solid: a small card stays crisp on bright photos. */
}

/* The category link sits above the stretched story link. */
.foliora-stage--pair .foliora-stage__cat {
	position: relative;
	z-index: 1;
	display: inline-block;
	margin: 0;
}

.foliora-stage--pair .foliora-stage__title {
	max-width: none;
	margin: 10px 0 0;
	font-size: calc(22px * var(--foliora-heading-scale, 1));
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.005em;
	color: var(--foliora-text);
	text-shadow: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* The story link covers the whole photo. */
.foliora-stage--pair .foliora-stage__link::before {
	content: "";
	position: absolute;
	inset: 0;
}

.foliora-stage--pair .foliora-stage__meta {
	margin-top: 10px;
}

/* On the card the focus ring takes the link colour (white would vanish). */
.foliora-stage--pair .foliora-stage__card :focus-visible {
	outline-color: var(--foliora-link);
}

.foliora-stage--pair .foliora-stage__arrow--prev {
	inset-inline-start: 24px;
}

.foliora-stage--pair .foliora-stage__arrow--next {
	inset-inline-end: 24px;
}

/* One story: the whole width (as on tablets), not half a row. */
.foliora-hero.foliora-stage--pair.foliora-stage--single {
	--stage-visible: 1;
}

/* Laptops: a taller shape, and a card that keeps clear of the arrows. */
@media (max-width: 1199px) {
	.foliora-hero.foliora-stage--pair {
		--pair-ratio: 3 / 2;
	}

	.foliora-stage--pair .foliora-stage__card {
		width: min(340px, calc(100% - 96px));
		padding: 20px 24px 18px;
	}

	.foliora-stage--pair .foliora-stage__title {
		font-size: calc(20px * var(--foliora-heading-scale, 1));
	}
}

/* Tablets: one story at a time. */
@media (max-width: 991px) {
	.foliora-hero.foliora-stage--pair {
		--stage-visible: 1;
		--pair-ratio: 16 / 9;
	}

	.foliora-stage--pair .foliora-stage__card {
		width: min(440px, 100%);
		padding: 24px 28px 22px;
	}

	.foliora-stage--pair .foliora-stage__title {
		font-size: calc(24px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage--pair .foliora-stage__arrow--prev {
		inset-inline-start: 12px;
	}

	.foliora-stage--pair .foliora-stage__arrow--next {
		inset-inline-end: 12px;
	}
}

/* Phones: a taller photo with the card near the bottom. */
@media (max-width: 767px) {
	.foliora-hero.foliora-stage--pair {
		--pair-ratio: 4 / 5;
		--stage-room: 160px;

		padding-bottom: 20px;
	}

	.foliora-stage--pair .foliora-stage__body,
	.foliora-stage--pair.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		justify-content: flex-end;
		padding: 16px;
	}

	.foliora-stage--pair .foliora-stage__slide::after,
	.foliora-stage--pair.is-ready .foliora-stage__slide.is-side::after {
		background: var(--stage-scrim);
	}

	.foliora-stage--pair .foliora-stage__card {
		width: 100%;
		padding: 18px 20px 16px;
	}

	.foliora-stage--pair .foliora-stage__title {
		margin-top: 8px;
		font-size: calc(20px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage--pair .foliora-stage__meta {
		margin-top: 8px;
		font-size: 11px;
	}
}

@media (max-width: 767px) and (orientation: landscape) {
	.foliora-hero.foliora-stage--pair {
		--pair-ratio: 16 / 9;
		--stage-room: 130px;
	}
}

@media (max-height: 560px) {
	.foliora-stage--pair .foliora-stage__body,
	.foliora-stage--pair.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
		justify-content: center;
		padding: 12px;
	}

	.foliora-stage--pair .foliora-stage__card {
		padding: 14px 20px 12px;
	}

	.foliora-stage--pair .foliora-stage__title {
		margin-top: 6px;
		font-size: calc(18px * var(--foliora-heading-scale, 1));
		-webkit-line-clamp: 2;
	}

	.foliora-stage--pair .foliora-stage__meta {
		margin-top: 6px;
	}
}

/* ---------- "Carousel" (hero-carousel.php): square photo tiles in a row as
   wide as the content (inside .container), three on large screens, two on
   tablets, one on phones, with the post grid's 32px gap so they line up
   with the story columns below. Each tile has a thin white frame inside its
   edges and the category pill and title on a dark band at the bottom; the
   whole tile opens the story. The row slides one story at a time.
   ---------- */
.foliora-hero.foliora-stage--carousel {
	--stage-visible: 3;
	--stage-gap: 32px;
	--stage-radius: calc(6px * var(--foliora-corner-scale, 1));
	--tile-w: calc((100% - (var(--stage-visible) - 1) * var(--stage-gap)) / var(--stage-visible));
	--tile-inset: 14px;
	--tile-band: rgb(0 0 0 / 0.6);
	--tile-title: calc(20px * var(--foliora-heading-scale, 1));
	--tile-pad: 20px; /* Band's side padding inside the frame. */

	padding: 40px 0 28px;
}

.foliora-stage--carousel .foliora-stage__viewport {
	/* Clip the tiles waiting off-screen, but leave room for the focus ring. */
	clip-path: inset(-6px);
	container-type: inline-size;
}

/* No JavaScript: a row of tiles that scrolls and snaps. */
.foliora-stage--carousel .foliora-stage__track {
	padding: 0;
}

.foliora-stage--carousel .foliora-stage__slide {
	flex-basis: var(--tile-w);
	aspect-ratio: 1;
	scroll-snap-align: start;
}

/* With JavaScript: tiles side by side, --d tiles from the left. */
.foliora-stage.foliora-stage--carousel.is-ready .foliora-stage__track {
	width: 100%;
	/* As tall as one square tile (100cqw = the row's width). */
	height: calc((100cqw - (var(--stage-visible) - 1) * var(--stage-gap)) / var(--stage-visible));
}

.foliora-stage.foliora-stage--carousel.is-ready .foliora-stage__slide {
	inset-inline-start: 0;
	width: var(--tile-w);
	height: 100%;
	aspect-ratio: auto;
	transform: translateX(calc(var(--d, 0) * var(--foliora-dir, 1) * (100% + var(--stage-gap))));
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.foliora-stage.foliora-stage--carousel.is-ready .foliora-stage__slide.is-jump {
	transition: none;
}

/* One story: its tile in the middle of the row, not alone at the start. */
.foliora-stage--carousel.foliora-stage--single .foliora-stage__track {
	justify-content: center;
}

.foliora-stage.foliora-stage--carousel.foliora-stage--single.is-ready .foliora-stage__slide {
	inset-inline-start: calc((100% - var(--tile-w)) / 2);
}

/* The frame: a hairline inside the tile's edges, over photo and band. */
.foliora-stage--carousel .foliora-stage__slide::after,
.foliora-stage--carousel.is-ready .foliora-stage__slide.is-side::after {
	inset: var(--tile-inset);
	z-index: 2;
	border: 1px solid rgb(255 255 255 / 0.85);
	border-radius: calc(2px * var(--foliora-corner-scale, 1));
	background: none;
}

.foliora-stage--carousel .foliora-stage__image {
	transition: transform 0.6s ease;
}

.foliora-stage--carousel .foliora-stage__slide:hover .foliora-stage__image {
	transform: scale(1.04);
}

.foliora-stage--carousel .foliora-stage__body,
.foliora-stage--carousel.is-ready .foliora-stage__slide.is-side .foliora-stage__body {
	justify-content: flex-end;
	gap: 0;
	padding: 0;
	opacity: 1;
}

/* The band: always dark, so the white title reads on any photo. Every band
   has room for a two-line title (pill on top, title at the bottom), so the
   pills and titles line up across the row. */
.foliora-stage__band {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: calc(var(--tile-inset) + 22px + 28px + 2.6 * var(--tile-title));
	padding: 0 calc(var(--tile-inset) + var(--tile-pad)) calc(var(--tile-inset) + 22px);
	background: var(--tile-band);
	transition: background-color 0.3s ease;
}

.foliora-stage--carousel .foliora-stage__slide:hover .foliora-stage__band {
	background: rgb(0 0 0 / 0.7);
}

/* The pill sits on the band's top edge. */
.foliora-stage .foliora-stage__pill {
	position: relative;
	z-index: 1;
	transform: translateY(-50%);
	background-image: none;
	padding-bottom: 0;
}

.foliora-stage--carousel .foliora-stage__title {
	max-width: none;
	margin: 2px 0 0;
	font-size: var(--tile-title);
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.005em;
	text-shadow: none;
	display: -webkit-box;
	-webkit-line-clamp: 3; /* Room is kept for two; a third only when needed. */
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* The story link covers the whole tile. */
.foliora-stage--carousel .foliora-stage__link::before {
	content: "";
	position: absolute;
	inset: 0;
}

/* Keyboard focus: the whole tile gets the ring (the link covers it). */
.foliora-stage--carousel .foliora-stage__link:focus-visible {
	outline: 0;
}

.foliora-stage--carousel .foliora-stage__slide:has(.foliora-stage__link:focus-visible) {
	outline: 2px solid var(--foliora-link);
	outline-offset: 3px;
}

.foliora-stage--carousel .foliora-stage__arrow--prev {
	inset-inline-start: 28px;
}

.foliora-stage--carousel .foliora-stage__arrow--next {
	inset-inline-end: 28px;
}

@media (max-width: 1399px) {
	.foliora-hero.foliora-stage--carousel {
		--tile-title: calc(18px * var(--foliora-heading-scale, 1));
		--tile-pad: 14px;
	}
}

@media (max-width: 1199px) {
	.foliora-hero.foliora-stage--carousel {
		--stage-gap: 24px;
		--tile-title: calc(17px * var(--foliora-heading-scale, 1));
		--tile-pad: 10px;
	}
}

/* Tablets: two tiles. */
@media (max-width: 991px) {
	.foliora-hero.foliora-stage--carousel {
		--stage-visible: 2;
		--tile-title: calc(17px * var(--foliora-heading-scale, 1));
		--tile-pad: 8px;

		padding-top: 32px;
	}

	.foliora-stage--carousel .foliora-stage__arrow--prev {
		inset-inline-start: 24px;
	}

	.foliora-stage--carousel .foliora-stage__arrow--next {
		inset-inline-end: 24px;
	}
}

/* Phones: one tile. */
@media (max-width: 575px) {
	.foliora-hero.foliora-stage--carousel {
		--stage-visible: 1;
		--tile-inset: 12px;
		--tile-title: calc(19px * var(--foliora-heading-scale, 1));
		--tile-pad: 12px;

		padding: 20px 0 16px;
	}
}

/* Short, wide screens (phones held sideways): three smaller tiles, so a
   tile is never taller than the screen. */
@media (max-height: 560px) and (min-width: 576px) {
	.foliora-hero.foliora-stage--carousel {
		--stage-visible: 3;
		--stage-gap: 16px;
		--tile-inset: 10px;
		--tile-title: calc(15px * var(--foliora-heading-scale, 1));

		padding: 20px 0 16px;
	}

	.foliora-stage--carousel .foliora-stage__band {
		padding: 0 calc(var(--tile-inset) + 10px) calc(var(--tile-inset) + 12px);
		min-height: calc(var(--tile-inset) + 12px + 28px + 2.6 * var(--tile-title));
	}

	.foliora-stage--carousel .foliora-stage__arrow {
		display: none;
	}
}

/* Phones held sideways: a wide slide that fits the short screen. */
@media (max-width: 767px) and (orientation: landscape) {
	.foliora-hero.foliora-stage,
	.foliora-hero.foliora-stage--strip {
		--stage-ratio: 16 / 9;
		--stage-room: 130px;
		--stage-min: 300px;
	}
}

/* Short screens (landscape phones and tablets, small laptop windows): the
   slide is lower, so the text gets smaller and the excerpt steps aside. */
@media (max-height: 560px) {
	.foliora-stage__body,
	.foliora-stage--strip .foliora-stage__body {
		gap: 8px;
		padding: 18px 22px;
	}

	.foliora-stage__title,
	.foliora-stage--strip .foliora-stage__title {
		font-size: calc(22px * var(--foliora-heading-scale, 1));
	}

	.foliora-stage__excerpt,
	.foliora-stage--strip .foliora-stage__excerpt {
		display: none;
	}

	.foliora-stage .foliora-stage__cta {
		height: 40px;
		margin-top: 2px;
	}
}

/* =====================================================================
   Phones and tablets: every slider starts right under the header.
   Side by side, Full-bleed and Large cover already run edge to edge from
   the header; the inset styles (Photo beside text, Centre stage, Gallery
   strip, Framed card, Carousel) left a strip of page above their rounded
   photos, which under a menu bar looked like a mistake. Below 992px they
   now go edge to edge too: no gap above, square corners, the photo across
   the full width (Centre stage and Gallery strip keep a thin gap between
   slides on tablets, where the neighbours still peek in).
   ===================================================================== */
@media (max-width: 991px) {
	.foliora-hero:not(.foliora-stage),
	.foliora-hero.foliora-stage:not(.foliora-stage--pair, .foliora-stage--bold, .foliora-stage--large) {
		padding-top: 0;
	}

	.foliora-hero.foliora-stage:not(.foliora-stage--pair, .foliora-stage--bold, .foliora-stage--large) {
		--stage-radius: 0px;
	}

	/* Photo beside text: the photo bleeds to the screen edges (100vw; the
	   section clips the few pixels a desktop scrollbar would add). */
	.foliora-hero:not(.foliora-stage) {
		overflow-x: clip;
	}

	.foliora-hero:not(.foliora-stage) .foliora-hero__media {
		margin-inline: calc(50% - 50vw);
		border-radius: 0;
	}

	.foliora-hero:not(.foliora-stage) .foliora-hero__media img {
		border-radius: 0;
	}

	/* Framed card and Carousel sit in the page container on wide screens. */
	.foliora-hero.foliora-stage:is(.foliora-stage--card, .foliora-stage--carousel) > .container {
		max-width: none;
		padding-inline: 0;
	}

	.foliora-hero.foliora-stage--carousel {
		--stage-gap: 3px;
	}
}

@media (max-width: 767px) {
	/* One slide across the whole width. */
	.foliora-hero.foliora-stage:not(.foliora-stage--pair, .foliora-stage--bold, .foliora-stage--large, .foliora-stage--carousel) {
		--stage-max: 100vw;
		--stage-peeks: 0px;
		--stage-gap: 0px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.foliora-stage.is-ready .foliora-stage__slide,
	.foliora-stage.foliora-stage--pair.is-ready .foliora-stage__slide,
	.foliora-stage--pair .foliora-stage__image,
	.foliora-stage__body,
	.foliora-stage__slide::after,
	.foliora-stage__dot span {
		transition: none;
	}

	.foliora-stage.is-playing .foliora-stage__dot.is-active span::after {
		animation: none;
	}
	.foliora-stage--pair .foliora-stage__slide:hover .foliora-stage__image,
	.foliora-stage--carousel .foliora-stage__slide:hover .foliora-stage__image {
		transform: none;
	}

	.foliora-stage.foliora-stage--carousel.is-ready .foliora-stage__slide,
	.foliora-stage--carousel .foliora-stage__image,
	.foliora-stage__band {
		transition: none;
	}
}

/* ---------- Right-to-left pages ----------
   The slider's arrows are inline SVGs (not foliora_icon()), so they are
   mirrored here: "next" and "Read story" point left, the way the stories
   move in RTL. The scale property keeps any transform on them working. */
[dir="rtl"] .foliora-hero__cta svg,
[dir="rtl"] .foliora-stage__cta svg,
[dir="rtl"] [data-foliora-hero-prev] svg,
[dir="rtl"] [data-foliora-hero-next] svg,
[dir="rtl"] .foliora-stage__arrow svg {
	scale: -1 1;
}

/* The counter keeps "01 / 03" left to right (direction: ltr above), which
   also makes its own start side the left, so place it on the right here. */
[dir="rtl"] .foliora-hero__counter {
	inset-inline-start: auto;
	inset-inline-end: 24px;
}

/* ---------- Custom slides: text and button in every style ----------
   template-parts/home/hero-extra.php: Framed card, Full-bleed, Side by side
   and Carousel show a custom slide's text and button where posts show
   their date, author or comments (Large cover: the text above its own
   button). On the white cards (Framed card, Side by side) they take the
   card's colours. Where the whole photo is the link (Side by side,
   Carousel) the button is a look-alike chip inside that link. */
.foliora-stage:is(.foliora-stage--card, .foliora-stage--pair) .foliora-stage__excerpt {
	margin: 12px auto 0;
	font-size: calc(15px * var(--foliora-text-scale, 1));
	color: var(--foliora-body);
	text-shadow: none;
}

.foliora-stage:is(.foliora-stage--card, .foliora-stage--pair) .foliora-stage__cta {
	margin-top: 18px;
	border-color: var(--foliora-line-strong);
	background: none;
	color: var(--foliora-text);
}

.foliora-stage:is(.foliora-stage--card, .foliora-stage--pair) .foliora-stage__cta:hover,
.foliora-stage--pair .foliora-stage__slide:hover .foliora-stage__cta--chip {
	border-color: var(--foliora-text);
	background: var(--foliora-text);
	color: var(--foliora-bg);
}

.foliora-stage .foliora-stage__cta--chip {
	height: 36px;
	padding: 0 18px;
	font-size: 12px;
	pointer-events: none;
}

.foliora-stage--carousel .foliora-stage__excerpt {
	margin-top: 6px;
	font-size: calc(14px * var(--foliora-text-scale, 1));
	line-height: 1.45;
}

.foliora-stage--carousel .foliora-stage__cta--chip {
	margin-top: 12px;
}

.foliora-stage--carousel .foliora-stage__slide:hover .foliora-stage__cta--chip {
	border-color: #fff;
	background: #fff;
	color: #14151a;
}

.foliora-stage--large .foliora-stage__excerpt {
	margin-top: 18px;
}
