/*
 * Search results page — full-width layout, hero banner, TL card grid,
 * TL-style pagination.
 *
 * All rules scoped to body.search-results (added via body_class hook)
 * so they work regardless of which template provides the outer shell.
 */

/* ── Full-bleed banner ──────────────────────────────────────────────── */

body.search-results .ptac-search-banner {
	position: relative;
	width: 100vw;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(135deg, #0e3d3f 0%, #1b5e61 40%, #1a7a7e 100%);
	overflow: hidden;
}

body.search-results .ptac-search-banner__overlay {
	position: absolute;
	inset: 0;
	opacity: 0.12;
	background:
		repeating-linear-gradient(
			45deg,
			transparent,
			transparent 40px,
			rgba(255, 255, 255, 0.03) 40px,
			rgba(255, 255, 255, 0.03) 80px
		);
	pointer-events: none;
}

body.search-results .ptac-search-banner__content {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	width: 100%;
	padding: 2.5rem 1.5rem;
	text-align: center;
}

body.search-results .ptac-search-banner__title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	letter-spacing: -0.01em;
	font-family: Montserrat, system-ui, sans-serif;
}

body.search-results .ptac-search-banner__query {
	color: rgba(255, 255, 255, 0.85);
	font-style: italic;
}

@media (min-width: 768px) {
	body.search-results .ptac-search-banner {
		min-height: 220px;
	}
	body.search-results .ptac-search-banner__title {
		font-size: 2.25rem;
	}
}

/* ── Constrain the body area below the banner ───────────────────────── */

body.search-results .ptac-search-body-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

body.search-results .ptac-search-filters-wrap {
	max-width: 1200px;
	margin: 0 auto;
}

/* ── Layout resets ──────────────────────────────────────────────────── */

body.search-results #primary {
	width: 100% !important;
	max-width: 100%;
	float: none !important;
	margin: 0 auto;
}

body.search-results .site-content .ast-container {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

body.search-results .site-main,
body.search-results .ast-row {
	display: block !important;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

/* Hide Astra's default archive header — we have our own banner. */
body.search-results .ast-archive-description,
body.search-results .ast-archive-entry-banner {
	display: none !important;
}

/* ── Filter bar ─────────────────────────────────────────────────────── */

body.search-results .ptac-search-filters {
	margin: 2rem 0 1.75rem;
}

/* ── Card grid ──────────────────────────────────────────────────────── */

body.search-results ul.ptac-search-results__cards {
	list-style: none !important;
	margin: 0 auto !important;
	padding: 0 1.5rem 3rem !important;
	max-width: 1200px;
	display: grid !important;
	grid-template-columns: 1fr;
	gap: 1rem;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
}

@media (min-width: 600px) {
	body.search-results ul.ptac-search-results__cards {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (min-width: 900px) {
	body.search-results ul.ptac-search-results__cards {
		grid-template-columns: repeat(3, 1fr) !important;
		gap: 1rem;
	}
}

/* ── Hover lift for generic cards ───────────────────────────────────── */

.ptac-search-card .ptac-tl-card__surface:hover .ptac-tl-card__inner,
.ptac-search-card .ptac-tl-card__surface:focus-visible .ptac-tl-card__inner {
	border-color: rgba(27, 94, 97, 0.35);
	box-shadow:
		0 2px 6px rgba(15, 40, 42, 0.06),
		0 12px 28px rgba(27, 94, 97, 0.1);
	transform: translateY(-3px);
}

/* ── TL-style pagination ────────────────────────────────────────────── */

body.search-results .ptac-search-pagination {
	--ptac-tl-page-teal: var(--ast-global-color-0, #1b5e61);
	--ptac-tl-page-muted: #6b7c7d;
	--ptac-tl-page-surface: #f4f8f8;
	--ptac-tl-page-border: rgba(27, 94, 97, 0.12);

	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem 1.5rem 2rem;
	border-top: 1px solid rgba(27, 94, 97, 0.08);
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__summary {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ptac-tl-page-muted);
	text-align: center;
	line-height: 1.35;
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__bar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	width: auto;
	max-width: 100%;
	min-width: 0;
	flex-wrap: nowrap;
	margin: 0 auto;
	padding: 0.35rem 0.45rem;
	border-radius: 999px;
	background: var(--ptac-tl-page-surface);
	border: 1px solid var(--ptac-tl-page-border);
	box-shadow:
		0 1px 2px rgba(15, 40, 42, 0.04),
		inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

@media (max-width: 480px) {
	body.search-results .ptac-search-pagination .ptac-tl-pagination__bar {
		justify-content: flex-start;
		overflow-x: auto;
		max-width: 100%;
		padding: 0.3rem 0.4rem;
		scrollbar-width: thin;
	}
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: 0.12rem;
	min-width: 0;
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	padding: 0 0.2rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #9aa8a9;
	line-height: 1;
	user-select: none;
	pointer-events: none;
}

body.search-results .ptac-search-pagination a.ptac-tl-pagination__link,
body.search-results .ptac-search-pagination span.ptac-tl-pagination__nav {
	box-sizing: border-box;
	min-width: 2.125rem;
	height: 2.125rem;
	padding: 0 0.4rem;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 2.125rem;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	color: var(--ptac-tl-page-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.18s ease,
		color 0.18s ease,
		border-color 0.18s ease,
		box-shadow 0.18s ease;
}

body.search-results .ptac-search-pagination a.ptac-tl-pagination__link:hover,
body.search-results .ptac-search-pagination a.ptac-tl-pagination__link:focus-visible {
	border-color: rgba(27, 94, 97, 0.2);
	background: rgba(255, 255, 255, 0.95);
	color: var(--ptac-tl-page-teal);
	outline: none;
	box-shadow: 0 1px 3px rgba(27, 94, 97, 0.1);
}

body.search-results .ptac-search-pagination a.ptac-tl-pagination__link.is-active {
	border-color: transparent;
	background: var(--ptac-tl-page-teal);
	color: #fff;
	font-weight: 700;
	pointer-events: none;
	box-shadow:
		0 2px 6px rgba(27, 94, 97, 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__link--nav {
	min-width: auto;
	padding: 0 0.65rem;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ptac-tl-page-teal);
}

body.search-results .ptac-search-pagination .ptac-tl-pagination__link--nav:hover,
body.search-results .ptac-search-pagination .ptac-tl-pagination__link--nav:focus-visible {
	background: rgba(255, 255, 255, 0.95);
}

body.search-results .ptac-search-pagination span.ptac-tl-pagination__nav {
	min-width: auto;
	padding: 0 0.65rem;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #b8c4c5;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Bottom page padding ─────────────────────────────────────────────── */

body.search-results #primary {
	padding-bottom: 3rem;
}

/* ── Hide Astra's built-in pagination on search ─────────────────────── */

body.search-results .ast-pagination {
	display: none !important;
}
