/* Client Index — A–Z list with a hover image that follows the scroll. */

/* Fonts served from the plugin itself (both SIL Open Font License 1.1). */
@font-face {
	font-family: "LCI Playfair Display";
	src: url("fonts/playfair-display-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "LCI Montserrat";
	src: url("fonts/montserrat-600.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

.lci {
	--lci-gap: clamp(24px, 4vw, 64px);
	--lci-line: currentColor;
	--lci-font-heading: "LCI Playfair Display", "Playfair Display", Georgia, "Times New Roman", serif;
	--lci-font-name: "LCI Montserrat", "Montserrat", "Helvetica Neue", Arial, sans-serif;
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: var(--lci-gap);
	align-items: stretch;
}

.lci--right .lci-media {
	order: 2;
}

/* Image column: as tall as the list; the frame slides inside it (see front.js). */
.lci-media {
	position: relative;
	min-width: 0;
}

/* The frame takes the shape of the image on show: nothing is cropped, and the
   image is never taller than the screen. */
.lci-frame {
	position: relative;
	width: 100%;
	will-change: transform;
}

.lci-img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100vh - var(--lci-offset, 120px) - 2rem);
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* The visible image sits in the flow and gives the frame its height;
   the outgoing one fades out on top of it. */
.lci-img.is-active {
	position: relative;
	opacity: 1;
}

.lci--right .lci-img {
	left: auto;
	right: 0;
}

.lci--right .lci-img.is-active {
	margin-left: auto;
}

/* Letter blocks */
.lci-letters {
	display: grid;
	grid-template-columns: repeat(var(--lci-cols, 2), minmax(0, 1fr));
	gap: 48px var(--lci-gap);
	align-content: start;
}

.lci-letter {
	min-width: 0;
}

.lci .lci-heading {
	margin: 0 0 16px;
	padding: 0 0 10px;
	border-bottom: 1px solid var(--lci-line);
	font-family: var(--lci-font-heading);
	font-size: clamp(1.75rem, 2.4vw, 2.5rem);
	line-height: 1;
	font-weight: 400;
	letter-spacing: 1px;
}

.lci .lci-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lci .lci-list li {
	margin: 0;
	padding: 0;
}

.lci .lci-name {
	display: inline-block;
	padding: 2px 0;
	color: inherit;
	text-decoration: none;
	text-transform: uppercase;
	font-family: var(--lci-font-name);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: -0.1px;
	line-height: 22px;
	cursor: default;
	transition: opacity 0.2s ease;
}

.lci a.lci-name {
	cursor: pointer;
}

.lci .lci-name:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 3px;
}

/* While a name is hovered, the others step back. */
.lci-letters:has(.lci-name:hover) .lci-name:not(:hover) {
	opacity: 0.4;
}

.lci a.lci-name:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Tablet / touch: no hover, so no image column. Tapping a name opens its
   image right under it instead (see front.js). */
@media (max-width: 900px), (hover: none) {
	.lci {
		grid-template-columns: minmax(0, 1fr);
	}

	.lci-media {
		display: none;
	}

	.lci .lci-name[data-lci-src] {
		cursor: pointer;
	}

	.lci .lci-name[data-lci-src]::after {
		content: "+";
		display: inline-block;
		margin-left: 8px;
		font-weight: 400;
		opacity: 0.5;
	}

	.lci .lci-name[aria-expanded="true"]::after {
		content: "−";
	}
}

.lci-peek {
	margin: 6px 0 18px;
	animation: lci-peek-in 0.3s ease;
}

.lci-peek img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 75vh;
}

.lci .lci-peek-link {
	display: inline-block;
	margin-top: 8px;
	color: inherit;
	font-family: var(--lci-font-name);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 4px;
}

@keyframes lci-peek-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@media (max-width: 520px) {
	.lci-letters {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lci-img,
	.lci .lci-name {
		transition: none;
	}

	.lci-peek {
		animation: none;
	}
}
