/* ==========================================================================
   Compositions « Centre équestre » (éditeur de blocs)
   Chargé sur le site ET dans l'éditeur, pour un aperçu fidèle.
   ========================================================================== */

:root {
	--ce-primary: #2E53A4;
	--ce-accent: #A85A17;
	--ce-night: #0C2251;
	--ce-blue: #133072;
	--ce-text-2: #3E4760;
	--ce-muted: #556079;
	--ce-line: #E1E6EF;
	--ce-soft: #F2F5FB;
	--ce-on-dark: #C8D3EA;
	--ce-copper: #A85A17;
	--ce-radius: 16px;
}

/* Section pleine largeur ------------------------------------------------------ */
.ce-section { padding-top: 72px; padding-bottom: 72px; }
.ce-section--soft { background: var(--ce-soft); }
.ce-section--dark { background: var(--ce-night); color: var(--ce-on-dark); }
.ce-section--dark h2, .ce-section--dark h3 { color: #fff; }
@media (max-width: 700px) { .ce-section { padding-top: 56px; padding-bottom: 56px; } }

.ce-inner { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; box-sizing: border-box; }
.ce-inner > * { margin-top: 0; margin-bottom: 0; }
.ce-inner > * + * { margin-top: 20px; }
.ce-inner > h2 + p { margin-top: 14px; }
.ce-inner > .wp-block-columns, .ce-inner > .wp-block-table, .ce-inner > .wp-block-details:first-of-type { margin-top: 36px; }
.ce-section h2 { font-size: clamp(30px, 3.2vw, 38px); line-height: 1.15; margin: 0; }
.ce-section h3 { font-size: 22px; line-height: 1.2; margin: 0; }
.ce-lead { font-size: 18px; line-height: 1.6; max-width: 760px; }
.ce-center { text-align: center; }
.ce-center .ce-lead { margin-left: auto; margin-right: auto; }
.ce-center .wp-block-buttons { justify-content: center; }

/* Boutons ------------------------------------------------------------------- */
/* Sélecteurs renforcés : les styles de WordPress pour le bouton « contour » sont plus prioritaires. */
.ce-section .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.ce-section .wp-block-button > .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
	border-radius: 999px; border: 2px solid var(--ce-accent); background: var(--ce-accent); color: #fff;
	font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none;
}
.ce-section .wp-block-button > .wp-block-button__link:hover { filter: brightness(.9); color: #fff; }
.ce-section .wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; border-color: var(--ce-primary); color: var(--ce-primary); }
.ce-section .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--ce-primary); color: #fff; filter: none; }
.ce-section--dark .wp-block-button.is-style-outline > .wp-block-button__link,
.ce-section .ce-cta .wp-block-button.is-style-outline > .wp-block-button__link { background: #fff; border-color: #fff; color: var(--ce-night); }
.ce-section--dark .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.ce-section .ce-cta .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--ce-soft); border-color: var(--ce-soft); color: var(--ce-night); }

/* Photo et texte ------------------------------------------------------------- */
.wp-block-columns.ce-media { gap: 48px; align-items: center; }
.ce-media .wp-block-image { margin: 0; }
.ce-media .wp-block-image img { width: 100%; height: 420px; object-fit: cover; border-radius: 20px; display: block; }
.ce-media .wp-block-column > * { margin-top: 0; margin-bottom: 0; }
.ce-media .wp-block-column > * + * { margin-top: 18px; }
@media (max-width: 781px) { .ce-media .wp-block-image img { height: 280px; } .wp-block-columns.ce-media { gap: 28px; } }
/* Photo à droite : sur mobile, la photo repasse au-dessus du texte. */
@media (max-width: 781px) { .ce-media--reverse { flex-direction: column-reverse; } }

.ce-checks { list-style: none; padding: 0 !important; margin: 0; }
.ce-checks li { position: relative; padding-left: 32px; font-size: 17px; }
.ce-checks li + li { margin-top: 10px; }
.ce-checks li::before {
	content: ""; position: absolute; left: 0; top: .15em; width: 22px; height: 22px; border-radius: 50%;
	background: var(--ce-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Cartes ---------------------------------------------------------------------- */
.ce-card { background: #fff; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); overflow: hidden; display: flex; flex-direction: column; padding-bottom: 26px; }
.ce-card > * { margin: 0; padding-left: 28px; padding-right: 28px; }
.ce-card > * + * { margin-top: 12px; }
.ce-card > .ce-card__media { padding: 0; margin: 0 0 22px; }
.ce-card > .ce-card__media + * { margin-top: 0; }
.ce-card__media img { width: 100%; height: 180px; object-fit: cover; display: block; border-radius: 0; }
.ce-card p { color: var(--ce-muted); line-height: 1.55; }
.ce-card .ce-card__link { margin-top: auto; padding-top: 12px; }
.ce-card .ce-card__link a { font-weight: 600; text-decoration: none; color: var(--ce-blue); }
.ce-card .ce-card__link a::after { content: " →"; content: " →" / ""; }
.ce-card .ce-card__link a:hover { text-decoration: underline; }

/* Chiffres clés -------------------------------------------------------------- */
.wp-block-columns.ce-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 20px; }
.ce-stat { background: #fff; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); padding: 28px 20px; text-align: center; }
.ce-stat > * { margin: 0; }
.ce-stat .ce-stat__value { font-size: 44px; line-height: 1.1; font-weight: 700; color: var(--ce-copper); }
.ce-stat .ce-stat__label { color: var(--ce-muted); font-size: 16px; margin-top: 4px; }
@media (max-width: 600px) { .ce-stat .ce-stat__value { font-size: 34px; } }

/* Tableau de tarifs ---------------------------------------------------------- */
.wp-block-table.ce-table { overflow-x: auto; margin: 0; }
.wp-block-table.ce-table .has-fixed-layout { table-layout: auto; }
.ce-table table { width: 100%; min-width: 480px; table-layout: auto; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); overflow: hidden; font-size: 17px; }
.ce-table th, .ce-table td { padding: 16px 20px; text-align: left; border: 0; border-bottom: 1px solid var(--ce-line); }
.ce-table thead th { background: var(--ce-night); color: #fff; font-weight: 600; border-bottom: 0; }
.ce-table tbody tr:nth-child(even) td { background: var(--ce-soft); }
.ce-table tbody tr:last-child td { border-bottom: 0; }
.ce-table th:last-child, .ce-table td:last-child { text-align: right; white-space: nowrap; }
.ce-table td:last-child { font-weight: 600; color: var(--ce-night); }
.ce-note { font-size: 14px; color: var(--ce-muted); }

/* Questions fréquentes ------------------------------------------------------- */
.wp-block-details.ce-faq { background: #fff; border: 1px solid var(--ce-line); border-radius: 14px; max-width: 820px; }
.ce-inner > .wp-block-details.ce-faq + .wp-block-details.ce-faq { margin-top: 12px; }
.ce-faq summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; font-size: 18px; color: var(--ce-night); display: flex; justify-content: space-between; gap: 16px; }
.ce-faq summary::-webkit-details-marker { display: none; }
.ce-faq summary::after { content: "+"; content: "+" / ""; font-size: 24px; line-height: 1; color: var(--ce-copper); }
.ce-faq[open] summary::after { content: "–"; content: "–" / ""; }
.ce-faq > :not(summary) { padding: 0 22px; margin: 0 0 18px; color: var(--ce-text-2); line-height: 1.65; }

/* Bandeau d'appel ------------------------------------------------------------ */
.ce-cta { background: var(--ce-night); border-radius: 24px; padding: 48px; display: grid; grid-template-columns: 1fr auto; gap: 8px 40px; align-items: center; }
.ce-cta > * { margin: 0; }
.ce-cta h2 { color: #fff; font-size: clamp(26px, 3vw, 34px); grid-column: 1; }
.ce-cta p { color: var(--ce-on-dark); font-size: 18px; grid-column: 1; }
.ce-cta > .wp-block-buttons { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 700px) {
	.ce-cta { grid-template-columns: 1fr; padding: 32px 24px; gap: 10px; }
	.ce-cta > .wp-block-buttons { grid-column: 1; grid-row: auto; margin-top: 14px; }
	.ce-cta .wp-block-button { flex: 1 1 auto; }
	.ce-section .ce-cta .wp-block-button > .wp-block-button__link { width: 100%; }
}

/* Intégration dans les pages : les sections touchent le bandeau de titre et le pied de page. */
.entry-content > .ce-section { margin-top: 0; }
.entry-content > .ce-section:first-child { margin-top: -56px; }
.entry-content > .ce-section:last-child { margin-bottom: -88px; }
@media (max-width: 700px) { .entry-content > .ce-section:last-child { margin-bottom: -64px; } }
.entry-content > .ce-section + :not(.ce-section) { margin-top: 1.1em; }

/* Trois cartes transformées en rangée défilante (voir scroller.js). */
.ce-inner > .scroller { margin-top: 36px; }
.scroller .wp-block-columns.scroller__track { display: grid; flex-wrap: nowrap; margin: 0; }
.scroller .wp-block-columns.scroller__track > .wp-block-column { flex-basis: auto !important; width: auto; margin: 0; }

/* Image pas encore choisie dans une composition : même visuel que les autres emplacements vides. */
.ce-section .wp-block-image img:not([src]), .ce-section .wp-block-image img[src=""] {
	display: block; width: 100%; min-height: 180px; border-radius: inherit;
	background: url("../img/cavalier.svg") center / auto 45% no-repeat, linear-gradient(135deg, #2A4A8C 0%, #0C2251 100%);
}
.ce-media .wp-block-image img:not([src]), .ce-media .wp-block-image img[src=""] { min-height: 420px; border-radius: 20px; }
