/*
 * Article template: header, hero photo and credit, reading column, table
 * of contents, inline media and captions, tags, share, author, related.
 */

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

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

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

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

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

.wpp-article__title {
	margin: 0;
	font-size: var(--wpp-step-5);
	line-height: 1.04;
}

/* A short multicolour bunting rule under the headline */
.wpp-article__title::after {
	content: "";
	display: block;
	width: 120px;
	height: 6px;
	margin-top: 0.6rem;
	border-radius: 3px;
	background: var(--wpp-stripe);
}

.wpp-article__standfirst {
	max-width: 50ch;
	margin: 20px 0 0;
	font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
	line-height: 1.45;
	color: var(--wpp-ink-soft);
}

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

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

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

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

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

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

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

	.wpp-article__hero-img {
		border-radius: var(--wpp-radius);
	}
}

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

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

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

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

/* The credit is the attachment caption: "Photo: Author / Licence, via Source". */
.wpp-credit {
	color: var(--wpp-ink-soft);
}

.wpp-credit a {
	color: inherit;
	text-decoration-color: var(--wpp-yellow);
	text-decoration-thickness: 2px;
}

.wpp-credit a:hover {
	color: var(--wpp-red-dark);
}

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

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

.wpp-article__body {
	min-width: 0;
	max-width: 720px;
}

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

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

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

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

.wpp-toc__title {
	cursor: pointer;
	font-family: var(--wpp-font-display);
	font-weight: 800;
	font-size: 1.1rem;
	padding-bottom: 10px;
	border-bottom: 4px solid transparent;
	border-image: var(--wpp-stripe) 1;
	list-style-position: inside;
}

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

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

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

.wpp-toc__list a:hover {
	color: var(--wpp-red-dark);
	text-decoration: underline;
}

@media (max-width: 1099px) {
	.wpp-toc {
		max-width: 720px;
		padding: 16px 18px;
		border-radius: var(--wpp-radius);
		background: var(--wpp-sand);
	}

	.wpp-toc__title {
		border-bottom: 0;
		border-image: none;
		padding-bottom: 0;
	}
}

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

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

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

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

.wpp-prose {
	font-family: var(--wpp-font-text);
	font-size: clamp(1.06rem, 1rem + 0.25vw, 1.2rem);
	line-height: 1.75;
	color: var(--wpp-ink);
}

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

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

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

.wpp-prose a {
	color: var(--wpp-blue);
	text-decoration-color: var(--wpp-yellow);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.wpp-prose a:hover {
	color: var(--wpp-red-dark);
}

.wpp-prose strong {
	font-weight: 700;
}

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

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

.wpp-prose li::marker {
	color: var(--wpp-red);
	font-family: var(--wpp-font-display);
	font-weight: 700;
}

.wpp-prose blockquote {
	margin-inline: 0;
	padding: 1rem 1.25rem;
	border-left: 6px solid var(--wpp-yellow);
	border-radius: 0 var(--wpp-radius) var(--wpp-radius) 0;
	background: var(--wpp-sand);
	font-size: 1.08em;
}

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

.wpp-prose img {
	height: auto;
}

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

/* Classic [caption] shortcode images: the caption carries the photo credit. */
.wpp-prose .wp-caption {
	max-width: 100%;
	margin-inline: 0;
}

.wpp-prose .wp-caption img {
	display: block;
	max-width: 100%;
	border-radius: var(--wpp-radius) var(--wpp-radius) 0 0;
}

.wpp-prose .wp-caption .wp-caption-text {
	margin: 0;
	padding: 0.5rem 0.85rem;
	border-radius: 0 0 var(--wpp-radius) var(--wpp-radius);
	background: var(--wpp-sand);
	font-size: var(--wpp-step--1);
	line-height: 1.45;
	color: var(--wpp-ink-soft);
}

.wpp-prose .wp-caption .wp-caption-text a {
	color: inherit;
	text-decoration-color: var(--wpp-yellow);
}

.wpp-prose .wp-caption .wp-caption-text a:hover {
	color: var(--wpp-red-dark);
}

.wpp-prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

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

.wpp-prose .wp-block-table thead th {
	border-bottom: 3px solid var(--wpp-ink);
	font-family: var(--wpp-font-display);
}

/* "Good to know" box: a group block with the class wpp-factbox. */
.wpp-prose .wpp-factbox {
	padding: 20px 22px;
	border-left: 6px solid var(--wpp-yellow);
	border-radius: 0 var(--wpp-radius) var(--wpp-radius) 0;
	background: var(--wpp-sand);
	font-size: 1rem;
	line-height: 1.6;
}

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

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

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

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

.wpp-tags__title,
.wpp-share__title {
	margin: 0 0 12px;
	font-size: var(--wpp-step-1);
}

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

.wpp-tags__list a,
.wpp-share__link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--wpp-radius-pill);
	background: var(--wpp-sand);
	color: var(--wpp-night);
	font-family: var(--wpp-font-display);
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wpp-tags__list a:hover,
.wpp-share__link:hover {
	background: var(--wpp-yellow);
	color: var(--wpp-night);
}

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

.wpp-author__avatar {
	border-radius: 50%;
	border: 3px solid var(--wpp-yellow);
}

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

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

.wpp-author__bio {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--wpp-ink-soft);
}

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

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

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