/*
 * Tips Recherche — styles par défaut.
 * Spécificité volontairement basse (1 ou 2 classes) : assez pour passer devant les styles génériques du thème
 * (a, input, div…), toujours derrière les réglages du module Divi (classe du module + 2 classes).
 */

.tips-rech {
	position: relative;
	width: 100%;
}
.tips-rech .tips-rech-form {
	display: flex;
	align-items: stretch;
	gap: 0;
	margin: 0;
	padding: 0;
}
.tips-rech .tips-rech-champ {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid #d8d8d8;
	border-radius: 6px;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}
.tips-rech .tips-rech-form:has(.tips-rech-btn) .tips-rech-champ {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.tips-rech .tips-rech-champ::-webkit-search-decoration { -webkit-appearance: none; }
.tips-rech .tips-rech-champ:focus { outline: 2px solid currentColor; outline-offset: -2px; }
.tips-rech .tips-rech-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	line-height: 1;
	color: #fff;
	background: #333;
	border: 0 solid #333;
	border-radius: 0 6px 6px 0;
	cursor: pointer;
}
.tips-rech .tips-rech-btn:focus-visible { outline: 2px solid #333; outline-offset: 2px; }
.tips-rech-ico { display: block; flex: none; }

/* Widget : couleurs et arrondi réglés dans Réglages > Recherche > Widget */
.tips-rech.tips-rech--widget .tips-rech-champ {
	background: var(--tips-rech-champ-bg, #fff);
	border-color: var(--tips-rech-champ-bord, #d8d8d8);
	border-radius: var(--tips-rech-rayon, 6px);
}
.tips-rech.tips-rech--widget .tips-rech-form:has(.tips-rech-btn) .tips-rech-champ {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.tips-rech.tips-rech--widget .tips-rech-btn {
	color: var(--tips-rech-btn-fg, #fff);
	background: var(--tips-rech-btn-bg, #333);
	border-radius: 0 var(--tips-rech-rayon, 6px) var(--tips-rech-rayon, 6px) 0;
}
.tips-rech.tips-rech--widget .tips-rech-panel { border-radius: var(--tips-rech-rayon, 6px); }

/* Liste des suggestions */
.tips-rech-panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 99999;
	max-height: min(70vh, 520px);
	overflow: auto;
	margin: 0;
	padding: 6px;
	background: #fff;
	color: #222;
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
	text-align: left;
	font-size: 15px;
	line-height: 1.4;
}
.tips-rech-panel.tips-rech-panel--flottant { right: auto; }
.tips-rech-panel[hidden] { display: none !important; }
.tips-rech-panel.is-chargement { opacity: .7; }
.tips-rech-panel .tips-rech-liste {
	list-style: none;
	margin: 0;
	padding: 0;
}
.tips-rech-panel .tips-rech-item {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
}
.tips-rech-panel .tips-rech-item::before { content: none; }
.tips-rech-panel .tips-rech-lien {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}
.tips-rech-panel .tips-rech-item.is-actif .tips-rech-lien,
.tips-rech-panel .tips-rech-lien:hover { background: rgba(0, 0, 0, .05); }
.tips-rech-panel .tips-rech-img {
	flex: none;
	width: 48px;
	height: 48px;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 4px;
}
.tips-rech-panel .tips-rech-txt {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	gap: 2px;
}
.tips-rech-panel .tips-rech-t {
	align-self: stretch;
	font-weight: 600;
	line-height: 1.3;
}
.tips-rech-panel .tips-rech-x {
	align-self: stretch;
	font-size: .85em;
	line-height: 1.4;
	opacity: .75;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.tips-rech-panel .tips-rech-ty {
	flex: none;
	align-self: flex-start;
	font-size: .75em;
	line-height: 1.2;
	padding: 3px 6px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .06);
	white-space: nowrap;
}
.tips-rech-panel .tips-rech-pied {
	padding: 8px;
	font-size: .9em;
}
.tips-rech-panel .tips-rech-pied:empty { display: none; }
.tips-rech-panel .tips-rech-liste:not(:empty) + .tips-rech-pied {
	margin-top: 4px;
	border-top: 1px solid rgba(0, 0, 0, .08);
}
.tips-rech-panel .tips-rech-tout { color: inherit; font-weight: 600; text-decoration: underline; }

/* Surbrillance (couleur et opacité : Réglages > Recherche) */
mark.tips-rech-mark {
	background: var(--tips-rech-mark, rgba(255, 216, 77, .45));
	color: inherit;
	padding: 0 .08em;
	margin: 0 -.08em;
	border-radius: 2px;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

@media print {
	mark.tips-rech-mark { background: none; }
	.tips-rech-panel { display: none !important; }
}
