/*
 * The Article (ADR-0019, ADR-0020, ADR-0023).
 *
 * One centred measure. Headings share the prose's left edge, so the reader's eye
 * starts once and keeps one axis all the way down. Only the hanging apparatus —
 * the section numeral, the photographic breakout, the byline ledger — is allowed
 * past that edge, and it never becomes a second column.
 */

.dcv-canvas--article { counter-reset: dcv-section; }

.dcv-article {
	max-width: var(--dcv-breakout);
	margin-inline: auto;
	padding: var(--dcv-space-lg) var(--dcv-gutter) var(--dcv-space-xl);
}

/* --- identity, before the image -------------------------------------------- */

.dcv-article__identity { max-width: var(--dcv-measure); }

.dcv-article__breadcrumbs {
	font-size: var(--dcv-text-xs);
	color: var(--dcv-muted);
	margin-bottom: var(--dcv-space-md);
}

.dcv-article__breadcrumbs a { color: inherit; text-decoration: none; }
.dcv-article__breadcrumbs a:hover { color: var(--dcv-cat-ink); }

.dcv-article__context {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--dcv-space-xs);
	margin-bottom: var(--dcv-space-sm);
}

.dcv-article__rubric,
.dcv-article__where {
	display: inline-flex;
	align-items: center;
	gap: var(--dcv-space-3xs);
	text-decoration: none;
	color: var(--dcv-cat-ink);
}

.dcv-article__where {
	color: var(--dcv-muted);
	padding-left: var(--dcv-space-xs);
	border-left: 1px solid var(--dcv-line-strong);
}

.dcv-article__rubric:hover,
.dcv-article__where:hover { color: var(--dcv-ink); }

.dcv-article__title {
	font-size: var(--dcv-display-2);
	line-height: var(--dcv-leading-display);
	letter-spacing: -0.022em;
	margin: 0;
	color: var(--dcv-ink);
}

.dcv-article__excerpt {
	margin: var(--dcv-space-sm) 0 0;
	font-size: var(--dcv-text-prose);
	line-height: 1.55;
	color: var(--dcv-muted);
}

/* The byline as a ruled ledger of equal cells. Part of the hanging apparatus:
   at wide viewports it takes the surplus width the prose does not use. */
.dcv-article__ledger {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin: var(--dcv-space-md) 0 0;
	border-top: 1px solid var(--dcv-line);
	border-bottom: 1px solid var(--dcv-line);
}

@media (min-width: 48rem) {
	.dcv-article__ledger {
		grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
		max-width: var(--dcv-breakout);
	}
}

.dcv-article__cell {
	padding: var(--dcv-space-sm) var(--dcv-space-md) var(--dcv-space-sm) 0;
	border-left: 1px solid var(--dcv-line);
	padding-left: var(--dcv-space-md);
}

.dcv-article__cell:nth-child(odd) { border-left: 0; padding-left: 0; }

@media (min-width: 48rem) {
	.dcv-article__cell:nth-child(odd) { border-left: 1px solid var(--dcv-line); padding-left: var(--dcv-space-md); }
	.dcv-article__cell:first-child { border-left: 0; padding-left: 0; }
}

.dcv-article__cell dd {
	margin: var(--dcv-space-3xs) 0 0;
	font-size: var(--dcv-text-sm);
}

/* --- the featured plate, contained at breakout width ----------------------- */

.dcv-article__plate {
	margin: var(--dcv-space-lg) 0 0;
	max-width: var(--dcv-breakout);
}

.dcv-article__image {
	width: 100%;
	border-radius: var(--dcv-radius);
}

.dcv-article__plate-context {
	margin-top: var(--dcv-space-2xs);
	font-size: var(--dcv-text-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dcv-muted);
}

/* --- the table of contents: one hairline disclosure row -------------------- */

.dcv-toc {
	max-width: var(--dcv-measure);
	margin: var(--dcv-space-lg) 0 0;
	border-top: 1px solid var(--dcv-line);
	border-bottom: 1px solid var(--dcv-line);
}

.dcv-toc__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--dcv-space-sm);
	padding: var(--dcv-space-xs) 0;
	cursor: pointer;
	list-style: none;
}

.dcv-toc__summary::-webkit-details-marker { display: none; }

.dcv-toc__count { font-size: var(--dcv-text-xs); color: var(--dcv-muted); }

.dcv-toc__list {
	margin: 0 0 var(--dcv-space-sm);
	padding-left: var(--dcv-space-md);
	display: flex;
	flex-direction: column;
	gap: var(--dcv-space-2xs);
	font-size: var(--dcv-text-sm);
}

.dcv-toc__list a { color: var(--dcv-muted); text-decoration: none; }
.dcv-toc__list a:hover { color: var(--dcv-cat-ink); }

/* --- the prose ------------------------------------------------------------- */

.dcv-article__body { margin-top: var(--dcv-space-lg); }

.dcv-article .dcv-prose {
	max-width: var(--dcv-measure);
	font-size: var(--dcv-text-prose);
	line-height: var(--dcv-leading-prose);
	color: var(--dcv-ink);
}

/* Headings share the prose left edge; the numeral hangs in the gutter beside
   them. That is the whole of the hanging apparatus for type. */
.dcv-article .dcv-prose h2 {
	position: relative;
	counter-increment: dcv-section;
	font-family: var(--dcv-font-display);
	font-style: normal;
	font-size: var(--dcv-display-3);
	line-height: var(--dcv-leading-title);
	color: var(--dcv-ink);
	margin: 2.2em 0 0.6em;
	padding: 0;
	border: 0;
	scroll-margin-top: var(--dcv-space-lg);
}

.dcv-article .dcv-prose h2::before {
	content: counter(dcv-section, decimal-leading-zero);
	position: absolute;
	left: -3.25rem;
	top: 0.35em;
	font-size: var(--dcv-text-sm);
	color: var(--dcv-muted);
	font-variant-numeric: tabular-nums;
}

@media (max-width: 68rem) {
	/* No gutter to hang in: the numeral sits inline rather than colliding. */
	.dcv-article .dcv-prose h2::before {
		position: static;
		display: block;
		margin-bottom: var(--dcv-space-3xs);
	}
}

.dcv-article .dcv-prose h3 {
	font-family: var(--dcv-font-display);
	font-style: normal;
	font-size: var(--dcv-display-4);
	color: var(--dcv-ink);
	margin: 1.8em 0 0.5em;
	padding: 0;
	border: 0;
}

.dcv-article .dcv-prose p {
	margin: 0 0 1.15em;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

/*
 * A link inside prose keeps its underline at rest — inside a paragraph it is the
 * only thing marking the link at all — so the hover has to say something else:
 * the rule thickens, drops away from the baseline, and the words themselves take
 * the section's pigment. Weight, distance and colour, all at once, on the same
 * long ease-out as everything else.
 */
.dcv-article .dcv-prose a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-color: var(--dcv-cat-ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--dcv-duration-fast) var(--dcv-ease),
	            text-decoration-color var(--dcv-duration-fast) var(--dcv-ease),
	            text-decoration-thickness var(--dcv-duration-fast) var(--dcv-ease),
	            text-underline-offset var(--dcv-duration-fast) var(--dcv-ease);
}

.dcv-article .dcv-prose a:hover,
.dcv-article .dcv-prose a:focus-visible {
	color: var(--dcv-cat-ink);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.24em;
}

.dcv-article .dcv-prose ul,
.dcv-article .dcv-prose ol {
	margin: 0 0 1.15em;
	padding-left: 1.35em;
}

.dcv-article .dcv-prose li { margin-bottom: 0.4em; }

.dcv-article .dcv-prose blockquote {
	margin: 1.6em 0;
	padding: 0 0 0 var(--dcv-space-md);
	border: 0;
	border-left: 1px solid var(--dcv-cat-ink);
	font-style: normal;
	color: var(--dcv-muted);
}

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

/* Figures and tables break out one step wider than the prose; captions return
   to the measure. */
.dcv-article .dcv-prose figure {
	margin: 1.8em 0;
	max-width: var(--dcv-breakout);
	width: 100%;
	padding: 0;
}

.dcv-article .dcv-prose figure img { border-radius: var(--dcv-radius); }

.dcv-article .dcv-prose figcaption {
	margin-top: var(--dcv-space-2xs);
	max-width: var(--dcv-measure);
	font-size: var(--dcv-text-sm);
	font-style: normal;
	color: var(--dcv-muted);
	padding: 0;
}

/* A table is the one thing that must be allowed to scroll on its own rather
   than push the page sideways. */
.dcv-article .dcv-prose table {
	display: block;
	max-width: var(--dcv-breakout);
	overflow-x: auto;
	border-collapse: collapse;
	font-size: var(--dcv-text-sm);
	margin: 1.8em 0;
}

.dcv-article .dcv-prose th,
.dcv-article .dcv-prose td {
	border: 1px solid var(--dcv-line);
	padding: var(--dcv-space-2xs) var(--dcv-space-xs);
	text-align: left;
}

.dcv-article .dcv-prose img { height: auto; }

/*
 * Authored info boxes. Part of the corpus carries an <aside class="wpaz-info-box">
 * inside the body: content, not layout, and nothing to do with ADR-0019's rule
 * against sidebars. Given the house treatment rather than left to a plugin's.
 */
.dcv-article .dcv-prose .wpaz-info-box {
	margin: 1.8em 0;
	padding: var(--dcv-space-sm) var(--dcv-space-md);
	background: var(--dcv-canvas-sunk);
	border: 1px solid var(--dcv-line);
	border-radius: var(--dcv-radius);
	font-size: var(--dcv-text-base);
	line-height: 1.55;
}

.dcv-article .dcv-prose .wpaz-info-box > *:last-child { margin-bottom: 0; }

/* --- the wayfinding row ---------------------------------------------------- */

.dcv-wayfinding {
	display: flex;
	flex-wrap: wrap;
	gap: var(--dcv-space-lg);
	margin-top: var(--dcv-space-xl);
	padding-top: var(--dcv-space-sm);
	border-top: 1px solid var(--dcv-line);
	max-width: var(--dcv-breakout);
}

.dcv-wayfinding__cell {
	display: flex;
	flex-direction: column;
	gap: var(--dcv-space-3xs);
}

/* Sized to its own words, not to the cell: the rule the link gesture draws has
   to end where the name ends. */
.dcv-wayfinding__cell a {
	align-self: start;
	font-family: var(--dcv-font-display);
	font-size: 1.05rem;
	text-decoration: none;
}

.dcv-wayfinding__cell a:hover { color: var(--dcv-cat-ink); }

/* --- related content: the page's single tonal change, kept late ------------ */

.dcv-related { padding-block: var(--dcv-space-section); }
.dcv-related__title { color: var(--dcv-on-olive); }

.dcv-related__list {
	border-top-color: var(--dcv-on-olive-line);
	margin-top: var(--dcv-space-sm);
}

.dcv-related__list .dcv-index__row { border-bottom-color: var(--dcv-on-olive-line); }
.dcv-related__list .dcv-index__row:hover {
	background-color: var(--dcv-olive-raised);
	background-color: color-mix(in oklab, var(--dcv-cat-glow) 10%, var(--dcv-olive-raised));
}

.dcv-related__list .dcv-index__row:hover .dcv-preview__numeral,
.dcv-related__list .dcv-index__row:hover .dcv-preview__label { color: var(--dcv-cat-glow); }
.dcv-related__list .dcv-preview__title { color: var(--dcv-on-olive); }
.dcv-related__list .dcv-preview__numeral { color: var(--dcv-on-olive-muted); }
.dcv-related__list .dcv-preview__label { color: var(--dcv-cat-glow); }
.dcv-related__list .dcv-preview__excerpt { color: var(--dcv-on-olive-muted); }

/* --- reading progress: the Rail's own edge --------------------------------- */

/*
 * Not a widget at the foot of the column and not a bar laid across the top of
 * the page: the Rail's right edge — the line already dividing chrome from
 * canvas — fills as the reader descends. Absolutely positioned, so it costs no
 * layout height and cannot push the column into a scroll, and unlabelled,
 * because a percentage is a number a reader does nothing with.
 */
.dcv-rail__progress {
	position: absolute;
	inset: 0 -1px 0 auto;
	width: 2px;
	pointer-events: none;
}

.dcv-progress {
	position: absolute;
	inset: 0 auto 0 0;
	width: 2px;
	/* On the olive edge, so the light cut of the Article's own pigment. */
	background: var(--dcv-cat-glow);
	transform-origin: top;
	transform: scaleY(0);
}
