/* === SEARCH ALL OVERLAY === */

/* Lien loupe dans le menu WP (principal + menu-option) */
.nav-menu a[href="#search-all"],
.nav-option-menu a[href="#search-all"] {
	font-size: 0;
	display: inline-block;
	width: 20px;
	height: 20px;
	vertical-align: middle;
	position: relative;
	top: -2px;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23111' stroke-width='2'/%3E%3Cline x1='16' y1='16' x2='22' y2='22' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.nav-menu a[href="#search-all"]:hover,
.nav-option-menu a[href="#search-all"]:hover {
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%235a1eff' stroke-width='2'/%3E%3Cline x1='16' y1='16' x2='22' y2='22' stroke='%235a1eff' stroke-width='2'/%3E%3C/svg%3E");
	text-decoration: none;
}

/* Overlay (popin) */
.search-all-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	background: rgba(255, 255, 255, 0.95);
	display: none;
	flex-direction: column;
	align-items: center;
	padding: calc(var(--gap) * 4) var(--gap);
}

.search-all-overlay.active {
	display: flex;
}

/* Bouton fermer (X) */
.search-all-close {
	position: absolute;
	top: calc(var(--gap) * 2);
	right: calc(var(--gap) * 2);
	background: none;
	border: none;
	cursor: pointer;
	width: 32px;
	height: 32px;
	padding: 0;
	transition: transform 0.3s ease;
}

.search-all-close:hover {
	transform: rotate(90deg);
}

.search-all-close span {
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	height: 2px;
	background: var(--c-dark);
	border-radius: 2px;
}

.search-all-close span:first-child {
	transform: translateY(-50%) rotate(45deg);
}

.search-all-close span:last-child {
	transform: translateY(-50%) rotate(-45deg);
}

.search-all-close:hover span {
	background: var(--c-fresh);
}

/* Container central */
.search-all-container {
	width: 100%;
	max-width: 800px;
	margin-top: calc(var(--gap) * 2);
}

/* Input géant */
.search-all-input-wrap {
	margin-bottom: calc(var(--gap) * 2);
}

.search-all-input {
	width: 100%;
	padding: 1rem 0;
	border: none;
	border-bottom: 2px solid var(--c-dark);
	font-size: var(--t2);
	font-family: var(--font);
	background: transparent;
	outline: none;
}

.search-all-input::placeholder {
	color: var(--c-grey);
}

.search-all-input:focus {
	border-color: var(--c-fresh);
}

/* Zone résultats */
.search-all-results {
	max-height: calc(100vh - 250px);
	overflow-y: auto;
}

.search-all-hint {
	color: var(--c-grey);
	font-size: var(--t5);
}

.search-all-no-results {
	color: var(--c-grey);
	font-size: var(--t5);
}

/* Liste des résultats */
.search-all-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Item résultat */
.search-all-item {
	border-bottom: 1px solid #eee;
}

.search-all-item a {
	display: flex;
	align-items: center;
	gap: var(--gap);
	padding: var(--gap) 0;
	text-decoration: none;
}

.search-all-item a:hover {
	text-decoration: none;
}

.search-all-item a:hover .search-all-item-title {
	color: var(--c-fresh);
}

/* Thumbnail */
.search-all-item-thumb {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	background: #f5f5f5;
	border-radius: 4px;
	overflow: hidden;
}

.search-all-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Contenu */
.search-all-item-content {
	flex: 1;
	min-width: 0;
}

.search-all-item-type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--c-grey);
	margin-bottom: 0.25rem;
}

.search-all-item-title {
	font-size: var(--t5);
	font-weight: 500;
	color: var(--c-dark);
	margin-bottom: 0.25rem;
}

.search-all-item-excerpt {
	font-size: var(--t6);
	color: var(--c-grey);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Highlight terme recherché */
.search-all-highlight {
	background: rgba(90, 30, 255, 0.15);
	padding: 0 2px;
	border-radius: 2px;
}

/* === XS (< 640px) === */
@media (max-width: 639px) {
	.search-all-overlay {
		padding: calc(var(--gap) * 3) var(--gap);
	}

	.search-all-close {
		top: var(--gap);
		right: var(--gap);
	}

	.search-all-input {
		font-size: var(--t3);
	}

	.search-all-item-thumb {
		width: 50px;
		height: 50px;
	}
}

/* Body lock quand overlay ouvert */
body.search-all-open {
	overflow: hidden;
}
