/**
 * Archive / search / 404 — layout only.
 *
 * .post-archive-hero-section, .entry-hero-container-inner,
 * .hero-section-overlay, .archive-title/.page-title and
 * .archive-description are targeted by the live mu-plugins
 * category-header-images.php / tag-header-images.php on category and
 * tag archives (background image, overlay, white text via !important).
 * This file sets padding/sizing/layout for those classes but never
 * sets background or text color on them for the .post-archive-hero-section
 * (no modifier) case — only the --fallback variant (date/author/search/404)
 * gets an explicit brand background here.
 */

/* -- Hero band: layout shared by both mu-plugin and fallback states -- */
.post-archive-hero-section {
	position: relative;
	width: 100%;
}

.entry-hero-container-inner {
	position: relative;
	width: 100%;
	overflow: hidden;
	background-size: cover;
	background-position: center;
}

/* Blur-fill, same as the single-post hero. The mu-plugin owns the
   background-image (and forces cover with !important); these pseudo-elements
   inherit that same image and layer over it, so the plugin's contract is
   untouched — the band gets a blurred cover copy plus an uncut contain copy.
   Both sit below .hero-section-overlay (z-index 1) and .hero-container (2). */
.entry-hero-container-inner::before,
.entry-hero-container-inner::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: inherit;
	background-repeat: no-repeat;
	background-position: center;
	pointer-events: none;
}

.entry-hero-container-inner::before {
	background-size: cover;
	filter: blur(36px);
	transform: scale(1.12);
}

.entry-hero-container-inner::after {
	background-size: contain;
}

.hero-section-overlay {
	position: absolute;
	inset: 0;
}

.hero-container {
	position: relative;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: var(--space-6) var(--space-4);
}

.archive-hero-header {
	max-width: 900px;
}

.archive-title.page-title {
	font-family: var(--font-display);
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.1;
	margin: 0 0 var(--space-2);
}

.archive-description {
	font-family: var(--font-body);
	font-size: 1.05rem;
	line-height: 1.5;
	max-width: 65ch;
}

/* Fallback state — date/author archives, search, 404 (no mu-plugin hero
   applies here since it checks is_category()/is_tag()). Own colors.
   These are low-traffic utility pages, so the band is a compact strip
   rather than the full hero slab: shallower padding, smaller title, a
   brand gradient, and the category spectrum along the bottom edge. */
.post-archive-hero-section--fallback .entry-hero-container-inner {
	background: linear-gradient(115deg, var(--color-brand) 0%, #3B2760 58%, var(--color-brand-bright) 100%);
}

.post-archive-hero-section--fallback .hero-container {
	padding: var(--space-4);
}

.post-archive-hero-section--fallback .archive-title.page-title {
	font-size: clamp(1.5rem, 2.4vw, 2.125rem);
	margin: 0;
}

.post-archive-hero-section--fallback .archive-title.page-title,
.post-archive-hero-section--fallback .archive-description {
	color: #FFFFFF;
}

/* The shared ::before/::after blur-fill pair inherits background-image,
   which is none here — reuse ::after as the spectrum edge and drop ::before. */
.post-archive-hero-section--fallback .entry-hero-container-inner::before {
	display: none;
}

.post-archive-hero-section--fallback .entry-hero-container-inner::after {
	top: auto;
	height: 4px;
	background: var(--rainbow);
}

/* -- Card grid -------------------------------------------------------- */
.archive-grid-wrap {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: var(--space-5) var(--space-4);
}

.archive-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
}

@media (min-width: 640px) {
	.archive-card-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.archive-card-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1280px) {
	.archive-card-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.archive-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.archive-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--color-border);
}

.archive-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.archive-card-pill {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	color: #FFFFFF;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: var(--space-1) var(--space-2);
	border-radius: var(--radius-sm);
}

/* --card-color is set inline per card from daveslocker_category_color(). */
.archive-card-body {
	padding: var(--space-3);
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	border-top: 3px solid var(--card-color, var(--color-brand-bright));
	background: color-mix(in srgb, var(--card-color, var(--color-brand-bright)) 10%, #fff);
}

.archive-card-title {
	font-family: var(--font-display);
	font-size: 1.1rem;
	line-height: 1.3;
	margin: 0;
}

.archive-card-title a {
	color: var(--color-ink);
	text-decoration: none;
}

.archive-card-title a:hover {
	color: var(--color-brand-bright);
}

.archive-card-time {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--color-muted);
}

/* -- Pagination / no-results ------------------------------------------ */
.archive-pagination {
	margin-top: var(--space-5);
	display: flex;
	justify-content: center;
	gap: var(--space-2);
}

.archive-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--space-2);
	border-radius: var(--radius-sm);
	border: 1px solid var(--color-border);
	color: var(--color-ink);
	text-decoration: none;
	font-family: var(--font-mono);
}

.archive-pagination .page-numbers.current {
	background: var(--color-brand-bright);
	border-color: var(--color-brand-bright);
	color: #FFFFFF;
}

.archive-no-results {
	text-align: center;
	padding: var(--space-6) var(--space-4);
}

/* -- Search form -------------------------------------------------------- */
.site-search-form {
	display: flex;
	gap: var(--space-2);
	max-width: 480px;
	margin: var(--space-4) auto 0;
}

.site-search-input {
	flex: 1;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-family: var(--font-body);
	font-size: 1rem;
}

.site-search-submit {
	padding: var(--space-2) var(--space-4);
	border: none;
	border-radius: var(--radius-sm);
	background: var(--color-brand-bright);
	color: #FFFFFF;
	font-family: var(--font-display);
	cursor: pointer;
}
