/**
 * Homepage project media showcase: one dominant creative + up to three
 * satellites, placed art-directed rather than gridded. No card chrome —
 * items sit directly against the section's own colour, at their real
 * advertising aspect ratio (--sc-ratio, set inline per item).
 *
 * Positions are defined once here, driven by item ORDER (dominant,
 * satellite-1..3) — never by project identity, so any project's
 * showcase_items reuse the same placement system. The `--mirrored`
 * variant swaps every left/right offset for projects that want the
 * dominant piece on the opposite side.
 */

.project-section--showcase {
	align-items: stretch;
}

/* Keep the text column narrow and clear of the media cluster — the
   cluster occupies the right ~55-60% of the canvas at desktop.
   `.container`'s own max-width/margin:auto centering has to be
   overridden here, not just shrunk, or the column drifts to the
   middle of the section instead of staying pinned to the gutter. */
@media (min-width: 900px) {
	.project-section--showcase .project-section__content {
		max-width: none;
		width: min(30rem, 40%);
		margin-inline: 0;
		padding-inline: var(--gutter) 0;
	}
}

.project-showcase {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* Mobile: percentage-based overlap with bottom-aligned text is
   fragile — description length varies per project and can grow the
   text block upward into any fixed band. Instead the showcase becomes
   a real flex sibling with its own reserved height, and the section
   packs [showcase, text] to the bottom as a group — text can never
   physically overlap the media, regardless of copy length. */
@media (max-width: 899px) {
	.project-section--showcase {
		flex-direction: column;
		justify-content: flex-end;
		align-items: stretch;
	}

	.project-showcase {
		position: relative;
		inset: auto;
		height: min(80vw, 360px);
		flex-shrink: 0;
	}
}

.project-showcase__item {
	position: absolute;
	aspect-ratio: var(--sc-ratio, 4 / 3);
}

/* Media is clipped by its own wrapper, not the positioned item box —
   the caption label sits just outside the media and must not be cut
   off by the same overflow:hidden that clips the creative to its
   aspect ratio. */
.project-showcase__media {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.project-showcase__media img,
.project-showcase__media video,
.project-showcase__media iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

.project-showcase__label {
	position: absolute;
	left: 0;
	bottom: -1.6em;
	font-size: var(--size-label);
	letter-spacing: 0;
	text-transform: none; /* Direction C: no capitals */
	color: var(--project-fg, var(--color-fg));
	opacity: 0.55;
	white-space: nowrap;
	/* Hidden below 900px: at mobile cluster scale, labels either
	   collide with the following text block or clip against the
	   viewport edge on right-anchored satellites — the format spec is
	   a desktop-density detail, not essential on a compact mobile
	   composition. */
	display: none;
}

@media (min-width: 900px) {
	.project-showcase__label {
		display: block;
	}
}

/* Staggered entrance — each satellite settles in slightly after the
   last, reinforcing the "placed" rather than "loaded" feel. */
.project-showcase__item.reveal {
	transition-delay: var(--sc-delay, 0ms);
}

/* ---- Mobile-first placement (base) ----
   Cluster sits in the upper portion of the section; text keeps the
   bottom. Only dominant + first two satellites are shown — the third
   is dropped rather than shrunk into illegibility. */

.project-showcase__item--dominant {
	left: 4%;
	top: 4%;
	width: 56%;
}

.project-showcase__item--satellite-1 {
	right: 4%;
	top: 0;
	width: 32%;
	z-index: 2;
}

.project-showcase__item--satellite-2 {
	right: 4%;
	top: 48%;
	width: 17%;
	z-index: 2;
}

.project-showcase__item--satellite-3 {
	display: none;
}

/* ---- Desktop art-directed placement ----
   Cluster lives entirely in the right ~55% of the canvas; the text
   column above is capped at 40% width so the two never compete for
   the same space regardless of copy length. */
@media (min-width: 900px) {
	.project-showcase__item--dominant {
		left: 47%;
		top: 7%;
		width: 32%;
	}

	.project-showcase__item--satellite-1 {
		left: 81%;
		top: 2%;
		width: 16%;
		right: auto;
	}

	.project-showcase__item--satellite-2 {
		left: auto;
		right: 2%;
		top: 36%;
		width: 10%;
	}

	.project-showcase__item--satellite-3 {
		display: block;
		left: auto;
		right: 5%;
		bottom: 7%;
		width: 23%;
	}
}

/* ---- Dominant Wide variant ----
   For a wide/video-shaped dominant (16:9 etc.) sizing by WIDTH like the
   other variants would make it very short. Instead it's sized by
   HEIGHT with width:auto, so aspect-ratio determines the width
   naturally — a square dominant stays roughly square, a 16:9 dominant
   genuinely reads as wide, with no per-project positioning needed.
   Satellites are pulled in tighter and right-anchored throughout so
   they stay clear regardless of how wide the dominant renders. */
.project-showcase--dominant-wide .project-showcase__item--dominant {
	width: 56%;
}

@media (min-width: 900px) {
	.project-showcase--dominant-wide .project-showcase__item--dominant {
		left: 38%;
		top: 12%;
		width: auto;
		height: 34%;
	}

	.project-showcase--dominant-wide .project-showcase__item--satellite-1 {
		left: auto;
		right: 3%;
		top: 6%;
		width: 8%;
	}

	.project-showcase--dominant-wide .project-showcase__item--satellite-2 {
		left: auto;
		right: 10%;
		top: 56%;
		width: 13%;
	}

	.project-showcase--dominant-wide .project-showcase__item--satellite-3 {
		display: none;
	}
}

@media (max-width: 899px) {
	.project-showcase--dominant-wide .project-showcase__item--satellite-1 {
		width: 15%;
		top: 2%;
	}

	/* Satellite-2 is much wider than satellite-1 (a 300x250-class ratio
	   vs. a tall skyscraper) — inheriting the same right:4% anchor as
	   satellite-1 let the two overlap. Anchored further left instead,
	   with its own right offset rather than depending on satellite-1's. */
	.project-showcase--dominant-wide .project-showcase__item--satellite-2 {
		right: 20%;
		width: 30%;
		top: auto;
		bottom: 4%;
	}
}

/* ---- Mirrored variant ----
   The project text block always anchors bottom-left (consistent site
   rhythm), so this isn't a literal left/right flip of the whole
   composition — that would collide with the text. Instead the whole
   cluster (dominant included) is right-anchored, giving a denser,
   more fanned-out silhouette than `standard` — every item's offset is
   measured from the right edge so nothing depends on how wide any
   individual item renders. */
@media (min-width: 900px) {
	.project-showcase--mirrored .project-showcase__item--dominant {
		left: 45%;
		top: 9%;
		width: 30%;
	}

	.project-showcase--mirrored .project-showcase__item--satellite-1 {
		left: auto;
		right: 3%;
		top: 3%;
		width: 15%;
	}

	.project-showcase--mirrored .project-showcase__item--satellite-2 {
		left: auto;
		right: 24%;
		top: 64%;
		width: 20%;
	}

	.project-showcase--mirrored .project-showcase__item--satellite-3 {
		right: 2%;
		bottom: 6%;
		width: 12%;
	}
}

/* Mobile: the mirrored composition's satellite-2 slot is sized for a
   WIDE shape (a leaderboard-type format) — legible in the desktop
   fan-out, but a wide-short format shrunk to mobile-satellite width
   becomes an illegible sliver. satellite-3's slot assumes a taller
   shape, which survives the same shrink far better, so mobile shows
   that one instead — same "drop the least mobile-friendly piece"
   principle as the base rules, just applied to the shape this variant
   actually produces. */
@media (max-width: 899px) {
	.project-showcase--mirrored .project-showcase__item--satellite-2 {
		display: none;
	}

	.project-showcase--mirrored .project-showcase__item--satellite-3 {
		display: block;
		right: 4%;
		top: 48%;
		width: 17%;
	}
}
