/*
Theme Name: Lushington
Theme URI: https://michaellushington.com/
Author: Boozaglo Web Development
Author URI: https://boozagloweb.com/
Description: Custom reading-first theme for Michael Lushington's poems, stories, plays, and essays. Replaces Divi; includes a one-time Divi cleanup tool under Tools.
Version: 1.4.1
Requires at least: 6.3
Requires PHP: 7.4
License: Proprietary
Text Domain: lushington
*/

/* Literata, self-hosted (SIL OFL 1.1). Weights 300–600, optical sizes 12–72. */
@font-face {
	font-family: "Literata";
	src: url("assets/fonts/Literata-latin.woff2") format("woff2");
	font-weight: 300 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Literata";
	src: url("assets/fonts/Literata-Italic-latin.woff2") format("woff2");
	font-weight: 300 600;
	font-style: italic;
	font-display: swap;
}

:root {
	--paper: #f6f7f4;
	--ink: #1d2327;
	--graphite: #5d656b;
	--rule: #d6dbd5;
	--mist: #e7ecea;
	--lake: #2e5e63;
	--lake-deep: #1e3f43;

	--serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

	--step--1: 0.875rem;
	--step-0: 1.1875rem;   /* 19px reading size */
	--step-1: 1.4rem;
	--step-2: 1.75rem;
	--step-3: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
	--step-4: clamp(3rem, 1rem + 9vw, 8.25rem);

	--measure: 36rem;
	--wide: 72rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: var(--step-0);
	line-height: 1.7;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;

	/* Short pages: the main area grows so the signup band and footer sit at the bottom of the window. */
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}
.site-main { flex: 1 0 auto; }

img, iframe { max-width: 100%; }
img { height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--lake); }

:focus-visible { outline: 2px solid var(--lake); outline-offset: 3px; }

h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--ink); color: var(--paper);
	padding: 0.5rem 1rem; font-size: var(--step--1);
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.wrap {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }

.site-header__inner {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 4.5rem;
}
.site-brand { margin-right: auto; }
.site-nav { order: 2; }
.site-tools { order: 3; display: flex; align-items: center; gap: 1.25rem; }

.search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin-right: -0.5rem;
	color: inherit;
	border-radius: 50%;
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] { color: var(--lake); }

.site-search { border-top: 1px solid var(--rule); background: var(--paper); }
.site-search__inner {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
	padding-block: 1rem 1.25rem;
}
.site-search .search-form { margin: 0 0 0 auto; max-width: 34rem; }
.site-search .search-form input { font-size: var(--step-0); }

.site-brand--text {
	font-size: var(--step-1);
	font-weight: 500;
	letter-spacing: -0.01em;
	text-decoration: none;
}
.site-brand img { max-height: 3rem; width: auto; }

.site-nav .menu,
.site-nav .sub-menu { list-style: none; margin: 0; padding: 0; }

.site-nav .menu { display: flex; gap: 0.25rem 1.75rem; }
.site-nav .menu > li { position: relative; }
.site-nav a {
	display: block;
	padding: 0.5rem 0;
	font-size: 1rem;
	text-decoration: none;
}
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a { text-decoration: underline; }

.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: -1rem;
	min-width: 14rem;
	padding: 0.5rem 1rem;
	background: var(--paper);
	border: 1px solid var(--rule);
	z-index: 20;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-0.25rem);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
.site-nav .sub-menu a { padding: 0.35rem 0; }

.nav-toggle {
	display: none;
	align-items: center;
	gap: 0.6rem;
	background: none;
	border: 0;
	padding: 0.5rem 0;
	font: inherit;
	font-size: 1rem;
	color: inherit;
	cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 1.25rem;
	height: 1px;
	background: currentColor;
	transition: transform 0.2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -0.4rem; }
.nav-toggle__bars::after { top: 0.4rem; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(0.4rem) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-0.4rem) rotate(-45deg); }

@media (max-width: 52rem) {
	.site-header__inner { flex-wrap: wrap; gap: 0.75rem; }
	.site-brand--text { font-size: 1.25rem; }
	.site-tools { gap: 0.35rem; }
	.search-toggle { margin-right: 0; }
	.nav-toggle { display: inline-flex; }
	.site-nav { display: none; width: 100%; padding-bottom: 1rem; order: 4; }
	.nav-open .site-nav { display: block; }
	.site-nav .menu { flex-direction: column; gap: 0; }
	.site-nav .menu > li { border-top: 1px solid var(--rule); }
	.site-nav a { padding: 0.75rem 0; font-size: var(--step-0); }
	.site-nav .sub-menu {
		position: static; visibility: visible; opacity: 1; transform: none;
		border: 0; padding: 0 0 0.5rem 1rem; min-width: 0; background: none;
	}
	.site-nav .sub-menu a { padding: 0.4rem 0; font-size: 1rem; color: var(--graphite); }
	.site-search .search-form { margin: 0; max-width: none; }

	/* Keep the top row the same height whether or not the menu is open. */
	.site-header__inner { min-height: 0; row-gap: 0; }
	.site-brand,
	.site-tools { min-height: 4.5rem; display: flex; align-items: center; }

	/* The header stays at the top while scrolling on phones and tablets. */
	.site-header { position: sticky; top: 0; z-index: 50; }
	.nav-open .site-nav,
	.site-search:not([hidden]) { max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
	/* Anything scrolled to in-page lands below the sticky header. */
	#hero-piece, #footer-form, #main, .hero { scroll-margin-top: 4.5rem; }
}
/* Logged in: WordPress's admin bar is fixed above 600px wide, so sit below it. */
@media (min-width: 601px) and (max-width: 52rem) {
	.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 46px); }
}

/* Smallest phones: icon-only menu button so the header fits on one line. */
@media (max-width: 24rem) {
	.nav-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.nav-toggle { padding: 0.5rem; }
	.site-brand--text { font-size: 1.1rem; }
}

/* ---------- Homepage ---------- */

.hero {
	position: relative;
	min-height: min(88vh, 52rem);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--paper);
	background: var(--lake-deep);
	overflow: hidden;
}
.hero__image {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
}
.hero::after {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(ellipse at center, rgba(14, 28, 31, 0.55) 0%, rgba(14, 28, 31, 0.35) 60%, rgba(14, 28, 31, 0.25) 100%);
}
.hero--plain { min-height: 60vh; }
.hero--plain::after { display: none; }

.hero__inner {
	position: relative;
	z-index: 1;
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
	padding-block: clamp(4rem, 10vw, 6rem);
}
.hero__title {
	font-size: var(--step-4);
	font-weight: 300;
	line-height: 0.95;
	letter-spacing: -0.02em;
	max-width: 14ch;
	text-wrap: balance;
}
.hero__title a { text-decoration: none; color: inherit; }
.hero__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.hero__first {
	margin: 1.5rem 0 0;
	max-width: 32rem;
	font-size: var(--step-1);
	font-style: italic;
	line-height: 1.45;
	opacity: 0.92;
}
.hero__read { margin: 1.75rem 0 0; font-size: 1rem; }
.hero__read a { color: inherit; }
.hero a:focus-visible { outline-color: var(--paper); }
.hero__credit {
	position: absolute;
	z-index: 1;
	right: var(--gutter);
	bottom: 0.75rem;
	margin: 0;
	font-size: 0.75rem;
	opacity: 0.75;
}
.hero__credit a { color: inherit; }

.epigraph {
	width: min(100% - 2 * var(--gutter), 60rem);
	margin: clamp(4rem, 10vw, 7rem) auto;
}
.epigraph { text-align: center; }
.epigraph blockquote { margin: 0; }
.epigraph p {
	margin: 0;
	font-size: 1.7rem;
	font-style: italic;
	font-weight: 300;
	line-height: 1.45;
	text-wrap: balance;
}
@media (max-width: 40rem) {
	.epigraph p { font-size: 1.25rem; line-height: 1.5; }
}
.epigraph figcaption { margin-top: 1.25rem; color: var(--graphite); font-size: 1rem; }

.section-title {
	font-size: var(--step-1);
	font-weight: 500;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--ink);
	margin-bottom: 0.5rem;
}

.featured { margin-bottom: clamp(4rem, 8vw, 6rem); }
.featured__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
	gap: 2.5rem var(--gutter);
	margin-top: 1.5rem;
}
.feature__link { display: block; text-decoration: none; }
.feature__image { width: 100%; aspect-ratio: 36 / 25; object-fit: cover; background: var(--mist); }
.feature__title { font-size: var(--step-2); margin-top: 1.25rem; }
.feature__link:hover .feature__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.feature__first { margin: 0.5rem 0 0; font-style: italic; color: var(--graphite); }
.feature__meta { margin: 0.5rem 0 0; font-size: var(--step--1); color: var(--graphite); }

.latest { margin-bottom: clamp(4rem, 8vw, 6rem); }
.more-link { margin: 1.5rem 0 0; font-size: 1rem; }

.browse { margin-bottom: clamp(4rem, 8vw, 6rem); }
.browse .forms-nav { margin-top: 1.25rem; }

/* ---------- Index of writing ---------- */

.index { list-style: none; margin: 0; padding: 0; }

.index-row { border-bottom: 1px solid var(--rule); }
.index-row__link {
	display: grid;
	grid-template-columns: 3.5rem 1fr auto;
	gap: 1.25rem;
	align-items: center;
	padding: 1rem 0;
	text-decoration: none;
}
.index-row__link:hover { color: inherit; }
.index-row__link:hover .index-row__title { color: var(--lake); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.index-row__thumb img {
	width: 3.5rem;
	height: 3.5rem;
	object-fit: cover;
	background: var(--mist);
}
.index-row__link:not(:has(.index-row__thumb)) { grid-template-columns: 1fr auto; }
.index-row__text { display: grid; gap: 0.15rem; min-width: 0; }
.index-row__title { font-size: var(--step-1); line-height: 1.25; }
.index-row__first {
	font-style: italic;
	color: var(--graphite);
	font-size: 1rem;
	line-height: 1.45;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.index-row__meta {
	display: grid;
	justify-items: end;
	font-size: var(--step--1);
	color: var(--graphite);
	line-height: 1.4;
	white-space: nowrap;
}

@media (max-width: 40rem) {
	.index-row__link { grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; }
	.index-row__link:not(:has(.index-row__thumb)) { grid-template-columns: 1fr; }
	.index-row__thumb img { width: 3rem; height: 3rem; }
	.index-row__first { white-space: normal; }
	.index-row__meta { grid-column: 2; justify-items: start; display: flex; gap: 0.75rem; }
	.index-row__link:not(:has(.index-row__thumb)) .index-row__meta { grid-column: 1; }
}

.forms-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
}
.forms-nav a { text-decoration: none; font-size: 1.05rem; }
.forms-nav a:hover { text-decoration: underline; }
.forms-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; color: var(--lake); }
.forms-nav__count { color: var(--graphite); font-size: var(--step--1); font-variant-numeric: oldstyle-nums; margin-left: 0.15em; }

.listing { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 8vw, 6rem); }
.listing__head { margin-bottom: 2rem; max-width: 46rem; }
.listing__title { font-size: var(--step-3); letter-spacing: -0.01em; }
.listing__count { margin: 0.75rem 0 0; color: var(--graphite); font-size: 1rem; }
.listing__intro { margin-top: 1rem; }
.listing .forms-nav { padding-bottom: 1.25rem; border-bottom: 1px solid var(--ink); }
.empty { color: var(--graphite); font-style: italic; margin-top: 2rem; }

.pager { margin-top: 2.5rem; }
.pager ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 1rem; }
.pager .current { color: var(--lake); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.pager a { text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.search-form { display: flex; gap: 0.5rem; margin-top: 1.25rem; max-width: 30rem; }
.search-form input {
	flex: 1;
	min-width: 0;
	font: inherit;
	font-size: 1rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--graphite);
	border-radius: 2px;
	background: #fff;
	color: var(--ink);
}
.search-form button,
.ml-button a {
	font: inherit;
	font-size: 1rem;
	padding: 0.6rem 1.1rem;
	border: 1px solid var(--ink);
	border-radius: 2px;
	background: var(--ink);
	color: var(--paper);
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}
.search-form button:hover,
.ml-button a:hover { background: var(--lake); border-color: var(--lake); color: var(--paper); }

/* ---------- A single piece ---------- */

.entry { padding-block: clamp(3rem, 7vw, 5rem) clamp(3rem, 6vw, 4.5rem); }

.entry__head,
.entry__body > *,
.entry-nav,
.comments {
	width: min(100% - 2 * var(--gutter), var(--measure));
	margin-inline: auto;
}

.entry__title {
	font-size: var(--step-3);
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.entry__meta { margin: 1rem 0 0; color: var(--graphite); font-size: 1rem; }
.entry__meta a { color: inherit; }

.entry .ml-lead {
	width: min(100% - 2 * var(--gutter), 46rem);
	margin: 2.5rem auto 3rem;
}
.ml-lead img {
	margin-inline: auto;
	max-height: 80vh;
	width: auto;
	object-fit: contain;
}
.ml-lead figcaption,
.ml-figure figcaption {
	margin-top: 0.6rem;
	font-size: var(--step--1);
	color: var(--graphite);
	text-align: center;
}
.ml-lead figcaption a,
.ml-figure figcaption a { color: inherit; }

.entry__body { font-size: var(--step-0); }
.entry__body p { margin-block: 0 1.35em; }
.entry__body h2 { font-size: var(--step-2); margin-block: 2em 0.6em; }
.entry__body h3 { font-size: var(--step-1); margin-block: 1.8em 0.5em; }
.entry__body blockquote { margin-block: 0 1.35em; padding-left: 1.25rem; border-left: 2px solid var(--rule); font-style: italic; }
.entry__body ul,
.entry__body ol { padding-left: 1.25em; margin-block: 0 1.35em; }
.entry__body hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }

.entry__body .ml-figure { margin-block: 2rem; }
.ml-figure img { margin-inline: auto; }

.entry__body > .ml-embed,
.entry__body > .ml-card-grid,
.entry__body > .alignwide { width: min(100% - 2 * var(--gutter), 60rem); }

.ml-embed--pdf { margin-block: 2rem 0.75rem; }
.ml-embed--pdf iframe {
	display: block;
	width: 100%;
	height: min(85vh, 72rem);
	border: 1px solid var(--rule);
	background: #fff;
}
.ml-embed-link { font-size: 1rem; }

.ml-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: 2.5rem var(--gutter);
	margin-block: 2.5rem;
}
.ml-card { margin: 0; }
.ml-card img { width: 100%; aspect-ratio: 36 / 25; object-fit: cover; background: var(--mist); }
.ml-card figcaption { margin-top: 0.85rem; font-size: 1rem; line-height: 1.5; }
.ml-card figcaption p { margin: 0.4rem 0 0; text-align: left !important; }
.ml-card-title { display: block; font-size: var(--step-1); font-weight: 400; line-height: 1.25; }
.ml-card-sub { display: block; color: var(--graphite); }

.entry-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin-top: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ink);
}
.entry-nav a { text-decoration: none; display: grid; gap: 0.2rem; }
.entry-nav__next { text-align: right; grid-column: 2; }
.entry-nav__label { font-size: var(--step--1); color: var(--graphite); }
.entry-nav__title { font-size: var(--step-1); line-height: 1.25; }
.entry-nav a:hover .entry-nav__title { text-decoration: underline; text-decoration-thickness: 1px; }

.comments { margin-top: 4rem; }
.comment-list { padding-left: 1.25rem; }
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea { width: 100%; font: inherit; font-size: 1rem; padding: 0.6rem; border: 1px solid var(--graphite); border-radius: 2px; }

/* ---------- Newsletter ---------- */

.newsletter { background: var(--lake-deep); color: var(--paper); }
.newsletter__inner {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
	padding-block: clamp(3.5rem, 8vw, 5.5rem);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
	gap: 2rem 4rem;
	align-items: center;
}
.newsletter h2 { font-size: var(--step-2); font-weight: 400; }
.newsletter__copy p { margin: 0.75rem 0 0; opacity: 0.85; max-width: 30rem; }
.newsletter a { color: inherit; }
.newsletter :focus-visible { outline-color: var(--paper); }

/* MailPoet form, restyled to match. The #footer-form ID outranks MailPoet's own per-form styles. */
#footer-form .mailpoet_form { padding: 0 !important; background: none !important; width: 100% !important; }
#footer-form .mailpoet_form,
#footer-form .mailpoet_form p,
#footer-form .mailpoet_form label { color: var(--paper) !important; font-family: var(--serif) !important; }
/* The theme supplies the heading and text, so hide the form's own. */
#footer-form .mailpoet_form .mailpoet_form_paragraph,
#footer-form .mailpoet_form .mailpoet-heading,
#footer-form .mailpoet_form h1,
#footer-form .mailpoet_form h2,
#footer-form .mailpoet_form h3 { display: none !important; }
/* Stack any columns so the field and button sit full width. */
#footer-form .mailpoet_form .mailpoet_form_columns_container,
#footer-form .mailpoet_form .mailpoet_form_columns { display: block !important; margin: 0 !important; padding: 0 !important; }
#footer-form .mailpoet_form .mailpoet_form_column { width: 100% !important; max-width: none !important; flex: none !important; margin: 0 !important; padding: 0 !important; }
#footer-form .mailpoet_form .mailpoet_paragraph { margin: 0 0 0.75rem !important; max-width: 28rem; }
#footer-form .mailpoet_form input.mailpoet_text {
	width: 100% !important;
	font: inherit !important;
	font-size: 1rem !important;
	padding: 0.75rem 0.9rem !important;
	border: 1px solid rgba(246, 247, 244, 0.5) !important;
	border-radius: 2px !important;
	background: rgba(246, 247, 244, 0.08) !important;
	color: var(--paper) !important;
}
#footer-form .mailpoet_form input.mailpoet_text::placeholder { color: rgba(246, 247, 244, 0.7) !important; }
#footer-form .mailpoet_form input.mailpoet_submit {
	width: 100% !important;
	font: inherit !important;
	font-size: 1rem !important;
	font-weight: 500 !important;
	padding: 0.75rem 1.25rem !important;
	border: 0 !important;
	border-radius: 2px !important;
	background: var(--paper) !important;
	color: var(--lake-deep) !important;
	cursor: pointer;
}
#footer-form .mailpoet_form input.mailpoet_submit:hover { background: #fff !important; }
#footer-form .mailpoet_message p { font-size: 1rem !important; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: rgba(246, 247, 244, 0.75); font-size: var(--step--1); }
.site-footer__inner {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin-inline: auto;
	padding-block: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--paper); }
.site-footer :focus-visible { outline-color: var(--paper); }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ---------- WordPress core ---------- */

.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0.25rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.25rem 0 1rem 1.5rem; }
.wp-caption-text,
.wp-element-caption { font-size: var(--step--1); color: var(--graphite); text-align: center; }

/* ---------- Motion ---------- */

/* Homepage: the photo settles, then the title rises in word by word. */
@keyframes ml-settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes ml-rise { from { opacity: 0; transform: translateY(0.45em); } to { opacity: 1; transform: none; } }
@keyframes ml-fade { from { opacity: 0; } to { opacity: 1; } }

.hero__image { animation: ml-settle 3.2s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.hero__word {
	display: inline-block;
	animation: ml-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: calc(200ms + var(--i, 0) * 140ms);
}
/* Words are inline-blocks, so the hover underline goes on each word. */
.hero__title a:hover .hero__word { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.hero__first {
	animation: ml-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: calc(500ms + var(--words, 1) * 140ms);
}
.hero__read,
.hero__credit {
	animation: ml-fade 0.8s ease both;
	animation-delay: calc(850ms + var(--words, 1) * 140ms);
}
.hero__credit { animation-delay: 1.8s; }

/* Homepage: the featured piece unfolds in place under the photo. */
.unfold {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.unfold[hidden] { display: none; }
.unfold.is-open { grid-template-rows: 1fr; }
.unfold__inner { overflow: hidden; min-height: 0; }
.unfold .entry { border-bottom: 1px solid var(--rule); }
.unfold .entry__body {
	opacity: 0;
	transform: translateY(0.75rem);
	transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}
.unfold.is-open .entry__body { opacity: 1; transform: none; }
.unfold__actions {
	width: min(100% - 2 * var(--gutter), var(--measure));
	margin: 2.5rem auto 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	font-size: 1rem;
}
.unfold__close {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.unfold__close:hover { color: var(--lake); }

/* Phones and tablets: a back-to-top button once the reader is well down the page. */
.to-top { display: none; }
@media (max-width: 52rem) {
	.to-top {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		right: 1rem;
		bottom: 1rem;
		z-index: 55;
		width: 2.75rem;
		height: 2.75rem;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--ink);
		color: var(--paper);
		box-shadow: 0 2px 10px rgba(29, 35, 39, 0.25);
		cursor: pointer;
		opacity: 0;
		visibility: hidden;
		transform: translateY(0.5rem);
		transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
	}
	.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
	.to-top:hover,
	.to-top:focus-visible { background: var(--lake); }
}

/* Single pieces: a thin reading-progress line at the top of the window. */
.read-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--lake);
	transform: scaleX(0);
	transform-origin: 0 50%;
	z-index: 60;
	pointer-events: none;
}
.admin-bar .read-progress { top: var(--wp-admin--admin-bar--height, 32px); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
	.site-header, .newsletter, .site-footer, .entry-nav, .comments { display: none; }
	body { background: #fff; font-size: 12pt; }
}
