/* -----------------------------------------------------------------
   Sprint 8 — Public Search styles (v2: tabs + grouped typeahead)

   Class naming: wt26-lc-search, wt26-lc-typeahead, wt26-lc-results,
                 wt26-lc-card, wt26-lc-tab, wt26-lc-search-panel
   Visual tokens via CSS custom properties so brand tweaks are local.
   ----------------------------------------------------------------- */

:root {
	--wt26-lc-color-primary:       #1f3a64;
	--wt26-lc-color-primary-dark:  #142845;
	--wt26-lc-color-accent:        #3a8e8c;
	--wt26-lc-color-accent-dark:   #2c6e6c;
	--wt26-lc-color-staff:         #b07420;
	--wt26-lc-color-blog:          #5b6770;
	--wt26-lc-color-bg:            #ffffff;
	--wt26-lc-color-bg-soft:       #f4f7fa;
	--wt26-lc-color-border:        #d8dde3;
	--wt26-lc-color-border-strong: #b7c0c9;
	--wt26-lc-color-text:          #1d2530;
	--wt26-lc-color-text-muted:    #5b6770;
	--wt26-lc-radius:              6px;
	--wt26-lc-shadow:              0 4px 14px rgba(20, 40, 69, 0.08);
	--wt26-lc-shadow-strong:       0 10px 30px rgba(20, 40, 69, 0.14);
}

/* ---------- Search input (shortcode) ---------- */
.wt26-lc-search {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.wt26-lc-search__form {
	display: flex;
	align-items: stretch;
	gap: 0;
	border: 1px solid var(--wt26-lc-color-border);
	border-radius: var(--wt26-lc-radius);
	background: var(--wt26-lc-color-bg);
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wt26-lc-search__form:focus-within {
	border-color: var(--wt26-lc-color-accent);
	box-shadow: 0 0 0 3px rgba(58, 142, 140, 0.15);
}

.wt26-lc-search__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 16px;
	border: none;
	outline: none;
	background: transparent;
	font: inherit;
	font-size: 16px;
	color: var(--wt26-lc-color-text);
}

.wt26-lc-search__input::placeholder {
	color: var(--wt26-lc-color-text-muted);
}

.wt26-lc-search__submit {
	flex: 0 0 auto;
	padding: 12px 22px;
	border: none;
	background: var(--wt26-lc-color-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wt26-lc-search__submit:hover,
.wt26-lc-search__submit:focus {
	background: var(--wt26-lc-color-accent-dark);
}

.wt26-lc-search--header .wt26-lc-search__input { padding: 8px 12px; font-size: 14px; }
.wt26-lc-search--header .wt26-lc-search__submit { padding: 8px 14px; font-size: 14px; }

/* Hero variant — constrained, centered. Without this, full-width Breakdance
   sections make the input span the entire viewport. */
.wt26-lc-search--hero {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

.wt26-lc-search--hero .wt26-lc-search__input  { padding: 14px 18px; font-size: 17px; }
.wt26-lc-search--hero .wt26-lc-search__submit { padding: 14px 28px; font-size: 16px; }

/* ---------- Typeahead dropdown ---------- */
.wt26-lc-search__typeahead {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	margin-top: 6px;
	background: var(--wt26-lc-color-bg);
	border: 1px solid var(--wt26-lc-color-border);
	border-radius: var(--wt26-lc-radius);
	box-shadow: var(--wt26-lc-shadow-strong);
	z-index: 1000;
	max-height: 70vh;
	overflow-y: auto;
}

.wt26-lc-typeahead__group {
	border-bottom: 1px solid var(--wt26-lc-color-border);
}
.wt26-lc-typeahead__group:last-of-type { border-bottom: 0; }

.wt26-lc-typeahead__group-header {
	padding: 8px 14px 6px;
	background: var(--wt26-lc-color-bg-soft);
	color: var(--wt26-lc-color-text-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wt26-lc-typeahead__group-header--wt-guide    { color: var(--wt26-lc-color-primary); }
.wt26-lc-typeahead__group-header--wt-blog     { color: var(--wt26-lc-color-blog); }
.wt26-lc-typeahead__group-header--staff-guide { color: var(--wt26-lc-color-staff); }

.wt26-lc-typeahead__list {
	margin: 0;
	padding: 2px 0 4px;
	list-style: none;
}

.wt26-lc-typeahead__item {
	margin: 0;
	padding: 0;
}

.wt26-lc-typeahead__link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	color: var(--wt26-lc-color-text);
	text-decoration: none;
	border-left: 3px solid transparent;
	transition: background 0.1s ease, border-color 0.1s ease;
}

.wt26-lc-typeahead__link:hover,
.wt26-lc-typeahead__item.is-active .wt26-lc-typeahead__link {
	background: var(--wt26-lc-color-bg-soft);
	border-left-color: var(--wt26-lc-color-accent);
}

.wt26-lc-typeahead__title {
	flex: 1 1 auto;
	font-size: 14px;
	line-height: 1.35;
}

.wt26-lc-typeahead__ext {
	flex: 0 0 auto;
	color: var(--wt26-lc-color-text-muted);
	font-size: 12px;
}

.wt26-lc-typeahead__empty {
	padding: 14px;
	color: var(--wt26-lc-color-text-muted);
	font-size: 14px;
	text-align: center;
}

.wt26-lc-typeahead__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px;
	color: var(--wt26-lc-color-text-muted);
	font-size: 14px;
}

/* Generic spinner — used in both typeahead (sm) and full results page (md) */
.wt26-lc-typeahead__spinner,
.wt26-lc-spinner {
	flex: 0 0 auto;
	border-radius: 50%;
	border: 2px solid var(--wt26-lc-color-border);
	border-top-color: var(--wt26-lc-color-accent);
	animation: wt26-lc-spin 0.7s linear infinite;
}

.wt26-lc-typeahead__spinner,
.wt26-lc-spinner--sm {
	width: 14px;
	height: 14px;
}

.wt26-lc-spinner--md {
	width: 22px;
	height: 22px;
	border-width: 3px;
}

@keyframes wt26-lc-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.wt26-lc-typeahead__spinner,
	.wt26-lc-spinner { animation-duration: 1.8s; }
}

.wt26-lc-typeahead__viewall {
	display: block;
	padding: 10px 14px;
	border-top: 1px solid var(--wt26-lc-color-border);
	color: var(--wt26-lc-color-primary);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	background: var(--wt26-lc-color-bg-soft);
}

.wt26-lc-typeahead__viewall:hover {
	color: var(--wt26-lc-color-primary-dark);
	text-decoration: underline;
}

/* ---------- Search results page ---------- */
.wt26-lc-search-page__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 24px 80px;
}

.wt26-lc-search-page__header {
	margin-bottom: 24px;
}

.wt26-lc-search-page__title {
	margin: 0 0 8px;
	font-size: clamp(28px, 4vw, 40px);
	color: var(--wt26-lc-color-primary);
	line-height: 1.2;
}

.wt26-lc-search-page__query {
	color: var(--wt26-lc-color-accent);
}

.wt26-lc-search-page__searchbar {
	margin-bottom: 32px;
}

.wt26-lc-search-page__results {
	margin-top: 8px;
}

/* ---------- Results container ---------- */
.wt26-lc-search-results {
	display: block;
}

.wt26-lc-search-results__status {
	margin-bottom: 16px;
	color: var(--wt26-lc-color-text-muted);
	font-size: 14px;
}

.wt26-lc-search-results__status--loading {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--wt26-lc-color-bg-soft);
	border-left: 3px solid var(--wt26-lc-color-accent);
	border-radius: var(--wt26-lc-radius);
	color: var(--wt26-lc-color-primary);
	font-size: 15px;
	font-weight: 500;
}

/* Skeleton-card loading state (shimmer) */
.wt26-lc-results__grid--loading {
	pointer-events: none;
	user-select: none;
}

.wt26-lc-card--skeleton {
	cursor: default;
}

.wt26-lc-card--skeleton:hover {
	transform: none;
	box-shadow: none;
	border-color: var(--wt26-lc-color-border);
}

.wt26-lc-skeleton {
	background: linear-gradient(
		90deg,
		#eef2f6 0%,
		#dde4ec 50%,
		#eef2f6 100%
	);
	background-size: 200% 100%;
	border-radius: 4px;
	animation: wt26-lc-shimmer 1.4s ease-in-out infinite;
}

.wt26-lc-skeleton--image {
	aspect-ratio: 16 / 9;
	border-radius: var(--wt26-lc-radius) var(--wt26-lc-radius) 0 0;
}

.wt26-lc-skeleton__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px 22px;
}

.wt26-lc-skeleton--title { width: 85%;   height: 18px; }
.wt26-lc-skeleton--line  { width: 100%;  height: 12px; }
.wt26-lc-skeleton--line-short { width: 60%; }

@keyframes wt26-lc-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.wt26-lc-skeleton { animation-duration: 3s; }
}

.wt26-lc-results__support-link {
	color: var(--wt26-lc-color-primary);
	font-weight: 600;
	text-decoration: none;
}
.wt26-lc-results__support-link:hover { text-decoration: underline; }

.wt26-lc-results__empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--wt26-lc-color-text-muted);
}
.wt26-lc-results__empty p { margin: 0 0 10px; }

.wt26-lc-results__hint {
	color: var(--wt26-lc-color-primary);
	font-weight: 500;
}

.wt26-lc-results__error {
	padding: 16px;
	background: #fff5f5;
	border: 1px solid #f3c1c1;
	border-radius: var(--wt26-lc-radius);
	color: #8b1a1a;
}

/* ---------- Tabs ---------- */
.wt26-lc-search-results__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--wt26-lc-color-border);
}

.wt26-lc-tab {
	flex: 0 0 auto;
	padding: 12px 20px;
	margin-bottom: -1px; /* overlap the strip's border */
	background: transparent;
	border: 0;
	border-bottom: 3px solid transparent;
	color: var(--wt26-lc-color-text-muted);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.wt26-lc-tab:hover {
	color: var(--wt26-lc-color-primary);
}

.wt26-lc-tab.is-active {
	color: var(--wt26-lc-color-primary);
	border-bottom-color: var(--wt26-lc-color-accent);
}

.wt26-lc-tab__count {
	color: var(--wt26-lc-color-text-muted);
	font-weight: 500;
	font-size: 13px;
}

.wt26-lc-tab.is-active .wt26-lc-tab__count {
	color: var(--wt26-lc-color-accent-dark);
}

/* ---------- Panels ---------- */
.wt26-lc-search-panel {
	display: none;
}
.wt26-lc-search-panel.is-active {
	display: block;
}

/* ---------- Show more ---------- */
.wt26-lc-results__more {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.wt26-lc-results__more-btn {
	padding: 10px 22px;
	background: var(--wt26-lc-color-bg);
	border: 1px solid var(--wt26-lc-color-border);
	border-radius: var(--wt26-lc-radius);
	color: var(--wt26-lc-color-primary);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.wt26-lc-results__more-btn:hover {
	background: var(--wt26-lc-color-bg-soft);
	border-color: var(--wt26-lc-color-border-strong);
}

/* ---------- Cards ---------- */
.wt26-lc-results__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wt26-lc-card {
	margin: 0;
	background: var(--wt26-lc-color-bg);
	border: 1px solid var(--wt26-lc-color-border);
	border-radius: var(--wt26-lc-radius);
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wt26-lc-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--wt26-lc-shadow);
	border-color: var(--wt26-lc-color-border-strong);
}

.wt26-lc-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.wt26-lc-card__image {
	aspect-ratio: 16 / 9;
	background: var(--wt26-lc-color-bg-soft);
	overflow: hidden;
}

.wt26-lc-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wt26-lc-card__image--placeholder {
	background: linear-gradient(135deg, #e9eef4 0%, #d8e1eb 100%);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.wt26-lc-card--wt-guide .wt26-lc-card__image--placeholder {
	background-image: url('images/wt-card-placeholder-public.svg');
}

.wt26-lc-card--staff-guide .wt26-lc-card__image--placeholder {
	background-image: url('images/wt-card-placeholder-staff.svg');
}

.wt26-lc-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px 20px;
	flex: 1 1 auto;
}

.wt26-lc-card__title {
	margin: 0;
	color: var(--wt26-lc-color-primary);
	font-size: 17px;
	line-height: 1.3;
	font-weight: 600;
}

.wt26-lc-card__excerpt {
	margin: 0;
	color: var(--wt26-lc-color-text);
	font-size: 14px;
	line-height: 1.5;
}

.wt26-lc-card__ext {
	color: var(--wt26-lc-color-text-muted);
	font-size: 0.85em;
	font-weight: 400;
	margin-left: 2px;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 600px) {
	.wt26-lc-search__form { flex-direction: column; }
	.wt26-lc-search__submit { width: 100%; padding: 12px; }
	.wt26-lc-search-page__inner { padding: 24px 16px 60px; }
}
