/* Hover List
   Override per site: .hover-list { --hl-line: #E6E5DE; --hl-muted: #706F68; --hl-accent: #8C7340; --hl-radius: 0; } */

.hover-list {
	--hl-line: #E6E5DE;
	--hl-muted: #706F68;
	--hl-accent: #8C7340;
	--hl-radius: 0;
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: 80px;
	align-items: start;
}

/* Left – heading, then the image panel, which stays in view while the list scrolls past */
.hover-list__side { position: sticky; top: 40px; }
.hover-list__side h2 { margin-bottom: 40px; }

/* Every figure sits in the same grid cell; the active one fades in */
.hover-list__panel { display: grid; }
.hover-list__figure {
	grid-area: 1 / 1;
	margin: 0;
	opacity: 0;
	transition: opacity .5s;
}
.hover-list__figure.is-active { opacity: 1; }
/* Extra class beats Salient's image rules */
.hover-list .hover-list__figure img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	margin: 0 !important; /* Salient adds a bottom margin to images */
	object-fit: cover;
	border-radius: var(--hl-radius);
}
.hover-list__figure figcaption { max-width: 480px; margin-top: 20px; font-size: 17px; line-height: 1.5em; color: var(--hl-muted); }
.hover-list__figure:not(.is-active) figcaption { opacity: 0; } /* outgoing text goes straight away, so two captions never overlap */

/* Right – the list */
.hover-list__items { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hl-line); }
.hover-list__items li { margin: 0; padding: 0; list-style: none; }

.hover-list__item {
	display: grid;
	grid-template-columns: 64px 1fr auto auto;
	column-gap: 24px;
	align-items: center;
	padding: 22px 0;
	border-top: 1px solid var(--hl-line);
	color: inherit;
	transition: opacity .4s;
}
.hover-list__num { font-size: 14px; color: var(--hl-muted); transition: color .3s; }
.hover-list__meta { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--hl-muted); }
.hover-list__title { font-size: clamp(28px, 3vw, 48px); line-height: 1.15em; letter-spacing: -.02em; }

/* Arrow (Font Awesome) */
.hover-list__item:after {
	content: "\f061";
	font: 300 20px 'Font Awesome 6 Pro';
	color: var(--hl-accent);
	opacity: 0;
	transform: translateX(-8px);
	transition: opacity .3s, transform .3s;
}
.hover-list__item.is-active:after { opacity: 1; transform: none; }

/* Secondary links – small pills under the list */
.hover-list__more { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; }
.hover-list__more li { margin: 0; padding: 0; list-style: none; }
.hover-list__more a {
	display: block;
	padding: 9px 16px;
	border: 1px solid var(--hl-line);
	border-radius: 100px;
	font-size: 15px;
	line-height: 1.2;
	color: inherit;
	transition: background-color .3s, border-color .3s;
}
.hover-list__more a:hover { border-color: var(--hl-accent); }
.hover-list__more .hover-list__num { display: none; }

/* Fade the other rows while hovering the list */
.hover-list__items:hover .hover-list__item:not(.is-active) { opacity: .35; }

/* Tablets and phones – list only */
@media (max-width: 999px) {
	.hover-list { grid-template-columns: 1fr; gap: 0; }
	.hover-list__side { position: static; }
	.hover-list__panel { display: none; }
	.hover-list__item { grid-template-columns: 44px 1fr auto; padding: 16px 0; }
	.hover-list__meta { display: none; }
	.hover-list__title { font-size: 22px; }
	.hover-list__item:after { opacity: 1; transform: none; font-size: 16px; }
	.hover-list__items:hover .hover-list__item:not(.is-active) { opacity: 1; }
}

/* ---------- Grid layout ---------- */
.hover-list--grid { display: block; }
.hover-list__caption { display: none; }
.hover-list--grid .hover-list__top {
	display: grid;
	grid-template-columns: 1fr minmax(0, 520px) 1fr;
	gap: 60px;
	align-items: center;
	margin-bottom: 80px;
}
.hover-list--grid .hover-list__top h2 { margin: 0; }
.hover-list--grid .hover-list__figure figcaption { display: none; }

/* Text for the active item, on the right */
.hover-list--grid .hover-list__captions { display: grid; align-self: center; }
.hover-list--grid .hover-list__caption {
	display: block;
	grid-area: 1 / 1;
	max-width: 320px;
	margin: 0 0 0 auto;
	padding: 0;
	font-size: 16px;
	line-height: 1.5em;
	color: var(--hl-muted);
	opacity: 0;
	transition: opacity .4s;
}
.hover-list--grid .hover-list__caption.is-active { opacity: 1; }
.hover-list--grid .hover-list__caption strong { display: block; margin-bottom: 8px; font-size: 20px; font-weight: inherit; color: var(--hl-accent); }

/* Links in columns */
.hover-list--grid .hover-list__items {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	column-gap: 48px;
	border: 0;
}
.hover-list--grid .hover-list__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid var(--hl-line);
	font-size: 16px;
}
.hover-list--grid .hover-list__item:before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.hover-list--grid .hover-list__item:after { margin-left: auto; font-size: 14px; }
.hover-list--grid .hover-list__num { display: none; }
.hover-list--grid .hover-list__title { font-size: inherit; letter-spacing: 0; }
.hover-list--grid .hover-list__items:hover .hover-list__item:not(.is-active) { opacity: 1; }

@media (max-width: 999px) {
	.hover-list--grid .hover-list__top { grid-template-columns: 1fr; gap: 30px; margin-bottom: 40px; }
	.hover-list--grid .hover-list__panel { display: grid; }
	.hover-list--grid .hover-list__captions { display: none; }
	.hover-list--grid .hover-list__items { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
@media (max-width: 690px) {
	.hover-list--grid .hover-list__items { grid-template-columns: 1fr; }
}

/* ---------- Rows layout ---------- */
.hover-list--rows { display: block; }
.hover-list--rows h2 { margin-bottom: 40px; }
.hover-list__rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hl-line); }
.hover-list__rows li { margin: 0; padding: 0; list-style: none; }
.hover-list__row {
	display: grid;
	grid-template-columns: 180px 1fr auto;
	gap: 40px;
	align-items: center;
	padding: 24px 0;
	border-bottom: 1px solid var(--hl-line);
	color: inherit;
}
.hover-list__thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--hl-radius); }
.hover-list .hover-list__thumb img { width: 100%; height: 100%; margin: 0 !important; object-fit: cover; transition: transform .6s cubic-bezier(.19, 1, .22, 1); }
.hover-list__body { display: block; }
.hover-list__row .hover-list__title { display: block; font-size: 32px; line-height: 1.1em; }
.hover-list__text { display: block; max-width: 520px; margin-top: 8px; font-size: 16px; line-height: 1.5em; color: var(--hl-muted); }
.hover-list__row:after {
	content: "\e09f"; /* arrow-up-right */
	font: 400 22px 'Font Awesome 6 Pro';
	color: var(--hl-accent);
	transition: transform .3s;
}
.hover-list__row:hover .hover-list__thumb img { transform: scale(1.06); }
.hover-list__row:hover:after { transform: rotate(45deg); }

/* ---------- Columns layout ---------- */
/* Made for a full-width row: lines run edge to edge. Photo and title on the left of each cell, arrow on the right.
   Hover and keyboard focus look the same. Everything moves with transforms, clip-path and opacity on one easing,
   so nothing reflows while it animates. */
/* Sizes can be changed from a theme: --hl-slot-w / --hl-slot-h (thumbnail), --hl-cell-pad (padding round each cell). */
.hover-list--cols {
	--hl-ease: cubic-bezier(.19, 1, .22, 1); /* fast start, long gentle finish – reads as smooth both in and out */
	--hl-time: 1s;
	--hl-slot-w: 112px;
	--hl-slot-h: 76px;
	--hl-cell-pad: 24px;
	--hl-shift: calc(-1 * (var(--hl-slot-w) + 32px)); /* how far the title moves left on hover: photo slot + gap */
	display: block;
}
.hover-list--cols h2 { margin: 0 24px 60px; text-align: center; }
.hover-list__cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(var(--rows), auto);
	grid-auto-flow: column; /* first half down the left, second half down the right */
	margin: 0;
	padding: 0;
	list-style: none;
}
.hover-list__cols li { margin: -1px 0 0; padding: 0; list-style: none; border-block: 1px solid var(--hl-line); } /* neighbouring lines overlap into one */
.hover-list__cols li.is-right { border-left: 1px solid var(--hl-line); }
.hover-list__cell {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	gap: 32px;
	padding: var(--hl-cell-pad); /* same space round the photo on every side */
	overflow: hidden;
	outline: 0;
	color: inherit;
	transition: color var(--hl-time) var(--hl-ease), opacity .5s ease;
}

/* Title and description – on hover the block moves left into the photo's space and up, and the description fades in below */
.hover-list__info { position: relative; flex: 1; max-width: 640px; transition: transform var(--hl-time) var(--hl-ease); }
.hover-list__cell .hover-list__title { display: block; overflow: hidden; font-size: clamp(22px, 2vw, 30px); line-height: 1.25em; }
.hover-list__title > span { position: relative; display: inline-block; transition: transform var(--hl-time) var(--hl-ease); }
.hover-list__title > span:after { content: attr(data-text); position: absolute; top: 100%; left: 0; } /* the copy that rolls in */
.hover-list__desc { position: absolute; top: 100%; left: 0; right: var(--hl-shift); } /* also uses the space the photo slot leaves */
.hover-list__desc > span {
	display: block;
	padding-top: 8px;
	font-size: 17px;
	line-height: 1.45em;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .4s ease, transform var(--hl-time) var(--hl-ease);
}

/* Photo – a thumbnail in the slot beside the title; grows to fill the cell under an overlay on hover. The script sets --t --r --b --l (the slot's position). Until then the photo stays hidden. */
.hover-list__slot { flex-shrink: 0; width: var(--hl-slot-w); height: var(--hl-slot-h); }
.hover-list__cell .hover-list__bg {
	position: absolute;
	z-index: -1;
	inset: 0;
	background: var(--hl-cell-bg, #141B30); /* also the fill when an item has no photo */
	clip-path: inset(100% 0 0 0);
	transition: clip-path var(--hl-time) var(--hl-ease);
	will-change: clip-path;
}
.hover-list__cell.is-measured .hover-list__bg { clip-path: inset(var(--t) var(--r) var(--b) var(--l) round var(--hl-thumb-radius, 12px)); }
.hover-list__cell .hover-list__bg:after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--hl-cell-overlay, rgba(20, 27, 48, .7));
	opacity: 0;
	transition: opacity var(--hl-time) var(--hl-ease);
}
/* The photo keeps the slot's shape, sized to cover the cell (--iw --ih, centred at --il --it), and is scaled down onto the
   slot (--x --y --s) – so the thumbnail shows the whole picture. On hover it scales back up with the clip.
   Only transform and clip-path animate, so the browser never relays out or resamples mid-animation. */
.hover-list .hover-list__cell .hover-list__bg img {
	position: absolute;
	top: var(--it, 0);
	left: var(--il, 0);
	width: var(--iw, 100%);
	max-width: none;
	height: var(--ih, 100%) !important;
	margin: 0 !important;
	object-fit: cover;
	transform-origin: 0 0;
	transform: translate(var(--x, 0), var(--y, 0)) scale(var(--s, 1));
	transition: transform var(--hl-time) var(--hl-ease);
	will-change: transform;
}
.hover-list__cell:after {
	content: "\f061";
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border: 1px solid var(--hl-line);
	border-radius: 50%;
	font: 300 18px 'Font Awesome 6 Pro';
	transition: background-color .5s ease, border-color .5s ease, color .5s ease, transform var(--hl-time) var(--hl-ease);
}

/* Active – hover or keyboard focus */
.hover-list__cols:hover .hover-list__cell:not(:hover) { opacity: .55; } /* the others fade back */
.hover-list__cell:is(:hover, :focus-visible) { color: #fff; }
.hover-list__cell:is(:hover, :focus-visible) .hover-list__info { transform: translate(var(--hl-shift), -18px); } /* left into the photo's space, up by half the description's height */
.hover-list__cell:is(:hover, :focus-visible) .hover-list__title > span { transform: translateY(-100%); }
.hover-list__cell:is(:hover, :focus-visible) .hover-list__desc > span { opacity: .85; transform: none; transition-delay: .15s; }
.hover-list__cell:is(:hover, :focus-visible) .hover-list__bg { clip-path: inset(0 round 0); }
.hover-list__cell:is(:hover, :focus-visible) .hover-list__bg:after { opacity: 1; }
.hover-list .hover-list__cell:is(:hover, :focus-visible) .hover-list__bg img { transform: none; }
.hover-list__cell:is(:hover, :focus-visible):after {
	border-color: var(--hl-cell-accent, #fff);
	background: var(--hl-cell-accent, #fff);
	color: var(--hl-cell-bg, #141B30);
	transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
	.hover-list__cell, .hover-list__cell *, .hover-list__cell:after { transition-duration: .01s !important; }
}

/* Secondary links in the Rows layout – numbered list in two columns, arrow on the right */
.hover-list--rows .hover-list__more {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(var(--rows), auto);
	grid-auto-flow: column;
	gap: 0 44px;
	margin-top: 60px;
}
.hover-list--rows .hover-list__more a {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 18px 0;
	border: 0;
	border-block: 1px solid var(--hl-line);
	border-radius: 0;
	font-size: 18px;
}
.hover-list--rows .hover-list__more li { margin-top: -1px; } /* neighbouring lines overlap into one */
.hover-list--rows .hover-list__more a:after {
	content: "\f061";
	margin-left: auto;
	font: 300 18px 'Font Awesome 6 Pro';
	transition: transform .3s;
}
.hover-list--rows .hover-list__more a:hover:after { transform: translateX(4px); }
.hover-list--rows .hover-list__more .hover-list__num { display: inline; width: 24px; font-size: 16px; color: var(--hl-muted); }

@media (max-width: 999px) {
	.hover-list__row { grid-template-columns: 96px 1fr auto; gap: 20px; padding: 18px 0; }
	.hover-list__row .hover-list__title { font-size: 22px; }
	.hover-list__text { display: none; }
	.hover-list--rows .hover-list__more { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
	.hover-list__cols { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
	.hover-list__cols li.is-right { border-left: 0; }
	.hover-list__cell { gap: 16px; padding: 20px 24px; }
	.hover-list--cols { --hl-slot-w: 72px; --hl-slot-h: 50px; }
	.hover-list__desc { display: none; }
	.hover-list__cell:is(:hover, :focus-visible) .hover-list__info { transform: none; }
	.hover-list__cols:hover .hover-list__cell:not(:hover) { opacity: 1; }
	.hover-list__cell .hover-list__title { font-size: 22px; }
	.hover-list__cell:after { width: 40px; height: 40px; }
	.hover-list--cols h2 { margin-bottom: 40px; }
}
