/**
 * How a written article looks on the front of the site.
 *
 * Everything is scoped under .acs-article so it touches nothing else.
 *
 * THE RULE THAT MATTERS: the body text colour is never set to a fixed
 * value and never changes with the reader's operating system. It inherits
 * whatever colour the theme already uses for text on that page. A previous
 * version guessed — it turned the text pale whenever the reader's computer
 * was in dark mode, even though the page behind it was still white, and the
 * article came out almost invisible. Nothing here can do that again:
 * anything that needs to be quieter than the body text is the same colour
 * at a lower opacity, and every line and panel is a translucent grey that
 * works on a white page and a black one alike.
 *
 * Colours that CANNOT make text disappear — the accent, the fonts, the
 * corner radius — still take the theme's own values where the theme
 * publishes them (Theavy_MMO sets --mfth-*), so an article looks like part
 * of the site rather than a plugin's idea of one.
 */

.acs-article {
	/* Text: the theme's, always. */
	--acs-ink: currentColor;

	/* Panels and rules: mid grey at low opacity reads on any background. */
	--acs-line: rgba(128, 128, 128, .30);
	--acs-line-soft: rgba(128, 128, 128, .18);
	--acs-surface: rgba(128, 128, 128, .09);

	/* Safe to take from the theme — none of these carry the body text. */
	--acs-accent: var(--mfth-accent, #b4232a);
	--acs-link: var(--mfth-link-blue, var(--mfth-accent, #b4232a));
	--acs-serif: var(--mfth-serif, "Source Serif 4", Georgia, "Times New Roman", serif);
	--acs-sans: var(--mfth-font, system-ui, -apple-system, "Segoe UI", sans-serif);
	--acs-r-sm: var(--mfth-r-sm, 10px);
	--acs-r-md: var(--mfth-r-md, 14px);
	--acs-shadow: var(--mfth-shadow-md, 0 10px 30px -8px rgba(0, 0, 0, .25));

	max-width: 720px;
	margin-inline: auto;
	font-family: var(--acs-serif);
	font-size: 19px;
	line-height: 1.8;
	color: var(--acs-ink);
	overflow-wrap: break-word;
}

.acs-article p {
	margin: 0 0 26px;
	color: var(--acs-ink);
}

/* The opening. A larger first paragraph is what makes a page read as a
   piece of journalism rather than a blog entry. */
.acs-article > p:first-of-type {
	font-size: 21.5px;
	line-height: 1.6;
	font-weight: 500;
	margin-bottom: 30px;
}

.acs-article h2,
.acs-article h3 {
	font-family: var(--acs-serif);
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: -.012em;
	color: var(--acs-ink);
	margin: 44px 0 14px;
	text-wrap: balance;

	/* A heading starts a new band across the full column — it never sits
	   beside a floated photograph. The placement code is what makes sure
	   there is writing beside the picture before the next one arrives. */
	clear: both;
}

.acs-article h2 { font-size: 28px; }
.acs-article h3 { font-size: 21px; }

/* A short accent rule above each section break. */
.acs-article h2::before {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin-bottom: 16px;
	background: var(--acs-accent);
	border-radius: 2px;
}

.acs-article ul,
.acs-article ol {
	margin: 0 0 26px 1.3em;
	padding: 0;
	color: var(--acs-ink);
}

.acs-article li { margin-bottom: 9px; }

.acs-article a {
	color: var(--acs-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.acs-article blockquote {
	margin: 34px 0;
	padding: 2px 0 2px 24px;
	border-left: 3px solid var(--acs-accent);
	font-size: 21px;
	line-height: 1.6;
	font-style: italic;
	color: var(--acs-ink);
	opacity: .82;
}

.acs-article blockquote p:last-child { margin-bottom: 0; }

/* ---------- Pictures ---------- */

.acs-article .acs-figure,
.acs-article .acs-embed {
	margin: 8px 0 34px;
}

.acs-article .acs-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--acs-r-md);
	box-shadow: var(--acs-shadow);
}

.acs-article figcaption {
	margin-top: 11px;
	font-family: var(--acs-sans);
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--acs-ink);
	opacity: .68;
	padding-left: 13px;
	border-left: 2px solid var(--acs-line);
}

.acs-article .acs-credit {
	display: block;
	margin-top: 3px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .07em;
	opacity: .85;
}

/* On a wide screen the photograph sits into the text rather than breaking
   it in half — writing runs around the picture. */
@media (min-width: 1000px) {
	.acs-article .acs-figure {
		float: right;
		width: 340px;
		max-width: 48%;
		margin: 6px 0 24px 30px;
	}

	.acs-article .acs-figure + p,
	.acs-article .acs-figure + h2 {
		margin-top: 0;
	}
}

/* ---------- Video ---------- */

.acs-article .acs-embed-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	background: rgba(128, 128, 128, .22);
	border-radius: var(--acs-r-md);
	overflow: hidden;
	box-shadow: var(--acs-shadow);
}

.acs-article .acs-embed-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/*
 * The poster. A video used to be dropped straight in as a lazy iframe,
 * which meant a reader part-way down the page — and every screenshot of
 * it — got a black rectangle where the video should be. Now the still
 * shows immediately and the player is only loaded when someone actually
 * decides to watch, which is both faster and impossible to mistake for
 * something broken.
 */
.acs-article .acs-embed-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

.acs-article .acs-embed-play {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	cursor: pointer;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .05), rgba(0, 0, 0, .42));
	transition: background .18s ease;
}

.acs-article .acs-embed-play:hover,
.acs-article .acs-embed-play:focus-visible {
	background: linear-gradient(to bottom, rgba(0, 0, 0, .12), rgba(0, 0, 0, .52));
	outline: none;
}

.acs-article .acs-embed-play::after {
	content: "";
	width: 74px;
	height: 52px;
	border-radius: 14px;
	background: var(--acs-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E") center / 26px 26px no-repeat;
	box-shadow: 0 6px 20px -4px rgba(0, 0, 0, .55);
	transition: transform .18s ease;
}

.acs-article .acs-embed-play:hover::after,
.acs-article .acs-embed-play:focus-visible::after {
	transform: scale(1.08);
}

.acs-article .acs-embed-play:focus-visible {
	box-shadow: inset 0 0 0 3px var(--acs-accent);
}

@media (prefers-reduced-motion: reduce) {
	.acs-article .acs-embed-play,
	.acs-article .acs-embed-play::after { transition: none; }
}

/* A service we cannot frame — an honest link instead. */
.acs-article .acs-watch {
	padding: 15px 19px;
	background: var(--acs-surface);
	border: 1px solid var(--acs-line);
	border-radius: var(--acs-r-sm);
	font-family: var(--acs-sans);
	font-size: 15px;
	font-weight: 600;
}

/* ---------- The credit at the end ---------- */

.acs-article .acs-source {
	clear: both;
	margin-top: 38px;
	padding: 15px 19px;
	background: var(--acs-surface);
	border: 1px solid var(--acs-line);
	border-radius: var(--acs-r-sm);
	font-family: var(--acs-sans);
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--acs-ink);
	opacity: .78;
}

.acs-article .acs-source a { color: var(--acs-accent); }

.acs-article .acs-source-label {
	display: inline-block;
	margin-right: 9px;
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--acs-accent);
	color: var(--mfth-accent-ink, #fff);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	vertical-align: 1px;
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
	.acs-article { font-size: 17.5px; line-height: 1.75; }
	.acs-article > p:first-of-type { font-size: 19px; }
	.acs-article h2 { font-size: 23px; margin-top: 36px; }
	.acs-article h3 { font-size: 19px; }
	.acs-article p { margin-bottom: 22px; }
	.acs-article .acs-figure,
	.acs-article .acs-embed { margin: 6px 0 26px; }
	.acs-article .acs-embed-play::after { width: 62px; height: 44px; background-size: 22px 22px; }
}
