/* CPC Chapitres 1.4.0 — direction « D ». Toutes les classes sont préfixées « cpc- ». */
.cpc-chapitres { --cpc-bordeaux:#3a0f1f; --cpc-bordeaux-2:#661f33; --cpc-orange:#c15a05; --cpc-or:#fadc6f; --cpc-lin:#f7f0e4; --cpc-sable:#efe3cd; --cpc-encre:#2b1a16; }

/* Pleine largeur, même dans le conteneur d'une section Enfold */
.cpc-chap-section .container,
.cpc-chap-section .container .flex_column,
.cpc-chap-section .entry-content-wrapper { max-width: none !important; width: 100% !important; padding: 0 !important; margin: 0 !important; float: none !important; }
.cpc-chap-section .av_textblock_section, .cpc-chap-section .avia_textblock { margin: 0 !important; }
.cpc-chap-section { overflow: hidden; }

.cpc-chapitres { width: 100%; }
.cpc-chap { display: grid; grid-template-columns: 1fr 1fr; min-height: min(78vh, 720px); }
.cpc-chap__photo { position: relative; overflow: hidden; min-height: 320px; background: var(--cpc-sable); }
.cpc-chap__img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; display: block !important; }
.cpc-chap__texte { display: flex; align-items: center; padding: clamp(36px, 6vw, 96px); }
.cpc-chap__interieur { max-width: 540px; }
.cpc-chap--inv .cpc-chap__photo { order: 2; }
.cpc-chap--sans-photo { grid-template-columns: 1fr; }
.cpc-chap--sans-photo .cpc-chap__interieur { max-width: 720px; margin: 0 auto; }

/* Huit habillages qui tournent (clairs et sombres en alternance), puis on recommence au 9e.
   Chaque thème définit : fond, titre, texte, petit texte + numéro, bouton (fond, texte, survol). */
.cpc-chap { --cpc-t-btn: var(--cpc-bordeaux); --cpc-t-btn-txt: var(--cpc-or); --cpc-t-btn-hover: var(--cpc-bordeaux-2); }
.cpc-chap--t0 { background: var(--cpc-lin);      --cpc-t-titre: var(--cpc-bordeaux-2); --cpc-t-texte: var(--cpc-encre); --cpc-t-eyebrow:#a94b02; }
.cpc-chap--t1 { background: var(--cpc-bordeaux); --cpc-t-titre: var(--cpc-or);         --cpc-t-texte:#f3e4dc;           --cpc-t-eyebrow: var(--cpc-or); --cpc-t-btn: var(--cpc-or); --cpc-t-btn-txt: var(--cpc-bordeaux); --cpc-t-btn-hover:#fff0b3; }
.cpc-chap--t2 { background: var(--cpc-sable);    --cpc-t-titre: var(--cpc-bordeaux);   --cpc-t-texte: var(--cpc-encre); --cpc-t-eyebrow:#a94b02; }
.cpc-chap--t3 { background: var(--cpc-orange);   --cpc-t-titre:#fff;                   --cpc-t-texte:#fff;              --cpc-t-eyebrow: var(--cpc-bordeaux); --cpc-t-btn-hover:#2c0c17; }
.cpc-chap--t4 { background:#e3eeea;              --cpc-t-titre:#115a5a;                --cpc-t-texte: var(--cpc-encre); --cpc-t-eyebrow:#146a6a; --cpc-t-btn:#115a5a; --cpc-t-btn-txt:#fff; --cpc-t-btn-hover:#0b4343; }
.cpc-chap--t5 { background:#3f2b6b;              --cpc-t-titre: var(--cpc-or);         --cpc-t-texte:#ece6f6;           --cpc-t-eyebrow:#d9c8ff; --cpc-t-btn: var(--cpc-or); --cpc-t-btn-txt:#2b1a4d; --cpc-t-btn-hover:#fff0b3; }
.cpc-chap--t6 { background:#f4ddd3;              --cpc-t-titre:#7d2438;                --cpc-t-texte: var(--cpc-encre); --cpc-t-eyebrow:#a94b02; --cpc-t-btn:#7d2438; --cpc-t-btn-txt:#fff; --cpc-t-btn-hover:#5e1a2a; }
.cpc-chap--t7 { background:#1f3d6e;              --cpc-t-titre:#fff0b3;                --cpc-t-texte:#e6edf8;           --cpc-t-eyebrow: var(--cpc-or); --cpc-t-btn: var(--cpc-or); --cpc-t-btn-txt:#14284a; --cpc-t-btn-hover:#fff0b3; }

.cpc-chap__num { display: block; margin: 0 0 6px; font-family: 'Buda', serif !important; font-weight: 300 !important; font-size: clamp(44px, 5vw, 76px); line-height: 1; color: var(--cpc-t-eyebrow); opacity: .9; }
.cpc-chap__eyebrow { margin: 0 0 14px !important; font-family: 'Maven Pro', sans-serif !important; font-size: 14px !important; font-weight: 700 !important; letter-spacing: .2em !important; text-transform: uppercase !important; color: var(--cpc-t-eyebrow) !important; }
.cpc-chap__titre { margin: 0 !important; font-family: 'Ubuntu', sans-serif !important; font-weight: 300 !important; font-size: clamp(34px, 3.6vw, 54px) !important; line-height: 1.1 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--cpc-t-titre) !important; text-wrap: balance; }
.cpc-chap__corps, .cpc-chap__corps p { font-family: 'Maven Pro', sans-serif !important; font-size: 18px !important; line-height: 1.75 !important; color: var(--cpc-t-texte) !important; text-wrap: pretty; }
.cpc-chap__corps p { margin: 18px 0 0 !important; }

.cpc-chap__lien { display: inline-block; margin-top: 28px; padding: 14px 24px; border-radius: 3px; background: var(--cpc-t-btn); font-family: 'Maven Pro', sans-serif !important; font-size: 16px !important; font-weight: 700 !important; color: var(--cpc-t-btn-txt) !important; text-decoration: none !important; border: 0 !important; transition: background .15s, color .15s; }
.cpc-chap__lien:hover { background: var(--cpc-t-btn-hover); color: var(--cpc-t-btn-txt) !important; }
.cpc-chap__lien:focus-visible { outline: 3px solid var(--cpc-t-btn); outline-offset: 3px; }

.cpc-chap-vide { padding: 24px; background: #fff3d9; border: 1px dashed #c15a05; }

@media (max-width: 767px) {
	.cpc-chap { grid-template-columns: 1fr; min-height: 0; }
	.cpc-chap__photo, .cpc-chap--inv .cpc-chap__photo { order: 0; min-height: 0; aspect-ratio: 4 / 3; }
	.cpc-chap__texte { padding: 40px 24px 48px; }
}
@media (prefers-reduced-motion: reduce) { .cpc-chap__lien { transition: none; } }

/* ── Carrousel de cartes [cpc_cartes] ─────────────────────────────────── */
.cpc-carrousel { --cpc-gap: 18px; --cpc-vue: 4; position: relative; }
.cpc-carrousel.cpc-vue-3 { --cpc-vue: 3; }
.cpc-carrousel__piste { display: flex; gap: var(--cpc-gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0 4px; }
.cpc-carrousel__piste::-webkit-scrollbar { display: none; }
.cpc-carrousel__piste:focus-visible { outline: 3px solid #fadc6f; outline-offset: 4px; }
.cpc-carrousel a.cpc-carte { flex: 0 0 calc((100% - (var(--cpc-vue) - 1) * var(--cpc-gap)) / var(--cpc-vue)); scroll-snap-align: start; display: flex; flex-direction: column; position: relative; border-radius: 3px; overflow: hidden; text-decoration: none !important; }
.cpc-carte__photo { position: relative; display: block; overflow: hidden; background: #661f33; }
.cpc-carte__img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; display: block !important; transition: transform .5s; }
.cpc-carrousel a.cpc-carte:hover .cpc-carte__img { transform: scale(1.04); }
.cpc-carrousel .cpc-carte__num { display: block; font-family: 'Buda', serif !important; font-weight: 300 !important; font-size: 40px; line-height: 1; }
.cpc-carrousel .cpc-carte__nom { display: block; margin-top: 8px; font-family: 'Ubuntu', sans-serif !important; font-weight: 500 !important; font-size: 19px; line-height: 1.25; text-wrap: balance; }
.cpc-carrousel .cpc-carte__avec { display: block; margin-top: 8px; font-family: 'Maven Pro', sans-serif !important; font-size: 15px; font-weight: 500; line-height: 1.4; }
.cpc-carrousel .cpc-carte__go { display: block; margin-top: 14px; font-family: 'Maven Pro', sans-serif !important; font-size: 14px; font-weight: 700; letter-spacing: .02em; }

/* Modèle « legende » : photo, puis encart de texte (titre complet toujours lisible) */
.cpc-carrousel--legende .cpc-carte__photo { aspect-ratio: 4 / 5; }
.cpc-carrousel--legende .cpc-carte__texte { flex: 1; display: block; padding: 20px 22px 22px; background: #f7f0e4; border-top: 4px solid var(--cpc-accent, #c15a05); }
.cpc-carrousel--clair.cpc-carrousel--legende .cpc-carte__texte { background: #fff; box-shadow: 0 0 0 1px #d9c7a8 inset; border-top: 4px solid var(--cpc-accent, #c15a05); }
.cpc-carrousel--legende .cpc-carte__num { color: var(--cpc-accent-txt, #a94b02) !important; }
.cpc-carrousel--legende .cpc-carte__nom { color: #3a0f1f !important; }
.cpc-carrousel--legende .cpc-carte__avec { color: #2b1a16 !important; }
.cpc-carrousel--legende .cpc-carte__go { color: #a94b02 !important; }
.cpc-carrousel--legende a.cpc-carte:hover .cpc-carte__go { text-decoration: underline; text-underline-offset: 4px; }

/* Modèle « voile » : texte sur la photo, voile de couleur */
.cpc-carrousel--voile a.cpc-carte { min-height: 460px; background: #661f33; }
.cpc-carrousel--voile .cpc-carte__photo { position: absolute; inset: 0; }
.cpc-carrousel--voile a.cpc-carte::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 25%, var(--cpc-accent, #5a3d8a) 82%); opacity: .94; pointer-events: none; }
.cpc-carrousel--voile .cpc-carte__texte { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: block; padding: 0 22px 22px; }
.cpc-carrousel--voile .cpc-carte__num { color: #fadc6f !important; }
.cpc-carrousel--voile .cpc-carte__nom, .cpc-carrousel--voile .cpc-carte__avec { color: #fff !important; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.cpc-carrousel--voile .cpc-carte__go { color: #fadc6f !important; }

/* Huit accents qui tournent */
.cpc-carte--t0 { --cpc-accent: #5a3d8a; --cpc-accent-txt: #5a3d8a; }
.cpc-carte--t1 { --cpc-accent: #1f8a8a; --cpc-accent-txt: #146a6a; }
.cpc-carte--t2 { --cpc-accent: #c15a05; --cpc-accent-txt: #a94b02; }
.cpc-carte--t3 { --cpc-accent: #2f5fa8; --cpc-accent-txt: #2a5497; }
.cpc-carte--t4 { --cpc-accent: #7d2438; --cpc-accent-txt: #7d2438; }
.cpc-carte--t5 { --cpc-accent: #3f7d5a; --cpc-accent-txt: #2f6446; }
.cpc-carte--t6 { --cpc-accent: #b0408a; --cpc-accent-txt: #94306f; }
.cpc-carte--t7 { --cpc-accent: #6b6b1f; --cpc-accent-txt: #575716; }

/* Flèches et barre de progression */
.cpc-carrousel__fleche { position: absolute; top: calc(50% - 40px); z-index: 5; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.28); transition: background .15s, opacity .15s; }
.cpc-carrousel__fleche--prec { left: -26px; }
.cpc-carrousel__fleche--suiv { right: -26px; }
.cpc-carrousel--sombre .cpc-carrousel__fleche { background: #fadc6f; color: #3a0f1f; }
.cpc-carrousel--sombre .cpc-carrousel__fleche:hover:not(:disabled) { background: #fff0b3; }
.cpc-carrousel--clair .cpc-carrousel__fleche { background: #3a0f1f; color: #fadc6f; }
.cpc-carrousel--clair .cpc-carrousel__fleche:hover:not(:disabled) { background: #661f33; }
.cpc-carrousel__fleche:disabled { opacity: 0; pointer-events: none; }
.cpc-carrousel__fleche:focus-visible { outline: 3px solid #c15a05; outline-offset: 3px; }
.cpc-carrousel__barre { position: relative; height: 3px; margin-top: 26px; border-radius: 2px; background: rgba(217,199,168,.35); }
.cpc-carrousel__barre span { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; border-radius: 2px; background: #c15a05; transition: left .2s, width .2s; }
.cpc-carrousel--sombre .cpc-carrousel__barre span { background: #fadc6f; }
.cpc-carrousel.is-statique .cpc-carrousel__fleche, .cpc-carrousel.is-statique .cpc-carrousel__barre { display: none; }

@media (max-width: 1100px) { .cpc-carrousel, .cpc-carrousel.cpc-vue-3 { --cpc-vue: 3; } }
@media (max-width: 800px) { .cpc-carrousel, .cpc-carrousel.cpc-vue-3 { --cpc-vue: 2; } .cpc-carrousel__fleche--prec { left: -10px; } .cpc-carrousel__fleche--suiv { right: -10px; } }
@media (max-width: 560px) { .cpc-carrousel, .cpc-carrousel.cpc-vue-3 { --cpc-vue: 1.15; --cpc-gap: 14px; } .cpc-carrousel__fleche { width: 44px; height: 44px; } .cpc-carrousel--voile a.cpc-carte { min-height: 420px; } }
@media (prefers-reduced-motion: reduce) { .cpc-carte__img, .cpc-carrousel__barre span { transition: none; } }
