/**
 * Fallback chrome for the legacy long tail — block 17.
 *
 * Loads after single.css (the shared prose) and reuses its centred article column
 * (.at-article__head / __title / __kicker / __body). This file adds only what the
 * fallback screens need beyond the prose: the search-result / archive listing, the
 * 404 actions, and a design-system button + search field. All colours come from the
 * tokens (tokens.css) so light + dark follow automatically. Buttons/links pin every
 * interactive state to honour the prototype's four-hover-effects-only rule.
 */

/* ---------------------------------------------------------------- *
 * Generic page — bottom breathing room under the prose
 * ---------------------------------------------------------------- */
.at-page {
	padding-bottom: clamp(48px, 7vw, 96px);
}

/* ---------------------------------------------------------------- *
 * Listing (search results + generic archives)
 * ---------------------------------------------------------------- */
.at-listing__desc {
	max-width: 740px;
	margin: 18px auto 0;
	padding: 0 clamp(18px, 5vw, 40px);
	font-family: var(--font-serif);
	font-size: 1.08rem;
	line-height: 1.6;
	color: var(--ink2);
}

.at-listing__items {
	max-width: 740px;
	margin: clamp(28px, 4vw, 46px) auto 0;
	padding: 0 clamp(18px, 5vw, 40px);
}

.at-listing__item {
	padding: 26px 0;
	border-top: 1px solid var(--line);
}
.at-listing__item:first-child {
	border-top: 0;
	padding-top: 0;
}

.at-listing__title {
	font-family: var(--font-serif);
	font-size: 1.45rem;
	line-height: 1.25;
	font-weight: 500;
	letter-spacing: -.01em;
	margin: 0;
	padding: 0;
}
.at-listing__link {
	color: var(--ink);
	text-decoration: none;
	border-bottom: 0;
}
.at-listing__link:visited,
.at-listing__link:focus,
.at-listing__link:active,
.at-listing__link:hover {
	color: var(--ink);
}
.at-listing__link:focus-visible {
	outline: 2px solid var(--accent2, var(--accent));
	outline-offset: 3px;
}

/* --ink2 (not the design system's de-emphasised --ink3) so the meta line clears
 * WCAG AA on its own — these listings have no prototype to mirror, so block 17
 * picks the accessible token rather than inheriting the b18-deferred --ink3 debt. */
.at-listing__meta {
	font-family: var(--font-mono);
	font-size: 12.5px;
	line-height: 1.65;
	letter-spacing: .02em;
	color: var(--ink2);
	margin: 10px 0 0;
	padding: 0;
}
.at-listing__sep {
	color: var(--ink2);
}

.at-listing__excerpt {
	font-family: var(--font-serif);
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--ink2);
	margin: 12px 0 0;
	padding: 0;
}

/* Numbered pagination — mono pills, centred under the list. */
.at-listing .navigation.pagination,
.at-listing .at-listing__pagination {
	max-width: 740px;
	margin: clamp(32px, 4vw, 52px) auto 0;
	padding: 0 clamp(18px, 5vw, 40px);
}
.at-listing .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}
.at-listing .page-numbers {
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 1;
	color: var(--ink2);
	text-decoration: none;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 9px 13px;
	min-width: 38px;
	text-align: center;
}
.at-listing .page-numbers:visited {
	color: var(--ink2);
}
.at-listing .page-numbers.current {
	color: var(--at-on-accent);
	background: var(--accent);
	border-color: var(--accent);
}
.at-listing .page-numbers.dots {
	border-color: transparent;
}
.at-listing .page-numbers:focus-visible {
	outline: 2px solid var(--accent2, var(--accent));
	outline-offset: 2px;
}

.at-listing__empty {
	max-width: 680px;
}

/* ---------------------------------------------------------------- *
 * 404
 * ---------------------------------------------------------------- */
.at-404__body {
	max-width: 680px;
}
.at-404__actions {
	margin: 30px 0 0;
}

/* ---------------------------------------------------------------- *
 * Design-system button + search field (404 + future fallbacks)
 * ---------------------------------------------------------------- */
/* Scoped under .at-page so the button beats the prose `.at-article__body a`
 * rule (0,1,1) it sits inside — a primary `<a>` button would otherwise inherit
 * the accent link colour + underline and vanish on its accent fill. */
.at-page .at-fb__btn {
	display: inline-block;
	font-family: var(--font-sans);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: .01em;
	line-height: 1;
	border-radius: var(--at-radius-pill, 999px);
	text-decoration: none;
	border-bottom: 0;
	cursor: pointer;
	transition: transform .12s ease;
}
.at-page .at-fb__btn--primary {
	background: var(--accent);
	color: var(--at-on-accent);
	font-weight: 500;
	padding: 14px 28px;
	border: 0;
}
.at-page .at-fb__btn--ghost {
	background: transparent;
	color: var(--ink);
	padding: 13px 22px;
	border: 1px solid var(--line2);
}
.at-page .at-fb__btn:active {
	transform: translateY(1px);
}
.at-page .at-fb__btn:focus-visible {
	outline: 2px solid var(--accent2, var(--accent));
	outline-offset: 3px;
}
/* Pin interactive states (four-hover-effects-only rule). */
.at-page .at-fb__btn--primary:visited,
.at-page .at-fb__btn--primary:focus,
.at-page .at-fb__btn--primary:active,
.at-page .at-fb__btn--primary:hover {
	color: var(--at-on-accent);
	background: var(--accent);
	border-color: var(--accent);
	border-bottom: 0;
}
.at-page .at-fb__btn--ghost:visited,
.at-page .at-fb__btn--ghost:focus,
.at-page .at-fb__btn--ghost:active,
.at-page .at-fb__btn--ghost:hover {
	color: var(--ink);
	background: transparent;
	border-color: var(--line2);
}

.at-fb__search {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 28px 0 0;
}
/* Scoped under .at-page to outrank refur's `input[type="search"]` rule (0,1,1),
 * which otherwise forces a #707070 value colour (fails AA in dark) + a 2px border. */
.at-page .at-fb__search-field {
	flex: 1 1 240px;
	min-width: 0;
	font-family: var(--font-mono);
	font-size: 14px;
	color: var(--ink);
	background: var(--bg2, var(--bg));
	border: 1px solid var(--line2);
	border-radius: var(--at-radius-pill, 999px);
	padding: 13px 18px;
}
.at-page .at-fb__search-field::placeholder {
	color: var(--ink2);
	opacity: 1;
}
.at-page .at-fb__search-field:focus-visible {
	outline: 2px solid var(--accent2, var(--accent));
	outline-offset: 2px;
}
