/* ==========================================================================
   Amstrad.eu – Recherche globale
   Trois palettes, calées sur les thèmes du plugin amstrad-plus-theme :
     - CPC 464 (défaut)  : html sans .apt-dark / .apt-light   → bleu LCD / jaune
     - CPC 664           : html.apt-dark                       → sombre neutre
     - 6128 Plus         : html.apt-light                      → clair
   Tous les couples texte/fond visent un contraste ≥ 4,5:1 (WCAG AA).
   ========================================================================== */

.aeu-rech,
.aeu-ac {
	/* CPC 464 — défaut */
	--aeu-fond: #121216;
	--aeu-fond-carte: #1b1b22;
	--aeu-fond-survol: #000080;
	--aeu-bord: #34343f;
	--aeu-texte: #ececf1;
	--aeu-texte-doux: #b9b9c6;
	--aeu-titre: #ffe14d;
	--aeu-titre-survol: #ffff00;
	--aeu-lien: #8fd0ff;
	--aeu-accent-fond: #000080;
	--aeu-accent-texte: #ffff00;
	--aeu-mark-fond: #ffff00;
	--aeu-mark-texte: #000080;
	--aeu-focus: #ffff00;
	--aeu-vignette: #0a0a40;
	--aeu-champ-fond: #000080;
	--aeu-champ-texte: #ffff00;
	--aeu-champ-ph: #c8c87a;
	--aeu-ombre: 0 10px 30px rgba(0, 0, 0, .55);
}

html.apt-dark .aeu-rech,
html.apt-dark .aeu-ac {
	/* CPC 664 */
	--aeu-fond: #17181c;
	--aeu-fond-carte: #202228;
	--aeu-fond-survol: #2a2e37;
	--aeu-bord: #3a3e48;
	--aeu-texte: #f0f2f5;
	--aeu-texte-doux: #bcc3cd;
	--aeu-titre: #82c8ff;
	--aeu-titre-survol: #b5ddff;
	--aeu-lien: #82c8ff;
	--aeu-accent-fond: #c42f26;
	--aeu-accent-texte: #ffffff;
	--aeu-mark-fond: #ffd54a;
	--aeu-mark-texte: #111111;
	--aeu-focus: #ffd54a;
	--aeu-vignette: #101114;
	--aeu-champ-fond: #0f1013;
	--aeu-champ-texte: #f0f2f5;
	--aeu-champ-ph: #9aa2ad;
	--aeu-ombre: 0 10px 30px rgba(0, 0, 0, .6);
}

html.apt-light .aeu-rech,
html.apt-light .aeu-ac {
	/* 6128 Plus */
	--aeu-fond: #f4f2ed;
	--aeu-fond-carte: #fffdf9;
	--aeu-fond-survol: #eaf1fb;
	--aeu-bord: #cfcac0;
	--aeu-texte: #1d1e22;
	--aeu-texte-doux: #4b4e57;
	--aeu-titre: #0a4a8f;
	--aeu-titre-survol: #063366;
	--aeu-lien: #0a4a8f;
	--aeu-accent-fond: #1f2a44;
	--aeu-accent-texte: #ffffff;
	--aeu-mark-fond: #ffe36e;
	--aeu-mark-texte: #1d1e22;
	--aeu-focus: #b3261e;
	--aeu-vignette: #e4e0d8;
	--aeu-champ-fond: #ffffff;
	--aeu-champ-texte: #1d1e22;
	--aeu-champ-ph: #6b6e76;
	--aeu-ombre: 0 10px 30px rgba(40, 30, 10, .18);
}

/* ---------- Conteneur ---------- */

.aeu-rech-page__titre {
	margin: 0 0 .6em;
}

.aeu-rech {
	background: var(--aeu-fond);
	color: var(--aeu-texte);
	border: 1px solid var(--aeu-bord);
	border-radius: 8px;
	padding: clamp(14px, 2.5vw, 26px);
	margin: 0 0 30px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
}

.aeu-rech *,
.aeu-ac * {
	box-sizing: border-box;
	text-transform: none;
	letter-spacing: normal;
}

.aeu-rech a {
	color: var(--aeu-lien);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.aeu-rech :focus-visible,
.aeu-ac :focus-visible {
	outline: 3px solid var(--aeu-focus);
	outline-offset: 2px;
}

/* ---------- Formulaire ---------- */

.aeu-rech__label {
	display: block;
	font-weight: 700;
	font-size: 15px;
	margin: 0 0 6px;
	color: var(--aeu-texte-doux);
}

.aeu-rech__champ {
	position: relative;
	display: flex;
	gap: 8px;
}

.aeu-rech__loupe {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--aeu-champ-ph);
	pointer-events: none;
}

.aeu-rech .aeu-rech__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 14px 0 42px;
	border: 2px solid var(--aeu-bord);
	border-radius: 6px;
	background: var(--aeu-champ-fond);
	color: var(--aeu-champ-texte);
	font: inherit;
	font-size: 18px;
	-webkit-appearance: none;
	appearance: none;
}

.aeu-rech .aeu-rech__input::placeholder {
	color: var(--aeu-champ-ph);
	opacity: 1;
}

.aeu-rech .aeu-rech__input:focus {
	border-color: var(--aeu-focus);
	outline: none;
}

.aeu-rech .aeu-rech__bouton {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 20px;
	border: 0;
	border-radius: 6px;
	background: var(--aeu-accent-fond);
	color: var(--aeu-accent-texte);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: inset 0 0 0 2px var(--aeu-accent-texte);
}

.aeu-rech .aeu-rech__bouton:hover {
	filter: brightness(1.15);
}

/* ---------- Résumé & onglets ---------- */

.aeu-rech__resume {
	margin: 18px 0 10px;
	font-size: 17px;
	color: var(--aeu-texte);
}

.aeu-rech__requete {
	font-weight: 700;
	color: var(--aeu-titre);
}

.aeu-rech__onglets ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 18px;
	padding: 0 0 14px;
	border-bottom: 1px solid var(--aeu-bord);
}

.aeu-rech__onglets li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aeu-rech .aeu-rech__onglets a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	border: 1px solid var(--aeu-bord);
	border-radius: 999px;
	background: var(--aeu-fond-carte);
	color: var(--aeu-texte);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.aeu-rech .aeu-rech__onglets a:hover {
	border-color: var(--aeu-titre);
}

.aeu-rech .aeu-rech__onglets a[aria-current="page"] {
	background: var(--aeu-accent-fond);
	color: var(--aeu-accent-texte);
	border-color: var(--aeu-accent-texte);
}

.aeu-rech__badge {
	display: inline-block;
	min-width: 1.8em;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--aeu-fond);
	color: var(--aeu-texte);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.aeu-rech__onglets a[aria-current="page"] .aeu-rech__badge {
	background: var(--aeu-accent-texte);
	color: var(--aeu-accent-fond);
}

/* ---------- Groupes ---------- */

.aeu-rech__groupe + .aeu-rech__groupe {
	margin-top: 26px;
}

.aeu-rech__groupe-tete {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 16px;
	margin: 0 0 10px;
}

.aeu-rech .aeu-rech__groupe-titre {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--aeu-texte);
}

.aeu-rech__groupe-titre i {
	color: var(--aeu-titre);
	margin-right: 4px;
}

.aeu-rech__nb {
	font-weight: 400;
	color: var(--aeu-texte-doux);
	font-size: 16px;
}

.aeu-rech .aeu-rech__voir {
	font-weight: 600;
	font-size: 15px;
}

/* ---------- Liste de résultats ---------- */

.aeu-rech .aeu-rech__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.aeu-rech .aeu-rech__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aeu-rech .aeu-rech__lien {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 10px;
	border: 1px solid var(--aeu-bord);
	border-radius: 6px;
	background: var(--aeu-fond-carte);
	color: var(--aeu-texte);
	text-decoration: none;
	transition: background-color .12s ease, border-color .12s ease;
}

.aeu-rech .aeu-rech__lien:hover,
.aeu-rech .aeu-rech__lien:focus-visible {
	background: var(--aeu-fond-survol);
	border-color: var(--aeu-titre);
}

.aeu-rech__vignette {
	flex: 0 0 auto;
	width: 96px;
	height: 68px;
	border-radius: 4px;
	overflow: hidden;
	background: var(--aeu-vignette);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--aeu-texte-doux);
	font-size: 24px;
}

.aeu-rech__vignette img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border: 0;
}

/* Captures CPC : on garde les pixels nets et l'image entière. */
.aeu-rech__liste--logiciels .aeu-rech__vignette img {
	object-fit: contain;
	image-rendering: pixelated;
}

/* Couvertures (format portrait). */
.aeu-rech__liste--librairie .aeu-rech__vignette {
	width: 60px;
	height: 82px;
}

.aeu-rech__texte {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.aeu-rech__titre {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--aeu-titre);
	overflow-wrap: anywhere;
}

.aeu-rech__lien:hover .aeu-rech__titre {
	color: var(--aeu-titre-survol);
	text-decoration: underline;
}

.aeu-rech__infos {
	font-size: 14px;
	color: var(--aeu-texte-doux);
}

.aeu-rech__extrait {
	font-size: 14.5px;
	color: var(--aeu-texte);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.aeu-rech mark,
.aeu-ac mark {
	background: var(--aeu-mark-fond);
	color: var(--aeu-mark-texte);
	padding: 0 2px;
	border-radius: 2px;
}

/* ---------- Pagination ---------- */

.aeu-rech__pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	list-style: none;
	margin: 22px 0 0;
	padding: 0;
}

.aeu-rech__pagination li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aeu-rech .aeu-rech__pagination a,
.aeu-rech__pagination span[aria-current] {
	display: inline-block;
	min-width: 42px;
	padding: 8px 12px;
	border: 1px solid var(--aeu-bord);
	border-radius: 6px;
	background: var(--aeu-fond-carte);
	color: var(--aeu-texte);
	text-align: center;
	text-decoration: none;
	font-weight: 600;
}

.aeu-rech .aeu-rech__pagination a:hover {
	border-color: var(--aeu-titre);
}

.aeu-rech__pagination span[aria-current] {
	background: var(--aeu-accent-fond);
	color: var(--aeu-accent-texte);
	border-color: var(--aeu-accent-texte);
}

.aeu-rech__ellipse {
	padding: 8px 4px;
	color: var(--aeu-texte-doux);
}

/* ---------- Aide / vide ---------- */

.aeu-rech__aide,
.aeu-rech__vide {
	margin-top: 16px;
	color: var(--aeu-texte);
}

.aeu-rech__aide ul {
	margin: 6px 0 10px 1.2em;
	padding: 0;
}

.aeu-rech__aide li {
	margin: 3px 0;
}

.aeu-rech__aide i {
	color: var(--aeu-titre);
	width: 1.3em;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
	.aeu-rech__champ {
		flex-wrap: wrap;
	}

	.aeu-rech .aeu-rech__bouton {
		width: 100%;
	}

	.aeu-rech__vignette {
		width: 72px;
		height: 54px;
	}

	.aeu-rech__liste--librairie .aeu-rech__vignette {
		width: 48px;
		height: 66px;
	}
}

/* ==========================================================================
   Suggestions instantanées (panneau sous les champs de recherche)
   ========================================================================== */

.aeu-ac {
	position: fixed;
	z-index: 100000;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--aeu-fond);
	color: var(--aeu-texte);
	border: 1px solid var(--aeu-bord);
	border-radius: 8px;
	box-shadow: var(--aeu-ombre);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	text-align: left;
	padding: 6px;
}

.aeu-ac[hidden] {
	display: none;
}

.aeu-ac__groupe {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 8px 8px 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--aeu-texte-doux);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.aeu-ac__groupe i {
	color: var(--aeu-titre);
	margin-right: 4px;
}

.aeu-ac a.aeu-ac__opt {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 6px 8px;
	border-radius: 5px;
	color: var(--aeu-texte);
	text-decoration: none;
}

.aeu-ac a.aeu-ac__opt[aria-selected="true"],
.aeu-ac a.aeu-ac__opt:hover {
	background: var(--aeu-fond-survol);
}

.aeu-ac__vign {
	flex: 0 0 auto;
	width: 52px;
	height: 38px;
	border-radius: 3px;
	overflow: hidden;
	background: var(--aeu-vignette);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--aeu-texte-doux);
}

.aeu-ac__vign img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	image-rendering: pixelated;
	display: block;
	margin: 0;
}

.aeu-ac__txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.aeu-ac__t {
	font-weight: 700;
	color: var(--aeu-titre);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aeu-ac__m {
	font-size: 13px;
	color: var(--aeu-texte-doux);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aeu-ac a.aeu-ac__tout {
	display: block;
	margin-top: 6px;
	padding: 10px;
	border-radius: 5px;
	background: var(--aeu-accent-fond);
	color: var(--aeu-accent-texte);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.aeu-ac a.aeu-ac__tout[aria-selected="true"],
.aeu-ac a.aeu-ac__tout:hover {
	outline: 3px solid var(--aeu-focus);
	outline-offset: -3px;
}

.aeu-ac__etat {
	padding: 12px 10px;
	color: var(--aeu-texte-doux);
}

@media (prefers-reduced-motion: reduce) {
	.aeu-rech .aeu-rech__lien {
		transition: none;
	}
}

/* Intégré dans le modèle Divi (mode Divi) : le module garde ses propres marges. */
.aeu-rech-module .aeu-rech {
	margin: 0;
}
