/* WP Andolsheim — module Flipbooks. Accordéon de catégories + sections dFlip.
   On ne restyle pas .dflip-books / ._df_thumb : la mise en forme des vignettes
   est laissée au plugin dFlip.

   Les couleurs d'accent sont injectées en inline par PHP depuis les réglages
   du plugin (variables --wpa-flipbooks-accent et --wpa-flipbooks-accent-fg).
   Valeurs de repli ici si jamais l'inline-style n'est pas chargé. */

.wpa-flipbooks {
	--wpa-flipbooks-accent: #799e1d;
	--wpa-flipbooks-accent-shadow: rgba(0, 0, 0, 0.18);
	--wpa-flipbooks-accent-fg: #ffffff;
}

/* ---- Item d'accordéon (<details>) ---- */
.wpa-flipbooks-section {
	margin: 0 0 0.6em;
	background: #fff;
}

.wpa-flipbooks-section:last-child {
	margin-bottom: 0;
}

/* ---- En-tête cliquable (<summary>) — rendu aligné sur le module Heading ---- */
.wpa-flipbooks-section__header {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.85em 1.1em;
	background: var(--wpa-flipbooks-accent);
	color: var(--wpa-flipbooks-accent-fg);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition: filter 0.15s ease;
}

.wpa-flipbooks-section__header:hover {
	filter: brightness(0.92);
}

/* masque le marqueur natif du <summary> */
.wpa-flipbooks-section__header::-webkit-details-marker {
	display: none;
}
.wpa-flipbooks-section__header::marker {
	content: "";
}

.wpa-flipbooks-section__header:focus-visible {
	outline: 2px solid var(--wpa-flipbooks-accent-fg);
	outline-offset: -5px;
}

.wpa-flipbooks-section__icon {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
}

.wpa-flipbooks-section__icon svg {
	display: block;
	width: 1.4em;
	height: 1.4em;
	color: inherit;
}

/* Titre : aligné sur .wpa-heading (mêmes valeurs typographiques). */
.wpa-flipbooks-section__title {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	color: var(--wpa-flipbooks-accent-fg) !important;
	font-weight: 700;
	font-size: 22px !important;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Chevron : flèche bas/haut selon état (rotation 180° via CSS quand [open]). */
.wpa-flipbooks-section__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
	color: inherit;
	transition: transform 0.25s ease;
}

.wpa-flipbooks-section__toggle svg {
	display: block;
	width: 1.3em;
	height: 1.3em;
	color: inherit;
}

.wpa-flipbooks-section[open] > .wpa-flipbooks-section__header .wpa-flipbooks-section__toggle {
	transform: rotate(180deg);
}

/* ---- Contenu déroulant ---- */
.wpa-flipbooks-section__content {
	padding: 1.25em 1.1em;
	border-top: 0;
}

.wpa-flipbooks-section__desc {
	margin: 0 0 1em;
	opacity: 0.85;
}

.wpa-flipbooks-section__desc > :last-child {
	margin-bottom: 0;
}

/* ---- Sous-sections imbriquées (niveau 2+ sous un accordéon) — pas d'accordéon, juste un titre. ---- */
.wpa-flipbooks-subsection {
	margin-top: 1.5em;
}

.wpa-flipbooks-subsection:first-child {
	margin-top: 0.5em;
}

.wpa-flipbooks-subsection__title {
	margin: 0 0 0.6em;
	padding: 0;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: inherit;
}

.wpa-flipbooks-subsection__books {
	margin: 0 0 0.5em;
}

/* Indentation progressive avec la profondeur (utile pour visualiser la hiérarchie). */
.wpa-flipbooks-subsection--depth-2 {
	padding-left: 1em;
}

.wpa-flipbooks-subsection--depth-3 {
	padding-left: 2em;
}

.wpa-flipbooks-subsection--depth-4 {
	padding-left: 3em;
}

/* ---- Aperçu dans l'éditeur Gutenberg ---- */
.wpa-flipbooks-editor-placeholder {
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	padding: 1.5em;
	text-align: center;
	color: rgba(0, 0, 0, 0.6);
}

.wpa-flipbooks-editor-placeholder .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.wpa-flipbooks-editor-placeholder p {
	margin: 0.4em 0 0;
}

.wpa-flipbooks-editor-hint {
	font-size: 0.9em;
	opacity: 0.75;
}
