/**
 * LEOS Portfolio — front-end styles.
 *
 * Token architecture:
 *   1. Internal API tokens (--leos-pf-fg, ...) resolve FIRST from the host
 *      theme's design-system variables (--fg, --surface, ...) and fall back
 *      to this plugin's own literal palette. On Leographer (and any theme
 *      following the Leographer design system) the showcase therefore follows
 *      the site's dark-mode switch with zero JavaScript.
 *   2. Themes without such tokens fall back to the own-* literals, which the
 *      dark rules below flip for html[data-theme="dark"] ancestors and for
 *      prefers-color-scheme: dark.
 *   3. data-scheme="light|dark" on the block pins the palette explicitly.
 */

.leos-pf {
	/* ---- Internal API tokens (the only names used below this block) ---- */
	--leos-pf-fg: var(--fg, var(--leos-pf-own-fg));
	--leos-pf-fg-muted: var(--fg-muted, var(--leos-pf-own-fg-muted));
	--leos-pf-fg-subtle: var(--fg-subtle, var(--leos-pf-own-fg-subtle));
	--leos-pf-surface: var(--surface, var(--leos-pf-own-surface));
	--leos-pf-surface-2: var(--surface-2, var(--leos-pf-own-surface-2));
	--leos-pf-border: var(--border, var(--leos-pf-own-border));
	--leos-pf-border-strong: var(--border-strong, var(--leos-pf-own-border-strong));
	--leos-pf-accent: var(--brand-text, var(--leos-pf-own-accent));
	--leos-pf-brand: var(--brand, var(--leos-pf-own-brand));
	--leos-pf-ring: var(--ring, var(--leos-pf-own-ring));
	--leos-pf-display: var(--font-display, Georgia, "Times New Roman", serif);
	--leos-pf-sans: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
	--leos-pf-ease: var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1));
	--leos-pf-fast: var(--fast, 150ms);
	--leos-pf-base: var(--base, 220ms);

	/* ---- Own literal palette (light) ---- */
	--leos-pf-own-fg: #0c0a09;
	--leos-pf-own-fg-muted: #57534e;
	--leos-pf-own-fg-subtle: #78716c;
	--leos-pf-own-surface: #ffffff;
	--leos-pf-own-surface-2: #f5f5f4;
	--leos-pf-own-border: #e7e5e4;
	--leos-pf-own-border-strong: #d6d3d1;
	--leos-pf-own-accent: #b80523;
	--leos-pf-own-brand: #d80629;
	--leos-pf-own-ring: #d80629;

	/* ---- Own literal palette (dark), referenced by the two dark rules ---- */
	--leos-pf-dark-fg: #fafafa;
	--leos-pf-dark-fg-muted: #a8a29e;
	--leos-pf-dark-fg-subtle: #78716c;
	--leos-pf-dark-surface: #1c1917;
	--leos-pf-dark-surface-2: #292524;
	--leos-pf-dark-border: #292524;
	--leos-pf-dark-border-strong: #44403c;
	--leos-pf-dark-accent: #ff5c70;
	--leos-pf-dark-brand: #d80629;
	--leos-pf-dark-ring: #ff5c70;

	/* ---- Layout + motion knobs (overridden inline per block) ---- */
	--leos-pf-gap: 24px;
	--leos-pf-radius: 12px;
	--leos-pf-cols: 3;
	--leos-pf-cols-md: 2;
	--leos-pf-cols-sm: 1;
	--leos-pf-aspect: 16 / 9;
	--leos-pf-item-aspect: var(--leos-pf-aspect);

	/* ---- Fixed visual constants ---- */
	--leos-pf-scrim: linear-gradient(180deg, rgba(12, 10, 9, 0) 30%, rgba(12, 10, 9, 0.12) 52%, rgba(12, 10, 9, 0.78) 100%);
	--leos-pf-glass: rgba(12, 10, 9, 0.55);
	--leos-pf-shadow: 0 1px 2px rgba(12, 10, 9, 0.05);
	--leos-pf-shadow-hover: 0 20px 44px -26px rgba(12, 10, 9, 0.35), 0 6px 14px -10px rgba(12, 10, 9, 0.14);

	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin-inline: auto;
	color: var(--leos-pf-fg);
	font-family: var(--leos-pf-sans);
	font-size: 16px;
	line-height: 1.5;
	color-scheme: light;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ---- Dark resolution: theme tokens exist → they win; otherwise own literals ---- */

html[data-theme="dark"] .leos-pf {
	color-scheme: dark;
}

html[data-theme="dark"] .leos-pf:not([data-scheme="light"]) {
	--leos-pf-own-fg: var(--leos-pf-dark-fg);
	--leos-pf-own-fg-muted: var(--leos-pf-dark-fg-muted);
	--leos-pf-own-fg-subtle: var(--leos-pf-dark-fg-subtle);
	--leos-pf-own-surface: var(--leos-pf-dark-surface);
	--leos-pf-own-surface-2: var(--leos-pf-dark-surface-2);
	--leos-pf-own-border: var(--leos-pf-dark-border);
	--leos-pf-own-border-strong: var(--leos-pf-dark-border-strong);
	--leos-pf-own-accent: var(--leos-pf-dark-accent);
	--leos-pf-own-brand: var(--leos-pf-dark-brand);
	--leos-pf-own-ring: var(--leos-pf-dark-ring);
}

@media (prefers-color-scheme: dark) {
	.leos-pf[data-scheme="auto"] {
		--leos-pf-own-fg: var(--leos-pf-dark-fg);
		--leos-pf-own-fg-muted: var(--leos-pf-dark-fg-muted);
		--leos-pf-own-fg-subtle: var(--leos-pf-dark-fg-subtle);
		--leos-pf-own-surface: var(--leos-pf-dark-surface);
		--leos-pf-own-surface-2: var(--leos-pf-dark-surface-2);
		--leos-pf-own-border: var(--leos-pf-dark-border);
		--leos-pf-own-border-strong: var(--leos-pf-dark-border-strong);
		--leos-pf-own-accent: var(--leos-pf-dark-accent);
		--leos-pf-own-brand: var(--leos-pf-dark-brand);
		--leos-pf-own-ring: var(--leos-pf-dark-ring);
	}
}

/* ---- Explicit pins ---- */

.leos-pf[data-scheme="light"] {
	--leos-pf-fg: #0c0a09;
	--leos-pf-fg-muted: #57534e;
	--leos-pf-fg-subtle: #78716c;
	--leos-pf-surface: #ffffff;
	--leos-pf-surface-2: #f5f5f4;
	--leos-pf-border: #e7e5e4;
	--leos-pf-border-strong: #d6d3d1;
	--leos-pf-accent: #b80523;
	--leos-pf-brand: #d80629;
	--leos-pf-ring: #d80629;
	color-scheme: light;
}

.leos-pf[data-scheme="dark"] {
	--leos-pf-fg: var(--leos-pf-dark-fg);
	--leos-pf-fg-muted: var(--leos-pf-dark-fg-muted);
	--leos-pf-fg-subtle: var(--leos-pf-dark-fg-subtle);
	--leos-pf-surface: var(--leos-pf-dark-surface);
	--leos-pf-surface-2: var(--leos-pf-dark-surface-2);
	--leos-pf-border: var(--leos-pf-dark-border);
	--leos-pf-border-strong: var(--leos-pf-dark-border-strong);
	--leos-pf-accent: var(--leos-pf-dark-accent);
	--leos-pf-brand: var(--leos-pf-dark-brand);
	--leos-pf-ring: var(--leos-pf-dark-ring);
	color-scheme: dark;
}

/* ---- Scoped resets ---- */

.leos-pf,
.leos-pf *,
.leos-pf *::before,
.leos-pf *::after {
	box-sizing: border-box;
}

.leos-pf [hidden] {
	display: none !important;
}

.leos-pf img,
.leos-pf video {
	max-width: 100%;
}

.leos-pf button,
.leos-pf input {
	font: inherit;
}

.leos-pf a {
	color: inherit;
}

.leos-pf .leos-pf__sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ==========================================================================
   Header
   ========================================================================== */

.leos-pf__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin: 0 0 clamp(20px, 3vw, 32px);
}

.leos-pf__header[data-align="center"] {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.leos-pf__header-copy {
	min-width: 0;
	max-width: 760px;
}

.leos-pf__eyebrow {
	margin: 0 0 10px;
	color: var(--leos-pf-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.18em;
	line-height: 1.4;
	text-transform: uppercase;
}

.leos-pf__heading-row {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 14px;
}

.leos-pf__heading {
	margin: 0;
	color: inherit;
	font-family: var(--leos-pf-display);
	font-size: clamp(28px, 3.2vw, 42px);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.08;
	text-wrap: balance;
}

.leos-pf__heading em {
	font-style: italic;
	color: var(--leos-pf-accent);
}

.leos-pf__count {
	flex: none;
	padding: 4px 10px;
	border: 1px solid var(--leos-pf-border-strong);
	border-radius: 999px;
	color: var(--leos-pf-fg-muted);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
}

.leos-pf__description {
	margin: 12px 0 0;
	max-width: 680px;
	color: var(--leos-pf-fg-muted);
	font-size: 16px;
	line-height: 1.65;
}

/* ==========================================================================
   Filter chips
   ========================================================================== */

.leos-pf__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 var(--leos-pf-gap);
}

.leos-pf__chip {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 14px;
	border: 1px solid var(--leos-pf-border-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--leos-pf-fg-muted);
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition:
		background-color var(--leos-pf-fast) var(--leos-pf-ease),
		border-color var(--leos-pf-fast) var(--leos-pf-ease),
		color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__chip:hover {
	border-color: var(--leos-pf-fg);
	color: var(--leos-pf-fg);
}

.leos-pf__chip.is-active {
	background: var(--leos-pf-fg);
	border-color: var(--leos-pf-fg);
	color: var(--leos-pf-surface);
}

.leos-pf__chip:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 2px;
}

/* ==========================================================================
   Grid + cards
   ========================================================================== */

.leos-pf__grid {
	display: grid;
	grid-template-columns: repeat(var(--leos-pf-cols), minmax(0, 1fr));
	gap: var(--leos-pf-gap);
}

.leos-pf__card {
	position: relative;
	min-width: 0;
	margin: 0;
}

.leos-pf__trigger {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: start;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.leos-pf__trigger:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 4px;
	border-radius: var(--leos-pf-radius);
}

.leos-pf__media {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	/* 0 0 auto (was 1 1 auto): media must keep its declared aspect ratio.
	 * With grow enabled, grid row-stretch let cards with short captions
	 * inflate their media beyond the ratio, so images in one row rendered
	 * at different ratios (seen on /dich-vu/phim-doanh-nghiep/ 4-col grid:
	 * the 1-line SCAVI card was taller than its 2-line-caption siblings).
	 * Height slack now stays in the caption area, media stays uniform. */
	flex: 0 0 auto;
	aspect-ratio: var(--leos-pf-item-aspect, var(--leos-pf-aspect));
	border-radius: var(--leos-pf-radius);
	background: var(--leos-pf-surface-2);
	box-shadow: var(--leos-pf-shadow);
	transform: translateZ(0);
}

/* Scoped under .leos-pf (0,2,0) on purpose: Elementor's global
 * `.elementor img { height: auto }` (0,1,1) otherwise overrides the bare
 * class and collapses posters to intrinsic height inside aspect boxes. */
.leos-pf .leos-pf__img {
	display: block;
	/* Fill the media box from its own coordinate system. A percentage
	 * height does NOT resolve against a parent whose height comes from
	 * aspect-ratio (Chrome treats it as indefinite), so a poster whose
	 * intrinsic ratio differs from the box (hero 1:1 vs 1280x550 banner)
	 * collapsed to auto height and showed grey bands. inset:0 pins the
	 * img to the media's used size — the same mechanism mosaic feature
	 * cards already rely on. Natural-ratio layouts override back to
	 * static/auto below. */
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale var(--leos-pf-base) var(--leos-pf-ease), filter var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf__poster-fallback {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(120% 90% at 20% 10%, rgba(216, 6, 41, 0.16), transparent 55%),
		linear-gradient(150deg, var(--leos-pf-surface-2), var(--leos-pf-border));
}

/* ---- Hover effects (motion uses individual transform properties so hover
        states compose with the reveal/offset transforms) ---- */

.leos-pf[data-hover="zoom"] .leos-pf__trigger:hover .leos-pf__img,
.leos-pf[data-hover="zoom"] .leos-pf__trigger:focus-visible .leos-pf__img {
	scale: 1.05;
}

.leos-pf[data-hover="lift"] .leos-pf__trigger {
	transition: translate var(--leos-pf-base) var(--leos-pf-ease), box-shadow var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf[data-hover="lift"] .leos-pf__trigger:hover {
	translate: 0 -4px;
}

.leos-pf[data-hover="lift"] .leos-pf__trigger:hover .leos-pf__media {
	box-shadow: var(--leos-pf-shadow-hover);
}

.leos-pf[data-hover="dim"] .leos-pf__img {
	transition: filter var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf[data-hover="dim"] .leos-pf__trigger:hover .leos-pf__img,
.leos-pf[data-hover="dim"] .leos-pf__trigger:focus-visible .leos-pf__img {
	filter: brightness(0.55);
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf .leos-pf__img,
	.leos-pf .leos-pf__trigger,
	.leos-pf .leos-pf__caption,
	.leos-pf .leos-pf__cta,
	.leos-pf .leos-pf__play {
		transition: none !important;
	}
}

/* ---- Popup cursor affordance ----
   Items that open the lightbox (the renderer marks them data-leos-pf-item)
   swap the plain link pointer for a small frosted "expand" chip, so visitors
   can read "opens a larger view" before clicking. Same visual language as the
   compare handle chip. Only devices with a real cursor are styled; link cards
   keep the pointer, non-interactive cards keep the default arrow, and the
   editor preview (plain div triggers) is untouched. Browsers that refuse SVG
   cursors (Safari) fall back to the pointer. */
@media (hover: hover) and (pointer: fine) {
	.leos-pf a.leos-pf__trigger[data-leos-pf-item] {
		cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='rgba(255,255,255,0.92)' stroke='rgba(12,10,9,0.3)' stroke-width='1'/%3E%3Cg fill='none' stroke='%231c1917' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 9L9 23'/%3E%3Cpath d='M19.5 9H23v3.5'/%3E%3Cpath d='M9 19.5V23h3.5'/%3E%3C/g%3E%3C/svg%3E") 16 16, pointer;
	}
}

/* ==========================================================================
   Captions
   ========================================================================== */

.leos-pf__caption {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	pointer-events: none;
}

.leos-pf__cat {
	color: var(--leos-pf-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.leos-pf__title {
	color: inherit;
	font-family: var(--leos-pf-display);
	font-size: clamp(19px, 1.7vw, 24px);
	font-weight: 500;
	letter-spacing: -0.015em;
	line-height: 1.2;
	text-wrap: balance;
}

.leos-pf__desc {
	color: var(--leos-pf-fg-muted);
	font-size: 14px;
	line-height: 1.55;
}

.leos-pf__cta {
	display: inline-flex;
	align-items: center;
	/* The caption is a flex column, so a bare inline-flex item is stretched
	   across it — measured 431px for a two-word label. Without fit-content the
	   growing rule would run far past the arrow instead of under the words. */
	width: fit-content;
	gap: 6px;
	margin-top: 3px;
	padding-bottom: 3px;
	color: var(--leos-pf-accent);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	/* 22px = the 6px gap + the 16px arrow measured on the live page, so the
	   growing rule stops before the icon instead of running under it. */
	--leos-pf-cta-rule-offset: 22px;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 1px;
	transition: background-size var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__cta svg {
	transition: translate var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__trigger:hover .leos-pf__cta svg {
	translate: 3px 0;
}

/* A card IS the link. The site's editorial `.site-main a:hover` rule would
   underline every line of text inside the anchor — title and CTA together —
   which reads as noise on a card that already lifts, sharpens its border and
   slides the arrow. The underline is dropped from the card and the link
   affordance moves to the CTA: a 1px accent rule that grows under the label.
   21px = the 6px gap plus the 15px arrow, so the line stops before the icon
   instead of running under it. Specificity (0,3,1) beats the theme rule
   (0,2,1) without !important. */
.leos-pf a.leos-pf__trigger:hover,
.leos-pf a.leos-pf__trigger:focus-visible {
	text-decoration: none;
}

.leos-pf__trigger:hover .leos-pf__cta,
.leos-pf__trigger:focus-visible .leos-pf__cta {
	background-size: calc(100% - var(--leos-pf-cta-rule-offset)) 1px;
}

/* Overlay captions live inside the media box (server markup places them
   there): anchored to the media bottom, clipped by the media radius, and
   the media may stretch to fill a taller grid row. */
.leos-pf[data-caption="overlay"] .leos-pf__caption {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	padding: clamp(14px, 2vw, 22px);
	padding-top: 44px;
	background: var(--leos-pf-scrim);
	color: #ffffff;
}

.leos-pf[data-caption="overlay"] .leos-pf__cat {
	color: #ffc2cb;
}

.leos-pf[data-caption="overlay"] .leos-pf__desc {
	/* The scrim is always dark: muted text must not inherit the light-mode
	   grays, otherwise it sinks into the background. */
	color: rgba(255, 255, 255, 0.82);
}

.leos-pf[data-caption="overlay"] .leos-pf__cta {
	color: #ffffff;
}

.leos-pf[data-caption="overlay"] .leos-pf__cta svg {
	color: #ffffff;
}

/* Below-media captions become an editorial card. */
.leos-pf[data-caption="below"] .leos-pf__caption {
	padding: 14px 4px 0;
}

.leos-pf[data-caption="below"] .leos-pf__cta {
	margin-top: 5px;
}

/* Hover reveal: overlay captions fade in; on touch they stay visible.
   data-hover and data-caption both live on the root element. The sliding
   caption is clipped by the media box itself (it renders inside it).
   Two spellings do the same job: `hover="reveal"` (the original, which also
   means "no media effect") and `caption_reveal="1"`, which layers the fade on
   top of any other hover effect — zoom, lift or dim — instead of forcing a
   choice between them. */
.leos-pf[data-hover="reveal"][data-caption="overlay"] .leos-pf__caption,
.leos-pf[data-hover-reveal="1"][data-caption="overlay"] .leos-pf__caption {
	opacity: 0;
	translate: 0 14px;
	transition: opacity var(--leos-pf-base) var(--leos-pf-ease), translate var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf[data-hover="reveal"][data-caption="overlay"] .leos-pf__trigger:hover .leos-pf__caption,
.leos-pf[data-hover="reveal"][data-caption="overlay"] .leos-pf__trigger:focus-visible .leos-pf__caption,
.leos-pf[data-hover-reveal="1"][data-caption="overlay"] .leos-pf__trigger:hover .leos-pf__caption,
.leos-pf[data-hover-reveal="1"][data-caption="overlay"] .leos-pf__trigger:focus-visible .leos-pf__caption {
	opacity: 1;
	translate: 0 0;
}

@media (hover: none) {
	.leos-pf[data-hover="reveal"][data-caption="overlay"] .leos-pf__caption,
	.leos-pf[data-hover-reveal="1"][data-caption="overlay"] .leos-pf__caption {
		opacity: 1;
		translate: none;
	}
}

.leos-pf[data-caption="none"] .leos-pf__caption {
	display: none;
}

/* ==========================================================================
   Media extras: play button, provider chip, placeholder, inline video
   ========================================================================== */

.leos-pf__play {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 62px;
	height: 62px;
	margin: auto;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background: var(--leos-pf-glass);
	color: #ffffff;
	transition: scale var(--leos-pf-base) var(--leos-pf-ease), background-color var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf__play svg {
	margin-left: 0;
	translate: -2px 0;
}

.leos-pf__trigger:hover .leos-pf__play,
a.leos-pf__play:hover {
	background: var(--leos-pf-brand);
	scale: 1.06;
}

a.leos-pf__play--ext {
	cursor: pointer;
}

a.leos-pf__play--ext:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 4px;
}

.leos-pf__provider {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	padding: 4px 9px;
	border-radius: 999px;
	background: var(--leos-pf-glass);
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.4;
}

.leos-pf__inline-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000000;
}

.leos-pf__placeholder {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(110% 90% at 85% 8%, rgba(216, 6, 41, 0.14), transparent 52%),
		radial-gradient(120% 120% at 10% 100%, rgba(216, 6, 41, 0.08), transparent 46%),
		var(--leos-pf-surface-2);
}

.leos-pf__placeholder::after {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px dashed var(--leos-pf-border-strong);
	border-radius: calc(var(--leos-pf-radius) - 4px);
}

/* ==========================================================================
   Layouts
   ========================================================================== */

/* ---- Mosaic: featured spans ----
   dense backfills holes left by tall/wide cards when the flow allows. */

.leos-pf[data-layout="mosaic"] .leos-pf__grid {
	grid-auto-flow: dense;
}

.leos-pf[data-layout="mosaic"] .leos-pf__card--wide {
	grid-column: span 2;
}

.leos-pf[data-layout="mosaic"] .leos-pf__card--tall {
	grid-row: span 2;
}

.leos-pf[data-layout="mosaic"] .leos-pf__card--feature {
	grid-column: span 2;
	grid-row: span 2;
}

.leos-pf[data-layout="mosaic"] .leos-pf__card--tall .leos-pf__media,
.leos-pf[data-layout="mosaic"] .leos-pf__card--feature .leos-pf__media {
	height: 100%;
	aspect-ratio: auto;
	/* Floor scales with the container width (≈ two 4:3 rows): spanning cards
	   keep their 2-row height and never detach the overlay caption. */
	min-height: max(52cqw, 220px);
}

/* The feature img leaves the flow: its intrinsic size (often larger than the
   displayed box) would otherwise push the spanned grid rows. */
.leos-pf[data-layout="mosaic"] .leos-pf__card--feature .leos-pf__img {
	position: absolute;
	inset: 0;
	height: 100%;
}

@media (max-width: 640px) {
	.leos-pf[data-layout="mosaic"] .leos-pf__card--wide,
	.leos-pf[data-layout="mosaic"] .leos-pf__card--tall,
	.leos-pf[data-layout="mosaic"] .leos-pf__card--feature {
		grid-column: auto;
		grid-row: auto;
	}

	.leos-pf[data-layout="mosaic"] .leos-pf__card--tall .leos-pf__media,
	.leos-pf[data-layout="mosaic"] .leos-pf__card--feature .leos-pf__media {
		height: auto;
		aspect-ratio: var(--leos-pf-item-aspect, var(--leos-pf-aspect));
	}
}

/* ---- Editorial: 12-column magazine rhythm (7-item cycle) ---- */

.leos-pf[data-layout="editorial"] .leos-pf__grid {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-flow: dense;
	align-items: start;
}

.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 1) {
	grid-column: span 7;
}

.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 2) {
	grid-column: span 5;
}

.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 3),
.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 4),
.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 5) {
	grid-column: span 4;
}

.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n + 6),
.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(7n) {
	grid-column: span 6;
}

/* Editorial keeps each photo's own ratio: forcing 4:5 here cropped landscape
   images and left empty bands under them. Width comes from the 12-col span,
   height from the image, so the magazine rhythm never fights the picture. */
.leos-pf[data-layout="editorial"] .leos-pf__media {
	flex: 0 0 auto;
	aspect-ratio: auto;
	height: auto;
}

.leos-pf[data-layout="editorial"] .leos-pf__img {
	position: static;
	height: auto;
}

.leos-pf[data-layout="editorial"] .leos-pf__media--video,
.leos-pf[data-layout="editorial"] .leos-pf__media--placeholder {
	aspect-ratio: var(--leos-pf-item-aspect, var(--leos-pf-aspect));
}

/* Wide pairs with the 5-column slot of the cycle (7 + 5 = 12). */
.leos-pf[data-layout="editorial"] .leos-pf__card--wide {
	grid-column: span 7;
}

.leos-pf[data-layout="editorial"] .leos-pf__card--feature {
	grid-column: span 12;
}

@media (max-width: 768px) {
	.leos-pf[data-layout="editorial"] .leos-pf__card:nth-child(n) {
		grid-column: 1 / -1;
	}
}

/* ---- Masonry: CSS columns with intrinsic image ratios ---- */

.leos-pf[data-layout="masonry"] .leos-pf__grid {
	display: block;
	columns: var(--leos-pf-cols);
	column-gap: var(--leos-pf-gap);
}

.leos-pf[data-layout="masonry"] .leos-pf__card {
	display: block;
	break-inside: avoid;
	margin-bottom: var(--leos-pf-gap);
}

.leos-pf[data-layout="masonry"] .leos-pf__media {
	aspect-ratio: auto;
	height: auto;
	min-height: 0;
}

.leos-pf[data-layout="masonry"] .leos-pf__img {
	position: static;
	height: auto;
}

.leos-pf[data-layout="masonry"] .leos-pf__media--video,
.leos-pf[data-layout="masonry"] .leos-pf__media--placeholder {
	aspect-ratio: var(--leos-pf-item-aspect, var(--leos-pf-aspect));
	height: auto;
}

@media (max-width: 1024px) {
	.leos-pf[data-layout="masonry"] .leos-pf__grid {
		columns: var(--leos-pf-cols-md);
	}
}

@media (max-width: 640px) {
	.leos-pf[data-layout="masonry"] .leos-pf__grid {
		columns: var(--leos-pf-cols-sm);
	}
}

/* ---- Filmstrip + Center focus: horizontal scroll with snap ---- */

.leos-pf[data-layout="filmstrip"] .leos-pf__strip,
.leos-pf[data-layout="focus"] .leos-pf__strip {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--leos-pf-cols) - 1) * var(--leos-pf-gap)) / var(--leos-pf-cols));
	gap: var(--leos-pf-gap);
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.leos-pf[data-layout="filmstrip"] .leos-pf__strip::-webkit-scrollbar,
.leos-pf[data-layout="focus"] .leos-pf__strip::-webkit-scrollbar {
	display: none;
}

/* Progress line replacing the native scrollbar: brand-coloured fill,
   position and length driven by JS on scroll. */
.leos-pf__progress {
	position: relative;
	height: 2px;
	margin-top: 14px;
	border-radius: 999px;
	background: var(--leos-pf-border);
	overflow: hidden;
}

.leos-pf__progress[hidden] {
	display: none;
}

.leos-pf__progress-fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 30%;
	border-radius: 999px;
	background: var(--leos-pf-brand);
}

.leos-pf[data-layout="filmstrip"] .leos-pf__card {
	scroll-snap-align: start;
}

/* Center focus: each card is 72% of the container with equal side padding,
   so the first card already sits in the middle at scroll 0 and every card
   can be snap-centred while the neighbours peek in. */
.leos-pf[data-layout="focus"] .leos-pf__strip {
	padding-inline: 14%;
	grid-auto-columns: 100%;
}

.leos-pf[data-layout="filmstrip"] .leos-pf__nav,
.leos-pf[data-layout="focus"] .leos-pf__nav {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

.leos-pf__nav-btn {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--leos-pf-border-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--leos-pf-fg);
	cursor: pointer;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease), border-color var(--leos-pf-fast) var(--leos-pf-ease), opacity var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__nav-btn:hover {
	background: var(--leos-pf-surface-2);
}

.leos-pf__nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.leos-pf__nav-btn:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.leos-pf[data-layout="filmstrip"] .leos-pf__strip {
		grid-auto-columns: calc((100% - (var(--leos-pf-cols-md) - 1) * var(--leos-pf-gap)) / var(--leos-pf-cols-md));
	}
}

@media (max-width: 640px) {
	.leos-pf[data-layout="filmstrip"] .leos-pf__strip {
		grid-auto-columns: calc((100% - (var(--leos-pf-cols-sm) - 1) * var(--leos-pf-gap)) / var(--leos-pf-cols-sm));
	}
}

/* ---- Spotlight: hero first card ---- */

.leos-pf[data-layout="spotlight"] .leos-pf__card:first-child {
	grid-column: 1 / -1;
}

.leos-pf[data-layout="spotlight"] .leos-pf__card:first-child .leos-pf__media {
	aspect-ratio: 21 / 9;
}

.leos-pf[data-layout="spotlight"] .leos-pf__card:first-child .leos-pf__title {
	font-size: clamp(22px, 2.4vw, 32px);
}

@media (max-width: 768px) {
	.leos-pf[data-layout="spotlight"] .leos-pf__card:first-child .leos-pf__media {
		aspect-ratio: 16 / 9;
	}
}

/* ---- Offset: staggered vertical rhythm ----
   Whole even columns shift down (class from the renderer), so a column's
   cards move together and can never overlap. Desktop only: below 1024px the
   grid reflows to fewer columns than the class pattern assumes. */

.leos-pf[data-layout="offset"] .leos-pf__grid {
	padding-bottom: clamp(24px, 4vw, 56px);
}

.leos-pf[data-layout="offset"] .leos-pf__card--alt {
	transform: translateY(clamp(24px, 4vw, 56px));
}

@media (max-width: 1024px) {
	.leos-pf[data-layout="offset"] .leos-pf__card--alt {
		transform: none;
	}
}

/* ---- Responsive columns for grid-based layouts ---- */

@media (max-width: 1024px) {
	.leos-pf__grid {
		grid-template-columns: repeat(var(--leos-pf-cols-md), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.leos-pf__grid {
		grid-template-columns: repeat(var(--leos-pf-cols-sm), minmax(0, 1fr));
	}
}

/* ==========================================================================
   Reveal-on-scroll (JS adds .leos-ready; without JS everything is visible)
   ========================================================================== */

.leos-pf--reveal.leos-ready .leos-pf__card {
	opacity: 0;
	translate: 0 22px;
	transition:
		opacity 0.55s var(--leos-pf-ease),
		translate 0.55s var(--leos-pf-ease);
}

.leos-pf--reveal.leos-ready .leos-pf__card:nth-child(3n + 2) {
	transition-delay: 70ms;
}

.leos-pf--reveal.leos-ready .leos-pf__card:nth-child(3n) {
	transition-delay: 140ms;
}

.leos-pf--reveal.leos-ready .leos-pf__card.is-inview {
	opacity: 1;
	translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf--reveal .leos-pf__card {
		opacity: 1 !important;
		translate: none !important;
		transition: none !important;
	}
}

/* ==========================================================================
   Empty state + view-all
   ========================================================================== */

.leos-pf__empty {
	padding: clamp(28px, 5vw, 56px);
	border: 1px dashed var(--leos-pf-border-strong);
	border-radius: var(--leos-pf-radius);
	color: var(--leos-pf-fg-muted);
	text-align: center;
}

.leos-pf__empty p {
	margin: 0;
	font-size: 15px;
}

.leos-pf__viewall-row {
	display: flex;
	justify-content: center;
	margin-top: clamp(20px, 3vw, 32px);
}

.leos-pf__viewall {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid var(--leos-pf-border-strong);
	border-radius: var(--leos-pf-radius, 8px);
	color: var(--leos-pf-fg);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease), border-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__viewall:hover {
	background: var(--leos-pf-surface-2);
	text-decoration: none;
}

.leos-pf__viewall:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 3px;
}

.leos-pf__viewall svg {
	transition: translate var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__viewall:hover svg {
	translate: 3px 0;
}

/* ==========================================================================
   Lightbox (always dark — a media viewer, independent of the page scheme)
   ========================================================================== */

.leos-pf__lb {
	/* Viewer colour tokens — the theme attributes below swap them.
	   data-lb-theme="dark" (absent attribute) | "light" | "glass". */
	--lb-scrim: rgba(12, 10, 9, 0.88);
	--lb-bg: #161413;
	--lb-fg: #fafafa;
	--lb-fg-muted: rgba(250, 250, 250, 0.72);
	--lb-fg-strong: rgba(250, 250, 250, 0.82);
	--lb-border: rgba(255, 255, 255, 0.12);
	--lb-stage-bg: #0c0a09;
	--lb-btn-bg: rgba(255, 255, 255, 0.06);
	--lb-btn-bg-hover: rgba(255, 255, 255, 0.14);
	--lb-btn-border: rgba(255, 255, 255, 0.2);
	--lb-accent: #ff5c70;
	--lb-cat: #ff8a9b;
	--lb-rail-bg: #0c0a09;
	--lb-rail-border: rgba(255, 255, 255, 0.08);
	--lb-scroll: rgba(255, 255, 255, 0.25);
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	width: min(1120px, calc(100vw - 32px));
	height: fit-content;
	max-width: none;
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 1px solid var(--lb-border);
	border-radius: 16px;
	background: var(--lb-bg);
	color: var(--lb-fg);
	overflow: hidden;
	/* A viewer is a control surface, not a document: rapid next/prev clicks
	   must never smear a text/image selection across the stage. */
	-webkit-user-select: none;
	user-select: none;
}

/* Paper-white viewer: warm off-whites, ink text, brand red accents. */
.leos-pf__lb[data-lb-theme="light"] {
	--lb-scrim: rgba(244, 240, 236, 0.92);
	--lb-bg: #faf8f6;
	--lb-fg: #1c1917;
	--lb-fg-muted: rgba(28, 25, 23, 0.66);
	--lb-fg-strong: rgba(28, 25, 23, 0.84);
	--lb-border: rgba(12, 10, 9, 0.14);
	--lb-stage-bg: #f1ede9;
	--lb-btn-bg: rgba(12, 10, 9, 0.05);
	--lb-btn-bg-hover: rgba(12, 10, 9, 0.12);
	--lb-btn-border: rgba(12, 10, 9, 0.18);
	--lb-accent: #d80629;
	--lb-cat: #d80629;
	--lb-rail-bg: #f1ede9;
	--lb-rail-border: rgba(12, 10, 9, 0.08);
	--lb-scroll: rgba(12, 10, 9, 0.25);
}

/* Frosted viewer: translucent panel over a softly blurred page. Falls back
   to the translucent tints alone where backdrop-filter is unsupported. */
.leos-pf__lb[data-lb-theme="glass"] {
	--lb-scrim: rgba(15, 13, 12, 0.42);
	--lb-bg: rgba(24, 22, 20, 0.6);
	--lb-fg: #fafafa;
	--lb-fg-muted: rgba(250, 250, 250, 0.75);
	--lb-fg-strong: rgba(250, 250, 250, 0.85);
	--lb-border: rgba(255, 255, 255, 0.18);
	--lb-stage-bg: rgba(12, 10, 9, 0.32);
	--lb-btn-bg: rgba(255, 255, 255, 0.08);
	--lb-btn-bg-hover: rgba(255, 255, 255, 0.16);
	--lb-btn-border: rgba(255, 255, 255, 0.24);
	--lb-accent: #ff5c70;
	--lb-cat: #ff8a9b;
	--lb-rail-bg: rgba(12, 10, 9, 0.32);
	--lb-rail-border: rgba(255, 255, 255, 0.1);
	--lb-scroll: rgba(255, 255, 255, 0.25);
	-webkit-backdrop-filter: blur(18px) saturate(1.1);
	backdrop-filter: blur(18px) saturate(1.1);
}

.leos-pf__lb[data-lb-theme="glass"]::backdrop {
	-webkit-backdrop-filter: blur(12px) saturate(1.05);
	backdrop-filter: blur(12px) saturate(1.05);
}

/* Frosted viewer follows the page scheme: paper glass on light pages,
   smoked glass on dark ones. Without this override the glass panel keeps the
   dark tint on a white site, so it reads as "dark" even though the blur is
   active and only the photo changes between pages.
   Specificity (html[data-theme] + class + dialog) beats the base glass block. */
html[data-theme="light"] .leos-pf__lb[data-lb-theme="glass"] {
	--lb-scrim: rgba(250, 248, 246, 0.55);
	--lb-bg: rgba(255, 255, 255, 0.72);
	--lb-fg: #1c1917;
	--lb-fg-muted: rgba(28, 25, 23, 0.66);
	--lb-fg-strong: rgba(28, 25, 23, 0.84);
	--lb-border: rgba(12, 10, 9, 0.12);
	--lb-stage-bg: rgba(255, 255, 255, 0.6);
	--lb-btn-bg: rgba(12, 10, 9, 0.05);
	--lb-btn-bg-hover: rgba(12, 10, 9, 0.12);
	--lb-btn-border: rgba(12, 10, 9, 0.18);
	--lb-accent: #d80629;
	--lb-cat: #d80629;
	--lb-rail-bg: rgba(255, 255, 255, 0.55);
	--lb-rail-border: rgba(12, 10, 9, 0.08);
	--lb-scroll: rgba(12, 10, 9, 0.25);
}

/* The prev/next chips sit on top of the photo, not on the paper panel, so a
   5% dark fill + ink icon disappears on dark images. Give them a frosted white
   chip of their own in light glass. */
html[data-theme="light"] .leos-pf__lb[data-lb-theme="glass"] .leos-pf__lb-arrow {
	background: rgba(255, 255, 255, 0.78);
	border-color: rgba(12, 10, 9, 0.18);
	color: #1c1917;
	box-shadow: 0 2px 10px rgba(12, 10, 9, 0.12);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

html[data-theme="light"] .leos-pf__lb[data-lb-theme="glass"] .leos-pf__lb-arrow:hover {
	background: rgba(255, 255, 255, 0.94);
}

.leos-pf__lb img {
	-webkit-user-drag: none;
	user-drag: none;
	-webkit-touch-callout: none;
}

/* The viewer is a <dialog> left in the page-content tree, so a rule written
   for article images — e.g. the theme's
   `.page-content--narrow .entry-content img { border-radius: … }` — reaches
   lightbox media and rounds its corners. Elementor pages escape this only
   because `.elementor img { border-radius: 0 }` happens to override it; on a
   classic page nothing does. Reset the stage media with specificity above
   those content rules. Rail thumbnails keep their own radius, and the PDF
   canvas keeps its 3px. */
.leos-pf__lb .leos-pf__lb-body .leos-pf__lb-stage img {
	border-radius: 0;
}

.leos-pf__lb button {
	touch-action: manipulation;
}

/* A closed <dialog> must stay hidden. The UA hides it with
   `dialog:not([open])`, but an author display on the base class overrides
   that and paints an empty dark panel on every page. Keep this rule. */
.leos-pf__lb:not([open]) {
	display: none;
}

/* Opt-in light fades (lightbox_fade). The dialog animation restarts each time
   it is shown; closing adds .is-closing for 170 ms before dialog.close().
   Kept short so opening never feels slow. */
.leos-pf__lb--fade {
	animation: leos-pf-lb-fade-in .18s ease both;
}

.leos-pf__lb--fade::backdrop {
	animation: leos-pf-lb-backdrop-in .18s ease both;
}

.leos-pf__lb--fade.is-closing {
	animation: leos-pf-lb-fade-out .17s ease both;
}

.leos-pf__lb--fade.is-closing::backdrop {
	animation: leos-pf-lb-backdrop-out .17s ease both;
}

.leos-pf__lb--fade .leos-pf__lb-stage {
	/* .18s ease per leg — slowed from .12s linear (0.17.0–0.17.3) so the dip
	   reads softer. */
	transition: opacity .18s ease;
}

.leos-pf__lb--fade .leos-pf__lb-stage.is-switching {
	opacity: 0;
}

/* Fade mode 'cross' (0.18.0, opt-in): the outgoing photo is pinned under the
   stage while the incoming one fades in on top, so stepping between photos
   never dips to the dark stage background. The fade rules carry
   .leos-pf__lb-stage in the selector so they outrank the zoom transition on
   .leos-pf__lb-stage img.leos-pf__lb-photo — without that, the zoom rule
   steals the transition property and the incoming photo pops in instantly
   (the 0.17.3 bug). */
.leos-pf__lb--fade .leos-pf__lb-under {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.leos-pf__lb--fade .leos-pf__lb-under img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0 auto;
	/* Snap the snapshot out of any active zoom without animating. */
	transition: none;
}

.leos-pf__lb--fade .leos-pf__lb-stage .leos-pf__lb-in {
	position: relative;
	z-index: 1;
	opacity: 0;
	transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
}

.leos-pf__lb--fade .leos-pf__lb-stage .leos-pf__lb-in.is-shown {
	opacity: 1;
}

@keyframes leos-pf-lb-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes leos-pf-lb-fade-out {
	from { opacity: 1; }
	to { opacity: 0; }
}

@keyframes leos-pf-lb-backdrop-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes leos-pf-lb-backdrop-out {
	from { opacity: 1; }
	to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf__lb--fade,
	.leos-pf__lb--fade::backdrop {
		animation: none;
	}

	.leos-pf__lb--fade .leos-pf__lb-stage {
		transition: none;
	}

	.leos-pf__lb--fade .leos-pf__lb-stage .leos-pf__lb-in {
		transition: none;
	}
}

.leos-pf__lb::backdrop {
	background: var(--lb-scrim);
}

.leos-pf__lb-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}

.leos-pf__lb-counter {
	font-size: 13px;
	letter-spacing: 0.04em;
	color: var(--lb-fg-muted);
	font-variant-numeric: tabular-nums;
}

.leos-pf__lb-close,
.leos-pf__lb-arrow {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--lb-btn-border);
	border-radius: 999px;
	background: var(--lb-btn-bg);
	color: var(--lb-fg);
	cursor: pointer;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__lb-close:hover,
.leos-pf__lb-arrow:hover {
	background: var(--lb-btn-bg-hover);
}

.leos-pf__lb-close:focus-visible,
.leos-pf__lb-arrow:focus-visible {
	outline: 2px solid var(--lb-accent);
	outline-offset: 2px;
}

.leos-pf__lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	background: var(--lb-stage-bg);
	overflow: hidden;
}

/* Stage photo: click/tap zooms 4× around the pressed point, a second click
   returns to fit. The magnifier cursor plus the corner badge make it obvious. */
.leos-pf__lb-stage img.leos-pf__lb-photo {
	cursor: zoom-in;
	touch-action: manipulation;
	transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

.leos-pf__lb.is-zoomed .leos-pf__lb-stage img.leos-pf__lb-photo {
	transform: scale(4);
	cursor: zoom-out;
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf__lb-stage img.leos-pf__lb-photo {
		transition: none;
	}
}

.leos-pf__lb-stage img,
.leos-pf__lb-stage video {
	display: block;
	max-width: 100%;
	max-height: min(72vh, 780px);
	width: auto;
	height: auto;
	margin: 0 auto;
}

.leos-pf__lb-stage iframe,
.leos-pf__lb-stage video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000000;
}

.leos-pf__lb-stage[data-aspect="9:16"] iframe,
.leos-pf__lb-stage[data-aspect="9:16"] video {
	width: auto;
	height: min(72vh, 780px);
	aspect-ratio: 9 / 16;
}

.leos-pf__lb-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: rgba(250, 250, 250, 0.6);
	font-size: 14px;
	pointer-events: none;
}

.leos-pf__lb-loading a {
	color: inherit;
	text-underline-offset: 3px;
	pointer-events: auto;
}

/* PDF documents (0.23.0): the stage becomes a reader. Pages render into a
   canvas that scrolls vertically, the pager floats at the bottom edge, and
   the global arrows keep meaning "another item" — only the arrow keys flip
   document pages, handing off to item navigation at the edges. */
.leos-pf__lb[data-kind="pdf"] .leos-pf__lb-stage {
	height: min(72vh, 780px);
}

.leos-pf__lb-pdf {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: flex;
	justify-content: center;
	padding: 18px 18px 72px;
	-webkit-overflow-scrolling: touch;
}

.leos-pf__lb-pdf canvas {
	display: block;
	width: auto;
	height: auto;
	background: #ffffff;
	border-radius: 3px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

.leos-pf__lb-pdfbar {
	position: absolute;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 2px 6px;
	border: 1px solid var(--lb-btn-border);
	border-radius: 999px;
	/* Solid panel colour, not the translucent button tint: the pill floats
	   over the white page canvas, where a 6% white wash would vanish. */
	background: var(--lb-bg);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
	z-index: 2;
}

.leos-pf__lb-pdfbtn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--lb-fg);
	cursor: pointer;
}

.leos-pf__lb-pdfbtn:hover:not(:disabled) {
	background: var(--lb-btn-bg-hover);
}

.leos-pf__lb-pdfbtn:disabled {
	opacity: 0.35;
	cursor: default;
}

.leos-pf__lb-pdfbtn:focus-visible {
	outline: 2px solid var(--lb-accent);
	outline-offset: 2px;
}

.leos-pf__lb-pdfnum {
	min-width: 76px;
	text-align: center;
	font-size: 12.5px;
	color: var(--lb-fg-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.leos-pf__lb-side {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 16px 16px;
}

.leos-pf__lb-copy {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.leos-pf__lb-cat {
	color: var(--lb-cat);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.leos-pf__lb-title {
	font-family: var(--leos-pf-display, Georgia, serif);
	font-size: 20px;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.leos-pf__lb-desc {
	margin: 0;
	color: var(--lb-fg-muted);
	font-size: 14px;
	line-height: 1.55;
}

.leos-pf__lb-detail {
	color: var(--lb-fg-strong);
	font-size: 14px;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.leos-pf__lb-detail p {
	margin: 0 0 0.8em;
}

.leos-pf__lb-detail > :last-child {
	margin-bottom: 0;
}

.leos-pf__lb-detail a {
	color: var(--lb-accent);
}

.leos-pf__lb-detail strong,
.leos-pf__lb-detail b {
	color: var(--lb-fg);
}

.leos-pf__lb-actions {
	display: flex;
	align-items: center;
	gap: 10px 18px;
	flex-wrap: wrap;
}

.leos-pf__lb-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--lb-btn-border);
	border-radius: 8px;
	color: var(--lb-fg);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__lb-cta:hover {
	background: var(--lb-btn-bg-hover);
	text-decoration: none;
}

.leos-pf__lb-cta:focus-visible {
	outline: 2px solid var(--lb-accent);
	outline-offset: 2px;
}

.leos-pf__lb-watch {
	flex: none;
	color: var(--lb-accent);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

.leos-pf__lb-watch:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Album rail (item gallery): one thumb per page of the open item. The JS
   toggles .has-rail on the dialog, so the stage shrinks deterministically
   even in browsers without :has().
   -------------------------------------------------------------------------- */

.leos-pf__lb-rail {
	display: flex;
	gap: 8px;
	padding: 10px 16px;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--lb-scroll) transparent;
	background: var(--lb-rail-bg);
	border-top: 1px solid var(--lb-rail-border);
}

.leos-pf__lb-rail[hidden] {
	display: none;
}

.leos-pf__lb-thumb {
	flex: 0 0 auto;
	width: 72px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: none;
	color: inherit;
	cursor: pointer;
	overflow: hidden;
	opacity: 0.55;
	transition: opacity var(--leos-pf-fast) var(--leos-pf-ease), border-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__lb-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.leos-pf__lb-thumb:hover {
	opacity: 0.85;
}

.leos-pf__lb-thumb.is-active {
	opacity: 1;
	border-color: var(--lb-accent);
}

.leos-pf__lb-thumb:focus-visible {
	outline: 2px solid var(--lb-accent);
	outline-offset: 2px;
}

/* Reserve room for the rail so a full-height video or portrait photo never
   pushes the side panel past the dialog's max height. */
.leos-pf__lb.has-rail .leos-pf__lb-stage img,
.leos-pf__lb.has-rail .leos-pf__lb-stage video {
	max-height: min(64vh, 700px);
}

.leos-pf__lb-arrow {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
}

.leos-pf__lb-arrow--prev {
	left: 14px;
}

.leos-pf__lb-arrow--next {
	right: 14px;
}

.leos-pf__lb-arrow[hidden] {
	display: none;
}

/* Video pages: the arrows float on top of the player and compete with its own
   controls, which fade out after a few idle seconds. They now follow the same
   rule — JS adds .is-chrome-idle when the cursor stops inside the frame or
   leaves it, and takes it off again on the next move. Only opacity changes, so
   the buttons never shift and the layout does not move. */
.leos-pf__lb[data-kind="video"] .leos-pf__lb-arrow {
	transition: opacity var(--leos-pf-base) var(--leos-pf-ease),
		background-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__lb[data-kind="video"].is-chrome-idle .leos-pf__lb-arrow {
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	/* The chrome still hides — it is an unobstructed view, not an animation —
	   but it appears and disappears without the fade. */
	.leos-pf__lb[data-kind="video"] .leos-pf__lb-arrow {
		transition: none;
	}
}

/* JS adds this class while a lightbox is open. A class is used instead of
   :has() so the scroll lock also works in older Safari/Firefox.
   The padding keeps the page from jumping when the scrollbar disappears:
   JS measures the gutter and stores it in --leos-pf-gutter. */
body.leos-pf-lb-open {
	overflow: hidden;
	padding-right: var(--leos-pf-gutter, 0px);
}

@media (max-width: 640px) {
	.leos-pf__lb {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border: 0;
		border-radius: 0;
	}

	.leos-pf__lb-body {
		flex: 1 1 auto;
		min-height: 0;
	}

	.leos-pf__lb-stage {
		flex: 1 1 auto;
		min-height: 0;
	}

	/* The document reader fills the screen height the stage gives it. */
	.leos-pf__lb[data-kind="pdf"] .leos-pf__lb-stage {
		height: auto;
	}

	.leos-pf__lb-stage iframe,
	.leos-pf__lb-stage video {
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
	}

	.leos-pf__lb-side {
		max-height: 32dvh;
		overflow: auto;
		padding-bottom: 64px;
	}

	/* Photo lightbox: stay compact instead of stretching to the full screen
	   (which left a large empty black area under the image). */
	.leos-pf__lb[data-kind="image"] {
		top: 50%;
		bottom: auto;
		translate: 0 -50%;
		width: calc(100vw - 24px);
		height: auto;
		max-height: calc(100dvh - 24px);
		border: 1px solid var(--lb-border);
		border-radius: 12px;
	}

	.leos-pf__lb[data-kind="image"] .leos-pf__lb-body {
		flex: 0 0 auto;
	}

	.leos-pf__lb[data-kind="image"] .leos-pf__lb-stage {
		flex: 0 0 auto;
		min-height: 0;
	}

	.leos-pf__lb[data-kind="image"] .leos-pf__lb-stage img {
		max-height: 58dvh;
		width: auto;
		max-width: 100%;
		margin: 0 auto;
	}

	.leos-pf__lb[data-kind="image"] .leos-pf__lb-side {
		max-height: 30dvh;
		overflow: auto;
		overscroll-behavior: contain;
		padding-bottom: 64px;
	}

	.leos-pf__lb-stage img,
	.leos-pf__lb-stage video,
	.leos-pf__lb-stage[data-aspect="9:16"] iframe,
	.leos-pf__lb-stage[data-aspect="9:16"] video {
		max-height: 64dvh;
	}

	/* Touch layout: keep both arrows together at the bottom-right, clear of
	   the left-aligned CTA/watch actions. Next sits at the thumb edge; prev
	   sits just inside it. Safe-area insets keep them off the home bar. */
	.leos-pf__lb .leos-pf__lb-arrow {
		top: auto;
		bottom: calc(14px + env(safe-area-inset-bottom, 0px));
		translate: none;
		width: 44px;
		height: 44px;
	}

	.leos-pf__lb .leos-pf__lb-arrow--prev {
		left: auto;
		right: calc(70px + env(safe-area-inset-right, 0px));
	}

	.leos-pf__lb .leos-pf__lb-arrow--next {
		left: auto;
		right: calc(14px + env(safe-area-inset-right, 0px));
	}

	/* Album rail becomes a full-bleed bottom strip; the pinned prev/next
	   cluster lifts above it so thumbs and buttons never overlap. */
	.leos-pf__lb .leos-pf__lb-rail {
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
	}

	.leos-pf__lb.has-rail .leos-pf__lb-arrow {
		bottom: calc(80px + env(safe-area-inset-bottom, 0px));
	}
}

/* ==========================================================================
   Justified rows (Flickr-style; ratio comes inline per card)
   ========================================================================== */

.leos-pf__canvas {
	container-type: inline-size;
}

.leos-pf__justified {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--leos-pf-gap);
}

.leos-pf__justified .leos-pf__card {
	/* flex-basis = row height × ratio, grow ∝ ratio: within a wrapped row
	   every media box resolves to the SAME height (width / ratio is equal). */
	flex: var(--leos-pf-ratio, 1.5) 1 calc(clamp(190px, 22vw, 330px) * var(--leos-pf-ratio, 1.5));
	min-width: 0;
}

.leos-pf__justified .leos-pf__media {
	width: 100%;
	aspect-ratio: var(--leos-pf-ratio, 3 / 2);
}

/* ==========================================================================
   Marquee band (duplicated track, single -50% loop)
   ========================================================================== */

.leos-pf__marquee-vp {
	overflow: hidden;
}

.leos-pf__marquee {
	display: flex;
	width: max-content;
	animation: leos-pf-marquee var(--leos-pf-marquee-d, 40s) linear infinite;
}

.leos-pf__marquee .leos-pf__card {
	flex: 0 0 auto;
	width: clamp(280px, 28vw, 420px);
	margin-right: var(--leos-pf-gap);
}

.leos-pf__marquee .leos-pf__card[data-leos-pf-clone] {
	user-select: none;
}

.leos-pf__marquee-vp:hover .leos-pf__marquee {
	animation-play-state: paused;
}

/* While the viewer dialog is open (scroll-lock sets this body class), the
 * ambient marquee strips hold still — the strip the user clicked stays put
 * behind the lightbox and resumes its drift when the viewer closes. */
body.leos-pf-lb-open .leos-pf__marquee {
	animation-play-state: paused;
}

@keyframes leos-pf-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf__marquee {
		animation: none;
	}

	.leos-pf__marquee-vp {
		overflow-x: auto;
	}
}

/* ==========================================================================
   Sticky stack (cards pin and stack up while scrolling)
   ========================================================================== */

.leos-pf__stack {
	display: grid;
	gap: var(--leos-pf-gap);
}

.leos-pf[data-layout="stack"] .leos-pf__card {
	position: sticky;
	top: calc(clamp(64px, 10vh, 120px) + min(var(--leos-pf-stack-i, 0), 6) * 10px);
	/* Mỗi card là một "tờ giấy" đục lỗ không trong suốt: card ghim phía sau
	   che kín card trước, caption (nền trong suốt) không thể chồng chữ. */
	background: var(--leos-pf-surface);
	border: 1px solid var(--leos-pf-border);
	border-radius: var(--leos-pf-radius);
	padding: clamp(10px, 1.4vw, 18px);
	box-shadow: var(--leos-pf-shadow);
}

.leos-pf[data-layout="stack"] .leos-pf__media {
	box-shadow: none;
	border-radius: calc(var(--leos-pf-radius) - 4px);
}

.leos-pf[data-layout="stack"].leos-pf[data-caption="below"] .leos-pf__caption {
	padding: 12px 6px 4px;
}

/* ==========================================================================
   Center-focus carousel (JS marks the card nearest the center)
   ========================================================================== */

.leos-pf[data-layout="focus"] .leos-pf__card {
	scroll-snap-align: center;
	transition: scale var(--leos-pf-base) var(--leos-pf-ease), opacity var(--leos-pf-base) var(--leos-pf-ease);
}

.leos-pf[data-layout="focus"] .leos-pf__card:not(.is-focus) {
	opacity: 0.8;
}

.leos-pf[data-layout="focus"] .leos-pf__card:not(.is-focus) .leos-pf__media {
	scale: 0.92;
}

.leos-pf[data-layout="focus"] .leos-pf__card:not(.is-focus) .leos-pf__caption {
	opacity: 0.4;
}

/* ==========================================================================
   Slideshow with Ken Burns (JS stacks + cycles; without JS cards flow)
   ========================================================================== */

.leos-pf__slides {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
}

.leos-ready .leos-pf__slides .leos-pf__card {
	grid-area: 1 / 1;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.7s var(--leos-pf-ease);
}

.leos-ready .leos-pf__slides .leos-pf__card.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

/* Slideshow cards drive their own visibility: the generic reveal rule adds
   .is-inview to every stacked slide and would otherwise reveal them all. */
.leos-pf--reveal.leos-ready .leos-pf__slides .leos-pf__card {
	opacity: 0;
	translate: none;
}

.leos-pf--reveal.leos-ready .leos-pf__slides .leos-pf__card.is-active {
	opacity: 1;
}

.leos-ready .leos-pf__slides .leos-pf__card.is-active .leos-pf__img {
	animation: leos-pf-kenburns 7s var(--leos-pf-ease) forwards;
}

@keyframes leos-pf-kenburns {
	from {
		scale: 1;
	}
	to {
		scale: 1.08;
	}
}

@media (prefers-reduced-motion: reduce) {
	.leos-ready .leos-pf__slides .leos-pf__card.is-active .leos-pf__img {
		animation: none;
	}

	/* The shared reveal rule forces every card visible with !important;
	   slides must stay hidden unless active or they all stack on top. */
	.leos-ready .leos-pf__slides .leos-pf__card {
		opacity: 0 !important;
		transition: none !important;
	}

	.leos-ready .leos-pf__slides .leos-pf__card.is-active {
		opacity: 1 !important;
	}
}

/* Controls: hidden until JS stacks the slides, then pinned to the active
   slide's bottom-right corner via grid placement. */
.leos-pf__nav--slides {
	display: none;
}

.leos-ready .leos-pf__nav--slides {
	display: flex;
	grid-area: 1 / 1;
	justify-self: end;
	align-self: end;
	z-index: 3;
	margin: 0 14px 14px;
}

.leos-pf__nav--slides .leos-pf__nav-btn {
	border-color: rgba(255, 255, 255, 0.3);
	background: var(--leos-pf-glass);
	color: #ffffff;
}

.leos-pf__nav--slides .leos-pf__nav-btn:hover {
	background: rgba(12, 10, 9, 0.75);
}

/* ==========================================================================
   Quote card (item kind: quote)
   ========================================================================== */

.leos-pf__media--quote {
	aspect-ratio: auto;
	display: flex;
	align-items: center;
	min-height: 240px;
	height: 100%;
	background: var(--leos-pf-surface-2);
	border: 1px solid var(--leos-pf-border);
}

.leos-pf__quote {
	margin: 0;
	padding: clamp(24px, 3vw, 40px);
}

.leos-pf__quote p {
	margin: 0;
	color: var(--leos-pf-fg);
	font-family: var(--leos-pf-display);
	font-size: clamp(22px, 2.2vw, 30px);
	font-style: italic;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.3;
	text-wrap: balance;
}

.leos-pf__quote p::before {
	content: "\201C";
	color: var(--leos-pf-accent);
}

.leos-pf__quote cite {
	display: block;
	margin-top: 16px;
	color: var(--leos-pf-fg-muted);
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.leos-pf__quote cite::before {
	content: "\2014\00a0";
}

/* ==========================================================================
   Print / polaroid frame (showcase option)
   ========================================================================== */

.leos-pf[data-frame="print"] .leos-pf__media {
	background: #ffffff;
	border: 1px solid var(--leos-pf-border);
	padding: clamp(8px, 1vw, 12px);
	box-shadow: var(--leos-pf-shadow);
}

.leos-pf[data-frame="print"] .leos-pf__card:nth-child(odd) {
	rotate: -0.5deg;
}

.leos-pf[data-frame="print"] .leos-pf__card:nth-child(even) {
	rotate: 0.4deg;
}

.leos-pf[data-frame="print"] .leos-pf__title {
	font-family: var(--font-logo, "Segoe Script", cursive);
	font-size: clamp(20px, 1.8vw, 26px);
	font-weight: 400;
	letter-spacing: 0.02em;
}

/* ==========================================================================
   Big index numbering (showcase option)
   ========================================================================== */

.leos-pf[data-show-index="1"] .leos-pf__card {
	counter-increment: leos-pf-idx;
}

.leos-pf[data-show-index="1"] .leos-pf__media::after {
	content: counter(leos-pf-idx, decimal-leading-zero);
	position: absolute;
	top: 6px;
	left: 14px;
	z-index: 2;
	color: rgba(255, 255, 255, 0.92);
	font-family: var(--leos-pf-display);
	font-size: clamp(34px, 3.6vw, 56px);
	font-weight: 500;
	line-height: 1.1;
	pointer-events: none;
	text-shadow: 0 2px 18px rgba(12, 10, 9, 0.55);
}

/* ==========================================================================
   Before / After compare (item kind: compare)
   ========================================================================== */

.leos-pf__media--compare {
	touch-action: pan-y;
}

.leos-pf__compare-before {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--leos-pf-split, 50%)) 0 0);
}

.leos-pf__compare-before img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.leos-pf__compare-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--leos-pf-split, 50%);
	z-index: 2;
	width: 2px;
	margin-left: -1px;
	background: #ffffff;
	box-shadow: 0 0 0 1px rgba(12, 10, 9, 0.35);
	pointer-events: none;
}

.leos-pf__compare-handle::after {
	content: "\25C4\00a0\25BA";
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	translate: -50% -50%;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(12, 10, 9, 0.4);
	color: #0c0a09;
	font-size: 9px;
	letter-spacing: -1px;
}

.leos-pf__compare-tag {
	position: absolute;
	top: 12px;
	z-index: 2;
	padding: 4px 9px;
	border-radius: 999px;
	background: var(--leos-pf-glass);
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	pointer-events: none;
}

.leos-pf__compare-tag--before {
	left: 12px;
}

.leos-pf__compare-tag--after {
	right: 12px;
}

.leos-pf__compare-range {
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	opacity: 0;
	background: transparent;
	cursor: ew-resize;
}

.leos-pf__media:has(.leos-pf__compare-range:focus-visible) {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 3px;
}

/* Muted hover preview video (self-hosted; played by JS on hover) */
.leos-pf__hv {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity var(--leos-pf-base) var(--leos-pf-ease);
	pointer-events: none;
}

.leos-pf__media.is-hovplaying .leos-pf__hv {
	opacity: 1;
}

/* ==========================================================================
   Split lightbox: media one side, project info panel the other
   ========================================================================== */

.leos-pf__lb-body {
	display: flex;
	flex-direction: column;
}

.leos-pf[data-lb-layout="split"] .leos-pf__lb {
	width: min(1240px, calc(100vw - 32px));
}

.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
	align-items: stretch;
}

.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-side {
	max-height: 76vh;
	overflow: auto;
	gap: 12px;
	padding: 18px 20px;
	border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-arrow--next {
	right: calc(min(380px, 30%) + 14px);
}

@media (max-width: 900px) {
	.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-body {
		grid-template-columns: 1fr;
	}

	.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-side {
		max-height: 42dvh;
		border-left: 0;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}

	.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-arrow--next {
		right: 14px;
	}
}

/* Below 640px the touch cluster re-anchors to the bottom of the dialog
   (see the mobile arrow rules), which in a stacked split viewer is the text
   column, not the image — measured 390x844: arrows y=690..734 landing on a
   description that ran y=632..719. Reserve the cluster's band (44px button
   + 14px gap, rounded up) so no line of copy can sit under a button. The
   side column keeps its own scroll, so long text simply scrolls clear. */
@media (max-width: 640px) {
	.leos-pf[data-lb-layout="split"] .leos-pf__lb .leos-pf__lb-side {
		padding-bottom: 60px;
	}
}


/* ==========================================================================
   Pagination (client-side; all cards are server-rendered)
   ========================================================================== */

.leos-pf__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: calc(var(--leos-pf-gap) * 1.15);
}

.leos-pf__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid var(--leos-pf-border-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--leos-pf-fg);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease), color var(--leos-pf-fast) var(--leos-pf-ease), border-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__more:hover {
	background: var(--leos-pf-fg);
	border-color: var(--leos-pf-fg);
	color: var(--leos-pf-bg, #ffffff);
}

.leos-pf__more-count {
	color: var(--leos-pf-fg-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.leos-pf__more:hover .leos-pf__more-count {
	color: inherit;
	opacity: 0.7;
}

.leos-pf__pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}

.leos-pf__page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--leos-pf-border);
	border-radius: 999px;
	background: transparent;
	color: var(--leos-pf-fg);
	font: inherit;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background-color var(--leos-pf-fast) var(--leos-pf-ease), color var(--leos-pf-fast) var(--leos-pf-ease), border-color var(--leos-pf-fast) var(--leos-pf-ease);
}

.leos-pf__page-btn:hover:not(:disabled):not(.is-active) {
	border-color: var(--leos-pf-border-strong);
	background: var(--leos-pf-surface-2);
}

/* Keep the active chip readable on hover (was white-on-grey). */
.leos-pf__page-btn.is-active:hover {
	background: var(--leos-pf-fg);
	border-color: var(--leos-pf-fg);
	color: #ffffff;
}

.leos-pf__page-btn.is-active {
	background: var(--leos-pf-fg);
	border-color: var(--leos-pf-fg);
	color: var(--leos-pf-bg, #ffffff);
}

.leos-pf__page-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.leos-pf__page-btn:focus-visible,
.leos-pf__more:focus-visible {
	outline: 2px solid var(--leos-pf-ring);
	outline-offset: 3px;
}

.leos-pf__pager-status {
	min-width: 52px;
	color: var(--leos-pf-fg-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.leos-pf__card[hidden] {
	display: none !important;
}

/* ==========================================================================
   Slideshow: progress bar + pause/play
   ========================================================================== */

.leos-pf__slide-progress {
	display: none;
}

.leos-ready .leos-pf__slide-progress {
	display: block;
	grid-area: 1 / 1;
	align-self: end;
	z-index: 3;
	height: 3px;
	background: rgba(255, 255, 255, 0.28);
}

.leos-pf__slide-bar {
	display: block;
	height: 100%;
	width: 100%;
	background: #ffffff;
	transform: scaleX(0);
	transform-origin: 0 50%;
}

.leos-pf__slide-bar.is-running {
	animation-name: leos-pf-slide-progress;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.leos-pf__slide-bar.is-paused {
	animation-play-state: paused;
}

@keyframes leos-pf-slide-progress {
	from {
		transform: scaleX(0);
	}
	to {
		transform: scaleX(1);
	}
}

.leos-pf__pause-icon {
	position: relative;
	display: block;
	width: 10px;
	height: 12px;
}

.leos-pf__pause-icon::before,
.leos-pf__pause-icon::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 3px;
	border-radius: 1px;
	background: currentColor;
}

.leos-pf__pause-icon::before {
	left: 0;
}

.leos-pf__pause-icon::after {
	right: 0;
}

.leos-pf__pause.is-paused .leos-pf__pause-icon::before {
	left: 1px;
	top: 1px;
	bottom: auto;
	width: 0;
	height: 0;
	border-left: 9px solid currentColor;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-radius: 0;
	background: none;
}

.leos-pf__pause.is-paused .leos-pf__pause-icon::after {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.leos-pf__slide-bar {
		display: none;
	}
}
