/**
 * Blog archive extras and the single article.
 *
 * The card grid itself is in blog.css, which both this and the home page
 * section share. What lives here is the archive intro, the pager, and the
 * typography for imported article HTML.
 *
 * The article body is classic editor markup written over several years, so the
 * rules below are deliberately element based rather than class based: there are
 * no wrapper classes to hook onto, and new posts will arrive the same way.
 */

/* =============================================================
   Archive
   ============================================================= */

.epc-archive__intro {
	max-width: 44rem;
	margin: 0 auto 2.5rem;
	text-align: center;
}

.epc-archive__intro .epc-blog__rule {
	margin-inline: auto;
	background: linear-gradient(90deg, transparent, var(--epc-white), transparent);
}

.epc-archive__count,
.epc-archive__empty {
	margin: 0;
	font-family: var(--epc-font-sans);
	font-size: 0.875rem;
	color: var(--epc-grey);
}

.epc-archive__empty {
	text-align: center;
}

/* --- Pager ---------------------------------------------------- */

.epc-pager {
	margin-top: 3rem;
}

.epc-pager__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.epc-pager__list .page-numbers {
	display: grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding-inline: 0.7rem;
	font-family: var(--epc-font-sans);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--epc-silver);
	text-decoration: none;
	background: var(--epc-wash);
	border: 1px solid var(--epc-line);
	border-radius: 10px;
	transition: color 320ms var(--epc-ease-soft),
		border-color 320ms var(--epc-ease-soft),
		background-color 320ms var(--epc-ease-soft);
}

.epc-pager__list a.page-numbers:hover,
.epc-pager__list a.page-numbers:focus-visible {
	color: var(--epc-white);
	background: rgb(255 255 255 / 10%);
	border-color: rgb(255 255 255 / 34%);
}

.epc-pager__list .page-numbers.current {
	color: var(--epc-black);
	background: var(--epc-white);
	border-color: var(--epc-white);
}

.epc-pager__list .page-numbers.dots {
	background: none;
	border-color: transparent;
}

/* =============================================================
   Article hero
   ============================================================= */

.epc-article__hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(20rem, 52vh, 30rem);
	min-height: clamp(20rem, 52svh, 30rem);
	overflow: hidden;
	background: var(--epc-black);
	isolation: isolate;
}

.epc-article__hero-media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.epc-article__hero-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * Heavier at the foot than the page heroes: the headline sits at the bottom
 * here, and article images are photographs of bright water.
 */
.epc-article__hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		180deg,
		rgb(0 0 0 / 55%) 0%,
		rgb(0 0 0 / 40%) 35%,
		rgb(0 0 0 / 88%) 100%
	);
	pointer-events: none;
}

/*
 * Same column as the body below it, so the headline and the first paragraph
 * share a left edge. On the full 1280px container the title started at 40px
 * while the body began at 265px, and the two halves of the page read as
 * unrelated.
 */
.epc-article__hero-inner {
	width: 100%;
	max-width: 64rem;
	margin-inline: auto;
	padding: 3rem var(--epc-gutter) 2.5rem;
}

.epc-article__hero-measure {
	max-width: 46rem;
	margin-inline: auto;
}

@media (min-width: 768px) {
	.epc-article__hero-inner {
		padding-block: 4rem 3rem;
	}
}

.epc-article__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0 0 1rem;
}

.epc-article__cats a {
	padding: 0.32rem 0.75rem;
	font-family: var(--epc-font-sans);
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--epc-white);
	background: rgb(255 255 255 / 12%);
	border: 1px solid var(--epc-line);
	border-radius: 999px;
	transition: background-color 320ms var(--epc-ease-soft);
}

.epc-article__cats a:hover,
.epc-article__cats a:focus-visible {
	background: rgb(255 255 255 / 24%);
}

.epc-article__title {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.5rem, 4.2vw, 2.75rem);
	font-weight: 600;
	line-height: 1.16;
	text-wrap: balance;
}

.epc-article__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	margin: 1.25rem 0 0;
	font-family: var(--epc-font-sans);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--epc-silver);
}

.epc-article__meta span {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
}

.epc-article__meta i {
	font-size: 0.75rem;
	color: var(--epc-grey);
}

/* =============================================================
   Article body
   ============================================================= */

/*
 * The background belongs on the full width element, not on the centred one.
 * Every other section in the theme is built that way; this one had its black
 * on __inner, so beyond that element's max-width the page background showed
 * through as two white bands down the sides.
 */
.epc-article {
	background: var(--epc-black);
}

/*
 * Narrower than the site container. An article is one column of text at a
 * 46rem measure, and hanging that inside the full 1280px frame left about
 * 270px of empty ground down each side. 64rem keeps the reading width the
 * same while closing most of that gap.
 */
.epc-article__inner {
	width: 100%;
	max-width: 64rem;
	margin-inline: auto;
	padding: 3rem var(--epc-gutter);
}

@media (min-width: 768px) {
	.epc-article__inner {
		padding-block: 4rem;
	}
}

/* A measure, not the full container: long lines are hard to read. */
.epc-article__body {
	max-width: 46rem;
	margin-inline: auto;
	font-family: var(--epc-font-sans);
	font-size: 1rem;
	line-height: 1.85;
	color: var(--epc-silver);
}

.epc-article__body > *:first-child {
	margin-top: 0;
}

.epc-article__body p {
	margin: 0 0 1.35rem;
	text-wrap: pretty;
}

.epc-article__body :is(h2, h3, h4, h5) {
	margin: 2.5rem 0 1rem;
	font-family: var(--epc-font-serif);
	font-weight: 600;
	line-height: 1.25;
	color: var(--epc-white);
	text-wrap: balance;
}

.epc-article__body h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
.epc-article__body h3 { font-size: clamp(1.125rem, 2.4vw, 1.375rem); }
.epc-article__body h4 { font-size: 1.0625rem; }
.epc-article__body h5 { font-size: 1rem; }

.epc-article__body a {
	color: var(--epc-white);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: rgb(255 255 255 / 38%);
	transition: text-decoration-color 320ms var(--epc-ease-soft);
}

.epc-article__body a:hover,
.epc-article__body a:focus-visible {
	text-decoration-color: var(--epc-white);
}

.epc-article__body strong,
.epc-article__body b {
	color: var(--epc-white);
	font-weight: 600;
}

.epc-article__body :is(ul, ol) {
	margin: 0 0 1.35rem;
	padding-left: 1.25rem;
}

.epc-article__body li {
	margin-bottom: 0.55rem;
	text-wrap: pretty;
}

.epc-article__body li::marker {
	color: var(--epc-grey);
}

.epc-article__body blockquote {
	margin: 2rem 0;
	padding: 0.35rem 0 0.35rem 1.25rem;
	font-family: var(--epc-font-serif);
	font-size: 1.0625rem;
	font-style: italic;
	color: var(--epc-white);
	border-left: 2px solid rgb(255 255 255 / 34%);
}

/*
 * Imported HTML carries inline width and height attributes and sometimes
 * inline styles, so these are forced: without them a 2000px wide image blows
 * out of the measure on a phone.
 */
.epc-article__body img {
	max-width: 100% !important;
	height: auto !important;
	margin-block: 1.5rem;
	border-radius: 14px;
}

.epc-article__body figure {
	margin: 1.75rem 0;
}

.epc-article__body figcaption {
	margin-top: 0.6rem;
	font-size: 0.8125rem;
	color: var(--epc-grey);
	text-align: center;
}

.epc-article__body iframe,
.epc-article__body video {
	max-width: 100%;
	margin-block: 1.5rem;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	border-radius: 14px;
}

/* Tables in the imported posts are wide; only the table scrolls. */
.epc-article__body table {
	display: block;
	width: 100%;
	overflow-x: auto;
	margin: 1.75rem 0;
	border-collapse: collapse;
	font-size: 0.875rem;
}

/*
 * Tables, figures and embeds step outside the reading measure and use the
 * whole column. The measure exists to keep line lengths readable, which is a
 * constraint on prose, not on a five column price table: squeezing one into
 * 46rem while empty space sat either side helped nobody.
 *
 * Only above 1100px, where that spare width actually exists.
 */
@media (min-width: 1100px) {
	.epc-article__body > :is(table, figure, iframe, video),
	.epc-article__body > .wp-block-table,
	.epc-article__body > .wp-block-image {
		width: calc(100% + 13rem);
		max-width: none;
		margin-inline: -6.5rem;
	}
}

.epc-article__body :is(th, td) {
	padding: 0.75rem 1rem;
	text-align: left;
	border: 1px solid var(--epc-line-soft);
}

.epc-article__body th {
	color: var(--epc-white);
	background: var(--epc-wash);
}

.epc-article__body hr {
	margin: 2.5rem 0;
	border: 0;
	border-top: 1px solid var(--epc-line-soft);
}

/* =============================================================
   Closing call to action
   ============================================================= */

.epc-article__foot {
	max-width: 46rem;
	margin: 3rem auto 0;
}

.epc-article__cta {
	padding: 2rem 1.5rem;
	text-align: center;
	background: var(--epc-gradient-surface);
	border: 1px solid rgb(141 143 142 / 30%);
	border-radius: 18px;
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
}

@media (min-width: 768px) {
	.epc-article__cta {
		padding: 2.5rem 2.5rem;
	}
}

.epc-article__cta-title {
	margin: 0 0 0.75rem;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.25rem, 3vw, 1.625rem);
	font-weight: 400;
	color: var(--epc-white);
}

.epc-article__cta-text {
	max-width: 38rem;
	margin: 0 auto 1.5rem;
	font-family: var(--epc-font-sans);
	font-size: 0.875rem;
	line-height: 1.8;
	color: var(--epc-grey);
	text-wrap: pretty;
}

.epc-article__cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

/* =============================================================
   Related
   ============================================================= */

.epc-related {
	border-top: 1px solid var(--epc-line-soft);
}

@media (prefers-reduced-motion: reduce) {
	.epc-pager__list .page-numbers,
	.epc-article__cats a,
	.epc-article__body a {
		transition-duration: 0.01ms !important;
	}
}
