/*
 * Everything but the front page: stories, archives, the film pages, plain pages, 404.
 *
 * Reading pages use one centred column (--measure). Inside .page-body every block takes that
 * width; pictures, videos and transcripts step wider, and a video breaks out as a dark band.
 */

.v14 {
	--measure: 38rem;
	--column: min(var(--measure), calc(100% - 2 * var(--gutter)));
}

/* Reading column ----------------------------------------------------------- */

.page-body {
	padding-bottom: clamp(48px, 7vw, 96px);
}

.page-body > * {
	width: var(--column);
	margin-inline: auto;
}

.page-body > p,
.page-body > ul,
.page-body > ol {
	margin-block: 0 1.1em;
	line-height: 1.7;
}

.page-body > ul,
.page-body > ol {
	padding-left: 1.25em;
}

.page-body li {
	margin-bottom: 0.35em;
}

.page-body li::marker {
	color: var(--mauve);
}

.page-body > h2,
.page-body > h3 {
	margin-block: 2.2em 0.6em;
	font-weight: 400;
}

.page-body > h2 {
	font-size: var(--t-2xl);
}

.page-body > h3 {
	font-size: var(--t-xl);
}

/* The lede: everything before the "more" tag. */
.story__body > p:has(~ [id^="more-"]) {
	margin-bottom: 1.4em;
	font-family: var(--serif);
	font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
	line-height: 1.4;
	color: var(--ink);
}

/* Photographs: plates, wider than the text, never taller than the screen. */
.page-body > .wp-block-image {
	width: min(64rem, calc(100% - 2 * var(--gutter)));
	margin-block: clamp(36px, 5vw, 72px);
}

.page-body > .wp-block-image img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 88svh;
	margin-inline: auto;
}

/* Video: a dark band across the page, like the front page's films. */
.page-body > .wp-block-embed.is-type-video,
.film-page__player .wp-block-embed {
	margin: 0;
}

.page-body > .wp-block-embed.is-type-video {
	position: relative;
	isolation: isolate;
	width: auto;
	margin-block: clamp(40px, 6vw, 80px);
	padding: clamp(24px, 4vw, 64px) var(--edge);
	background: var(--screen);
}

.page-body > .wp-block-embed.is-type-video::before,
.film-page__screen::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--grain);
	background-size: 180px;
	opacity: 0.07;
	pointer-events: none;
}

.page-body > .wp-block-embed .wp-block-embed__wrapper {
	max-width: 1120px;
	margin-inline: auto;
}

.wp-block-embed iframe {
	border: 0;
}

/* Audio interviews: the accent panel, as on the cards. */
.page-body > .listen {
	width: min(44rem, calc(100% - 2 * var(--gutter)));
	margin-block: clamp(36px, 5vw, 64px);
	padding: 22px clamp(20px, 3vw, 32px) 26px;
	background: var(--mauve);
	color: var(--paper);
}

.listen__label {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 24px;
	margin: 0 0 16px;
	font-family: var(--serif);
	font-size: var(--t-xl);
	line-height: 1.2;
}

.listen__time {
	font-family: var(--sans);
	font-size: var(--t-s);
	color: var(--paper);
}

.listen .wp-block-audio {
	margin: 0;
}

.listen audio {
	display: block;
	width: 100%;
}

/* Transcripts: a disclosure, then a screenplay. Names centred above the lines. */
.page-body > .transcript-details {
	width: min(48rem, calc(100% - 2 * var(--gutter)));
	margin-top: clamp(48px, 7vw, 96px);
	border-top: 1px solid var(--ink-soft);
}

.transcript-details summary {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 4px 24px;
	padding: 20px 0;
	cursor: pointer;
	list-style: none;
}

.transcript-details summary::-webkit-details-marker {
	display: none;
}

.transcript-details__title {
	font-family: var(--serif);
	font-size: var(--t-2xl);
	line-height: 1.1;
	color: var(--ink);
}

.transcript-details__title::after {
	content: "+";
	margin-left: 0.4em;
	color: var(--mauve);
}

.transcript-details[open] .transcript-details__title::after {
	content: "\2013";
}

.transcript-details summary:hover .transcript-details__title {
	color: var(--mauve);
}

.transcript-details__count {
	font-size: var(--t-s);
	color: var(--ink-soft);
}

.transcript {
	padding: 12px 0 24px;
}

.transcript p {
	max-width: 32rem;
	margin: 0 auto 0.85em;
	font-family: var(--serif);
	font-size: var(--t-l);
	line-height: 1.5;
}

.transcript .transcript__speaker {
	margin: 2.1em auto 0.4em;
	font-family: var(--sans);
	font-size: var(--t-xs);
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-align: center;
	color: var(--ink-soft);
}

.transcript .transcript__speaker:first-child {
	margin-top: 1em;
}

.transcript__note {
	font-style: italic;
	color: var(--ink-soft);
}

.page-body > .wp-block-columns {
	width: var(--column);
	gap: 8px 40px;
	margin-block: 0 1em;
}

.page-body .wp-block-column p {
	margin: 0 0 1em;
	line-height: 1.7;
}

/* Story ------------------------------------------------------------------- */

.story__head,
.plain-page__head {
	width: min(52rem, calc(100% - 2 * var(--gutter)));
	margin-inline: auto;
	padding: clamp(56px, 8vw, 120px) 0 clamp(32px, 4vw, 56px);
}

.story__phase {
	margin: 0 0 clamp(28px, 4vw, 48px);
	font-size: var(--t-s);
}

.story__phase a {
	color: var(--ink-soft);
	text-decoration: none;
}

.story__phase a:hover {
	color: var(--mauve);
}

.story__num {
	margin-right: 12px;
	font-family: var(--serif);
	font-size: var(--t-l);
	color: var(--mauve);
}

.story__label {
	margin: 0 0 8px;
	font-size: var(--t-xs);
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.story__title,
.plain-page__title {
	margin: 0;
	font-size: clamp(2.5rem, 1.4rem + 3.4vw, 4.5rem);
	font-weight: 300;
	line-height: 0.98;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.story__subtitle {
	margin: 10px 0 0;
	font-family: var(--serif);
	font-size: var(--t-xl);
	font-style: italic;
	color: var(--ink-soft);
}

.story__date {
	margin: 20px 0 0;
	font-size: var(--t-s);
	color: var(--ink-soft);
}

.story__head + .story__body,
.plain-page__head + .plain-page__body {
	padding-top: 0;
}

.story__head,
.story__body > :first-child {
	/* The head and the first paragraph share the reading column's left edge. */
	box-sizing: border-box;
}

.story__head,
.plain-page__head {
	width: var(--column);
}

.story__topics {
	width: var(--column);
	margin: 0 auto;
	padding-top: 24px;
	border-top: 1px solid var(--rule);
}

.story__topics dl {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 20px 32px;
	margin: 0;
}

.story__topics dt {
	font-size: var(--t-xs);
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.story__topics dd {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 4px 0 0;
}

.story__topics dd a {
	font-family: var(--serif);
	font-size: var(--t-l);
	color: var(--ink);
	text-decoration: none;
}

.story__topics dd a:hover {
	color: var(--mauve);
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.story__more {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px clamp(24px, 4vw, 64px);
	margin-top: clamp(64px, 9vw, 128px);
	padding: clamp(32px, 4vw, 56px) var(--edge) clamp(56px, 7vw, 96px);
	border-top: 1px solid var(--rule);
}

.story__step {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: inherit;
	text-decoration: none;
}

.story__step--next {
	grid-column: 2;
	text-align: right;
}

.story__step-dir,
.story__step-label {
	font-size: var(--t-xs);
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.story__step-title {
	font-family: var(--serif);
	font-size: var(--t-2xl);
	line-height: 1.1;
	color: var(--ink);
	text-wrap: balance;
}

.story__step:hover .story__step-title {
	color: var(--mauve);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* Archives ---------------------------------------------------------------- */

.archive-page__head {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 20px 24px;
	align-items: end;
	padding: clamp(56px, 8vw, 120px) var(--edge) clamp(36px, 4vw, 56px);
}

.archive-page__name {
	grid-column: 1 / span 6;
}

.archive-page__num {
	display: block;
	margin-bottom: 12px;
	font-family: var(--serif);
	font-size: var(--t-xl);
	line-height: 1;
	color: var(--mauve);
}

.archive-page__kicker {
	margin: 0 0 8px;
	font-size: var(--t-xs);
	letter-spacing: 0.02em;
	color: var(--ink-soft);
}

.archive-page__title {
	margin: 0;
	font-size: var(--t-4xl);
	font-weight: 300;
	line-height: 0.95;
	letter-spacing: -0.01em;
}

.archive-page__count {
	margin: 14px 0 0;
	font-size: var(--t-s);
	color: var(--ink-soft);
}

.archive-page__words {
	grid-column: 7 / -1;
	max-width: 34rem;
}

.archive-page__line {
	margin: 0;
	font-family: var(--serif);
	font-size: var(--t-2xl);
	font-style: italic;
	line-height: 1.15;
	text-wrap: balance;
}

.archive-page__text {
	margin: 10px 0 0;
	color: var(--ink-soft);
}

.archive-page__empty {
	padding-inline: var(--edge);
}

/* Justified rows: every card grows in proportion to its picture's shape, so a row's
   pictures end up the same height without cropping. The filler keeps the last row short. */
.grid {
	display: flex;
	flex-wrap: wrap;
	gap: 44px clamp(14px, 1.6vw, 24px);
	margin: 0;
	padding: 0 var(--edge);
	list-style: none;
}

.grid::after {
	content: "";
	flex: 999 1 0;
}

.grid .card {
	flex: var(--ratio) 1 calc(var(--ratio) * 15rem);
	width: auto;
	min-width: 0;
}

.grid .card__media {
	height: auto;
	aspect-ratio: var(--ratio);
}

.pages ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: clamp(48px, 6vw, 80px) 0 0;
	padding: 0 var(--edge);
	list-style: none;
}

.pages .page-numbers {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--rule);
	color: var(--ink);
	text-decoration: none;
	font-size: var(--t-s);
}

.pages a.page-numbers:hover {
	border-color: var(--mauve);
	color: var(--mauve);
}

.pages .page-numbers.current {
	border-color: var(--mauve);
	background: var(--mauve);
	color: var(--paper);
}

.pages .page-numbers.dots {
	border-color: transparent;
}

.phases {
	margin-top: clamp(80px, 10vw, 144px);
	padding: clamp(32px, 4vw, 48px) var(--edge) clamp(56px, 7vw, 96px);
	border-top: 1px solid var(--rule);
}

.phases__title {
	margin: 0 0 20px;
	font-size: var(--t-xl);
	font-weight: 400;
}

.phases ol {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 20px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.phases a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: inherit;
	text-decoration: none;
}

.phases__num {
	font-family: var(--serif);
	color: var(--mauve);
}

.phases__name {
	font-family: var(--serif);
	font-size: var(--t-xl);
	line-height: 1.1;
	color: var(--ink);
}

.phases__when {
	font-size: var(--t-xs);
	color: var(--ink-soft);
}

.phases a:hover .phases__name,
.phases [aria-current] .phases__name {
	text-decoration: underline;
	text-decoration-color: var(--mauve);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* Film pages -------------------------------------------------------------- */

.film-page__screen {
	position: relative;
	isolation: isolate;
	padding: clamp(48px, 6vw, 88px) var(--edge) clamp(32px, 4vw, 56px);
	background: var(--screen);
	color: var(--screen-ink);
}

.film-page__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 28px;
	margin-bottom: clamp(24px, 3vw, 40px);
}

.film-page__kicker {
	flex-basis: 100%;
	margin: 0;
	font-size: var(--t-s);
}

.film-page__kicker a,
.film-page__parts a {
	color: var(--screen-soft);
	text-decoration: none;
}

.film-page__kicker a:hover {
	color: var(--screen-ink);
	text-decoration: underline;
}

.film-page__title {
	margin: 0;
	font-size: var(--t-4xl);
	font-weight: 300;
	line-height: 0.95;
	color: var(--screen-ink);
}

.film-page__when {
	margin: 0;
	color: var(--screen-soft);
}

.film-page__player .wp-block-embed__wrapper {
	max-width: none;
}

.film-page__parts ol {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 24px;
	margin: clamp(24px, 3vw, 40px) 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid rgb(236 231 232 / 0.14);
}

.film-page__parts a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 16px 0 4px;
}

.film-page__part {
	font-family: var(--serif);
	font-size: var(--t-xl);
	color: var(--screen-ink);
}

.film-page__part-when {
	font-size: var(--t-xs);
}

.film-page__parts a[aria-current] .film-page__part,
.film-page__parts a:hover .film-page__part {
	text-decoration: underline;
	text-decoration-color: var(--screen-soft);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.film-page__parts a:focus-visible,
.film-page__kicker a:focus-visible {
	outline-color: var(--screen-soft);
}

.film-page__body {
	padding-top: clamp(56px, 7vw, 96px);
}

.film-page__next {
	padding: clamp(32px, 4vw, 56px) var(--edge) clamp(56px, 7vw, 96px);
	border-top: 1px solid var(--rule);
}

.film-page__next a {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	color: inherit;
	text-decoration: none;
}

.film-page__next-label,
.film-page__next-when {
	font-size: var(--t-xs);
	color: var(--ink-soft);
}

.film-page__next-title {
	font-family: var(--serif);
	font-size: var(--t-3xl);
	font-weight: 300;
	line-height: 1;
}

.film-page__next a:hover .film-page__next-title {
	color: var(--mauve);
}

/* 404 --------------------------------------------------------------------- */

.not-found__phases {
	padding-left: 1.25em;
	font-family: var(--serif);
	font-size: var(--t-xl);
}

/* Smaller screens ---------------------------------------------------------- */

@media (max-width: 960px) {
	.archive-page__name,
	.archive-page__words {
		grid-column: 1 / -1;
	}

	.phases ol {
		grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	}
}

@media (max-width: 720px) {
	.grid .card {
		flex-basis: calc(var(--ratio) * 10rem);
	}

	.story__more {
		grid-template-columns: minmax(0, 1fr);
	}

	.story__step--next {
		grid-column: 1;
	}

	.film-page__parts ol {
		grid-template-columns: minmax(0, 1fr);
	}

	.film-page__parts a {
		flex-direction: row;
		justify-content: space-between;
		align-items: baseline;
		padding-block: 12px;
		border-bottom: 1px solid rgb(236 231 232 / 0.14);
	}
}
