/* ==========================================================================
   Search results (templates/search.html + inc/search.php).
   Grouped "universal" search: two-tone title, category count pills, then a
   section per category (Topics / Authors / Volumes+Issues + Articles). Brand
   tokens only.
   ========================================================================== */

/* ---- Two-tone left-aligned title ---- */
.wulr-search-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--body);
	margin: 0;
}
/* Muted "Search /" prefix; the keyword stays bold ink. */
.wulr-search-title-pre {
	color: var(--wp--preset--color--stone);
}

/* ---- Green centered hero (title + search bar + count pills) ---- */
.wulr-search-hero {
	text-align: center;
}
/* Flush the green hero into the tan results section (no white seam). */
.wulr-search-hero + .wulr-search-results {
	margin-top: 0;
}
.wulr-search-hero .wulr-search-title {
	color: var(--wp--preset--color--white);
}
.wulr-search-hero .wulr-search-title-pre {
	color: rgba(255, 255, 255, 0.6);
}
.wulr-search-hero .wulr-search-head {
	align-items: center;
}
.wulr-search-hero .wulr-search-edit {
	margin-inline: auto;
}
.wulr-search-hero .wulr-search-nav {
	justify-content: center;
}

/* Editable keyword bar under the title. */
.wulr-search-head {
	display: flex;
	flex-direction: column;
	gap: 18px;
	align-items: flex-start;
}
.wulr-search-edit {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 560px;
	background: var(--wp--preset--color--white);
	/* stone (>=3:1) — search field boundary on the white overlay; rule token was 1.8:1 (1.4.11). */
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 999px;
	overflow: hidden;
	transition: border-color 0.15s;
}
.wulr-search-edit:focus-within {
	border-color: var(--wp--preset--color--accent);
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
.wulr-search-edit-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 52px;
	padding: 0 22px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--body);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--md);
}
.wulr-search-edit-field:focus {
	outline: none;
}
/* The search clear (×) button is brand-tinted globally in global.css
   (input[type="search"]::-webkit-search-cancel-button). */
.wulr-search-edit-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
	transition: color 0.15s;
}
.wulr-search-edit-btn:hover,
.wulr-search-edit-btn:focus-visible {
	color: var(--wp--preset--color--red-dk);
}

/* ---- Category count pills (jump to each section) ---- */
.wulr-search-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.wulr-count-pill {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 8px 15px;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--body);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.15s, border-color 0.15s;
}
.wulr-count-n {
	font-weight: 700;
	color: var(--wp--preset--color--accent);
}

/* ---- Section headings (entities + Articles) ---- */
.wulr-section-heading {
	font-family: var(--wp--preset--font-family--display);
	/* Matches the By Topic/Author letter headings (.wulr-idx-letter, xxl). */
	font-size: var(--wp--preset--font-size--xxl);
	line-height: 1.1;
	color: var(--wp--preset--color--body);
	margin: 0 0 16px;
	scroll-margin-top: 24px;
}
.wulr-section-count {
	color: var(--wp--preset--color--stone);
	font-size: 0.7em;
	font-weight: 400;
}

/* ---- Entity match sections (topics / authors / volumes) ---- */
.wulr-entities {
	display: flex;
	flex-direction: column;
	gap: 36px;
}
.wulr-entity-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}
.wulr-entity-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 2px;
	text-decoration: none;
	transition: border-color 0.12s;
}
.wulr-entity-card:hover,
.wulr-entity-card:focus-visible {
	border-color: var(--wp--preset--color--accent);
}
.wulr-entity-name {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.2;
	color: var(--wp--preset--color--body);
	transition: color 0.12s;
}
.wulr-entity-card:hover .wulr-entity-name,
.wulr-entity-card:focus-visible .wulr-entity-name {
	color: var(--wp--preset--color--accent);
}
.wulr-entity-meta {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--stone);
}

/* ---- Articles results grid (3-up, mirrors the archive) ---- */
.wulr-search-results .wulr-card-grid {
	grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px) {
	.wulr-search-results .wulr-card-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 560px) {
	.wulr-search-results .wulr-card-grid {
		grid-template-columns: 1fr;
	}
}
.wulr-search-empty {
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--lg);
	color: var(--wp--preset--color--stone);
	margin: 0;
}
