/* PatiSwap Home — composants de la page d'accueil et bloc de suggestion.
   Palette du site (Astra) : ambre #9A690F / #885C09, brun #291901 / #1A0E00,
   crème #FFF7F0, pêche #FFE0C1, bordure #F0D9BC. */

.psh-tool,
.psh-roles,
.psh-faq,
.psh-suggest {
	--psh-amber: #9A690F;
	--psh-amber-dark: #885C09;
	--psh-brown: #291901;
	--psh-ink: #1A0E00;
	--psh-muted: #5a4a3a;
	--psh-cream: #FFF7F0;
	--psh-peach: #FFE0C1;
	--psh-line: #F0D9BC;
	--psh-radius: 16px;
	box-sizing: border-box;
}
.psh-tool *,
.psh-roles *,
.psh-faq *,
.psh-suggest * {
	box-sizing: border-box;
}

.psh-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Recherche du hero ---------- */

.psh-tool {
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	text-align: left;
}
.psh-search {
	position: relative;
	margin: 0;
}
.psh-search__field {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1.5px solid var(--psh-line);
	border-radius: 999px;
	padding: 6px 6px 6px 18px;
	box-shadow: 0 10px 30px rgba(26, 14, 0, 0.28);
}
.psh-search__field:focus-within {
	border-color: var(--psh-amber);
	outline: 3px solid var(--psh-peach);
	outline-offset: 2px;
}
.psh-search__icon {
	flex: 0 0 auto;
	color: var(--psh-muted);
}
.psh-tool .psh-search__input,
.psh-tool .psh-search__input:focus {
	flex: 1 1 auto;
	min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 10px 4px !important;
	margin: 0;
	font-size: 17px;
	line-height: 1.4;
	color: var(--psh-brown);
	height: auto;
}
.psh-search__input::placeholder {
	color: #6b5a48;
	opacity: 1;
}
.psh-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}
.psh-tool .psh-search__submit {
	flex: 0 0 auto;
	min-height: 46px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--psh-amber);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.psh-tool .psh-search__submit:hover,
.psh-tool .psh-search__submit:focus {
	background: var(--psh-amber-dark);
	color: #fff;
}
.psh-tool .psh-search__submit:focus-visible {
	outline: 3px solid var(--psh-brown);
	outline-offset: 2px;
}

.psh-search__list {
	position: absolute;
	z-index: 50;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--psh-line);
	border-radius: 14px;
	box-shadow: 0 14px 34px rgba(26, 14, 0, 0.22);
	max-height: 320px;
	overflow-y: auto;
}
.psh-search__list[hidden] {
	display: none;
}
.psh-search__option {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--psh-brown);
	cursor: pointer;
	border-left: 3px solid transparent;
}
.psh-search__option[aria-selected="true"],
.psh-search__option:hover {
	background: var(--psh-cream);
	border-left-color: var(--psh-amber);
}
.psh-search__opt-name {
	font-weight: 600;
}
.psh-search__opt-via {
	display: block;
	font-size: 13px;
	color: var(--psh-muted);
	font-weight: 400;
}
.psh-search__opt-cat {
	flex: 0 0 auto;
	font-size: 13px;
	color: var(--psh-muted);
}

/* ---------- Aucun résultat ---------- */

.psh-noresult {
	margin-top: 12px;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid var(--psh-line);
	border-radius: var(--psh-radius);
	box-shadow: 0 6px 20px rgba(26, 14, 0, 0.18);
	color: var(--psh-brown);
}
.psh-noresult[hidden] {
	display: none;
}
.psh-noresult__title {
	margin: 0 0 4px;
	font-weight: 700;
	color: var(--psh-ink);
}
.psh-noresult__text {
	margin: 0 0 10px;
	font-size: 15px;
	color: var(--psh-muted);
}
.psh-noresult a,
.psh-roles a,
.psh-suggest a {
	color: var(--psh-amber-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Souvent remplacés ---------- */

.psh-popular {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 12px;
	margin-top: 18px;
}
.psh-popular__label {
	font-size: 14px;
	font-weight: 600;
	color: var(--psh-peach);
	white-space: nowrap;
}
.psh-popular__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.psh-popular__list li {
	margin: 0;
}
.psh-tool .psh-chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 224, 193, 0.55);
	background: rgba(28, 16, 1, 0.55);
	color: var(--psh-cream);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.psh-tool .psh-chip:hover {
	background: var(--psh-cream);
	color: var(--psh-brown);
}
.psh-tool .psh-chip:focus-visible {
	outline: 3px solid var(--psh-peach);
	outline-offset: 2px;
	background: var(--psh-cream);
	color: var(--psh-brown);
}

/* ---------- Micro-preuves ---------- */

.psh-proofs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 0;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: rgba(255, 247, 240, 0.92);
}
.psh-proofs li {
	margin: 0;
	white-space: nowrap;
}
.psh-proofs li + li::before {
	content: "·";
	margin: 0 10px;
	color: var(--psh-peach);
}

/* ---------- Suggestion d'ingrédient ---------- */

.psh-suggest {
	color: var(--psh-brown);
	text-align: left;
}
.psh-suggest--card {
	max-width: 720px;
	margin: 0 auto;
	padding: 20px 22px;
	background: #fff;
	border: 1px solid var(--psh-line);
	border-radius: var(--psh-radius);
	box-shadow: 0 2px 10px rgba(26, 14, 0, 0.06);
}
.psh-suggest__title {
	margin: 0 0 2px;
	font-weight: 700;
	font-size: 17px;
	color: var(--psh-ink);
}
.psh-suggest__text {
	margin: 0 0 10px;
	font-size: 15px;
	color: var(--psh-muted);
}
.psh-suggest .psh-suggest__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--psh-amber);
	border-radius: 999px;
	background: #fff;
	color: var(--psh-amber-dark);
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}
.psh-suggest .psh-suggest__toggle:hover,
.psh-suggest .psh-suggest__toggle:focus,
.psh-suggest .psh-suggest__toggle[aria-expanded="true"] {
	background: var(--psh-cream);
	color: var(--psh-brown);
}
.psh-suggest .psh-suggest__toggle:focus-visible {
	outline: 3px solid var(--psh-brown);
	outline-offset: 2px;
}
.psh-suggest__form {
	margin-top: 14px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 14px;
}
.psh-suggest__form[hidden] {
	display: none;
}
.psh-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.psh-field:nth-child(3) {
	grid-column: 1 / -1;
}
.psh-field label {
	font-size: 14px;
	font-weight: 600;
	color: var(--psh-brown);
}
.psh-req,
.psh-opt {
	font-weight: 400;
	color: var(--psh-muted);
}
.psh-suggest .psh-field input,
.psh-suggest .psh-field textarea {
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 1.5px solid #d9c3a5;
	border-radius: 10px;
	background: #fff;
	color: var(--psh-brown);
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
}
.psh-suggest .psh-field textarea {
	min-height: 64px;
	resize: vertical;
}
.psh-suggest .psh-field input:focus-visible,
.psh-suggest .psh-field textarea:focus-visible {
	outline: 3px solid var(--psh-peach);
	outline-offset: 1px;
	border-color: var(--psh-amber);
}
.psh-suggest .psh-field [aria-invalid="true"] {
	border-color: #b3261e;
}
.psh-help {
	margin: 0;
	font-size: 13px;
	color: var(--psh-muted);
}
.psh-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.psh-suggest__actions {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
}
.psh-suggest .psh-btn {
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--psh-amber);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}
.psh-suggest .psh-btn:hover,
.psh-suggest .psh-btn:focus {
	background: var(--psh-amber-dark);
	color: #fff;
}
.psh-suggest .psh-btn:focus-visible {
	outline: 3px solid var(--psh-brown);
	outline-offset: 2px;
}
.psh-suggest .psh-btn[disabled] {
	opacity: 0.7;
	cursor: wait;
}
.psh-suggest__privacy {
	font-size: 13px;
}
.psh-suggest__msg {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}
.psh-suggest__msg:empty {
	display: none;
}
.psh-suggest__msg.is-error {
	color: #b3261e;
}
.psh-suggest__msg.is-ok {
	color: #2e7d32;
}
.psh-suggest__msg.is-info {
	color: var(--psh-brown);
}

/* ---------- Exemple pédagogique (rôles) ---------- */

.psh-roles {
	display: grid;
	grid-template-columns: minmax(220px, 280px) 1fr;
	gap: 20px;
	align-items: start;
	color: var(--psh-brown);
}
.psh-roles__source {
	padding: 18px 20px;
	background: var(--psh-cream);
	border: 1px solid var(--psh-line);
	border-radius: var(--psh-radius);
}
.psh-roles__eyebrow {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--psh-muted);
}
.psh-roles__name {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}
.psh-roles .psh-roles__name a {
	color: var(--psh-ink);
	text-decoration: none;
}
.psh-roles .psh-roles__name a:hover {
	text-decoration: underline;
}
.psh-roles__fn {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
}
.psh-roles__fn-label {
	width: 100%;
	color: var(--psh-muted);
}
.psh-tag {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	background: #f0ebe3;
	color: var(--psh-muted);
	font-size: 13px;
	font-weight: 600;
}
.psh-roles__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.psh-roles__item {
	margin: 0;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid var(--psh-line);
	border-radius: var(--psh-radius);
	box-shadow: 0 2px 10px rgba(26, 14, 0, 0.06);
}
.psh-roles__target {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
}
.psh-roles .psh-roles__target a {
	color: var(--psh-ink);
	text-decoration: none;
}
.psh-roles .psh-roles__target a:hover {
	text-decoration: underline;
}
.psh-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--psh-amber);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
}
.psh-roles__role {
	margin: 0 0 4px;
	font-size: 15px;
	color: var(--psh-brown);
}
.psh-roles__effect {
	margin: 0 0 8px;
	font-size: 15px;
	color: var(--psh-muted);
}
.psh-roles__meta {
	margin: 0;
	font-size: 14px;
}
.psh-roles__meta div {
	display: flex;
	gap: 6px;
	margin-top: 4px;
}
.psh-roles__meta dt {
	flex: 0 0 auto;
	font-weight: 600;
	color: var(--psh-brown);
}
.psh-roles__meta dt::after {
	content: " :";
}
.psh-roles__meta dd {
	margin: 0;
	color: var(--psh-muted);
}
.psh-roles__more {
	grid-column: 2;
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}
.psh-roles a:focus-visible,
.psh-noresult a:focus-visible,
.psh-suggest a:focus-visible {
	outline: 3px solid var(--psh-amber);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- FAQ ---------- */

.psh-faq {
	max-width: 820px;
	margin: 0 auto;
	border-top: 1px solid var(--psh-line);
}
.psh-faq__item {
	border-bottom: 1px solid var(--psh-line);
}
.psh-faq .psh-faq__q {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}
.psh-faq .psh-faq__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 56px;
	padding: 14px 4px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--psh-ink);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	box-shadow: none;
}
.psh-faq .psh-faq__btn:hover,
.psh-faq .psh-faq__btn:focus,
.psh-faq .psh-faq__btn:active {
	background: transparent;
	color: var(--psh-amber-dark);
}
.psh-faq .psh-faq__btn:focus-visible {
	outline: 3px solid var(--psh-amber);
	outline-offset: 2px;
	border-radius: 6px;
}
.psh-faq__icon {
	position: relative;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--psh-cream);
	border: 1px solid var(--psh-line);
}
.psh-faq__icon::before,
.psh-faq__icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 2px;
	margin: -1px 0 0 -5px;
	background: var(--psh-amber-dark);
	transition: transform 0.2s ease;
}
.psh-faq__icon::after {
	transform: rotate(90deg);
}
.psh-faq__btn[aria-expanded="true"] .psh-faq__icon::after {
	transform: rotate(0deg);
}
.psh-faq__a {
	padding: 0 4px 16px;
	color: var(--psh-muted);
	font-size: 16px;
	line-height: 1.6;
}
.psh-faq__a p {
	margin: 0 0 8px;
}
.psh-faq__a p:last-child {
	margin-bottom: 0;
}

/* ---------- Tablette ---------- */

@media (max-width: 1199px) {
	.psh-roles {
		grid-template-columns: 1fr;
	}
	.psh-roles__more {
		grid-column: auto;
	}
}

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

@media (max-width: 767px) {
	.psh-search__field {
		padding: 5px 5px 5px 14px;
	}
	.psh-tool .psh-search__input,
	.psh-tool .psh-search__input:focus {
		font-size: 16px;
	}
	.psh-tool .psh-search__submit {
		min-height: 44px;
		padding: 0 16px;
		font-size: 15px;
	}
	.psh-popular {
		display: block;
		margin-top: 16px;
	}
	.psh-popular__label {
		display: block;
		margin-bottom: 8px;
		text-align: center;
	}
	.psh-popular__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 2px 2px 6px;
		margin: 0 -2px;
		scroll-snap-type: x proximity;
	}
	.psh-popular__list::-webkit-scrollbar {
		display: none;
	}
	.psh-popular__list li {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}
	.psh-tool .psh-chip {
		min-height: 40px;
	}
	.psh-proofs {
		font-size: 13px;
	}
	.psh-proofs li + li::before {
		margin: 0 7px;
	}
	.psh-suggest__form {
		grid-template-columns: 1fr;
	}
	.psh-suggest--card {
		padding: 16px;
	}
	.psh-roles {
		gap: 12px;
	}
	.psh-roles__source {
		padding: 14px 16px;
	}
	.psh-roles__name {
		font-size: 20px;
		margin-bottom: 8px;
	}
	.psh-roles__fn-label {
		width: auto;
	}
	.psh-roles__list {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.psh-roles__item {
		padding: 14px 16px;
	}
	.psh-faq .psh-faq__btn {
		font-size: 16px;
		min-height: 52px;
	}
	.psh-faq__a {
		font-size: 15px;
	}
}

/* ---------- /ingredients/ : lien de suggestion dans le message « aucun résultat » ---------- */

#patiswap-no-results .psh-catalog-suggest {
	margin-top: 16px;
}
#patiswap-no-results .psh-btn {
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: #9A690F;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}
#patiswap-no-results .psh-btn:hover,
#patiswap-no-results .psh-btn:focus {
	background: #885C09;
	color: #fff;
}
#patiswap-no-results .psh-btn:focus-visible {
	outline: 3px solid #291901;
	outline-offset: 2px;
}
/* Accessibilité : les deux lignes grises du message « Aucun ingrédient trouvé »
   (#555 / #999 sur blanc) n'atteignaient pas toutes le contraste minimal 4.5:1. */
#patiswap-no-results p {
	color: #5a4a3a !important;
}

@media (prefers-reduced-motion: reduce) {
	.psh-faq__icon::before,
	.psh-faq__icon::after,
	.psh-tool .psh-chip,
	.psh-tool .psh-search__submit {
		transition: none;
	}
}

/* Le thème souligne tous les liens de contenu (.ast-single-post .entry-content a) :
   les chips et les noms d'ingrédients restent sans soulignement, sauf au survol. */
.psh-tool a.psh-chip,
.psh-roles .psh-roles__name a,
.psh-roles .psh-roles__target a {
	text-decoration: none !important;
}
.psh-roles .psh-roles__name a:hover,
.psh-roles .psh-roles__target a:hover {
	text-decoration: underline !important;
}

/* Micro-preuves sur mobile : les chiffres sur une ligne, « Gratuit » sur la suivante
   (évite un séparateur orphelin en début de ligne). */
@media (max-width: 767px) {
	.psh-proofs__more {
		display: none;
	}
	.psh-proofs .psh-proofs__free {
		flex-basis: 100%;
		text-align: center;
	}
	.psh-proofs .psh-proofs__free::before {
		display: none;
	}
}

/* Le thème ajoute un retrait de 20px à toutes les listes de contenu. */
.psh-tool .psh-popular__list,
.psh-tool .psh-proofs,
.psh-roles .psh-roles__list {
	padding-left: 0 !important;
	margin-left: 0 !important;
}
.psh-tool .psh-search__list {
	padding: 6px !important;
	margin-left: 0 !important;
}

/* Très petits écrans (~360px) : on libère de la place pour le texte du champ. */
@media (max-width: 400px) {
	.psh-search__icon {
		display: none;
	}
	.psh-tool .psh-search__submit {
		padding: 0 14px;
	}
}

/* Le thème ajoute une grande marge sous chaque paragraphe de contenu :
   espacements gérés ici par flex/gap pour rester compact. */
.psh-roles p,
.psh-noresult p,
.psh-suggest p {
	margin: 0 !important;
}
.psh-faq .psh-faq__a p {
	margin: 0 0 8px !important;
}
.psh-faq .psh-faq__a p:last-child {
	margin-bottom: 0 !important;
}
.psh-roles__source {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.psh-roles__item {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.psh-roles__meta div:first-child {
	margin-top: 0;
}
.psh-noresult {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}
.psh-noresult[hidden] {
	display: none;
}
.psh-noresult .psh-suggest {
	width: 100%;
}
.psh-suggest--card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.psh-suggest__form {
	width: 100%;
}
.psh-suggest__toggle + .psh-suggest__form {
	margin-top: 10px;
}
@media (max-width: 767px) {
	.psh-roles__source {
		padding: 12px 14px;
		gap: 6px;
	}
	.psh-roles__name {
		font-size: 19px;
	}
	.psh-roles__fn {
		font-size: 13px;
	}
	.psh-roles__effect,
	.psh-roles__role {
		font-size: 14px;
	}
	.psh-roles__meta {
		font-size: 13px;
	}
}

/* Tablette et grand écran : les 6 raccourcis tiennent sur une seule ligne sous leur libellé. */
@media (min-width: 768px) {
	.psh-tool {
		max-width: 790px;
	}
	.psh-popular {
		flex-direction: column;
		gap: 8px;
	}
}

/* /ingredients/ : raccourcis populaires en 3 colonnes sur mobile, noms lisibles en entier. */
@media (max-width: 767px) {
	.section-populaires article .eael-entry-title,
	.section-populaires article .eael-entry-title a {
		font-size: 15px !important;
		line-height: 1.3 !important;
	}
}
