/*
 * Article template: header, hero photo, reading column, table of contents,
 * inline media, tags, share, author, after-article blocks.
 */

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

.wm-article__header {
	padding-top: clamp(24px, 4vw, 56px);
	padding-bottom: clamp(24px, 3vw, 40px);
}

.wm-article__header > * {
	max-width: 900px;
}

.wm-article__section {
	margin: 0 0 14px;
}

.wm-article__section .wm-cat {
	font-size: var(--wm-step-0);
}

.wm-article__title {
	margin: 0;
	font-size: var(--wm-step-5);
	line-height: 1.02;
	letter-spacing: -0.035em;
}

.wm-article__standfirst {
	max-width: 46ch;
	margin: 20px 0 0;
	font-family: var(--wm-font-text);
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
	line-height: 1.4;
	color: var(--wm-ink-soft);
}

.wm-article__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--wm-line);
	font-size: var(--wm-step--1);
	color: var(--wm-ink-soft);
}

.wm-article__meta p {
	margin: 0;
	display: grid;
	gap: 2px;
}

.wm-article__avatar {
	border-radius: 50%;
	flex: 0 0 auto;
}

.wm-article__dates {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 16px;
}

/* ---------- Hero photo ---------- */

.wm-article__hero {
	max-width: calc(var(--wm-wrap) + 2 * var(--wm-gutter));
	margin: 0 auto;
}

@media (min-width: 1280px) {
	.wm-article__hero {
		padding-inline: var(--wm-gutter);
	}
}

.wm-article__hero-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.wm-article__caption,
.wm-prose figcaption {
	margin-top: 10px;
	font-size: var(--wm-step--1);
	line-height: 1.45;
	color: var(--wm-ink-soft);
}

.wm-article__hero .wm-article__caption {
	padding-inline: var(--wm-gutter);
}

@media (min-width: 1280px) {
	.wm-article__hero .wm-article__caption {
		padding-inline: 0;
	}
}

.wm-credit {
	margin-left: 6px;
	color: var(--wm-ink-soft);
}

.wm-credit a {
	color: inherit;
}

/* ---------- Layout: reading column + TOC ---------- */

.wm-article__layout {
	display: grid;
	gap: 32px;
	padding-top: clamp(32px, 5vw, 56px);
}

.wm-article__body {
	min-width: 0;
	max-width: 700px;
}

@media (min-width: 1100px) {
	.wm-article__layout {
		grid-template-columns: minmax(0, 700px);
		justify-content: center;
	}

	.wm-article__layout.has-toc {
		grid-template-columns: 240px minmax(0, 700px);
		justify-content: start;
		gap: 72px;
		padding-left: calc(var(--wm-gutter) + 40px);
	}
}

/* ---------- Table of contents ---------- */

.wm-toc {
	font-size: 0.95rem;
}

.wm-toc__title {
	cursor: pointer;
	font-weight: 800;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--wm-ink);
	list-style-position: inside;
}

.wm-toc__list {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}

.wm-toc__item--h3 {
	padding-left: 14px;
	font-size: 0.9rem;
}

.wm-toc__list a {
	color: var(--wm-ink-soft);
	text-decoration: none;
	line-height: 1.35;
}

.wm-toc__list a:hover {
	color: var(--wm-coral-ink);
	text-decoration: underline;
}

@media (max-width: 1099px) {
	.wm-toc {
		max-width: 700px;
		padding: 16px 18px;
		background: var(--wm-capiz-2);
	}

	.wm-toc__title {
		border-bottom: 0;
		padding-bottom: 0;
	}
}

@media (min-width: 1100px) {
	.wm-toc {
		position: sticky;
		top: 124px;
		align-self: start;
		max-height: calc(100vh - 144px);
		overflow: auto;
	}

	.wm-toc__title {
		list-style: none;
		pointer-events: none;
	}

	.wm-toc__title::-webkit-details-marker {
		display: none;
	}
}

/* ---------- Prose ---------- */

.wm-prose {
	font-family: var(--wm-font-text);
	font-size: clamp(1.15rem, 1.08rem + 0.3vw, 1.3rem);
	line-height: 1.7;
	color: var(--wm-ink);
}

.wm-prose > * {
	margin-block: 0 1.15em;
}

.wm-prose h2 {
	margin-top: 2.2em;
	margin-bottom: 0.6em;
	font-size: var(--wm-step-3);
	scroll-margin-top: 130px;
}

.wm-prose h3 {
	margin-top: 1.8em;
	margin-bottom: 0.5em;
	font-size: var(--wm-step-1);
	letter-spacing: -0.01em;
	scroll-margin-top: 130px;
}

.wm-prose a {
	color: var(--wm-coral-ink);
	text-decoration-thickness: 1px;
}

.wm-prose a:hover {
	text-decoration-thickness: 2px;
}

.wm-prose strong {
	font-weight: 650;
}

.wm-prose ul,
.wm-prose ol {
	padding-left: 1.3em;
}

.wm-prose li + li {
	margin-top: 0.4em;
}

.wm-prose li::marker {
	color: var(--wm-coral-ink);
	font-family: var(--wm-font-display);
	font-weight: 700;
}

.wm-prose blockquote {
	margin-inline: 0;
	padding-left: 22px;
	border-left: 4px solid var(--wm-coral);
	font-style: italic;
	font-size: 1.15em;
}

.wm-prose figure {
	margin-inline: 0;
}

.wm-prose img {
	height: auto;
}

/* Wide and full images break out of the reading column. */
@media (min-width: 1100px) {
	.wm-prose .alignwide {
		width: min(1000px, calc(100vw - 2 * var(--wm-gutter)));
		max-width: none;
	}
}

.wm-prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--wm-font-display);
	font-size: 0.95rem;
}

.wm-prose .wp-block-table th,
.wm-prose .wp-block-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--wm-line);
	text-align: left;
	vertical-align: top;
}

.wm-prose .wp-block-table thead th {
	border-bottom: 2px solid var(--wm-ink);
}

/* "Good to know" box: a group block with the class wm-factbox. */
.wm-prose .wm-factbox {
	padding: 20px 22px;
	background: var(--wm-capiz-2);
	border-left: 4px solid var(--wm-mango);
	font-family: var(--wm-font-display);
	font-size: 1rem;
	line-height: 1.55;
}

.wm-prose .wm-factbox > :last-child {
	margin-bottom: 0;
}

/* Sources list at the end of a story: a list block with the class wm-sources. */
.wm-prose .wm-sources {
	font-family: var(--wm-font-display);
	font-size: 0.9rem;
	color: var(--wm-ink-soft);
}

/* ---------- Tags, share, author ---------- */

.wm-tags,
.wm-share,
.wm-author {
	margin-top: 40px;
	padding-top: 22px;
	border-top: 1px solid var(--wm-line);
}

.wm-tags__title,
.wm-share__title {
	margin: 0 0 12px;
	font-size: var(--wm-step-0);
	letter-spacing: 0;
}

.wm-tags__list,
.wm-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wm-tags__list a,
.wm-share__link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--wm-line);
	border-radius: var(--wm-radius);
	background: var(--wm-white);
	color: var(--wm-ink);
	font-family: var(--wm-font-display);
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none;
	cursor: pointer;
}

.wm-tags__list a:hover,
.wm-share__link:hover {
	border-color: var(--wm-ink);
}

.wm-author {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 18px;
	align-items: start;
}

.wm-author__avatar {
	border-radius: 50%;
}

.wm-author__name {
	margin: 0 0 6px;
	font-size: var(--wm-step-1);
}

.wm-author__name a {
	color: inherit;
	text-decoration: none;
}

.wm-author__bio {
	margin: 0;
	font-family: var(--wm-font-text);
	font-size: 1.08rem;
	line-height: 1.55;
	color: var(--wm-ink-soft);
}

/* ---------- After the article ---------- */

.wm-article__after {
	margin-top: var(--wm-section-space);
}

.wm-related {
	margin-top: var(--wm-section-space);
	border-top: 1px solid var(--wm-line);
}

.wm-article__comments {
	max-width: 760px;
	padding-bottom: var(--wm-section-space);
}
