/* =============================================================================
   TEN DIGITALS - EDITORIAL CONTENT
   Long-form prose, breadcrumbs, pagination and search.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   PROSE
   Body copy holds a 600-760px measure, per the global page construction rules.
   -------------------------------------------------------------------------- */

.td-prose {
	color: var(--td-ink-2);
	font-size: var(--td-fs-body);
	line-height: var(--td-lh-loose);
	max-width: 68ch;
}

/* The measure above is the rule this file has always claimed and never
   enforced: without it an article inherits the 1120px reading container and
   runs to about 115 characters a line, which is roughly twice what anybody
   reads comfortably. Everything else in here assumes that column width. */

.td-prose > * + * { margin-top: 1.35em; }

.td-prose h2,
.td-prose h3,
.td-prose h4 {
	color: var(--td-ink);
	letter-spacing: var(--td-tracking-head);
	line-height: var(--td-lh-tight);
	scroll-margin-top: calc(var(--td-header-h) + 32px);
	text-wrap: balance;
}

.td-prose h2 { font-size: var(--td-fs-h3); margin-top: 2.4em; }
.td-prose h3 { font-size: var(--td-fs-h4); margin-top: 2em; }
.td-prose h4 { font-size: 1.125rem; margin-top: 1.9em; }

/* A hairline above every top-level heading. In a long read this is what tells
   you a new argument has started before you have read a word of it. */
.td-prose h2::before {
	background: var(--td-line);
	content: "";
	display: block;
	height: 1px;
	margin-bottom: 0.9em;
	width: 100%;
}

.td-prose h2:first-child { margin-top: 0; }
.td-prose h2:first-child::before { display: none; }

/* The opening paragraph carries the article into its own voice. */
.td-prose > p:first-child {
	color: var(--td-ink);
	font-size: var(--td-fs-lead);
	line-height: var(--td-lh-body);
}

/* -----------------------------------------------------------------------------
   ARTICLE LAYOUT
   Body plus a rail. The rail is where the contents list belongs on a long read:
   in view while you scroll, rather than something you scrolled past.
   -------------------------------------------------------------------------- */

.td-body > .td-container > .td-prose { margin-inline: auto; }

.td-body__grid {
	display: grid;
	gap: var(--td-s-6);
	grid-template-columns: minmax(0, 1fr);
}

.td-body__grid .td-prose { max-width: none; }

/* Narrow screens read the contents first, then the article - so the aside is
   ordered above the body here and moved beside it further down. */
.td-body__aside { order: -1; }

@media (min-width: 960px) {
	.td-body__grid {
		align-items: start;
		column-gap: clamp(40px, 5vw, 88px);
		grid-template-columns: minmax(0, 68ch) minmax(190px, 240px);
		justify-content: center;
	}

	.td-body__aside {
		order: 0;
		position: sticky;
		top: calc(var(--td-header-h) + var(--td-s-5));
	}
}

.td-prose a {
	color: var(--td-accent);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--td-accent) 42%, transparent);
}

.td-prose a:hover { text-decoration-color: var(--td-accent); }

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

.td-prose li + li { margin-top: 0.5em; }

.td-prose ul { list-style: none; padding-left: 0; }

.td-prose ul > li {
	padding-left: 1.6em;
	position: relative;
}

.td-prose ul > li::before {
	background: var(--td-grad-brand);
	border-radius: 2px;
	content: "";
	height: 7px;
	left: 0.15em;
	position: absolute;
	top: 0.66em;
	transform: rotate(45deg);
	width: 7px;
}

.td-prose blockquote {
	border-left: 2px solid var(--td-accent);
	color: var(--td-ink);
	font-family: var(--td-font-editorial);
	font-size: var(--td-fs-h4);
	line-height: 1.4;
	margin-block: 1.8em;
	padding: 0.2em 0 0.2em 1.4em;
}

.td-prose blockquote cite {
	color: var(--td-ink-3);
	display: block;
	font-family: var(--td-font-body);
	font-size: var(--td-fs-sm);
	font-style: normal;
	margin-top: 0.8em;
}

.td-prose img,
.td-prose figure { border-radius: var(--td-r-card); }

.td-prose figure { margin-block: 2em; }

.td-prose pre {
	background: var(--td-well-bg);
	border: 1px solid var(--td-line);
	border-radius: var(--td-r-btn);
	overflow-x: auto;
	padding: 20px;
}

.td-prose code {
	background: var(--td-well-bg);
	border-radius: 4px;
	padding: 0.15em 0.4em;
}

.td-prose pre code { background: none; padding: 0; }

.td-prose table {
	border-collapse: collapse;
	display: block;
	overflow-x: auto;
	width: 100%;
}

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

.td-prose th {
	color: var(--td-ink);
	font-size: var(--td-fs-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* -----------------------------------------------------------------------------
   BREADCRUMBS
   -------------------------------------------------------------------------- */

.td-breadcrumbs {
	color: var(--td-ink-3);
	font-size: var(--td-fs-xs);
	margin-bottom: var(--td-s-6);
}

.td-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.td-breadcrumbs li { align-items: center; display: flex; gap: 10px; }

.td-breadcrumbs li + li::before {
	color: var(--td-ink-4);
	content: "/";
}

.td-breadcrumbs a { color: inherit; text-decoration: none; }
.td-breadcrumbs a:hover { color: var(--td-accent); }
.td-breadcrumbs [aria-current="page"] { color: var(--td-ink); }

/* -----------------------------------------------------------------------------
   PAGINATION
   -------------------------------------------------------------------------- */

.pagination,
.td-page-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--td-s-2);
	justify-content: center;
	margin-top: var(--td-s-8);
}

.pagination .nav-links,
.td-page-links {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--td-s-2);
}

.page-numbers {
	align-items: center;
	border: 1px solid var(--td-line);
	border-radius: var(--td-r-btn);
	color: var(--td-ink-2);
	display: inline-flex;
	font-size: var(--td-fs-sm);
	justify-content: center;
	min-width: 44px;
	padding: 11px 14px;
	text-decoration: none;
	transition:
		border-color var(--td-t-micro) var(--td-ease),
		color var(--td-t-micro) var(--td-ease),
		transform var(--td-t-micro) var(--td-ease-spring);
}

.page-numbers:hover {
	border-color: var(--td-hairline-accent);
	color: var(--td-accent);
	transform: translateY(-2px);
}

.page-numbers.current {
	background: var(--td-grad-brand);
	border-color: transparent;
	color: #fff;
}

.pagination .screen-reader-text { position: absolute; }

/* -----------------------------------------------------------------------------
   SEARCH FORM
   -------------------------------------------------------------------------- */

.td-searchform { max-width: 560px; }
.td-searchform .td-input { flex: 1; }
.td-searchform .td-btn { flex: none; padding-inline: 18px; }

/* -----------------------------------------------------------------------------
   PAGE HEAD
   -------------------------------------------------------------------------- */

.td-page-head { padding-top: calc(var(--td-header-h) + clamp(32px, 4vw, 64px)); }

.td-article { position: relative; }
