/* Compostage Maroc : plateforme 3D + « Comment travailler avec nous » */
.cm3d, .cmwork {
	--g: var(--wp--preset--color--primary, #0a6430);
	--g-dark: var(--wp--preset--color--quaternary, #042110);
	--g-soft: var(--wp--preset--color--secondary, #dae5df);
	--ink: #1e2a22;
	--muted: #56645b;
	--line: #d5ddd6;
	font-family: var(--wp--preset--font-family--open-sans, "Open Sans", system-ui, sans-serif);
	color: var(--ink);
}
.cm3d { padding: clamp(3rem, 2rem + 4vw, 6rem) 0; background: #f4f7f2; }
.cm3d__inner, .cmwork__inner { width: min(1240px, 100% - 2rem); margin: 0 auto; }
.cm3d__head { max-width: 46rem; margin-bottom: 2rem; }
.cm3d__head h2, .cmwork h2 { margin: 0 0 .75rem; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1.15; font-weight: 700; color: var(--g-dark); }
.cm3d__head p, .cmwork__intro { margin: 0; font-size: 1.08rem; line-height: 1.65; color: var(--muted); }

.cm3d__layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .cm3d__layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; } }

.cm3d__stage {
	position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
	background: linear-gradient(180deg, #e3eddb 0%, #f2f5ee 100%); touch-action: pan-y; cursor: grab;
	box-shadow: 0 1px 0 rgba(4, 33, 16, .06), 0 18px 40px -28px rgba(4, 33, 16, .45);
}
@media (min-width: 1024px) { .cm3d__stage { aspect-ratio: 16 / 11; position: sticky; top: 1.5rem; } }
.cm3d__stage:active { cursor: grabbing; }
.cm3d__stage canvas { display: block; width: 100%; height: 100%; }
.cm3d__markers { position: absolute; inset: 0; pointer-events: none; }
.cm3d__marker {
	position: absolute; left: 0; top: 0; pointer-events: auto; width: 34px; height: 34px; border-radius: 50%;
	border: 2px solid #fff; background: var(--g); color: #fff; font: 700 15px/1 inherit; cursor: pointer;
	box-shadow: 0 4px 12px rgba(4, 33, 16, .35); transition: background .2s, scale .2s;
}
.cm3d__marker:hover, .cm3d__marker.is-active { background: #c33b2c; scale: 1.15; }
.cm3d__marker:focus-visible, .cm3d__ctrl:focus-visible, .cm3d__step button:focus-visible { outline: 3px solid #f2b632; outline-offset: 2px; }
.cm3d__controls { position: absolute; left: .75rem; bottom: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.cm3d__ctrl {
	min-height: 40px; padding: .45rem .95rem; border: 0; border-radius: 8px; cursor: pointer;
	background: rgba(255, 255, 255, .92); color: var(--g-dark); font: 600 .92rem/1.2 inherit; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.cm3d__ctrl[aria-pressed="true"] { background: var(--g); color: #fff; }
.cm3d__hint { position: absolute; right: .75rem; bottom: .9rem; margin: 0; font-size: .8rem; color: var(--muted); background: rgba(255,255,255,.8); padding: .2rem .5rem; border-radius: 6px; }
.cm3d__fallback { display: none; position: absolute; inset: 0; place-items: center; text-align: center; padding: 1.5rem; color: var(--muted); }
.cm3d.is-fallback .cm3d__fallback { display: grid; }
.cm3d.is-fallback .cm3d__controls, .cm3d.is-fallback .cm3d__hint, .cm3d.is-fallback canvas { display: none; }
.cm3d:not(.is-3d) .cm3d__controls, .cm3d:not(.is-3d) .cm3d__hint { visibility: hidden; }

.cm3d__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; counter-reset: s; }
.cm3d__step { border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.cm3d__step.is-active { border-color: var(--g); box-shadow: 0 6px 18px -12px rgba(10, 100, 48, .6); }
.cm3d__step h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; font-weight: 700; }
.cm3d__step button {
	all: unset; box-sizing: border-box; display: flex; align-items: center; gap: .8rem; width: 100%;
	padding: .85rem 1rem .35rem; cursor: pointer; border-radius: 12px; color: var(--g-dark);
}
.cm3d__num { flex: 0 0 auto; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--g-soft); color: var(--g); font-weight: 700; }
.cm3d__step.is-active .cm3d__num { background: #c33b2c; color: #fff; }
.cm3d__step p { margin: 0; padding: 0 1rem .95rem 3.9rem; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.cm3d__note { margin: 1rem 0 0; font-size: .95rem; color: var(--muted); }

/* « Comment travailler avec nous » */
.cmwork { padding: clamp(3rem, 2rem + 4vw, 6rem) 0; background: #fff; }
.cmwork__intro { max-width: 44rem; margin-bottom: 2.2rem; }
.cmwork__steps { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); counter-reset: w; }
.cmwork__steps li { position: relative; padding: 1.3rem 1.2rem 1.2rem; border-top: 3px solid var(--g); background: #f4f7f2; border-radius: 0 0 12px 12px; }
.cmwork__steps li::before { counter-increment: w; content: counter(w); display: block; margin-bottom: .5rem; font-size: 1.6rem; font-weight: 700; color: var(--g); }
.cmwork__steps h3 { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--g-dark); }
.cmwork__steps p { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.cmwork__paths { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cmwork__path { display: flex; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; }
.cmwork__path h3 { margin: 0 0 .5rem; font-size: 1.2rem; color: var(--g-dark); }
.cmwork__path p { margin: 0 0 1.2rem; color: var(--muted); line-height: 1.6; flex: 1; }
.cmwork__btn {
	align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.2rem; border-radius: 8px;
	background: var(--g); color: #fff !important; font-weight: 700; text-decoration: none;
}
.cmwork__btn:hover { background: var(--g-dark); }
.cmwork__btn--ghost { background: transparent !important; color: var(--g) !important; border: 2px solid var(--g) !important; }
.cmwork__btn--ghost:hover { background: var(--g-soft); }

@media (prefers-reduced-motion: reduce) { .cm3d__marker, .cm3d__step { transition: none; } }

/* Vue 3D agrandie */
.cm3d__ctrl--expand::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .45em; vertical-align: -.1em; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v2H6v4H4V4zm10 0h6v6h-2V6h-4V4zM4 14h2v4h4v2H4v-6zm14 0h2v6h-6v-2h4v-4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v2H6v4H4V4zm10 0h6v6h-2V6h-4V4zM4 14h2v4h4v2H4v-6zm14 0h2v6h-6v-2h4v-4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.cm3d__ctrl--expand[aria-pressed="true"]::before { transform: rotate(180deg); }
.cm3d__stage.is-expanded { position: fixed !important; inset: 0; top: 0 !important; z-index: 100000; width: 100vw; height: 100vh; height: 100dvh; max-width: none; aspect-ratio: auto !important; border-radius: 0; margin: 0; background: #f3efe4; }
.cm3d__stage.is-expanded:fullscreen { width: 100%; height: 100%; }
html.cm3d-lock, html.cm3d-lock body { overflow: hidden !important; }
