/**
 * Article template — the editorial reading layer.
 *
 * This file adds ONLY what the article needs. Tokens, primitives and the
 * masthead come from css/home.css, because the article wrapper carries both
 * .dus-home and .dus-article. That is deliberate: it makes a second visual
 * identity structurally impossible — there is one token source for the site.
 *
 * The page is typographic. Quotation treatments are distinguished by weight,
 * colour, rule and indentation rather than by cards, shadows or rounded boxes.
 * Exactly one block is tinted (the Qur'an figure); everything else earns its
 * hierarchy from type and whitespace.
 *
 * Arabic is a first-class reading language here: it gets its own faces, its own
 * sizes and its own line-heights, never the Latin metrics.
 */

/*
 * EB Garamond, self-hosted (SIL Open Font License, redistributable). The
 * editorial serif for article titles and scholarly headings. Self-hosted rather
 * than requested from Google Fonts because Google's web subset drops the
 * precomposed U+1E92 (capital Z with dot below, used in scholarly
 * transliteration). This file is the upstream OFL variable font instanced at
 * weight 700 and subset to the full scholarly Latin set plus punctuation, so the
 * complete transliteration renders consistently in one face. It downloads only
 * on article surfaces, where this stylesheet is enqueued and the title uses it.
 */
@font-face {
	font-family: "EB Garamond";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/eb-garamond-700.woff2") format("woff2");
}

.dus-article {
	--acc-t: #faf1ea;          /* the single tint, for the Qur'an figure */
	--measure: 728px;          /* primary reading column, inside 680-760 */
	--rail: 240px;
	--railgap: 72px;
}

/* The article draws its own measures; the theme wrapper must not add any. */
body.single-article #main-content {
	margin: 0;
	padding: 0;
	max-width: none;
}

/* ============================================================ PROGRESS */

/*
 * Reading progress: a 2px hairline directly under the masthead. No floating
 * widget, no percentage, no circle.
 */
.dus-progress {
	position: sticky;
	top: 0;
	z-index: 20;
	height: 2px;
	background: var(--line);
}

.dus-progress__bar {
	display: block;
	height: 2px;
	width: 0;
	background: var(--acc);
	transition: width .08s linear;
}

@media (prefers-reduced-motion: reduce) {
	.dus-progress__bar { transition: none; }
}

/* ============================================================ HEAD */

.dus-article__back {
	padding-top: 26px;
}

.dus-article__back a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--body);
}

.dus-article__head {
	padding-top: 36px;
	text-align: center;
}

.dus-article__head-inner {
	max-width: 780px;
	margin: 0 auto;
}

.dus-article__title {
	/* Editorial serif: the article title is the deliberate classical moment. */
	font-family: var(--ft-serif);
	font-size: 46px;
	font-weight: 700;
	/* Serif wants far less negative tracking than the sans title did (-.036em). */
	letter-spacing: -.008em;
	line-height: 1.15;
	margin-top: 20px;
	color: var(--ink);
	text-wrap: balance;
}

.dus-article__standfirst {
	font-size: 19px;
	line-height: 1.65;
	color: var(--body);
	margin-top: 22px;
}

.dus-article__byline {
	margin-top: 24px;
}

.dus-article__byline strong {
	color: var(--body);
	font-weight: 600;
}

.dus-article__dates {
	margin-top: 6px;
}

/* ============================================================ HERO */

.dus-article__hero {
	padding-top: 36px;
}

/*
 * The base `.dus-home figure { margin: 0 }` reset cancels .dus-wrap's auto-
 * centring, so above --wrap the hero band left-aligns while the article grid
 * stays centred. Re-centre it so both share one axis (as on the video page).
 */
.dus-article .dus-article__hero {
	margin-inline: auto;
}

.dus-article__hero-media {
	max-width: 1040px;
	margin: 0 auto;
	aspect-ratio: 2 / 1;
}

.dus-article__hero figcaption {
	max-width: 1040px;
	margin: 12px auto 0;
}

/*
 * From the two-column breakpoint up, align the hero (and its caption) with the
 * article's BODY column instead of the full centred band: shift it right by the
 * grid's own rail + gap, and cap it at the reading measure so its RIGHT edge
 * meets the prose as well - not the wider grid cell. At >=1200 the fr column
 * already equals --measure, so the cap is a no-op and that (passed) geometry is
 * unchanged; between 1024 and 1199 the fr column is wider than --measure, and
 * the cap is exactly what pulls the right edge back onto the body. It keeps its
 * 2/1 ratio and stays tied to the grid because it reuses --rail / --railgap /
 * --measure. Below 1024 the rail folds and the body goes full-width, so the hero
 * already matches the reading column - this offset does not apply there.
 */
@media (min-width: 1024px) {
	.dus-article__hero-media,
	.dus-article__hero figcaption {
		max-width: var(--measure);
		margin-left: calc(max(0px, (100% - 1040px) / 2) + var(--rail) + var(--railgap));
		margin-right: max(0px, (100% - 1040px) / 2);
	}
}

/* ============================================================ GRID */

.dus-article__main {
	padding-top: 56px;
}

.dus-article__grid {
	max-width: 1040px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	gap: 0 var(--railgap);
	align-items: start;
}

/* ============================================================ RAIL */

.dus-article__rail {
	position: sticky;
	top: 34px;
}

.dus-rail__block + .dus-rail__block {
	margin-top: 30px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

/* contents — a details element, so mobile needs no JavaScript */
.dus-toc summary {
	list-style: none;
	cursor: pointer;
}
.dus-toc summary::-webkit-details-marker { display: none; }

.dus-toc__list {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.dus-toc__list a {
	display: block;
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--body);
	padding: 10px 0 10px 16px;
	border-left: 2px solid var(--line);
}

.dus-toc__list a:hover,
.dus-toc__list a:focus-visible {
	color: var(--ink);
	border-left-color: var(--acc);
	text-decoration: none;
}

.dus-toc__list .is-sub a {
	padding-left: 28px;
	font-size: 13.5px;
}

.dus-toc__list a.is-current {
	color: var(--ink);
	font-weight: 600;
	border-left-color: var(--acc);
}

/* language toggle — hidden by the template when there is no alternate */
.dus-lang {
	display: flex;
	gap: 6px;
	margin-top: 12px;
}

.dus-lang a {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--body);
}

.dus-lang a.is-current {
	background: var(--ink);
	color: #fff;
}

/* series — hidden by the template when there is no series */
.dus-series__title {
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.45;
	margin-top: 10px;
	color: var(--ink);
}

/* share — deliberately quiet: small, muted, text-led */
.dus-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.dus-share a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	color: var(--muted);
}

.dus-share a:hover,
.dus-share a:focus-visible { color: var(--acc); text-decoration: none; }

.dus-share svg { width: 16px; height: 16px; display: block; }

/* ============================================================ BODY TYPE */

.dus-article__body {
	max-width: var(--measure);
	font-size: 17.5px;
	line-height: 1.88;
	color: var(--body);
}

/*
 * PARAGRAPH RHYTHM.
 *
 * Consecutive body paragraphs sit at 0.8em (~14px here), so an argument reads
 * as continuous prose rather than as a stack of separated blocks. Set in em, so
 * it tracks the font size at every breakpoint without a second rule.
 *
 * Everything that is a STRUCTURAL change — heading, Qur'an, hadith, quotation,
 * Arabic passage, figure, table, list, apparatus — is given markedly more room
 * than this. That contrast is what organises the page: space now means "the
 * argument has changed gear", not merely "a new paragraph".
 */
/*
 * font-size: inherit is NOT redundant. style.css carries bare element rules —
 * p { margin: 0 0 25px; font-size: 24px } plus responsive overrides down to
 * 16px — and a value inherited from .dus-article__body always loses to a rule
 * matching the element itself, whatever the specificity. Without this the body
 * set at 24px, the 0.8em gap computed against 24px (19.2px), and the 728px
 * column carried ~50 characters instead of ~70.
 *
 * Declaring `inherit` outranks the bare rule while still following
 * .dus-article__body at every breakpoint: 17.5px desktop, 17px mobile.
 */
.dus-article__body > p,
.dus-article__body li { font-size: inherit; }

.dus-article__body > p { margin: 0 0 0.8em; }

.dus-article__body a {
	color: var(--acc);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.dus-lede {
	font-size: 20px;
	line-height: 1.7;
	color: var(--ink);
	font-weight: 500;
	margin: 0 0 26px;   /* the lede closes a unit, so a little more than 0.8em */
}

.dus-article__body h2 {
	/* Scholarly section headings share the editorial serif with the title. */
	font-family: var(--ft-serif);
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.004em;
	line-height: 1.24;
	color: var(--ink);
	/* ~3.3x the paragraph gap above, ~1x below: the heading binds to its text */
	margin: 48px 0 14px;
	scroll-margin-top: 90px;
}

.dus-article__body h3 {
	font-family: var(--ft-serif);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.003em;
	line-height: 1.3;
	color: var(--ink);
	margin: 36px 0 11px;
	scroll-margin-top: 90px;
}

.dus-article__body h4 {
	font-size: 17.5px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--ink);
	margin: 28px 0 9px;
}

/*
 * A list is the continuation of the sentence that introduces it, so it keeps
 * the paragraph gap above (0.8em, inherited from the preceding <p>) and takes
 * its separation below instead.
 */
.dus-article__body ol,
.dus-article__body ul {
	margin: 0 0 28px;
	padding-left: 24px;
	list-style-position: outside;
}

.dus-article__body ul { list-style: disc; }
.dus-article__body ol { list-style: decimal; }
.dus-article__body li { margin-bottom: 10px; padding-left: 4px; }

.dus-article__body strong { color: var(--ink); font-weight: 600; }

/* footnote markers and inline references */
.dus-fn {
	font-size: 11.5px;
	font-weight: 700;
	line-height: 0;
	vertical-align: super;
	padding: 0 1px;
}
.dus-fn a { color: var(--acc); text-decoration: none; }

.dus-ref {
	font-size: 14px;
	color: var(--acc-d);
	white-space: nowrap;
}

/* ============================================================ ARABIC */

/*
 * Arabic gets its own faces, sizes and leading. Amiri and Scheherazade New both
 * run optically smaller than Inter, so every Arabic block is sized up and given
 * markedly looser leading than the Latin around it.
 */
.dus-quran { font-family: "Scheherazade New", "Amiri", serif; }

/*
 * Editor-authored Arabic. Prose typed into the editor arrives as
 * <p lang="ar" dir="rtl"> with NO class, so none of the Arabic rules in this
 * section reach it and it fell back to Inter - which carries no Arabic glyphs,
 * leaving the OS to substitute a face that differs across platforms.
 *
 * :not([class]) is deliberate, and narrower than excluding Qur'an by name. Every
 * specialised Arabic element already carries a class (.dus-quran__ar,
 * .dus-source__ar, .dus-ar, .dus-inline-ar, .dus-arabic-para), so this rule
 * cannot reach any of them - including ones added later. The specialised
 * treatments are protected by not matching at all, rather than by weight.
 */
.dus-article__body [lang="ar"]:not([class]) {
	font-family: "Amiri", serif;
}

.dus-inline-ar {
	font-size: 1.18em;
	line-height: 1;
	color: var(--ink);
}

.dus-arabic-para {
	font-size: 27px;
	line-height: 2.05;
	text-align: right;
	color: var(--ink);
	margin: 34px 0;             /* Arabic keeps more air than English prose */
}

/* ---- Qur'an figure: the ONLY tinted block in the article ---- */
.dus-article__body figure.dus-quran {
	margin: 38px 0;             /* Arabic scripture block: the most air on the page */
	padding: 30px 32px;
	background: var(--acc-t);
	border-radius: var(--r);
}

.dus-quran__label { color: var(--acc-d); display: block; }

.dus-quran__ar {
	font-family: "Scheherazade New", "Amiri", serif;
	font-size: 38px;
	line-height: 2.0;
	text-align: right;
	color: var(--ink);
	margin: 18px 0 20px;
}

.dus-quran__tr {
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--body);
	margin: 0 0 12px;
}

.dus-quran__src {
	font-size: 14px;
	line-height: 1.6;
	color: var(--acc-d);
	font-weight: 600;
	margin: 0;
}

/* ---- hadith / source passage: rule on the RTL reading edge, no fill ---- */
.dus-article__body figure.dus-source {
	margin: 36px 0;
	padding: 2px 26px 2px 0;
	border-right: 2px solid var(--ink);
}

.dus-source__ar {
	font-size: 29px;
	line-height: 2.1;
	text-align: right;
	color: var(--ink);
	margin: 16px 0 18px;
}

.dus-source__tr {
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--body);
	margin: 0 0 12px;
}

.dus-source__meta {
	font-size: 14px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0;
}
.dus-source__meta strong { color: var(--body); font-weight: 600; }

/* ---- scholarly quotation: larger, no fill, no rule ---- */
.dus-article__body figure.dus-scholar { margin: 38px 0; }

.dus-scholar blockquote { margin: 0; padding: 0; border: 0; }

.dus-scholar blockquote p {
	font-size: 25px;
	font-weight: 600;
	letter-spacing: -.024em;
	line-height: 1.45;
	color: var(--ink);
	margin: 0 0 16px;
}

.dus-scholar figcaption {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 12px;
	font-size: 14px;
	color: var(--muted);
}

.dus-scholar__rule {
	width: 28px;
	height: 2px;
	background: var(--acc);
	display: inline-block;
}

.dus-scholar__who { color: var(--body); font-weight: 600; }

/* ---- ordinary blockquote: the quietest ---- */
.dus-article__body blockquote {
	margin: 32px 0;
	padding-left: 24px;
	border-left: 2px solid var(--line);
}

.dus-article__body blockquote p {
	font-size: 17px;
	line-height: 1.8;
	color: var(--muted);
	margin: 0;
}

/* ---- cited work: rules, not a box ---- */
.dus-cite {
	display: flex;
	gap: 20px;
	align-items: center;
	margin: 32px 0;
	padding: 22px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.dus-cite__cover {
	width: 58px;
	aspect-ratio: 3 / 4;
	border-radius: 4px;
	flex-shrink: 0;
}

.dus-cite__title { font-size: 17.5px; font-weight: 600; margin-top: 8px; color: var(--ink); }
.dus-cite__meta { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---- editorial note ---- */
.dus-note {
	margin-top: 40px;
	padding: 20px 0;
	border-top: 1px solid var(--line);
}

.dus-note p {
	font-size: 14px;
	line-height: 1.75;
	color: var(--muted);
	margin-top: 10px;
}

/* ============================================================ TABLE */

.dus-table-wrap {
	margin: 32px 0;
	overflow-x: auto;
}

.dus-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
	line-height: 1.6;
}

.dus-table caption {
	caption-side: top;
	text-align: left;
	font-size: 14px;
	color: var(--muted);
	padding-bottom: 12px;
}

.dus-table th,
.dus-table td {
	text-align: left;
	padding: 12px 16px 12px 0;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

.dus-table thead th {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--acc-d);
	border-bottom: 1px solid var(--ink);
	padding-bottom: 10px;
}

.dus-table td.dus-ar { font-size: 22px; line-height: 1.9; color: var(--ink); }

/* ============================================================ FIGURE */

.dus-article__body figure.dus-figure { margin: 34px 0; }

.dus-figure__media { aspect-ratio: 16 / 9; }

.dus-article__body figcaption {
	font-size: 14px;
	line-height: 1.6;
	color: var(--muted);
	margin-top: 12px;
}

/* ============================================================ APPARATUS */

.dus-footnotes {
	margin-top: 36px;
	padding-top: 26px;
	border-top: 2px solid var(--ink);
}

.dus-references {
	margin-top: 30px;
	padding-top: 26px;
	border-top: 1px solid var(--line);
}

.dus-footnotes h2,
.dus-references h2 {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.02em;
	margin: 0 0 16px;
	color: var(--ink);
}

.dus-footnotes ol,
.dus-references ol {
	margin: 0;
	padding-left: 20px;
	font-size: 15px;
	line-height: 1.75;          /* tighter scholarly rhythm in the apparatus */
	color: var(--body);
}

.dus-footnotes li,
.dus-references li { margin-bottom: 7px; padding-left: 4px; }

.dus-fn__back { margin-left: 6px; color: var(--acc); text-decoration: none; }

/* ============================================================ AUTHOR */

.dus-author {
	display: flex;
	gap: 22px;
	align-items: flex-start;
	margin-top: 44px;
	padding-top: 30px;
	border-top: 1px solid var(--line);
}

.dus-author__avatar {
	width: 88px;
	height: 88px;
	border-radius: 999px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--img);
}
.dus-author__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }

.dus-author__name {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: -.024em;
	margin-top: 9px;
	color: var(--ink);
}

.dus-author__bio { margin-top: 10px; }

/* ============================================================ PREV / NEXT */

.dus-prevnext {
	max-width: 1040px;
	margin: 0 auto;
	padding-top: 56px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 40px;
	border-top: 1px solid var(--line);
	margin-top: 64px;
}

.dus-prevnext__item { padding: 26px 0; }
.dus-prevnext__item--next { text-align: right; }

.dus-prevnext__label { display: block; }

.dus-prevnext__title {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -.02em;
	line-height: 1.35;
	margin-top: 8px;
	color: var(--ink);
}

/* ============================================================ RELATED */

.dus-related { padding-top: 88px; }

.dus-related__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 40px;
	margin-top: 36px;
}

.dus-related__media { display: block; aspect-ratio: 16 / 10; }
.dus-related__subj { display: block; margin-top: 22px; }

.dus-related__title {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.024em;
	line-height: 1.3;
	margin-top: 11px;
	color: var(--ink);
}

.dus-related__meta { margin-top: 14px; }

/* ============================================================ 1100px */

@media (max-width: 1199px) {
	.dus-article { --railgap: 48px; --rail: 210px; }
	.dus-article__title { font-size: 40px; }
}

/* ============================================================ TABLET */

@media (max-width: 1023px) {

	.dus-article__title { font-size: 36px; }

	/* the rail folds above the reading column */
	.dus-article__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.dus-article__rail {
		position: static;
		margin-bottom: 36px;
		padding-bottom: 28px;
		border-bottom: 1px solid var(--line);
	}

	/* contents becomes a compact disclosure */
	.dus-toc summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: 44px;
	}
	.dus-toc summary::after {
		content: "";
		width: 9px; height: 9px;
		border-right: 2px solid var(--muted);
		border-bottom: 2px solid var(--muted);
		transform: rotate(45deg);
		transition: transform .15s ease;
	}
	.dus-toc[open] summary::after { transform: rotate(-135deg); }

	.dus-rail__block + .dus-rail__block { margin-top: 22px; padding-top: 18px; }

	.dus-article__body { max-width: none; }

	.dus-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
}

/* On desktop the disclosure is always open and its control is not needed. */
@media (min-width: 1024px) {
	.dus-toc > summary { display: none; }
	.dus-toc > .dus-toc__list { display: block; }
}

/* ============================================================ MOBILE */

@media (max-width: 767px) {

	.dus-article__back { padding-top: 18px; }
	.dus-article__head { padding-top: 24px; text-align: left; }
	.dus-article__head-inner { max-width: none; }

	.dus-article__title { font-size: 30px; line-height: 1.18; margin-top: 14px; }
	.dus-article__standfirst { font-size: 17px; margin-top: 16px; }
	.dus-article__byline { margin-top: 18px; }

	.dus-article__hero { padding-top: 24px; }
	.dus-article__hero-media { aspect-ratio: 3 / 2; }

	.dus-article__main { padding-top: 32px; }

	.dus-article__body { font-size: 17px; line-height: 1.85; }
	/* the paragraph gap is in em, so it follows the smaller body size by itself */
	.dus-lede { font-size: 18.5px; margin: 0 0 22px; }

	.dus-article__body h2 { font-size: 23px; margin: 36px 0 13px; }
	.dus-article__body h3 { font-size: 19px; margin: 28px 0 10px; }
	.dus-article__body h4 { font-size: 17px; }

	/* Arabic stays generously sized; it is never squeezed to Latin metrics. */
	.dus-quran__ar { font-size: 28px; line-height: 1.95; }
	.dus-source__ar { font-size: 24px; line-height: 2.0; }
	.dus-arabic-para { font-size: 23px; line-height: 2.0; }
	.dus-table td.dus-ar { font-size: 20px; }

	.dus-article__body figure.dus-quran { padding: 22px 20px; }
	.dus-article__body figure.dus-source { padding-right: 18px; }

	.dus-quran__tr,
	.dus-source__tr { font-size: 16px; }

	.dus-scholar blockquote p { font-size: 21px; }

	/* the cited work stacks rather than squeezing its cover */
	.dus-cite { flex-direction: column; align-items: flex-start; gap: 14px; }

	.dus-table { font-size: 15px; }
	.dus-table th, .dus-table td { padding: 10px 12px 10px 0; }

	.dus-author { flex-direction: column; gap: 16px; }
	.dus-author__avatar { width: 64px; height: 64px; }

	.dus-prevnext {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		margin-top: 44px;
		padding-top: 8px;
	}
	.dus-prevnext__item { padding: 20px 0; border-bottom: 1px solid var(--line); }
	.dus-prevnext__item--next { text-align: left; }

	.dus-related { padding-top: 52px; }
	.dus-related__grid { grid-template-columns: minmax(0, 1fr); gap: 36px 0; margin-top: 26px; }
}
