/* ==========================================================================
   Search results · 404 · archive fallback
   --------------------------------------------------------------------------
   Loaded only on search, 404 and archive routes (see idc_archive_styles in
   functions.php). Kept out of pages.css deliberately: that file is 31KB loaded
   on every page of the site, and these rules are needed on a handful of routes.

   Every value is an existing token from style.css. The hero itself
   (.page-hero, .page-hero-title, .page-hero-sub) is already styled in
   pages.css and is not redefined here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Result / archive list — shared by search.php and index.php
   -------------------------------------------------------------------------- */

.idc-result-list {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
	display: grid;
	gap: 14px;
}

.idc-result-link {
	position: relative;
	display: block;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-left: 3px solid var(--gold-dark);
	border-radius: var(--radius-md);
	padding: 22px 24px;
	text-decoration: none;
	transition: border-color .18s ease, transform .18s ease;
}

.idc-result-link:hover,
.idc-result-link:focus-visible {
	border-color: var(--border-hover);
	transform: translateY(-2px);
}

.idc-result-link:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

.idc-result-kind {
	display: block;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--gold);
	margin-bottom: 6px;
}

.idc-result-title {
	font-family: var(--font-heading);
	font-size: clamp(1.15rem, 2.4vw, 1.5rem);
	font-weight: 600;
	line-height: 1.35;
	color: var(--text);
	margin: 0 0 8px;
	/* Product titles on this site run long. Wrap; never overflow. */
	overflow-wrap: break-word;
}

.idc-result-price {
	display: block;
	font-weight: 700;
	color: var(--gold-light);
	margin-bottom: 8px;
}

.idc-result-excerpt {
	display: block;
	color: var(--text-muted);
	font-size: .92rem;
	line-height: 1.65;
}

/* --------------------------------------------------------------------------
   2. Empty state — a real answer, not a blank page
   --------------------------------------------------------------------------
   Named .idc-empty-state rather than reusing .idc-acct-empty, which is scoped
   to .woocommerce-account and would not apply on a search page.
   -------------------------------------------------------------------------- */

.idc-empty-state {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 40px 28px;
	text-align: center;
}

.idc-empty-h2 {
	font-family: var(--font-heading);
	font-size: clamp(1.3rem, 2.6vw, 1.7rem);
	font-weight: 600;
	color: var(--text);
	margin: 0 0 12px;
}

.idc-empty-state p {
	color: var(--text-muted);
	max-width: 52ch;
	margin: 0 auto 24px;
	line-height: 1.7;
}

/* --------------------------------------------------------------------------
   3. 404 — the routes onward
   -------------------------------------------------------------------------- */

.idc-notfound {
	max-width: 760px;
	margin-inline: auto;
}

.idc-notfound-h2 {
	font-family: var(--font-heading);
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
	font-weight: 600;
	color: var(--text);
	margin: 0 0 16px;
}

.idc-notfound-links {
	list-style: none;
	margin: 0 0 44px;
	padding: 0;
	display: grid;
	gap: 12px;
}

.idc-notfound-link {
	position: relative;
	display: block;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 18px 52px 18px 20px;
	text-decoration: none;
	transition: border-color .18s ease, transform .18s ease;
}

.idc-notfound-link:hover,
.idc-notfound-link:focus-visible {
	border-color: var(--border-hover);
	transform: translateY(-2px);
}

.idc-notfound-link:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

.idc-notfound-link-title {
	display: block;
	font-family: var(--font-heading);
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--text);
}

.idc-notfound-link-desc {
	display: block;
	margin-top: 4px;
	font-size: .88rem;
	line-height: 1.55;
	color: var(--text-muted);
}

.idc-notfound-arrow {
	position: absolute;
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
	color: var(--gold);
	font-size: 1.2rem;
	transition: transform .18s ease;
}

.idc-notfound-link:hover .idc-notfound-arrow {
	transform: translateY(-50%) translateX(3px);
}

/* --------------------------------------------------------------------------
   4. The search form itself
   -------------------------------------------------------------------------- */

.idc-search-bar,
.idc-notfound-search {
	margin-bottom: 32px;
}

.idc-search-bar .search-form,
.idc-notfound-search .search-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	max-width: 560px;
}

.idc-search-bar .search-field,
.idc-notfound-search .search-field {
	flex: 1 1 240px;
	min-height: 48px;
	padding: 12px 16px;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1rem;
	transition: border-color .16s ease, box-shadow .16s ease;
}

.idc-search-bar .search-field::placeholder,
.idc-notfound-search .search-field::placeholder {
	color: var(--text-dim);
}

/* Gold focus, matching the account forms — crimson is the error colour. */
.idc-search-bar .search-field:focus,
.idc-notfound-search .search-field:focus {
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .18);
	outline: none;
}

.idc-search-bar .search-submit,
.idc-notfound-search .search-submit {
	min-height: 48px;
	padding: 12px 26px;
	background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
	border: none;
	border-radius: var(--radius-pill);
	color: var(--text);
	font-family: var(--font-body);
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	cursor: pointer;
}

/* The label WordPress renders around the field is for screen readers only. */
.idc-search-bar .search-form .screen-reader-text,
.idc-notfound-search .search-form .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Pagination
   -------------------------------------------------------------------------- */

.idc-pagination {
	margin-top: 8px;
}

.idc-pagination .nav-links {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.idc-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	text-decoration: none;
	font-variant-numeric: lining-nums tabular-nums;
	transition: border-color .16s ease, color .16s ease;
}

.idc-pagination .page-numbers:hover,
.idc-pagination .page-numbers:focus-visible {
	border-color: var(--border-hover);
	color: var(--gold);
}

.idc-pagination .page-numbers.current {
	background: rgba(var(--gold-rgb), .12);
	border-color: var(--border-hover);
	color: var(--gold-light);
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.idc-result-link {
		padding: 18px 16px;
	}

	.idc-notfound-link {
		padding: 16px 44px 16px 16px;
	}

	.idc-search-bar .search-submit,
	.idc-notfound-search .search-submit {
		/* Full width rather than a stub button beside a wrapped field. */
		flex: 1 1 100%;
	}
}

/* --------------------------------------------------------------------------
   7. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.idc-result-link,
	.idc-notfound-link,
	.idc-notfound-arrow {
		transition: none;
	}

	.idc-result-link:hover,
	.idc-result-link:focus-visible,
	.idc-notfound-link:hover,
	.idc-notfound-link:focus-visible {
		transform: none;
	}

	.idc-notfound-link:hover .idc-notfound-arrow {
		transform: translateY(-50%);
	}
}
