/*
 * Kontradiktion — the edition landing: full-viewport hero index + filmstrip
 * navigation, then the below-the-fold reading content.
 * Part of the split stylesheet set — see base.css for the map and load order.
 */

/* Base landing typography (also applies where edition markup renders outside
   the immersive index). The below-the-fold rules further down override parts
   of these — keep that order. */
.k-edition__title {
	margin-bottom: 0.25em;
	line-height: 1.1;
}
.k-edition__intro {
	font-size: 1.15rem;
	opacity: 0.85;
	margin-bottom: 2.5rem;
}
.k-edition__pieces .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
	list-style: none;
	padding: 0;
}
.k-edition__pieces .wp-block-post-title {
	margin: 0 0 0.25rem;
}
.k-edition__pieces .wp-block-post-excerpt {
	opacity: 0.8;
	margin: 0;
}

/* --- Edition landing: an immersive, full-viewport index --- */
.k-index-layout {
	max-width: none;
	margin: 0;
	padding: 0;
}

/* Hero: the active piece's media fills the screen; caption + filmstrip at the base. */
.k-index {
	position: relative;
	height: calc(100vh - var(--k-header-h));
	height: calc(100dvh - var(--k-header-h)); /* dvh: track the mobile URL bar so the
	                                             hero always fills the viewport (no black
	                                             gap below the image until you scroll) */
	min-height: 30rem;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background: #000;
}
/* Logged-in staff: the admin bar bumps the page down, so give the hero the
   remaining height (otherwise the landing gets a permanent bar-height scroll). */
body.admin-bar .k-index {
	height: calc(100vh - var(--k-header-h) - var(--wp-admin--admin-bar--height, 32px));
	height: calc(100dvh - var(--k-header-h) - var(--wp-admin--admin-bar--height, 32px));
}
/* The stage is clickable — it opens whichever piece it is currently showing
   (handler in landing.php). The cursor is the only affordance it gets: the
   caption right below already names the piece, so a hover treatment on a
   full-viewport image would be noise. */
.k-index__stage {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: #000;
	cursor: pointer;
}
/* One background cell per piece — all in the DOM up front so images are preloaded.
   Cells crossfade on opacity (no src swapping = no flicker); a black cell background
   is the fallback while a still/clip is still loading. */
.k-index__cell {
	position: absolute;
	inset: 0;
	opacity: 0;
	background: #000;
	transition: opacity 0.55s ease;
}
.k-index__cell.is-active {
	opacity: 1;
}
/* Descendant selector (two classes) so it beats the global `body.k-site img/video {
   height: auto }` reset — otherwise the media collapses to natural height and
   object-fit has nothing to cover (black shows below, worst in portrait). */
.k-index__cell .k-index__cell-img,
.k-index__cell .k-index__cell-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
/* The still is the immediate base; the clip fades in over it only once it can play,
   so switching to a video piece never flickers image→video. */
.k-index__cell-video {
	opacity: 0;
	transition: opacity 0.55s ease;
}
.k-index__cell-video.is-ready {
	opacity: 1;
}
/* Keeps white chrome legible over media of ANY brightness (a near-white clip would
   otherwise wash out the caption/strip): a strong dark wash at the base, a lighter one
   under the top bar. */
.k-index__scrim {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 16%, rgba(0, 0, 0, 0) 42%),
		linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 16%);
}

/* Active-piece caption, just above the strip. */
.k-index__caption {
	position: relative;
	z-index: 3;
	margin: 0;
	padding: 0 2rem 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.k-index__caption-title {
	font-size: clamp(1.4rem, 3.5vw, 2.6rem);
	line-height: 1.1;
}
.k-index__caption-by {
	font-style: italic;
	color: var(--k-muted);
}

/* Filmstrip = the navigation. The rail holds the scroller + left/right arrows; the
   native scrollbar is hidden (arrows + swipe/trackpad drive it instead). */
.k-index__rail {
	position: relative;
	z-index: 3;
}
.k-index__strip {
	display: flex;
	gap: clamp(0.9rem, 7vw, 8.5rem); /* airier on wide screens, tight enough on phones */
	margin: 0;
	padding: 0.75rem 2rem 3rem;
	list-style: none;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* old Edge */
}
.k-index__strip::-webkit-scrollbar {
	display: none; /* WebKit/Blink */
}
.k-index__arrow {
	position: absolute;
	top: calc(50% - 1.25rem); /* centre on the thumbnails, above the bottom padding */
	transform: translateY(-50%);
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	background: rgba(0, 0, 0, 0.55);
	color: var(--k-fg);
	border: 1px solid var(--k-rule);
	border-radius: 50%;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s ease;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.k-index__arrow:hover {
	opacity: 1;
}
.k-index__arrow[hidden] {
	display: none;
}
.k-index__arrow--prev {
	left: 0.5rem;
}
.k-index__arrow--next {
	right: 0.5rem;
}
.k-strip__item {
	flex: 0 0 auto;
}
.k-strip__link {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	max-width: 22rem;
	text-decoration: none;
	opacity: 0.55;
	transition: opacity 0.25s ease;
}
.k-strip__link:hover,
.k-strip__item.is-active .k-strip__link {
	opacity: 1;
}
.k-strip__thumb {
	flex: 0 0 auto;
	width: 5rem;
	overflow: hidden;
}
.k-strip__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.k-strip__meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}
.k-strip__title {
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.k-strip__by {
	font-size: 0.75rem;
	font-style: italic;
	color: var(--k-muted);
}

/* Phones: compact tiles capped near a third of the width so at least ~3 pieces are
   visible, stacked vertically — thumbnail on top, title (clamped to 2 lines) below.
   The artist stays in the caption above to keep the tiles small. Tighter side
   padding gives them room. */
@media (max-width: 600px) {
	.k-index__strip {
		padding-inline: 1rem;
		align-items: flex-start;
	}
	.k-strip__item {
		width: min(20rem, 24vw);
	}
	.k-strip__link {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0.45rem;
	}
	.k-strip__thumb {
		width: 100%;
	}
	.k-strip__title {
		font-size: 0.7rem;
		letter-spacing: 0.06em;
		line-height: 1.25;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
	.k-strip__by {
		display: none;
	}
}

/* Scroll-down affordance to the reading content below the hero. */
.k-index__more {
	position: absolute;
	z-index: 3;
	top: 1.25rem;
	right: 2rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	text-decoration: none;
	color: var(--k-muted);
	font-size: 0.62rem;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}
.k-index__more:hover {
	color: var(--k-fg);
}
.k-index__more .k-chevron {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.k-index__cell,
	.k-index__cell-video {
		transition: none;
	}
}

/* --- Below the fold: the edition's reading content --- */
.k-edition__body {
	padding-top: 4rem;
	scroll-margin-top: var(--k-header-h); /* "Bläddra" target lands below the sticky bar */
}
body.admin-bar .k-edition__body {
	scroll-margin-top: calc(var(--k-header-h) + var(--wp-admin--admin-bar--height, 32px));
}
.k-edition__head {
	text-align: center;
	margin-bottom: 3.5rem;
}
.k-edition__title {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: clamp(1.3rem, 3vw, 1.9rem);
	margin: 0 0 0.75rem;
}
.k-edition__intro {
	color: var(--k-muted);
	max-width: var(--k-measure);
	margin-inline: auto;
}
/* Landing section wrapper for the shared artists component (base.css). */
.k-edition__artists {
	margin-top: 5rem;
	border-top: 1px solid var(--k-rule);
	padding-top: 3rem;
}

/* --- Previews for pieces with no image material (Q10, 2026-08-08) -----------
   The landing is image-led, but audio and text-only pieces have no obvious
   image. Rather than demand a stand-in image per piece, they fall back:
   preview blurb → format glyph → the plain rendered title (the owner liked the
   plain-title default, so it is the floor, not a failure state). */

/* Hero cell stand-in: glyph over title, or the wordmark for the foreword. */
.k-index__cell-mark {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	padding: 4rem 2rem 9rem;
	text-align: center;
	color: rgba(255, 255, 255, 0.5);
}
.k-index__cell-mark .k-glyph {
	width: clamp(3.5rem, 9vh, 6rem);
	height: auto;
	opacity: 0.7;
}
.k-index__cell-title {
	font-size: clamp(1.6rem, 5vw, 3.4rem);
	line-height: 1.15;
	max-width: 20ch;
}
/* The foreword's wordmark, scaled up from the header's compact logo mark. */
.k-index__cell-mark .k-wordmark__stack {
	font-size: clamp(1rem, 2.6vh, 1.6rem);
	letter-spacing: 0.42em;
	text-indent: 0.42em;
	color: var(--k-fg);
	opacity: 0.85;
}

/* Strip tile stand-in: keeps the filmstrip's rhythm where a thumbnail would be,
   so an image-less piece doesn't leave a ragged gap. */
.k-strip__thumb--mark {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--k-rule);
	color: var(--k-muted);
}
.k-strip__thumb--mark .k-glyph {
	width: 45%;
	height: auto;
}
.k-strip__thumb--mark .k-wordmark__stack {
	font-size: 0.3rem;
	letter-spacing: 0.28em;
	text-indent: 0.28em;
	color: var(--k-fg);
}

/* Preview blurb under the byline — the text piece's answer to a preview image. */
.k-index__caption-blurb {
	margin-top: 0.35rem;
	max-width: 46ch;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--k-muted);
}
.k-index__caption-blurb:empty {
	display: none;
}
