/* LPO Vendée — recherche en overlay (R91, 25/09/2026). Voir recherche.js.
 * Palette : bleu nuit de la charte pour le fond, papier pour le champ et les cartes. */

/* Loupe dans le header : même pastille que le bouton icône « Mon espace » ; l'écart entre les deux boutons
   est resserré (le bloc Boutons a 30 px par défaut).
   v2 (28/09/2026) : le bloc Bouton porte le texte « Rechercher » et plus de SVG. L'éditeur du site vide un SVG
   placé dans le texte d'un bouton dès qu'on réenregistre le header, et WordPress 6.7+ ne rend rien pour un
   bouton vide : la loupe disparaissait. L'icône est donc dessinée ici par un masque CSS ; le texte, en taille 0,
   reste le nom accessible du lien. */
.lpo-header-pill .wp-block-buttons { gap: 12px; }
.lpo-btn-recherche .wp-block-button__link { display: inline-flex; font-size: 0; line-height: 1; transition: background-color 0.15s ease, color 0.15s ease; }
.lpo-btn-recherche .wp-block-button__link::before {
	content: ""; display: block; width: 18px; height: 18px; background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Focus rendu par le script à la fermeture de l'overlay : pas d'anneau orange ni d'ombre (voir recherche.js). */
.lpo-btn-recherche .wp-block-button__link.lpo-focus-silencieux:focus,
.lpo-btn-recherche .wp-block-button__link.lpo-focus-silencieux:focus-visible { outline: none; box-shadow: none; }
/* Ancienne version du bloc (SVG encore présent) : pas de double icône. */
.lpo-btn-recherche .wp-block-button__link svg { display: block; }
.lpo-btn-recherche .wp-block-button__link:has(svg)::before { display: none; }
.lpo-btn-recherche .wp-block-button__link:hover,
.lpo-btn-recherche .wp-block-button__link:focus-visible {
	background-color: var(--wp--preset--color--lpo-warm-50);
	color: var(--wp--preset--color--lpo-blue);
}

/* Overlay. ⚠️ `display:flex` battrait l'attribut hidden (display:none par défaut) : l'overlay invisible
   resterait au-dessus de la page et avalerait les clics, dont celui sur la loupe. D'où la règle [hidden]. */
.lpo-recherche[hidden] { display: none; }
.lpo-recherche { position: fixed; inset: 0; z-index: 100001; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity 0.2s ease; }
.lpo-recherche.is-open { opacity: 1; }
.lpo-recherche__fond { position: absolute; inset: 0; background: rgba(4, 30, 46, 0.96); } /* lpo-night */
.lpo-recherche-ouverte { overflow: hidden; }
.lpo-recherche__cadre {
	position: relative;
	align-self: flex-start;
	width: min(88vw, 1600px); /* recherche.js recale largeur, marges et hauteur sur la pill du menu à l'ouverture */
	max-width: 100%;
	margin: 24px auto 0;
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	padding: 0 0 40px;
	transform: translateY(-6px) scale(0.985);
	transform-origin: top center;
	transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
	scrollbar-width: thin;
}
.lpo-recherche.is-open .lpo-recherche__cadre { transform: none; }
.lpo-recherche__logo { display: flex; align-items: center; flex: 0 0 auto; margin-right: clamp(12px, 2vw, 32px); }
.lpo-recherche__logo img { display: block; width: 100%; height: auto; }

/* Le champ : une pill blanche à la place de la barre de menu. */
.lpo-recherche__form {
	position: relative; /* la croix y est positionnée sur la loupe du header (recherche.js) */
	display: flex; align-items: center; gap: 14px; box-sizing: border-box;
	min-height: 77px; padding: 8px 16px 8px clamp(20px, 2.8vw, 40px);
	border-radius: 999px; background: var(--wp--preset--color--lpo-paper);
	box-shadow: var(--wp--preset--shadow--pill, 0 12px 30px -12px rgba(0, 0, 0, 0.35));
}
.lpo-recherche__loupe { display: flex; color: var(--wp--preset--color--lpo-blue); }
.lpo-recherche .lpo-recherche__form .lpo-recherche__champ,
.lpo-recherche .lpo-recherche__form .lpo-recherche__champ:focus,
.lpo-recherche .lpo-recherche__form .lpo-recherche__champ:focus-visible {
	border: 0 !important; outline: none !important; box-shadow: none !important; -webkit-appearance: none; appearance: none; border-radius: 0;
}
.lpo-recherche__champ {
	flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent;
	font-family: var(--wp--preset--font-family--sora, inherit); font-size: clamp(18px, 1.6vw, 24px); font-weight: 600;
	color: var(--wp--preset--color--lpo-ink); padding: 8px 0;
}
.lpo-recherche__champ::placeholder { color: var(--wp--preset--color--lpo-warm-300); font-weight: 500; }
.lpo-recherche__champ::-webkit-search-cancel-button { -webkit-appearance: none; }
.lpo-recherche__fermer {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: var(--wp--preset--color--lpo-warm-50);
	color: var(--wp--preset--color--lpo-ink); cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.lpo-recherche__fermer:hover, .lpo-recherche__fermer:focus-visible { background: var(--wp--preset--color--lpo-blue); color: #fff; outline: none; }

/* État et résultats */
/* Indicateur d'activité (R95) : anneau qui tourne à droite du champ pendant la requête REST. */
.lpo-recherche__spin { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(0, 135, 205, 0.22); border-top-color: var(--wp--preset--color--lpo-blue); animation: lpo-recherche-spin 0.8s linear infinite; }
.lpo-recherche__spin[hidden] { display: none; }
@keyframes lpo-recherche-spin { to { transform: rotate(360deg); } }
.lpo-recherche__etat { margin: 18px 0 0; text-align: center; color: rgba(255, 255, 255, 0.72); font-size: 14px; min-height: 1.4em; }
.lpo-recherche__liste { list-style: none; margin: 14px auto 0; padding: 0; width: min(100%, 820px); display: grid; gap: 10px; }
@keyframes lpo-recherche-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lpo-recherche__liste li { animation: lpo-recherche-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.lpo-recherche__liste a {
	display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center;
	padding: 12px; border-radius: 16px; background: var(--wp--preset--color--lpo-paper);
	color: var(--wp--preset--color--lpo-ink); text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lpo-recherche__liste a:hover, .lpo-recherche__liste a:focus-visible {
	transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.6); outline: none;
}
.lpo-recherche__liste a:focus-visible { box-shadow: 0 0 0 3px var(--wp--preset--color--lpo-orange); }
.lpo-recherche__img { display: block; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--wp--preset--color--lpo-warm-100); }
.lpo-recherche__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lpo-recherche__vide { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--wp--preset--color--lpo-warm-300); }
.lpo-recherche__corps { display: grid; gap: 3px; min-width: 0; }
.lpo-recherche__type { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wp--preset--color--lpo-blue); }
.lpo-recherche__date { font-weight: 600; color: var(--wp--preset--color--lpo-ink); opacity: 0.6; } /* R95 : date à côté du type */
.lpo-recherche__titre { font-size: 17px; font-weight: 700; line-height: 1.25; }
.lpo-recherche__titre mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
.lpo-recherche__extrait {
	font-size: 14px; line-height: 1.45; color: var(--wp--preset--color--lpo-warm-700);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lpo-recherche__tous { margin: 18px 0 0; text-align: center; }
.lpo-recherche__tous a {
	display: inline-block; padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff; font-weight: 600; text-decoration: none; font-size: 14px; transition: background-color 0.15s ease;
}
.lpo-recherche__tous a:hover, .lpo-recherche__tous a:focus-visible { background: var(--wp--preset--color--lpo-blue); border-color: var(--wp--preset--color--lpo-blue); outline: none; }

@media (max-width: 700px) {
	.lpo-recherche__cadre { width: calc(100% - 32px); margin-top: 16px; }
	.lpo-recherche__form { min-height: 60px; padding-left: 18px; gap: 10px; }
	.lpo-recherche__champ { font-size: 17px; }
	.lpo-recherche__liste a { grid-template-columns: 64px 1fr; gap: 12px; padding: 10px; }
	.lpo-recherche__img { width: 64px; height: 64px; }
	.lpo-recherche__titre { font-size: 15px; }
	.lpo-recherche__extrait { -webkit-line-clamp: 2; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.lpo-recherche__spin { animation-duration: 2.4s; }
	.lpo-recherche, .lpo-recherche__cadre, .lpo-recherche__liste a { transition: none; }
	.lpo-recherche__liste li { animation: none; }
}
@media (max-width: 700px) {
	.lpo-recherche__logo { margin-right: 8px; }
}
