/**
 * archive.css — Archive & filter listing styles.
 *
 * Covers: .archive-head, .filter-tabs, .card-grid, .empty, pagination.
 * Tokens only. Mobile-first. No edits to main.css required.
 *
 * @package The_Edited_Wild
 */

/* ── Archive page header ──────────────────────────────────────────────────── */

.archive-head {
	text-align: left;
	padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.25rem;
}

.archive-head__eyebrow {
	font-family: var(--tew-sans);
	font-size: var(--tew-eyebrow);
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--tew-accent-ink);
	margin: 0 0 1rem;
}

.archive-head__title {
	font-family: var(--tew-serif);
	font-size: var(--tew-h1);
	color: var(--tew-ink);
	margin: 0;
	line-height: 1.05;
}

.archive-head__meta {
	font-family: var(--tew-sans);
	font-size: var(--tew-eyebrow);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--tew-muted);
	margin: 1.25rem 0 0;
}

.archive-head__sep {
	margin-inline: 0.5rem;
	color: var(--tew-rule);
}

/* ── Filter tab bar ───────────────────────────────────────────────────────── */

.filter-tabs {
	display: flex;
	justify-content: flex-start;
	border-top: 1px solid var(--tew-rule);
	border-bottom: 1px solid var(--tew-rule);
	padding-block: 0.5rem 0.5rem;
	margin-bottom: 2.5rem;
	/* Allow horizontal scroll on narrow viewports without wrapping */
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	/* Hide scrollbar visually; scrolling still works */
	scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
	display: none;
}

.filter-tabs ul {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.filter-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Minimum 44 × 44 px tap target (WCAG 2.5.5) */
	min-height: 44px;
	padding-inline: 1rem;
	font-family: var(--tew-sans);
	font-size: var(--tew-eyebrow, 0.6875rem); /* ~11px */
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--tew-muted);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.filter-tab:hover,
.filter-tab:focus-visible {
	color: var(--tew-ink);
	outline: none;
}

.filter-tab.is-active {
	color: var(--tew-ink);
	font-weight: 700;
	border-bottom-color: var(--tew-ink);
}

/* First tab flush with the heading's left edge */
.filter-tabs li:first-child .filter-tab {
	padding-left: 0;
}

/* ── Geo filter rows (Country + Region) ──────────────────────────────────── */
/* Stacks cleanly below the section tab bar with consistent left alignment.  */

.filter-tabs--geo {
	border-top: none;
	border-bottom: 1px solid var(--tew-rule);
	margin-top: 0;          /* flush below preceding row, no negative pull */
	margin-bottom: 0;
	padding-block: 0.375rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.filter-tabs--geo::-webkit-scrollbar {
	display: none;
}

.filter-tabs--geo:last-of-type {
	margin-bottom: 2.5rem;
}

/* On 375 px the pills must wrap OR scroll — the parent has overflow-x:auto
   so the ul stays nowrap (same as section tabs). Nothing extra needed. */

/* ── Mobile archive tweaks (< 48 rem) ────────────────────────────────────── */
@media (max-width: 47.9375rem) {
	.archive-head {
		padding-block: clamp(1.75rem, 5vw, 3rem) 1rem;
	}

	.archive-head__title {
		font-size: clamp(2rem, 9vw, 4.5rem);
		word-break: break-word;
	}

	/* Filter tab: slightly more compact on phone */
	.filter-tab {
		padding-inline: 0.75rem;
		min-height: 40px;
	}

	/* Card grid spacing: tighter on phone */
	.card-grid {
		gap: 1.5rem;
	}
}

/* ── Story card grid ──────────────────────────────────────────────────────── */
/* .card-grid base layout is defined in main.css. Archive-specific override: */

.card-grid {
	padding-block-end: 3rem;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.empty {
	text-align: center;
	color: var(--tew-muted);
	font-family: var(--tew-sans);
	font-size: 1rem;
	padding-block: 4rem;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.navigation.pagination {
	display: flex;
	justify-content: center;
	padding-block: 2rem 4rem;
}

.navigation.pagination .nav-links {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.navigation.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding-inline: 0.625rem;
	font-family: var(--tew-sans);
	font-size: 0.875rem;
	color: var(--tew-muted);
	text-decoration: none;
	border: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:focus-visible {
	color: var(--tew-ink);
	border-color: var(--tew-rule);
	outline: none;
}

.navigation.pagination .page-numbers.current {
	color: var(--tew-ink);
	font-weight: 700;
	border-color: var(--tew-ink);
}

.navigation.pagination .page-numbers.dots {
	border-color: transparent;
	pointer-events: none;
}
