/*
Theme Name: Photo Story
Version: 2.1.0
Requires at least: 6.6
Requires PHP: 8.2
Text Domain: photo-story
License: GPL-2.0-or-later
*/

:root {
	--paper: #f4efe8;
	--ink: #28211d;
	--rust: #93452f;
	--rule: #c9b9aa;
	--wide: 76rem;
	--reading: 43rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.05rem;
	line-height: 1.7;
}
a { color: var(--rust); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible { outline: .2rem solid var(--rust); outline-offset: .25rem; }
img { display: block; max-width: 100%; height: auto; }
.skip-link {
	position: fixed;
	z-index: 20;
	top: -6rem;
	left: 1rem;
	padding: .8rem 1rem;
	background: var(--ink);
	color: var(--paper);
}
.skip-link:focus { top: 1rem; }

.story-masthead,
.story-colophon {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 2rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1.25rem clamp(1rem, 4vw, 3.5rem);
	border-bottom: 1px solid var(--rule);
}
.story-mark {
	color: var(--ink);
	font-size: 1.25rem;
	font-weight: 700;
	text-decoration: none;
}
.menu {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.story-main,
.story-archive,
.story-reading {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0 clamp(1rem, 4vw, 3.5rem);
}
.story-prologue {
	display: grid;
	align-content: center;
	min-height: 78vh;
	border-bottom: 1px solid var(--rust);
}
.story-prologue h1,
.story-page-title {
	max-width: 12ch;
	margin: .3rem 0 1rem;
	font-size: clamp(3rem, 9vw, 7.5rem);
	line-height: .92;
	letter-spacing: -.04em;
}
.story-kicker,
.chapter-heading p,
.story-index-item time {
	margin: 0;
	font-family: system-ui, sans-serif;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.story-introduction { max-width: 42rem; font-size: clamp(1.2rem, 2.4vw, 1.8rem); }
.story-chapter {
	display: grid;
	grid-template-columns: minmax(9rem, 1fr) minmax(0, 3fr);
	gap: clamp(1.5rem, 5vw, 5rem);
	padding: clamp(4rem, 9vw, 9rem) 0;
	border-bottom: 1px solid var(--rule);
}
.chapter-heading { position: sticky; top: 1rem; align-self: start; }
.chapter-heading h2 { margin: .5rem 0; font-size: 1.2rem; }
.story-frame { margin: 0 0 3rem; }
.story-frame img { width: 100%; max-height: 82vh; object-fit: cover; }
.story-frame figcaption { max-width: 36rem; margin-top: .65rem; font-size: .9rem; font-style: italic; }
.story-copy { max-width: var(--reading); }
.story-copy > :first-child { margin-top: 0; }
.story-sequence .story-frame:nth-child(even) { width: 78%; margin-left: auto; }
.story-listings { margin: 0; padding-left: 1.4rem; }
.story-listings li { padding: 0 0 2rem 1rem; }
.story-epilogue { max-width: var(--reading); margin: 6rem 0 6rem auto; }
.story-epilogue dt { margin-top: 2rem; font-weight: 700; }
.story-epilogue dd { margin: .5rem 0; }

.story-index { margin: 3rem 0; }
.story-index-item {
	display: grid;
	grid-template-columns: minmax(10rem, 1fr) 2fr;
	gap: 2rem;
	padding: 2rem 0;
	border-top: 1px solid var(--rule);
}
.story-index-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.story-index-item h2 { font-size: clamp(1.6rem, 3vw, 2.8rem); }
.story-reading { padding-block: clamp(3rem, 8vw, 8rem); }
.story-reading article > header,
.story-reading .entry-content { max-width: var(--reading); margin-inline: auto; }
.story-reading figure { max-width: 62rem; margin: 3rem auto; }
.entry-content img,
.entry-content .wp-block-gallery { max-width: 100%; }
.story-colophon { margin-top: 5rem; border-top: 1px solid var(--rule); border-bottom: 0; }
.story-colophon__mark span { display: block; font-size: .8rem; }

@media (max-width: 44rem) {
	.story-masthead,
	.story-colophon,
	.story-chapter { display: block; }
	.story-navigation,
	.story-colophon nav { margin-top: 1rem; }
	.chapter-heading { position: static; margin-bottom: 2rem; }
	.story-index-item { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
	.story-chapter,
	.story-index-item { border-color: CanvasText; }
}
