/*
 * cs-search — styles du moteur de recherche interne.
 *
 * Jetons de la charte v1.0 (22/08/2026) portés par l'enveloppe `.csrch` :
 * aucune couleur en dur hors du bloc ci-dessous. cs-explorer porte les siens
 * sur `.csx`, avec d'autres valeurs — les deux plugins cohabitent donc sur la
 * même page, le bandeau saisonnier de l'état zéro-résultat gardant les siens.
 *
 * Angles droits partout, aucune ombre, aucun dégradé, Arial seul.
 *
 * DEUX JETONS S'ÉCARTENT DE LA CHARTE, dont le §10 pose l'AA comme « non
 * négociable » alors que ses couleurs ne l'atteignent pas : le vert porteur
 * (#5A8F27 → #4A7A00) et le texte secondaire (#7A7A72 → #6E6E66). Contrastes
 * mesurés et justification : DEC-06 dans docs/decisions.md.
 */

.csrch {
	/* Fonds — trois seulement : blanc, panneau crème, (pied de page, hors plugin). */
	--csrch-bg: #FFFFFF;
	--csrch-panel: #F6F6F2;

	/* Textes */
	--csrch-text: #2B2B2B;
	--csrch-text-soft: #4A4A44;
	--csrch-muted: #6E6E66;
	--csrch-on-accent: #FFFFFF;

	/* Verts : l'accent est décoratif, l'encre est le seul vert porteur. */
	--csrch-accent: #7EBB42;
	--csrch-accent-ink: #4A7A00;
	--csrch-accent-hover: #3F6B12;

	/* Filets */
	--csrch-line: #E4E4DC;
	--csrch-line-soft: #E0E0D8;

	--csrch-font: Arial, Helvetica, sans-serif;
	--csrch-tap: 44px;

	font-family: var(--csrch-font);
	color: var(--csrch-text);
}

.csrch *,
.csrch *::before,
.csrch *::after {
	box-sizing: border-box;
}

/* Divi impose des puces et des retraits à toute liste de #left-area : on les
   annule sur nos listes seulement, jamais globalement. */
.csrch ul,
.csrch ol {
	list-style: none;
	margin: 0;
	padding: 0;
	line-height: inherit;
}

.csrch li {
	margin: 0;
}

.csrch-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
   Le champ
   --------------------------------------------------------------------------- */

.csrch-field {
	position: relative;
	display: flex;
	align-items: stretch;
	height: 46px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-bg);
	border-radius: 0;
}

.csrch-field.is-focused {
	border-color: var(--csrch-accent-ink);
}

.csrch-field__input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0 12px;
	border: 0;
	outline: none;
	background: transparent;
	font-family: var(--csrch-font);
	font-size: 15px;
	line-height: 1.2;
	color: var(--csrch-text);
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}

.csrch-field__input::placeholder {
	color: var(--csrch-muted);
	opacity: 1;
	font-size: 14px;
}

.csrch-field__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.csrch-field__submit {
	flex: 0 0 46px;
	width: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--csrch-accent-ink);
	color: var(--csrch-on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 0;
}

.csrch-field__submit:hover,
.csrch-field__submit:focus {
	background: var(--csrch-accent-hover);
}

.csrch-field__icon {
	display: block;
}

/* ---------------------------------------------------------------------------
   Le panneau de suggestions (hors charte, validé : bloc bordé collé au champ,
   ni ombre ni animation — il se lit comme une liste à filets, pas comme une
   popup). Positionné hors flux : en flux, l'ouverture décalerait la page
   entière sous l'en-tête.
   --------------------------------------------------------------------------- */

.csrch-panel {
	position: absolute;
	z-index: 1000;
	top: 100%;
	left: -1px;
	right: -1px;
	margin-top: -1px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-bg);
	border-radius: 0;
	box-shadow: none;
}

.csrch-panel[hidden] {
	display: none;
}

.csrch-panel__item {
	display: flex;
	gap: 10px;
	align-items: center;
	min-height: 56px;
	padding: 8px 10px;
	border-bottom: 1px solid var(--csrch-line-soft);
	text-decoration: none;
	color: var(--csrch-text);
	cursor: pointer;
}

.csrch-panel__item.is-active,
.csrch-panel__item:hover {
	background: var(--csrch-panel);
}

.csrch-panel__thumb {
	flex: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-panel);
	object-fit: cover;
	display: block;
}

.csrch-panel__body {
	min-width: 0;
}

.csrch-panel__title {
	font-size: 14px;
	line-height: 1.35;
	color: var(--csrch-text);
	font-weight: 400;
}

.csrch-panel__title b {
	font-weight: 700;
}

.csrch-panel__all {
	display: block;
	min-height: var(--csrch-tap);
	padding: 13px 10px;
	font-size: 14px;
	color: var(--csrch-text);
	text-decoration: none;
	font-weight: 400;
}

.csrch-panel__all .csrch-arrow {
	color: var(--csrch-accent);
	font-weight: 700;
}

.csrch-panel__none {
	padding: 14px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--csrch-text-soft);
}

/* ---------------------------------------------------------------------------
   Badges et pastilles
   --------------------------------------------------------------------------- */

.csrch-badge {
	display: inline-block;
	margin-top: 6px;
	padding: 2px 5px;
	border: 1px solid var(--csrch-accent-ink);
	color: var(--csrch-accent-ink);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-radius: 0;
}

.csrch-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.csrch-pills__item {
	display: flex;
}

.csrch-pill {
	display: flex;
	align-items: center;
	min-height: var(--csrch-tap);
	padding: 11px 12px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-bg);
	color: var(--csrch-text);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 0;
}

a.csrch-pill:hover,
a.csrch-pill:focus {
	border-color: var(--csrch-accent-ink);
	color: var(--csrch-accent-ink);
	text-decoration: none;
}

.csrch-pill--on {
	border-color: var(--csrch-accent-ink);
	background: var(--csrch-accent-ink);
	color: var(--csrch-on-accent);
	font-weight: 700;
}

a.csrch-pill--on:hover,
a.csrch-pill--on:focus {
	color: var(--csrch-on-accent);
}

.csrch-pill--marker {
	color: var(--csrch-muted);
}

/* ---------------------------------------------------------------------------
   Page de résultats
   --------------------------------------------------------------------------- */

.csrch-results__field {
	margin-bottom: 22px;
}

.csrch-results__title {
	margin: 0;
	font-family: var(--csrch-font);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.015em;
	color: var(--csrch-text);
}

.csrch-results__count {
	margin: 8px 0 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--csrch-accent-ink);
}

.csrch-facets {
	margin-top: 20px;
}

.csrch-facet + .csrch-facet {
	margin-top: 18px;
}

.csrch-facet__label,
.csrch-facet__summary {
	margin: 0;
	font-family: var(--csrch-font);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--csrch-accent-ink);
}

.csrch-facet--collapsible {
	margin-top: 14px;
	border-top: 1px solid var(--csrch-line-soft);
	padding-top: 12px;
}

/* Case à cocher du repli : hors écran mais focusable au clavier. */
.csrch-facet__toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.csrch-facet__label--wide {
	display: none;
}

.csrch-facet__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--csrch-tap);
	cursor: pointer;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--csrch-text);
}

.csrch-facet__toggle:focus-visible ~ .csrch-facet__summary {
	outline: 2px solid var(--csrch-accent-ink);
	outline-offset: 2px;
}

.csrch-facet__chevron {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	color: var(--csrch-accent-ink);
}

/* Le « + » devient « × » une fois ouvert : même glyphe, tourné d'un huitième. */
.csrch-facet__toggle:checked ~ .csrch-facet__summary .csrch-facet__chevron {
	transform: rotate(45deg);
}

.csrch-facet__toggle:not(:checked) ~ .csrch-pills,
.csrch-facet__toggle:not(:checked) ~ .csrch-facet__note {
	display: none;
}

.csrch-facet__note {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--csrch-muted);
}

.csrch-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 12px;
	margin-top: 24px;
}

.csrch-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.csrch-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.csrch-card__media,
.csrch-card__media-empty {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-panel);
	overflow: hidden;
}

.csrch-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.csrch-card__title {
	display: block;
	margin-top: 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--csrch-accent-ink);
}

.csrch-card__link:hover .csrch-card__title {
	text-decoration: underline;
}

.csrch-card__diets {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--csrch-muted);
}

.csrch-pagination {
	margin-top: 28px;
	border-top: 1px solid var(--csrch-line-soft);
	padding-top: 20px;
}

.csrch-pagination__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.csrch-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: var(--csrch-tap);
	min-height: var(--csrch-tap);
	padding: 0 12px;
	border: 1px solid var(--csrch-line);
	color: var(--csrch-text);
	font-size: 14px;
	text-decoration: none;
	border-radius: 0;
}

.csrch-pagination .page-numbers.current {
	border-color: var(--csrch-accent-ink);
	background: var(--csrch-accent-ink);
	color: var(--csrch-on-accent);
	font-weight: 700;
}

.csrch-pagination .page-numbers.dots {
	border-color: transparent;
}

/* ---------------------------------------------------------------------------
   Zéro résultat — le seul panneau crème de la page, et le seul CTA.
   --------------------------------------------------------------------------- */

.csrch-empty {
	margin-top: 18px;
	padding: 18px 16px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-panel);
}

/* Un vide dû à une facette n'est pas l'état zéro-résultat : pas de panneau
   crème, pas de CTA — juste une phrase sous les pastilles restées en place. */
.csrch-empty--filtered {
	margin-top: 20px;
	padding: 0;
	border: 0;
	background: transparent;
}

.csrch-empty__lede {
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--csrch-text);
}

/* Le bandeau saisonnier est remis sur fond blanc : la charte interdit deux
   panneaux crème imbriqués, et le blanc rend sa lisibilité à la liste à filets. */
.csrch-empty__season {
	margin-top: 18px;
	padding: 16px;
	border: 1px solid var(--csrch-line);
	background: var(--csrch-bg);
}

.csrch-empty__near {
	margin-top: 18px;
}

.csrch-empty__kicker {
	margin: 0;
	font-family: var(--csrch-font);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--csrch-accent-ink);
}

.csrch-capture {
	margin-top: 22px;
	border-top: 1px solid var(--csrch-line-soft);
	padding-top: 18px;
}

.csrch-capture__title {
	margin: 0;
	font-family: var(--csrch-font);
	font-size: 15px;
	font-weight: 700;
	color: var(--csrch-text);
}

.csrch-capture__form {
	margin-top: 10px;
}

.csrch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	border: 0;
	border-radius: 0;
	background: var(--csrch-accent-ink);
	color: var(--csrch-on-accent);
	font-family: var(--csrch-font);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.csrch-btn:hover,
.csrch-btn:focus {
	background: var(--csrch-accent-hover);
	color: var(--csrch-on-accent);
	text-decoration: none;
}

.csrch-capture__note {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--csrch-muted);
}

/* MailPoet pose ses couleurs, ses polices et ses arrondis en ligne : on les
   ramène à la charte sans toucher à son balisage. */
.csrch-capture .mailpoet_form,
.csrch-capture .mailpoet_form * {
	font-family: var(--csrch-font) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.csrch-capture .mailpoet_form {
	background: transparent !important;
	padding: 0 !important;
}

.csrch-capture .mailpoet_form h1,
.csrch-capture .mailpoet_form h2,
.csrch-capture .mailpoet_form h3,
.csrch-capture .mailpoet_form hr {
	display: none !important;
}

.csrch-capture .mailpoet_text,
.csrch-capture .mailpoet_email {
	width: 100% !important;
	height: 48px !important;
	border: 1px solid var(--csrch-line) !important;
	background: var(--csrch-bg) !important;
	padding: 0 12px !important;
	font-size: 15px !important;
	color: var(--csrch-text) !important;
}

.csrch-capture .mailpoet_submit {
	min-height: 48px !important;
	padding: 0 18px !important;
	border: 0 !important;
	background-color: var(--csrch-accent-ink) !important;
	color: var(--csrch-on-accent) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Desktop
   --------------------------------------------------------------------------- */

@media (min-width: 768px) {

	.csrch-field {
		height: 44px;
	}

	.csrch-field__submit {
		flex-basis: 44px;
		width: 44px;
	}

	.csrch-results__title {
		font-size: 30px;
	}

	.csrch-results__count {
		font-size: 18px;
		margin-top: 10px;
	}

	.csrch-facets {
		display: flex;
		flex-wrap: wrap;
		gap: 40px;
		align-items: flex-start;
		margin-top: 24px;
	}

	.csrch-facet + .csrch-facet {
		margin-top: 0;
	}

	.csrch-facet__label,
	.csrch-facet__summary {
		font-size: 11px;
	}

	/* La place existe : le moment du repas est déplié, sans repli à ouvrir. */
	.csrch-facet--collapsible {
		flex-basis: 100%;
		margin-top: 4px;
		padding-top: 16px;
	}

	.csrch-facet__summary {
		display: none;
	}

	.csrch-facet__label--wide {
		display: block;
	}

	.csrch-facet__toggle:not(:checked) ~ .csrch-pills {
		display: flex;
	}

	.csrch-facet__toggle:not(:checked) ~ .csrch-facet__note {
		display: block;
	}

	.csrch-pill {
		font-size: 14px;
		padding: 12px 14px;
	}

	.csrch-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 24px;
		margin-top: 28px;
	}

	.csrch-card__title {
		font-size: 15px;
		margin-top: 10px;
	}

	.csrch-badge {
		font-size: 10px;
		padding: 2px 6px;
		margin-top: 8px;
	}

	.csrch-card__diets {
		font-size: 13px;
		margin-top: 8px;
	}

	.csrch-empty {
		padding: 28px 24px;
	}

	.csrch-empty__season {
		padding: 24px;
	}

	.csrch-facet__note {
		font-size: 13px;
	}
}
