/* ==========================================================================
   INESJ — Components
   Frame & placeholder print · hover zoom · chapter index · masthead ·
   category · pause-motion link
   ========================================================================== */

/* Frame: every photograph lives in one ------------------------------------ */

.frame {
	position: relative;
	margin: 0;
}

.frame__media {
	position: relative;
	aspect-ratio: var(--ratio, 4 / 5);
	overflow: hidden;
	border-radius: var(--radius-photo);
	background-color: var(--tone, color-mix(in srgb, var(--fg) 12%, transparent));
}

/* Sky: a photograph first shows as a very light blue instead of its own
   colour — the site's blue (hue 244), from Sky (#a8cbe8) for the darkest print
   to a very pale sky for the brightest. The palest blues are softer, like
   Haze. Browsers without relative colours show plain Sky. */
html.palette-sky .frame__media {
	background-color: var(--c-safelight);
}

@supports (color: oklch(from red clamp(0.86, calc((l - 0.62) * 0.3 + 0.89), 0.93) clamp(0.028, calc(0.052 - (l - 0.7) * 0.11), 0.052) 244)) {
	html.palette-sky .frame__media {
		background-color: oklch(from var(--tone, var(--c-safelight)) clamp(0.86, calc((l - 0.62) * 0.3 + 0.89), 0.93) clamp(0.028, calc(0.052 - (l - 0.7) * 0.11), 0.052) 244);
	}
}

.frame__img,
.frame__media > .placeholder {
	transition:
		opacity 1.1s var(--ease-out),
		transform 1.6s var(--ease-out);
}

.frame__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--focus, 50% 50%);
}

/* Portrait crops keep faces: bias the crop upward. */
.frame--4x5,
.frame--3x4,
.frame--2x3 {
	--focus: 50% 32%;
}

/* Prints develop in as they arrive (only with JS; without it they just show). */
html.js .frame--image .frame__img {
	opacity: 0;
}

html.js .frame--image.is-loaded .frame__img {
	opacity: 1;
}

/* Hover zoom — a slow editorial push-in on static photographs (not on the
   drifting wall or the viewfinder). Mouse/trackpad only: touch screens keep
   the images still and scroll naturally. */
@media (hover: hover) and (pointer: fine) {
	.frame--zoom:hover .frame__img,
	.frame--zoom:hover .frame__media > .placeholder {
		transform: scale(1.04);
	}
}

@media (prefers-reduced-motion: reduce) {
	.frame--zoom:hover .frame__img,
	.frame--zoom:hover .frame__media > .placeholder {
		transform: none;
	}
}

.frame__veil {
	position: absolute;
	inset: 0;
	background-color: var(--c-paper);
	opacity: 0;
	pointer-events: none;
}

.frame__caption {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	padding-top: var(--s-3);
	font-size: var(--fs-small);
	line-height: 1.35;
}

/* Placeholder print --------------------------------------------------------- */

.tone-1 { --tone: var(--tone-1); --tone-fg: var(--c-ink); }
.tone-2 { --tone: var(--tone-2); --tone-fg: var(--c-paper); }
.tone-3 { --tone: var(--tone-3); --tone-fg: var(--c-paper); }
.tone-4 { --tone: var(--tone-4); --tone-fg: var(--c-paper); }
.tone-5 { --tone: var(--tone-5); --tone-fg: var(--c-ink); }
.tone-6 { --tone: var(--tone-6); --tone-fg: var(--c-paper); }
.tone-7 { --tone: var(--tone-7); --tone-fg: var(--c-ink); }
.tone-8 { --tone: var(--tone-8); --tone-fg: var(--c-paper); }

.placeholder {
	position: absolute;
	inset: 0;
	color: var(--tone-fg, var(--c-ink));
	background:
		radial-gradient(120% 90% at 28% 18%, color-mix(in srgb, #fff 18%, transparent), transparent 60%),
		radial-gradient(90% 70% at 80% 100%, color-mix(in srgb, #000 16%, transparent), transparent 70%),
		var(--tone);
}

/* Crop ticks in the four corners. */
.placeholder__ticks {
	position: absolute;
	inset: 10px;
	--t: 10px;
	background:
		linear-gradient(currentColor, currentColor) top left / var(--t) 1px,
		linear-gradient(currentColor, currentColor) top left / 1px var(--t),
		linear-gradient(currentColor, currentColor) top right / var(--t) 1px,
		linear-gradient(currentColor, currentColor) top right / 1px var(--t),
		linear-gradient(currentColor, currentColor) bottom left / var(--t) 1px,
		linear-gradient(currentColor, currentColor) bottom left / 1px var(--t),
		linear-gradient(currentColor, currentColor) bottom right / var(--t) 1px,
		linear-gradient(currentColor, currentColor) bottom right / 1px var(--t);
	background-repeat: no-repeat;
	opacity: 0.55;
}

.placeholder__text {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 12px;
	display: grid;
	gap: 2px;
	font-family: var(--font-sans);
	font-size: 0.625rem;
	font-weight: 600;
	font-stretch: 100%;
	font-style: normal;
	line-height: 1.3;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

.placeholder__file {
	text-transform: none;
	letter-spacing: 0.02em;
	font-weight: 500;
}

/* Chapter index: "03 —— Brands" ------------------------------------------- */

.chapter-index {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chapter-index__rule {
	width: 28px;
	height: 1px;
	background: currentColor;
}

/* Masthead ----------------------------------------------------------------- */

.masthead {
	display: grid;
	gap: var(--s-5);
}

.masthead__title {
	/* A word wider than the page (--word: its length) makes the title smaller instead of splitting. */
	font-size: min(var(--fs-masthead), (100vw - 2 * var(--margin)) / (var(--word, 1) * 0.5));
	font-weight: 800;
	font-stretch: 64%;
	line-height: 0.84;
	letter-spacing: -0.012em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
	/* Lines as flex items, so their mask margins add up instead of collapsing. */
	display: flex;
	flex-direction: column;
}

.masthead__title .line {
	display: block;
	overflow: hidden;
	/* Room in the mask for accents on capitals (É, À, Ó) and descenders, without moving the lines. */
	padding: 0.16em 0 0.1em;
	margin: -0.16em 0 -0.1em;
}

.masthead__title .line__inner {
	display: block;
}

.masthead__deck {
	display: inline-block;
	margin-left: 0.14em;
	font-size: 0.4em;
	line-height: 1;
	letter-spacing: -0.015em;
	vertical-align: baseline;
}

/* Category: kicker / italic title / text ----------------------------------- */

.category {
	display: grid;
	gap: var(--s-3);
	align-content: start;
	max-width: 30em;
}

.category__index {
	display: flex;
	align-items: center;
	gap: 10px;
}

.category__index::after {
	content: "";
	width: 28px;
	height: 1px;
	background: currentColor;
}

.category__heading {
	display: grid;
	gap: 6px;
	margin-top: var(--s-2);
}

.category__title {
	font-size: var(--fs-title);
	line-height: 1;
}

.category__text {
	max-width: 27em;
	font-size: var(--fs-body);
	line-height: 1.5;
	text-wrap: pretty;
}

/* Pause-motion control (footer symbol + keyboard-only skip button) -------- */

/* The footer control: a pause symbol (two bars), a play symbol (a triangle)
   while motion is off. 24 px target around a 10 px symbol. */
.motion-toggle {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	opacity: 0.85;
	transition: opacity var(--dur-ui) var(--ease-out);
}

.motion-toggle:hover {
	opacity: 1;
}

.motion-toggle__icon {
	display: block;
	box-sizing: border-box;
	width: 9px;
	height: 10px;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

.motion-off .motion-toggle__icon {
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 9px solid currentColor;
	border-right: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
}

.motion-toggle[hidden],
.skip-link--motion[hidden] {
	display: none;
}
