/*
 * Mise en page des pages Elementor (scripts/pages.php) : classes « vm-e-… » posées sur les conteneurs
 * et widgets. Elementor lit ses réglages de mise en page dans des variables CSS (--flex-direction,
 * --gap, --padding-*) : on règle ces variables plutôt que de surcharger ses propriétés.
 */

/* --------------------------------------------------------------------------
 * Sections et blocs
 * -------------------------------------------------------------------------- */

.e-con.vm-e-section {
	--padding-top: var(--vm-section-y);
	--padding-bottom: var(--vm-section-y);
	--gap: var(--vm-space-5);
}

.e-con.vm-e-section--top {
	--padding-top: 3.5rem;
}

.e-con.vm-e-section--tight {
	--padding-top: 2.5rem;
	--padding-bottom: 2.5rem;
}

.e-con.vm-e-section--top.vm-e-section--tight {
	--padding-top: 4.5rem;
}

.e-con.vm-e-section--last {
	--padding-bottom: 6rem;
}

.e-con.vm-e-section--surface {
	background-color: var(--vm-surface);
}

/* Blocs internes : pas de marge latérale (déjà portée par la section). */
.e-con.vm-e-section .e-con {
	--padding-left: 0;
	--padding-right: 0;
	--padding-top: 0;
	--padding-bottom: 0;
}

.e-con.vm-e-row {
	--flex-direction: row;
	--flex-wrap: wrap;
	--align-items: center;
	--gap: var(--vm-space-3);
}

.e-con.vm-e-row--between {
	--justify-content: space-between;
	--align-items: flex-end;
}

.e-con.vm-e-row > .elementor-widget,
.e-con.vm-e-row > .e-con {
	--width: auto;
	width: auto;
}

.e-con.vm-e-intro {
	--gap: var(--vm-space-2);
	max-width: 45rem;
}

.vm-e-intro__text p,
.vm-e-intro__text {
	margin: 0;
	color: var(--vm-text-muted);
	font-size: 1.125rem;
}

/* Deux colonnes : contenu principal + colonne latérale (démarches, infos, contact) */
.e-con.vm-e-columns {
	--flex-direction: row;
	--flex-wrap: wrap;
	--align-items: flex-start;
	--gap: var(--vm-space-6);
}

.e-con.vm-e-columns--middle {
	--align-items: center;
}

.e-con.vm-e-columns__main {
	--gap: var(--vm-space-3);
	--width: auto;
	flex: 999 1 40rem;
	min-width: 0;
}

.e-con.vm-e-columns__aside {
	--gap: var(--vm-space-4);
	--width: auto;
	flex: 1 1 17.5rem;
	min-width: 0;
}

.e-con.vm-e-columns__half {
	--gap: var(--vm-space-3);
	--width: auto;
	flex: 1 1 26rem;
	min-width: 0;
}

.vm-e-subtitle .elementor-heading-title,
.vm-e-subtitle {
	color: var(--vm-primary-dark);
	font-size: var(--vm-fs-h4);
}

.vm-e-subheading .elementor-heading-title {
	margin-top: var(--vm-space-3);
	font-size: 1.25rem;
}

.vm-e-cover img {
	display: block;
	width: 100%;
	height: 22.5rem;
	border-radius: var(--vm-radius-card);
	object-fit: cover;
}

.elementor-widget-text-editor p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
 * Boutons (widget Bouton d'Elementor, réglé par le Kit) et variantes
 * -------------------------------------------------------------------------- */

/* Widget Bouton d'Elementor : même apparence que .vm-btn (primaire plein, pilule, 700). */
.elementor-widget-button .elementor-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--vm-field-height);
	padding: 0.875rem 1.75rem;
	border: 2px solid var(--vm-primary);
	border-radius: var(--vm-radius-pill);
	background: var(--vm-primary);
	color: var(--vm-white);
	font-family: var(--vm-font);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.elementor-widget-button .elementor-button:hover,
.elementor-widget-button .elementor-button:focus {
	border-color: var(--vm-primary-dark);
	background: var(--vm-primary-dark);
	color: var(--vm-white);
}

.vm-e-btn-secondary .elementor-button {
	border-color: var(--vm-primary);
	background: transparent;
	color: var(--vm-primary);
}

.vm-e-btn-secondary .elementor-button:hover,
.vm-e-btn-secondary .elementor-button:focus {
	border-color: var(--vm-primary-dark);
	background: var(--vm-surface);
	color: var(--vm-primary-dark);
}

.vm-e-btn-white .elementor-button {
	border-color: var(--vm-white);
	background: var(--vm-white);
	color: var(--vm-primary-dark);
}

.vm-e-btn-white .elementor-button:hover,
.vm-e-btn-white .elementor-button:focus {
	border-color: var(--vm-surface);
	background: var(--vm-surface);
	color: var(--vm-primary-dark);
}

.vm-e-btn-outline-white .elementor-button {
	border-color: var(--vm-white);
	background: transparent;
	color: var(--vm-white);
}

.vm-e-btn-outline-white .elementor-button:hover,
.vm-e-btn-outline-white .elementor-button:focus {
	background: var(--vm-white);
	color: var(--vm-primary-dark);
}

/* --------------------------------------------------------------------------
 * Accueil : bandeau photo, infos pratiques, contact
 * -------------------------------------------------------------------------- */

.e-con.vm-e-home-hero {
	--padding-top: 8rem;
	--padding-bottom: 10rem;
	--gap: var(--vm-space-4);
	--align-items: flex-start;
	position: relative;
	background-color: var(--vm-hero);
	background-position: center 40%;
	color: var(--vm-white);
}

/* Voile sombre : opacité ≥ 0,75 derrière le texte (contraste 4,5:1 quelle que soit la photo). */
.e-con.vm-e-home-hero::before {
	position: absolute;
	inset: 0;
	content: "";
	background: linear-gradient(90deg, rgb(1 6 24 / 88%) 0%, rgb(1 6 24 / 78%) 60%, rgb(1 6 24 / 40%) 100%);
}

.e-con.vm-e-home-hero > .e-con-inner {
	position: relative;
	z-index: 1;
}

.vm-e-home-hero .elementor-heading-title,
.vm-e-home-hero__title .elementor-heading-title {
	color: var(--vm-white);
}

.vm-e-home-hero__title,
.vm-e-home-hero__lead {
	max-width: 47.5rem;
}

.vm-e-home-hero__lead,
.vm-e-home-hero__lead p {
	color: #e6ecf5;
	font-size: var(--vm-fs-lead);
}

.vm-e-eyebrow .elementor-heading-title {
	color: var(--vm-accent);
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.e-con.vm-e-home-infos {
	--padding-top: 0;
	--padding-bottom: 0;
	position: relative;
	z-index: 2;
	margin-top: -3.5rem;
}

.e-con.vm-e-section--services {
	--padding-top: 6rem;
	--gap: 2.5rem;
}

.e-con.vm-e-form-card {
	padding: 2.25rem;
	border-radius: var(--vm-radius-card);
	background: var(--vm-white);
}

.vm-hours {
	display: flex;
	flex-direction: column;
	gap: var(--vm-space-1);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 47.9375em) {

	.e-con.vm-e-home-hero {
		--padding-top: 4.5rem;
		--padding-bottom: 7rem;
	}

	/* Sur mobile, le texte occupe toute la largeur : voile uniforme. */
	.e-con.vm-e-home-hero::before {
		background: rgb(1 6 24 / 80%);
	}

	.e-con.vm-e-form-card {
		padding: var(--vm-space-4);
	}
}

/* --------------------------------------------------------------------------
 * Galerie (a11y.js : 3 images visibles, boutons précédent / suivant, compteur)
 * -------------------------------------------------------------------------- */

.e-con.vm-e-gallery__head {
	--flex-direction: row;
	--flex-wrap: wrap;
	--justify-content: space-between;
	--align-items: flex-end;
	--gap: var(--vm-space-3);
}

.e-con.vm-e-gallery__head > .elementor-widget {
	width: auto;
}

.e-con.vm-e-gallery__track {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(18.75rem, 100%), 1fr));
	gap: var(--vm-grid-gap);
}

.vm-e-gallery__item img {
	display: block;
	width: 100%;
	height: 21.25rem;
	border-radius: var(--vm-radius-card);
	object-fit: cover;
}

.vm-gallery__controls {
	display: flex;
	align-items: center;
	gap: var(--vm-space-2);
}

.vm-gallery__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 2px solid var(--vm-primary);
	border-radius: 50%;
	background: var(--vm-white);
	color: var(--vm-primary);
	cursor: pointer;
}

.vm-gallery__btn--next {
	background: var(--vm-primary);
	color: var(--vm-white);
}

.vm-gallery__btn:hover {
	border-color: var(--vm-primary-dark);
	background: var(--vm-primary-dark);
	color: var(--vm-white);
}

.vm-gallery__counter {
	min-width: 3rem;
	font-weight: 500;
	text-align: center;
}

/* --------------------------------------------------------------------------
 * Gabarit « démarche » : sommaire, accordéon, encarts
 * -------------------------------------------------------------------------- */

.vm-toc ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	margin: 0 0 var(--vm-space-1);
	padding: 0;
	list-style: none;
}

.vm-toc a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.5rem 1.125rem;
	border: 2px solid var(--vm-border-ui);
	border-radius: var(--vm-radius-pill);
	box-sizing: border-box;
	color: var(--vm-primary-dark);
	font-size: var(--vm-fs-small);
	font-weight: 500;
	text-decoration: none;
}

.vm-toc a:hover {
	border-color: var(--vm-primary-dark);
	text-decoration: underline;
}

.e-con.vm-e-accordion {
	--gap: var(--vm-space-3);
}

.e-con.vm-e-accordion__item {
	--gap: 0;
	overflow: hidden;
	border: 1px solid var(--vm-border);
	border-radius: var(--vm-radius-card);
	background: var(--vm-white);
	scroll-margin-top: var(--vm-space-4);
}

/* Sans JavaScript : titre et texte affichés, avec les marges du bloc. */
.vm-e-accordion__title .elementor-heading-title {
	margin: 0;
	padding: var(--vm-space-4) 1.75rem 0;
	font-size: var(--vm-fs-h3);
	line-height: 1.25;
}

.vm-e-accordion__text {
	padding: var(--vm-space-3) 1.75rem var(--vm-space-4);
}

/* Avec JavaScript : le titre devient un bouton (dans le H2), le texte un panneau dépliable. */
.vm-accordion__title.elementor-heading-title {
	padding: 0;
}

.vm-accordion__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--vm-space-3);
	width: 100%;
	padding: var(--vm-space-4) 1.75rem;
	border: 0;
	background: var(--vm-white);
	color: var(--vm-text);
	font: inherit;
	text-align: start;
	white-space: normal; /* Hello Elementor interdit le retour à la ligne dans les boutons. */
	cursor: pointer;
}

/* L'intitulé peut se réduire et couper un mot trop long : sur mobile, le titre passe à la ligne et le
   signe reste visible (RGAA 10.11, affichage à 320 px). */
.vm-accordion__toggle > span:first-child {
	min-width: 0;
	overflow-wrap: anywhere;
}

.vm-accordion__toggle:hover {
	color: var(--vm-primary-dark);
}

.vm-accordion__toggle:focus-visible {
	outline-offset: -4px;
}

.vm-accordion__sign {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--vm-surface);
	color: var(--vm-primary);
}

.vm-accordion__sign .vm-icon {
	transition: transform 0.15s ease;
}

.vm-accordion__toggle[aria-expanded="true"] .vm-accordion__sign .vm-icon {
	transform: rotate(180deg);
}

.vm-accordion__panel .vm-e-accordion__text {
	padding-top: 0;
}

.e-con.vm-e-aside-box {
	--gap: var(--vm-space-2);
	padding: var(--vm-space-4);
	border: 1px solid var(--vm-border);
	border-radius: var(--vm-radius-card);
	background: var(--vm-white);
}

.vm-e-aside-box__title .elementor-heading-title {
	font-size: 1.25rem;
}

.vm-e-aside-box ul {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding-left: 1.25rem;
	color: var(--vm-text-lead);
	font-size: var(--vm-fs-small);
}

a.vm-link-card {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	padding: var(--vm-space-4);
	border: 1px solid var(--vm-border);
	border-radius: var(--vm-radius-card);
	background: var(--vm-white);
	color: var(--vm-text);
	text-decoration: none;
}

a.vm-link-card strong {
	color: var(--vm-primary-dark);
	font-size: 1.125rem;
	text-decoration: underline;
	text-underline-offset: 3px;
}

a.vm-link-card span {
	color: var(--vm-text-muted);
	font-size: var(--vm-fs-small);
}

a.vm-link-card:hover {
	border-color: var(--vm-primary);
}

.vm-archives {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* --------------------------------------------------------------------------
 * Bloc d'appel (« Votre association n'apparaît pas ? »)
 * -------------------------------------------------------------------------- */

.e-con.vm-e-cta {
	--flex-direction: row;
	--flex-wrap: wrap;
	--justify-content: space-between;
	--align-items: center;
	--gap: var(--vm-space-4);
	padding: 2.5rem;
	border-radius: var(--vm-radius-card);
	background: var(--vm-primary);
	color: var(--vm-white);
}

.e-con.vm-e-cta__text {
	--gap: var(--vm-space-1);
	--width: auto;
	flex: 1 1 20rem;
}

.vm-e-cta .elementor-heading-title {
	color: var(--vm-white);
	font-size: var(--vm-fs-h3);
}

.vm-e-cta p {
	color: #e6ecf5;
}

.e-con.vm-e-cta > .elementor-widget-button {
	width: auto;
}

@media (max-width: 47.9375em) {

	.e-con.vm-e-cta {
		padding: var(--vm-space-4);
	}
}

/* --------------------------------------------------------------------------
 * Contenus importés : intertitres, tableaux, figures (blocs de texte des pages)
 * -------------------------------------------------------------------------- */

.vm-e-accordion__text h3 {
	margin: var(--vm-space-4) 0 var(--vm-space-2);
	font-size: var(--vm-fs-h4);
}

.vm-e-accordion__text h3:first-child {
	margin-top: 0;
}

/* :nth-child(n) : passe devant le zébrage des tableaux de Hello Elementor. */
table.vm-table {
	width: 100%;
	margin: 0 0 var(--vm-space-3);
	border-collapse: collapse;
	font-size: var(--vm-fs-small);
}

table.vm-table caption {
	margin-bottom: var(--vm-space-2);
	font-weight: 700;
	text-align: start;
}

table.vm-table > * > tr:nth-child(n) > th,
table.vm-table > * > tr:nth-child(n) > td {
	padding: 0.75rem;
	border: 1px solid var(--vm-border-ui);
	background: var(--vm-white);
	text-align: start;
	vertical-align: top;
}

table.vm-table > thead > tr:nth-child(n) > th {
	background: var(--vm-surface);
}

/* Tableau large sur mobile : défilement dans le bloc, pas dans la page. min-width: 0 : sans lui, le bloc
   (élément d'un conteneur flex) prendrait la largeur du tableau et serait coupé par l'accordéon. */
.vm-e-accordion__text,
.vm-accordion__panel {
	min-width: 0;
	max-width: 100%;
}

.vm-e-accordion__text {
	overflow-x: auto;
}

.vm-figure {
	margin: var(--vm-space-3) 0 0;
}

.vm-figure__img {
	display: block;
	width: auto;
	max-width: min(100%, 22rem);
	height: auto;
	border: 1px solid var(--vm-border);
	border-radius: var(--vm-radius-tile);
}
