/*
 * Simulation 360° (accueil, après « De l'esquisse au permis ») : scène en bleu nuit. Titre, phrase
 * secteurs, trois temps en grands numéros (le troisième en orange), bloc acf/sim-plan (grande
 * visionneuse avec nom de la pièce et bouton ; plan, liste numérotée et légende à droite), puis le
 * chiffre des panoramas et le texte. sim.js relie le tout ; sans script, tout reste lisible.
 */

.cp-main > .cp-sim-part { margin-block: 0; }

.cp-sim {
	--cp-sim-navy: var(--wp--preset--color--navy, #000033);
	--cp-sim-orange: var(--wp--preset--color--orange, #FF9900);
	--cp-sim-soft: rgba(255, 255, 255, .74);
	--cp-sim-line: rgba(255, 255, 255, .14);
	--cp-sim-ease: cubic-bezier(.65, 0, .25, 1);
	--cp-sim-dwell: 4600ms;
	position: relative;
	margin: 0 !important;
	padding-block: clamp(72px, 9vw, 128px);
	overflow: hidden;
	background: radial-gradient(90% 70% at 85% 0%, #12127A 0%, rgba(18, 18, 122, 0) 60%), var(--cp-sim-navy);
	color: #fff;
}
/* Trame de points, qui s'efface vers le bas. */
.cp-sim::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.4px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 55%); mask-image: linear-gradient(180deg, #000, transparent 55%); pointer-events: none; }
.cp-sim > * { position: relative; }
.cp-sim,
.cp-sim * { box-sizing: border-box; }
.cp-sim > *,
.cp-sim__stage > *,
.cp-sim__side > *,
.cp-sim__text > *,
.cp-sim__fig > * { margin-block: 0 !important; }

/* Couleurs déclarées : les titres héritent sinon du bleu nuit global. */
.cp-sim .cp-sim__title { color: #fff; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
.cp-sim .cp-sim__lead { margin-top: 20px !important; color: var(--cp-sim-soft); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.6; }

/* Trois temps : grands numéros au trait ; le troisième, celui de la section, en orange. */
.cp-sim .cp-sim__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(40px, 5vw, 64px) !important; padding: 0; border-top: 1px solid var(--cp-sim-line); list-style: none; counter-reset: cp-sim-step; }
.cp-sim__steps li { position: relative; margin: 0; padding: 22px 28px 0 0; color: var(--cp-sim-soft); font-size: 15.5px; line-height: 1.55; counter-increment: cp-sim-step; }
.cp-sim__steps li::before { content: counter(cp-sim-step, decimal-leading-zero); display: block; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .38); font-size: clamp(44px, 4.4vw, 64px); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.cp-sim__steps li::after { content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 2px; background: transparent; }
.cp-sim__steps li:last-child::before { color: var(--cp-sim-orange); -webkit-text-stroke: 0; }
.cp-sim__steps li:last-child::after { background: var(--cp-sim-orange); }
.cp-sim .cp-sim__steps strong { display: block; margin: 12px 0 6px; color: #fff; font-size: 20px; font-weight: 700; line-height: 1.25; }

/* ---------- Scène (bloc acf/sim-plan) : visionneuse à gauche, plan et pièces à droite ---------- */
.cp-sim .cp-sim__stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(20px, 2.4vw, 32px); align-items: stretch; margin-top: clamp(48px, 6vw, 80px) !important; }

.cp-sim__view { display: flex; min-width: 0; }
.cp-sim__frame { position: relative; flex: 1; min-height: 520px; max-width: 100%; overflow: hidden; border-radius: 8px; background: #000; box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .8); }
.cp-sim .cp-sim__frame img.cp-sim__shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .7s ease, transform 6s ease; }
.cp-sim .cp-sim__frame img.cp-sim__shot.is-on { z-index: 1; opacity: 1; transform: none; }
.cp-sim__frame::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(0deg, rgba(0, 0, 30, .85) 0%, rgba(0, 0, 30, 0) 45%), linear-gradient(180deg, rgba(0, 0, 30, .4), rgba(0, 0, 30, 0) 25%); pointer-events: none; }
.cp-sim__badge { position: absolute; left: 24px; top: 22px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 30, .6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; letter-spacing: .04em; }
.cp-sim__badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--cp-sim-orange); box-shadow: 0 0 0 4px rgba(255, 153, 0, .25); }
.cp-sim__over { position: absolute; left: clamp(20px, 2.4vw, 36px); right: clamp(20px, 2.4vw, 36px); bottom: clamp(20px, 2.4vw, 32px); z-index: 3; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 28px; }
.cp-sim__label { min-width: 0; }
.cp-sim .cp-sim__num { margin: 0; color: var(--cp-sim-soft); font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.cp-sim .cp-sim__name { margin: 4px 0 0; color: #fff; font-size: clamp(28px, 2.8vw, 40px); font-weight: 700; line-height: 1.05; }
.cp-sim .cp-sim__go { display: inline-flex; align-items: center; gap: 12px; padding: 16px 26px; border-radius: 8px; background: var(--cp-sim-orange); color: var(--cp-sim-navy); font-weight: 700; line-height: 1.2; text-decoration: none; transition: background .25s, transform .25s; }
.cp-sim .cp-sim__go:hover { background: #fff; color: var(--cp-sim-navy); transform: translateY(-2px); }
.cp-sim__go .cp-icon { width: 24px; height: 24px; }
.cp-sim__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.cp-sim__side { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: clamp(18px, 2vw, 26px); border-radius: 8px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--cp-sim-line); }
.cp-sim__plan { margin: 0; }
.cp-sim__map { position: relative; overflow: visible; }
.cp-sim .cp-sim__map > img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }
.cp-sim__pt { position: absolute; left: var(--x); top: var(--y); z-index: 2; width: 36px; height: 36px; margin: -18px 0 0 -18px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.cp-sim__pt i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--cp-sim-navy); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 51, .45); transition: transform .3s var(--cp-sim-ease), background .3s; }
.cp-sim__pt::before { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid var(--cp-sim-orange); border-radius: 50%; opacity: 0; }
.cp-sim__pt[aria-pressed="true"] i { background: var(--cp-sim-orange); transform: scale(1.25); }
.cp-sim__pt[aria-pressed="true"]::before { animation: cp-sim-ping 1.6s ease-out infinite; }
.cp-sim__pt:hover i { transform: scale(1.25); }
.cp-sim__pt:focus-visible { outline: 2px solid var(--cp-sim-orange); outline-offset: 2px; }
.cp-sim__pt span { position: absolute; left: 50%; bottom: calc(100% - 2px); padding: 4px 10px; border-radius: 8px; background: var(--cp-sim-navy); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cp-sim__pt:hover span,
.cp-sim__pt:focus-visible span { opacity: 1; }
@keyframes cp-sim-ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

.cp-sim .cp-sim__rooms { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cp-sim__rooms li { margin: 0; }
.cp-sim__rooms button { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; overflow: hidden; padding: 12px 14px; border: 0; border-radius: 6px; background: transparent; color: #fff; font: 600 16px/1.3 var(--wp--preset--font-family--titillium, sans-serif); text-align: left; cursor: pointer; transition: background .25s; }
.cp-sim__no { color: rgba(255, 255, 255, .45); font-size: 13px; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; transition: color .25s; }
.cp-sim__rooms svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; }
.cp-sim__rooms button:hover,
.cp-sim__rooms button[aria-pressed="true"] { background: rgba(255, 255, 255, .08); }
.cp-sim__rooms button[aria-pressed="true"] .cp-sim__no { color: var(--cp-sim-orange); }
.cp-sim__rooms button:hover svg,
.cp-sim__rooms button[aria-pressed="true"] svg { color: var(--cp-sim-orange); opacity: 1; transform: none; }
.cp-sim__rooms button:focus-visible { outline: 2px solid var(--cp-sim-orange); outline-offset: 2px; }
/* Défilement automatique : un filet orange se remplit sous la pièce affichée. */
.cp-sim__rooms button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--cp-sim-orange); transform: scaleX(0); transform-origin: left; }
.cp-sim__stage.is-auto .cp-sim__rooms button[aria-pressed="true"]::after { animation: cp-sim-fill var(--cp-sim-dwell) linear forwards; }
.cp-sim__stage.is-paused .cp-sim__rooms button[aria-pressed="true"]::after { animation-play-state: paused; }
@keyframes cp-sim-fill { to { transform: scaleX(1); } }
.cp-sim .cp-sim__cap { margin-top: auto !important; padding-top: 14px; border-top: 1px solid var(--cp-sim-line); color: var(--cp-sim-soft); font-size: 14px; line-height: 1.5; }

/* Simulation chargée : elle prend toute la largeur de la scène, en 16/9. */
.cp-sim__stage.is-live > :not(.cp-sim__live) { display: none; }
.cp-sim__live { position: relative; grid-column: 1 / -1; aspect-ratio: 16 / 9; max-height: 82vh; max-width: 100%; overflow: hidden; border-radius: 8px; background: #000; }
.cp-sim__live iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cp-sim__bar { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.cp-sim .cp-sim__bar a,
.cp-sim .cp-sim__bar button { padding: 8px 14px; border: 0; border-radius: 8px; background: rgba(0, 0, 51, .8); color: #fff; font: 600 14px/1.2 var(--wp--preset--font-family--titillium, sans-serif); text-decoration: none; cursor: pointer; }
.cp-sim .cp-sim__bar a:hover,
.cp-sim .cp-sim__bar button:hover { background: var(--cp-sim-orange); color: var(--cp-sim-navy); }
.cp-sim__bar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Pied : le chiffre des panoramas, puis le texte en deux colonnes. */
.cp-sim .cp-sim__text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(32px, 4vw, 64px); margin-top: clamp(48px, 6vw, 72px) !important; padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--cp-sim-line); }
.cp-sim .cp-sim__text:has(> .cp-sim__fig) { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
.cp-sim .cp-sim__text p { color: var(--cp-sim-soft); font-size: 16.5px; line-height: 1.7; }
.cp-sim .cp-sim__fig p { color: #fff; font-size: 16px; font-weight: 600; line-height: 1.3; }
.cp-sim .cp-sim__fig strong { display: block; margin-bottom: 10px; color: var(--cp-sim-orange); font-size: clamp(56px, 6vw, 88px); font-weight: 700; line-height: .9; letter-spacing: -.03em; }

@media (max-width: 1100px) {
	.cp-sim .cp-sim__stage { grid-template-columns: minmax(0, 1fr); }
	.cp-sim__frame { min-height: 0; aspect-ratio: 16 / 10; }
	.cp-sim .cp-sim__text:has(> .cp-sim__fig) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cp-sim__fig { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
	.cp-sim .cp-sim__steps { grid-template-columns: minmax(0, 1fr); }
	.cp-sim__steps li { padding: 18px 0; }
	.cp-sim__steps li + li { border-top: 1px solid var(--cp-sim-line); }
	.cp-sim__steps li::before { font-size: 40px; }
	.cp-sim__frame { aspect-ratio: auto; min-height: 440px; }
	.cp-sim__over { flex-direction: column; align-items: stretch; }
	.cp-sim .cp-sim__go { justify-content: center; }
	.cp-sim .cp-sim__text,
	.cp-sim .cp-sim__text:has(> .cp-sim__fig) { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.cp-sim__fig { margin-bottom: 12px !important; }
	.cp-sim__pt { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
	.cp-sim__pt i,
	.cp-sim__pt::before { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
	.cp-sim__pt span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.cp-sim .cp-sim__frame img.cp-sim__shot { transition: opacity .2s; transform: none; }
	.cp-sim__pt[aria-pressed="true"]::before { animation: none; }
}
