/* Photo row: overlapping photos, the front one centred and largest.
   Markup: includes/partials/photo-row.php. Behaviour: assets/js/photo-row.js.

   No viewport media queries on purpose. NitroPack's unused-CSS pass deletes
   rules whose media condition doesn't match the width it renders at
   (devlog 2026-09-09), so every size comes from the row's own width:
   the cards are clamp(12rem, 38%, 24rem) wide, and the outer cards' offsets
   are capped with min() so on a narrow row they tuck in behind their
   neighbours instead of running off the edge. */

.rl-photo-row {
	position: relative;
	margin: 2.5rem 0 1rem;
	padding: 1.25rem 0;
}
/* Gives the row its height: an invisible card the size of the front photo. */
.rl-photo-row::before {
	content: '';
	display: block;
	width: clamp(12rem, 38%, 24rem);
	aspect-ratio: 4 / 3;
	margin: 0 auto;
}

/* data-pos: 0 = front, -3..3 = places to the left/right, off = hidden behind.
   --x is a share of the row's width; --s scales the card. */
.rl-photo-row a.rl-photo-row__item {
	position: absolute;
	top: 50%;
	left: calc(50% + var(--x, 0%));
	display: block;
	width: clamp(12rem, 38%, 24rem);
	aspect-ratio: 4 / 3;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .25);
	transform: translate(-50%, -50%) scale(var(--s, .5));
	z-index: var(--z, 0);
	filter: brightness(.8);
	cursor: pointer;
	transition: left .45s ease, transform .45s ease, opacity .45s ease, filter .3s ease, visibility 0s;
}
/* Team pages put the row inside .tabs, whose tab-button rules
   (.tabs a, .tabs a:not(:first-child)) would otherwise pad and shift every card. */
.tabs .rl-photo-row a.rl-photo-row__item {
	margin: 0;
	padding: 0;
	border: 0;
}
.rl-photo-row .rl-photo-row__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: 50% 30%; /* portrait photos: keep heads in frame */
}
.rl-photo-row a.rl-photo-row__item:hover {
	filter: brightness(.95);
}
.rl-photo-row a.rl-photo-row__item:focus-visible {
	outline: 3px solid #f05d48;
	outline-offset: 3px;
}

.rl-photo-row a.rl-photo-row__item[data-pos="-3"] { --x: calc(-1 * min(38%, 50% - 6rem)); --s: .58; --z: 7; }
.rl-photo-row a.rl-photo-row__item[data-pos="-2"] { --x: calc(-1 * min(28%, 50% - 5rem)); --s: .7; --z: 8; }
.rl-photo-row a.rl-photo-row__item[data-pos="-1"] { --x: -16%; --s: .84; --z: 9; }
.rl-photo-row a.rl-photo-row__item[data-pos="0"]  { --x: 0%; --s: 1; --z: 10; filter: none; cursor: zoom-in; }
.rl-photo-row a.rl-photo-row__item[data-pos="1"]  { --x: 16%; --s: .84; --z: 9; }
.rl-photo-row a.rl-photo-row__item[data-pos="2"]  { --x: min(28%, 50% - 5rem); --s: .7; --z: 8; }
.rl-photo-row a.rl-photo-row__item[data-pos="3"]  { --x: min(38%, 50% - 6rem); --s: .58; --z: 7; }
.rl-photo-row a.rl-photo-row__item[data-pos="off"] {
	opacity: 0;
	visibility: hidden;
	transition: left .45s ease, transform .45s ease, opacity .45s ease, filter .3s ease, visibility 0s linear .45s;
}

/* 1 or 2 photos: side by side. */
.rl-photo-row.rl-photo-row--few {
	display: flex;
	justify-content: center;
	gap: .75rem;
	padding: 0;
}
.rl-photo-row.rl-photo-row--few::before {
	content: none;
}
.rl-photo-row.rl-photo-row--few a.rl-photo-row__item {
	position: relative;
	top: auto;
	left: auto;
	flex: 0 1 clamp(12rem, 38%, 24rem);
	width: auto;
	transform: none;
	filter: none;
	cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
	.rl-photo-row a.rl-photo-row__item {
		transition: none !important;
	}
}
