/* ==========================================================================
   Ealan V3: article (single post). Loaded on single posts only, after v3.css.
   The one-page language on a page that scrolls natively: a hero screen (the glass on the
   right, giant title, standfirst + meta on the bottom hairline), a ~68ch body on Obsidian
   with the object sticky in the aside over the section index, a closing CTA, related
   posts as a hairline index, the V3 footer.
   ========================================================================== */

/* Native scroll: no snapping between the article screens. */
html.v3-is-article {
	scroll-snap-type: none;
}

/* ---------- Hero ---------- */
.v3-article__hero {
	justify-content: stretch;
	padding-bottom: clamp(16px, 3vh, 36px);
}

.v3-article__hero-slot {
	position: absolute;
	right: calc(var(--gutter) * 0.5);
	top: calc(50% + var(--header-h) / 4);
	width: min(68svh, 42vw);
	height: min(68svh, 42vw);
	transform: translateY(-50%);
}

.v3-article__hero-inner {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: clamp(16px, 3vh, 32px);
}

.v3-article__title {
	/* Block (the word-split spans flow as text); auto margins centre it in the column. */
	margin-block: auto;
	max-width: 11ch;
	font-size: clamp(3rem, min(1rem + 7vw, 14vh), 10rem);
}

.v3-article__hero-bottom {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: clamp(20px, 4vw, 72px);
	padding-top: clamp(14px, 2.4vh, 24px);
	border-top: 1px solid var(--line);
}

.v3-article__standfirst {
	max-width: 52ch;
	font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
	line-height: 1.5;
	color: var(--ink-2);
}

.v3-article__meta {
	display: flex;
	gap: clamp(24px, 3.5vw, 56px);
	margin: 0;
}

.v3-article__meta dt {
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-3);
}

.v3-article__meta dd {
	margin: 4px 0 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(1.0625rem, 0.9rem + 0.5vw, 1.375rem);
	line-height: 1.2;
	color: var(--ink);
	white-space: nowrap;
}

/* ---------- Body: text | sticky aside (object + section index) ---------- */
.v3-article__body {
	position: relative;
	z-index: 1;
	padding-block: clamp(40px, 8vh, 96px) clamp(72px, 14vh, 160px);
}

.v3-article__grid {
	display: grid;
	grid-template-columns: minmax(0, 68ch) minmax(260px, 1fr);
	gap: clamp(32px, 6vw, 112px);
	font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
}

.v3-article__aside {
	position: sticky;
	top: calc(var(--header-h) + clamp(16px, 4vh, 40px));
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: clamp(16px, 3vh, 32px);
	font-size: 1rem;
}

.v3-article__slot {
	width: 100%;
	height: min(48svh, 30vw);
}

.v3-article__toc ol {
	margin-top: 12px;
	border-top: 1px solid var(--line-strong);
}

.v3-article__toc a {
	display: grid;
	grid-template-columns: 2.6em minmax(0, 1fr);
	gap: 8px;
	padding: 10px 0 10px 12px;
	border-bottom: 1px solid var(--line);
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--ink-3);
	transition: color 250ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.v3-article__toc a .mono {
	padding-top: 2px;
}

.v3-article__toc a:hover {
	color: var(--ink);
}

.v3-article__toc a.is-current {
	color: var(--ink);
	background: linear-gradient(90deg, rgba(232, 67, 140, 0.1), transparent 70%);
	box-shadow: inset 3px 0 0 var(--accent);
}

.v3-article__toc a.is-current .mono {
	color: var(--accent-deep);
}

/* ---------- Body type ---------- */
.v3-article__content {
	min-width: 0;
	line-height: 1.75;
	color: var(--ink-2);
	counter-reset: v3-section;
}

.v3-article__content > * + * {
	margin-top: 1.35em;
}

/* Opening paragraph: a step up, full ink. */
.v3-article__content > p:first-child {
	font-size: 1.28em;
	line-height: 1.55;
	color: var(--ink);
}

/* End mark after the last paragraph. */
.v3-article__content > p:last-child::after {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-left: 0.5em;
	background: var(--accent);
}

.v3-article__content strong {
	font-weight: 600;
	color: var(--ink);
}

.v3-article__content em {
	font-style: italic;
	color: var(--ink);
}

.v3-article__content a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color 200ms var(--ease);
}

.v3-article__content a:hover {
	color: var(--accent-deep);
}

/* Section heading: numbered, on a hairline. */
.v3-article__content h2 {
	margin-top: 2.4em;
	padding-top: 1.1em;
	border-top: 1px solid var(--line);
	font-size: clamp(1.75rem, 1rem + 1.8vw, 2.875rem);
	line-height: 1.04;
	letter-spacing: -0.03em;
	counter-increment: v3-section;
	scroll-margin-top: calc(var(--header-h) + 24px);
}

.v3-article__content h2::before {
	content: counter(v3-section, decimal-leading-zero);
	display: block;
	margin-bottom: 1.1rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	color: var(--accent-deep);
}

.v3-article__content h3 {
	margin-top: 2em;
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.625rem);
}

.v3-article__content h2 + *,
.v3-article__content h3 + * {
	margin-top: 0.9em;
}

/* Pull quote: huge Inter, a Magenta opening mark. */
.v3-article__content blockquote {
	position: relative;
	margin-block: 2em;
	padding-block: 0.6em 0.2em;
}

.v3-article__content blockquote::before {
	content: "\201C";
	display: block;
	height: 0.5em;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(5rem, 3rem + 5vw, 9rem);
	line-height: 0.8;
	color: var(--accent);
}

.v3-article__content blockquote p {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(2.25rem, 1rem + 3.6vw, 4.75rem);
	line-height: 0.96;
	letter-spacing: -0.04em;
	color: var(--ink);
	text-wrap: balance;
}

.v3-article__content blockquote cite {
	display: block;
	margin-top: 1.2em;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	font-style: normal;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-3);
}

/* Lists on hairlines: a Magenta dash (ul) or a mono number (ol). */
.v3-article__content ul,
.v3-article__content ol {
	border-top: 1px solid var(--line);
	counter-reset: v3-item;
}

.v3-article__content li {
	position: relative;
	padding: 0.85em 0 0.85em 2.6em;
	border-bottom: 1px solid var(--line);
	line-height: 1.6;
}

.v3-article__content ul > li::before {
	content: "";
	position: absolute;
	left: 0.2em;
	top: 1.65em;
	width: 16px;
	height: 2px;
	background: var(--accent);
}

.v3-article__content ol > li {
	counter-increment: v3-item;
}

.v3-article__content ol > li::before {
	content: counter(v3-item, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 1.2em;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	color: var(--accent-deep);
}

.v3-article__content figure img {
	height: auto;
}

.v3-article__content figcaption {
	margin-top: 0.8em;
	font-size: 0.875rem;
	color: var(--ink-3);
}

/* ---------- Next move: CTA + related ---------- */
.v3-article__next-inner {
	display: flex;
	flex-direction: column;
	gap: clamp(32px, 7vh, 88px);
}

.v3-article__cta {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
	align-items: center;
	gap: clamp(24px, 4vw, 72px);
}

.v3-article__cta-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(16px, 2.6vh, 28px);
}

.v3-article__cta h2 {
	max-width: 15ch;
	font-size: clamp(2.2rem, min(1rem + 3.6vw, 8.5vh), 5rem);
}

.v3-article__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 26px;
}

.v3-article__next-slot {
	height: min(40svh, 28vw);
}

.v3-article__index {
	margin-top: 14px;
	border-top: 1px solid var(--line-strong);
}

.v3-article__row {
	display: grid;
	grid-template-columns: 3.2em minmax(0, 1fr) minmax(0, 0.95fr) 24px;
	align-items: center;
	gap: clamp(10px, 1.5vw, 24px);
	padding: clamp(14px, 2.2vh, 24px) 0 clamp(14px, 2.2vh, 24px) 14px;
	border-bottom: 1px solid var(--line);
	outline-offset: -2px;
	transition: background 350ms var(--ease), box-shadow 350ms var(--ease);
}

.v3-article__row-num {
	color: var(--ink-3);
}

.v3-article__row-title {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(1.3rem, min(0.6rem + 2vw, 4.4vh), 2.5rem);
	line-height: 1.05;
	letter-spacing: -0.025em;
	color: var(--ink);
	text-wrap: balance;
	transition: transform 350ms var(--ease);
}

.v3-article__row-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--ink-3);
}

.v3-article__row-meta {
	font-size: 0.6875rem;
	color: var(--ink-2);
}

.v3-article__row .icon {
	color: var(--ink-3);
	transition: transform 300ms var(--ease), color 300ms var(--ease);
}

.v3-article__row:hover,
.v3-article__row:focus-visible {
	background: linear-gradient(90deg, rgba(232, 67, 140, 0.1), transparent 70%);
	box-shadow: inset 3px 0 0 var(--accent);
}

.v3-article__row:hover .v3-article__row-title,
.v3-article__row:focus-visible .v3-article__row-title {
	transform: translateX(8px);
}

.v3-article__row:hover .icon,
.v3-article__row:focus-visible .icon {
	color: var(--accent-deep);
	transform: translateX(4px);
}

/* ---------- Responsive (the desktop gate covers phones in the demo) ---------- */
@media (max-width: 1023px) {
	.v3-article__hero-slot {
		right: -12vw;
		top: calc(var(--header-h) + 20svh);
		width: min(78vw, 48svh);
		height: min(78vw, 48svh);
	}

	.v3-article__title {
		max-width: none;
	}

	.v3-article__hero-bottom {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.v3-article__meta {
		flex-wrap: wrap;
		gap: 16px 28px;
	}

	.v3-article__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	/* The object parks in the lower right corner while reading, mostly off screen. */
	.v3-article__aside {
		position: static;
	}

	.v3-article__slot {
		position: fixed;
		right: -30vw;
		bottom: -12svh;
		width: 58vw;
		height: 58vw;
	}

	.v3-article__toc {
		display: none;
	}

	.v3-article__cta {
		grid-template-columns: 1fr;
	}

	.v3-article__next-slot {
		order: -1;
		justify-self: end;
		width: min(44vw, 240px);
		height: min(44vw, 240px);
	}

	.v3-article__row {
		grid-template-columns: 2.4em minmax(0, 1fr) 20px;
		grid-template-areas: "num title icon" ". info .";
		row-gap: 8px;
	}

	.v3-article__row-num {
		grid-area: num;
	}

	.v3-article__row-title {
		grid-area: title;
	}

	.v3-article__row-info {
		grid-area: info;
	}

	.v3-article__row .icon {
		grid-area: icon;
	}
}

@media (max-width: 640px) {
	.v3-article__title {
		font-size: clamp(2.6rem, 13.5vw, 4.25rem);
	}

	.v3-article__content blockquote p {
		font-size: clamp(2rem, 9.5vw, 2.75rem);
	}
}

/* Phones: 12px minimum for the small print. */
@media (max-width: 1023px) {
	.v3-article__meta dt,
	.v3-article__row-meta {
		font-size: 0.75rem;
	}
}
