/* ==========================================================
   Casacreat : composants (complète theme.json)
   ========================================================== */

:root {
	--cc-rayon: 14px;
	--cc-ombre: 0 10px 30px rgba(59, 36, 24, .10);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* Petit sur-titre en capitales */
.cc-eyebrow {
	font-size: .8rem !important;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--wp--preset--color--terracotta);
	margin-bottom: .4em !important;
}

/* Boutons : effet au survol */
.wp-element-button, .wp-block-button__link { transition: transform .15s, background-color .15s, color .15s; }
.wp-block-button__link:hover { transform: translateY(-2px); }
.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--brun) !important;
	color: #fff !important;
}

/* En-tête collant */
.cc-entete { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--wp--preset--color--ligne); }
.admin-bar .cc-entete { top: 32px; }
@media (max-width: 782px) { .admin-bar .cc-entete { top: 46px; } }
.cc-entete .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--brun); }
@media (max-width: 900px) { .cc-entete .cc-cta-entete { display: none; } }

/* Bandeau promo */
.cc-promo { font-size: .92rem; text-align: center; }
.cc-promo a { color: var(--wp--preset--color--terracotta-clair); font-weight: 700; }

/* Carte (style de groupe « Carte ») */
.is-style-carte {
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: var(--cc-rayon);
	padding: 28px;
	transition: border-color .15s, box-shadow .15s;
}
a.is-style-carte:hover, .is-style-carte.cc-cliquable:hover {
	border-color: var(--wp--preset--color--terracotta);
	box-shadow: var(--cc-ombre);
}
.is-style-carte p { color: var(--wp--preset--color--texte-doux); }
.cc-sombre .is-style-carte {
	background: rgba(255, 255, 255, .05);
	border-color: rgba(255, 255, 255, .12);
}
.cc-sombre .is-style-carte p, .cc-sombre p { color: var(--wp--preset--color--beige); }
.cc-sombre h2, .cc-sombre h3 { color: #fff; }

/* Icône dans une carte */
.cc-ico {
	width: 48px; height: 48px; border-radius: 12px;
	background: var(--wp--preset--color--beige);
	color: var(--wp--preset--color--terracotta);
	display: grid; place-items: center;
	font-size: 1.4rem; line-height: 1;
	margin-bottom: 4px !important;
}
.cc-sombre .cc-ico { background: rgba(255, 255, 255, .08); color: var(--wp--preset--color--terracotta-clair); }

/* Liste à coches / flèches */
.is-style-coches { list-style: none; padding-left: 0; }
.is-style-coches li {
	position: relative; padding: 10px 0 10px 30px;
	border-bottom: 1px solid var(--wp--preset--color--ligne);
}
.is-style-coches li::before {
	content: "✓"; position: absolute; left: 0;
	color: var(--wp--preset--color--terracotta); font-weight: 700;
}

/* Bande d'atouts */
.cc-atouts ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; font-weight: 500; }
.cc-atouts li::before { content: "✓ "; color: var(--wp--preset--color--terracotta-clair); font-weight: 700; }

/* Encadré 150 m² */
.cc-limite {
	border-left: 6px solid var(--wp--preset--color--terracotta);
	border-radius: var(--cc-rayon);
}
.cc-limite .cc-chiffre {
	font-family: var(--wp--preset--font-family--titre);
	font-size: 3rem; line-height: 1;
	color: var(--wp--preset--color--terracotta);
}

/* Étapes numérotées */
.cc-etapes { counter-reset: etape; }
.cc-etape { counter-increment: etape; border-top: 3px solid var(--wp--preset--color--terracotta); padding-top: 18px; }
.cc-etape::before {
	content: "0" counter(etape);
	font-family: var(--wp--preset--font-family--titre);
	font-size: 2rem; color: var(--wp--preset--color--terracotta-clair);
	display: block;
}
.cc-etape p { color: var(--wp--preset--color--texte-doux); font-size: .95rem; }

/* Bloc CTA terracotta */
.cc-cta { border-radius: 24px; }
.cc-cta h2, .cc-cta p { color: #fff; }
.cc-cta .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: #fff; color: var(--wp--preset--color--terracotta); }
.cc-cta .is-style-outline .wp-block-button__link { border-color: #fff; color: #fff; }
.cc-cta .is-style-outline .wp-block-button__link:hover { background: #fff !important; color: var(--wp--preset--color--terracotta) !important; }

/* Emplacement avis Google */
.cc-avis { border: 2px dashed rgba(255, 255, 255, .25); border-radius: var(--cc-rayon); }

/* Visuels arrondis */
.cc-visuel img { border-radius: 24px; box-shadow: var(--cc-ombre); }

/* ==========================================================
   Comparateur avant / après
   Structure dans l'éditeur : un Groupe (style « Comparateur avant / après »)
   contenant 2 blocs Image : 1. le plan, 2. le rendu 3D.
   ========================================================== */
.is-style-avant-apres {
	position: relative;
	border-radius: var(--cc-rayon);
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--beige);
	user-select: none;
	touch-action: pan-y;
	padding: 0 !important;
}
.is-style-avant-apres > .wp-block-image,
.is-style-avant-apres > figure {
	position: absolute; inset: 0; margin: 0 !important; width: 100%; height: 100%;
}
.is-style-avant-apres > figure img {
	width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
.is-style-avant-apres > figure:nth-of-type(2) { clip-path: inset(0 0 0 var(--pos, 50%)); }
.is-style-avant-apres figcaption { display: none; }
.cc-ba-poignee {
	position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
	width: 3px; background: #fff; transform: translateX(-50%); pointer-events: none;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.cc-ba-poignee::after {
	content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
	width: 44px; height: 44px; border-radius: 50%; background: #fff;
	color: var(--wp--preset--color--brun); display: grid; place-items: center;
	font-weight: 700; box-shadow: var(--cc-ombre);
}
.cc-ba-curseur {
	position: absolute; inset: 0; width: 100%; height: 100%;
	opacity: 0; cursor: ew-resize; margin: 0;
}
.cc-ba-curseur:focus-visible + .cc-ba-poignee::after { outline: 3px solid var(--wp--preset--color--terracotta); }
.cc-ba-etiquette {
	position: absolute; top: 12px; padding: 4px 12px; border-radius: 999px;
	background: rgba(46, 30, 22, .75); color: #fff; font-size: .8rem; font-weight: 700;
	pointer-events: none;
}
.cc-ba-etiquette.avant { left: 12px; }
.cc-ba-etiquette.apres { right: 12px; }

/* Dans l'éditeur : on affiche les 2 images côte à côte pour pouvoir les remplacer */
.editor-styles-wrapper .is-style-avant-apres { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: visible; }
.editor-styles-wrapper .is-style-avant-apres > figure { position: static; height: auto; }
.editor-styles-wrapper .is-style-avant-apres > figure:nth-of-type(2) { clip-path: none; }
.editor-styles-wrapper .is-style-avant-apres figcaption { display: block; }

/* Légende de projet */
.cc-projet h3 { margin-top: 14px !important; margin-bottom: 0 !important; font-size: 1.1rem; }
.cc-projet p { color: var(--wp--preset--color--texte-doux); font-size: .92rem; margin-top: 0 !important; }

/* ==========================================================
   Pied de page
   ========================================================== */
.cc-pied a { color: var(--wp--preset--color--beige); text-decoration: none; }
.cc-pied a:hover { color: var(--wp--preset--color--terracotta-clair); }
.cc-pied ul { list-style: none; padding-left: 0; }
.cc-pied li { margin: .35em 0; }
.cc-pied h4 { color: #fff; }
.cc-recherches { border-top: 1px solid rgba(255, 255, 255, .12); }
.cc-recherches h4 { font-family: var(--wp--preset--font-family--texte); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.cc-recherches p, .cc-recherches a, .cc-bas, .cc-bas a { color: #CDAE9F !important; font-size: .84rem; line-height: 1.9; }

/* ==========================================================
   Logo (pictogramme + texte bicolore, comme la plaquette)
   ========================================================== */
.cc-logo { align-items: center; }
.cc-logo .cc-logo-picto { margin: 0; }
.cc-logo .cc-logo-picto img { display: block; }
.cc-logo-nom { margin: 0 !important; font-family: var(--wp--preset--font-family--texte); font-weight: 700; font-size: 1.55rem; letter-spacing: .02em; line-height: 1; }
.cc-logo-nom a { text-decoration: none; color: var(--wp--preset--color--brun-fonce) !important; }
.cc-logo-nom span { color: var(--wp--preset--color--terracotta); }
.cc-logo-sous-titre { margin: 4px 0 0 !important; font-size: .62rem !important; letter-spacing: .16em; text-transform: uppercase; color: var(--wp--preset--color--texte-doux); line-height: 1.2; }
.cc-pied .cc-logo-nom a { color: #fff !important; }
.cc-pied .cc-logo-nom span { color: var(--wp--preset--color--terracotta-clair); }
@media (max-width: 480px) { .cc-logo-sous-titre { display: none; } .cc-logo-nom { font-size: 1.3rem; } }

/* Galerie de rendus */
.cc-galerie img { border-radius: var(--cc-rayon); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.cc-galerie figcaption { color: var(--wp--preset--color--texte-doux); font-size: .9rem; text-align: left; }
.cc-visuel-dossier { margin: 0; }
.cc-visuel-dossier img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--wp--preset--color--beige); border-radius: var(--cc-rayon); width: 100%; }

/* Menu : « Contact / Devis » en bouton */
.cc-entete .cc-nav-cta > a,
.cc-entete .cc-nav-cta .wp-block-navigation-item__content {
	background: var(--wp--preset--color--terracotta); color: #fff !important;
	padding: .55em 1.15em !important; border-radius: 999px; font-weight: 700;
}
.cc-entete .cc-nav-cta > a:hover { background: #8E463F; }
.wp-block-navigation__responsive-container.is-menu-open .cc-nav-cta .wp-block-navigation-item__content { display: inline-block; margin-top: .6em; }
@media (min-width: 600px) and (max-width: 1100px) { .cc-entete .wp-block-navigation { font-size: .88rem; } .cc-entete .wp-block-navigation__container { gap: 1rem; } }

/* Ancres : compenser l'en-tête collant */
[id] { scroll-margin-top: 110px; }

/* Citation */
.cc-citation { border-left: 4px solid var(--wp--preset--color--terracotta-clair); padding-left: 1.4rem; font-family: var(--wp--preset--font-family--titre); font-size: 1.25rem; line-height: 1.5; }
.cc-sombre .cc-citation { color: #fff; }

/* Livrables */
.cc-livrables ol { counter-reset: none; padding-left: 0; list-style: none; }
.cc-livrables li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--wp--preset--color--ligne); }
.cc-livrables li strong { color: var(--wp--preset--color--terracotta); font-family: var(--wp--preset--font-family--titre); }

/* Guide des autorisations : grille de cartes */
.cc-autorisations { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.cc-autorisations > * { margin: 0 !important; }
.cc-badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin: 2px 4px 2px 0; }
.cc-badge.dp { background: #F3DED0; color: #7B4A34; }
.cc-badge.pc { background: #A6574F; color: #fff; }
.cc-badge.libre { background: #E8EFE3; color: #3F5A34; }
.cc-badge.autre { background: #E6E1F0; color: #4A3F6B; }

/* Fiche projet (Réalisations) */
.cc-fiche dt { font-weight: 700; color: var(--wp--preset--color--brun-fonce); margin-top: .8em; }
.cc-fiche dd { margin: .2em 0 0; color: var(--wp--preset--color--texte-doux); }

/* Retouches après mise en ligne (16/11) */
.wp-site-blocks > * { margin-block-start: 0 !important; }   /* pas de bande vide entre en-tête, contenu et pied */
.is-style-carte h3 a { text-decoration: none; color: inherit; }
.is-style-carte h3 a:hover { color: var(--wp--preset--color--terracotta); }
.cc-autorisations .is-style-carte > * + * { margin-block-start: .45rem !important; }
.cc-autorisations .is-style-carte p { margin-bottom: 0; line-height: 1.5; }
