/* =========================================================
   archive.css: list pages. Topic archives, search, date
   archives, later pages of the home list, and the 404.
   ========================================================= */

.archive-header {
	padding: var(--space-6) 0 var(--space-5);
	background:
		radial-gradient(ellipse 36% 90% at 0% 0%, color-mix(in srgb, var(--tone-mark, #f472b6) 18%, transparent), transparent 70%),
		radial-gradient(ellipse 30% 80% at 100% 0%, rgba(244, 114, 182, .12), transparent 70%);
	border-bottom: 1px solid var(--line);
}
.archive-header__title {
	margin: 0 0 var(--space-2);
	font-size: clamp(2rem, 2.6vw + 1.2rem, 3.25rem);
	overflow-wrap: break-word;
}
.archive-header[class*="tone-"] .archive-header__title::before {
	content: "";
	display: block;
	width: 32px;
	height: 2px;
	margin-bottom: var(--space-3);
	border-radius: 2px;
	background: var(--tone-mark);
}
.archive-header__title q { quotes: "\201C" "\201D"; }
.archive-header__desc {
	margin: 0;
	max-width: 44rem;
	color: var(--muted);
	font-size: 1.15rem;
	line-height: 1.55;
}
.archive-header__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3) var(--space-5);
	margin-top: var(--space-5);
}
.archive-header__search { flex: 1 1 20rem; max-width: 28rem; }

/* The other topics, one tap away. */
.topic-switch ul { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.topic-switch a {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	min-height: 44px;
	padding: .4rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-pill);
	background: var(--card);
	color: var(--ink);
	font-size: .95rem;
	font-weight: 700;
	text-decoration: none;
}
.topic-switch a:hover { border-color: var(--faint); }
.topic-switch a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.topic-switch__count { color: var(--muted); font-weight: 400; font-size: .88rem; }
.topic-switch a[aria-current="page"] .topic-switch__count { color: var(--periwinkle); }

.archive-list { padding-top: var(--space-5); }
.archive-list__count { margin: 0 0 var(--space-3); color: var(--muted); font-family: var(--font-mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- 404 ---------- */
.error-404 { padding: var(--space-8) 0 var(--space-5); }
.error-404__title { font-size: clamp(2rem, 2.6vw + 1.2rem, 3.25rem); margin-bottom: var(--space-2); }
.error-404__lede { max-width: 40rem; color: var(--muted); font-size: 1.15rem; margin-bottom: var(--space-5); }
.error-404__search { margin-bottom: var(--space-5); }
.error-404__topics { display: flex; flex-wrap: wrap; gap: var(--space-1); }

@media (max-width: 640px) {
	.archive-header { padding: var(--space-5) 0 var(--space-4); }
	.archive-header__tools { margin-top: var(--space-4); }
	/* Phones: search first, then the topics as one row that scrolls sideways. */
	.archive-header__search { order: -1; flex-basis: 100%; max-width: none; }
	.topic-switch { flex: 0 0 calc(100% + 2 * var(--gutter)); min-width: 0; margin: 0 calc(-1 * var(--gutter)); }
	.topic-switch ul {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 2px var(--gutter);
		scrollbar-width: none;
	}
	.topic-switch ul::-webkit-scrollbar { display: none; }
	.topic-switch a { white-space: nowrap; }
}
