/* Row FAQ (module faq) : une FAQ : titre et questions en accordéon ou en liste ouverte, recherche. Site et éditeur. Couleurs du thème du projet (--theme-*) */

.fq {
	position: relative;
	width: 100%;
	--fq-border: color-mix(in srgb, currentColor 18%, transparent);
	--fq-soft: color-mix(in srgb, currentColor 6%, transparent);
	--fq-muted: color-mix(in srgb, currentColor 62%, transparent);
	--fq-radius: .75rem;
	/* Marges intérieures d'une question : aérées, encore plus sur grand écran */
	--fq-pad-x: 1.75rem;
	--fq-pad-y: 1.5rem;
	/* Trait entre les questions : couleur du séparateur du thème (Design) */
	--fq-divider: var(--theme-divider-color, rgba(127, 127, 127, .3));
}

.fq [hidden],
.fq .fq-empty {
	display: none !important;
}

/* Recherche */
.fq-search {
	margin-bottom: 1rem;
}

.fq-search-input {
	display: block;
	width: 100%;
	padding: .8rem 1rem;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid var(--fq-border);
	border-radius: var(--fq-radius);
	-webkit-appearance: none;
	appearance: none;
}

.fq-search-input:focus {
	outline: 2px solid var(--theme-primary, currentColor);
	outline-offset: 1px;
}

.fq-none {
	margin: 1rem 0 0;
	color: var(--fq-muted);
}

/* Titre de la FAQ */
.fq-title {
	margin: 0 0 1rem;
	font-family: var(--theme-font-title, inherit);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
}

/* Questions */
/* Style « card » : chaque question dans une card du thème (Design > Cartes) */
.fq-card .fq-item {
	color: var(--theme-card-text, inherit);
	background: var(--theme-card-background, transparent);
	border: var(--theme-card-border, 1px solid var(--fq-border));
	border-radius: var(--theme-card-radius, var(--fq-radius));
	box-shadow: var(--theme-card-shadow, none);
}

.fq-card .fq-item + .fq-item {
	margin-top: 1.5rem;
}

/* Style « bordure » : questions séparées par un trait de la couleur du séparateur, sans cadre */
.fq-border .fq-item {
	border: 0;
	border-bottom: 1px solid var(--fq-divider);
	border-radius: 0;
}

.fq-border .fq-item:last-child {
	border-bottom: 0;
}

/* Question : un h3 qui garde la mise en forme des titres du thème (taille, graisse, police) */
.fq-q {
	margin: 0;
}

/* Icône facultative devant la question */
.fq-icon {
	margin-right: .6rem;
	color: var(--theme-primary, inherit);
}

.fq-a {
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.fq-a > :first-child {
	margin-top: 0;
}

.fq-a > :last-child {
	margin-bottom: 0;
}

.fq-a ul,
.fq-a ol {
	padding-left: 1.4rem;
}

.fq-a a {
	color: var(--theme-primary, inherit);
	text-decoration: underline;
}

/* Accordéon : un volet <details> par question (s'ouvre sans JavaScript) */
.fq-accordion .fq-item > .fq-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: var(--fq-pad-y) var(--fq-pad-x);
	cursor: pointer;
	list-style: none;
	-webkit-user-select: none;
	user-select: none;
}

.fq-accordion .fq-item > .fq-summary::-webkit-details-marker {
	display: none;
}

.fq-accordion .fq-item > .fq-summary::marker {
	content: "";
}

.fq-accordion .fq-item > .fq-summary:focus-visible {
	outline: 2px solid var(--theme-primary, currentColor);
	outline-offset: 2px;
}

.fq-chevron {
	flex: 0 0 auto;
	transition: transform .2s ease;
}

.fq-accordion .fq-item[open] > .fq-summary {
	padding-bottom: .75rem;
}

.fq-accordion .fq-item[open] .fq-chevron {
	transform: rotate(180deg);
}

.fq-accordion .fq-a {
	padding: 0 var(--fq-pad-x) var(--fq-pad-y);
}

/* Accordéon séparé par une bordure : texte aligné sur le trait */
.fq-accordion.fq-border .fq-item > .fq-summary,
.fq-accordion.fq-border .fq-a {
	padding-left: 0;
	padding-right: 0;
}

/* Liste ouverte : questions et réponses les unes sous les autres */
.fq-list .fq-item {
	padding: var(--fq-pad-y) var(--fq-pad-x);
}

.fq-list.fq-border .fq-item {
	padding-left: 0;
	padding-right: 0;
}

.fq-list .fq-q {
	margin-bottom: .4rem;
}

@media (min-width: 768px) {
	.fq {
		--fq-pad-x: 3rem;
		--fq-pad-y: 2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fq-chevron {
		transition: none;
	}
}
