/* ==========================================================================
   Cabinet Dentaire Lumière — socle commun (reset, animations, composants
   neutres). Couleurs et polices sont définies dans le style.css de chaque
   version.
   ========================================================================== */

:root {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --c-wa: #1FA855;
  interpolate-size: allow-keywords;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 16px; border-radius: 8px; background: #000; color: #fff; }
.skip-link:focus { top: 16px; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }

/* Photos : recadrage propre quel que soit le format d'origine */
.cover { width: 100%; height: 100%; object-fit: cover; }

/* --- Accordéon (FAQ) -------------------------------------------------- */
details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .5s var(--ease), content-visibility .5s allow-discrete;
}
details[open]::details-content { block-size: auto; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* --- Comparateur à glisser --------------------------------------------- */
.compare { position: relative; overflow: hidden; --pos: 50%; user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__top { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__range {
  position: absolute; inset: 0; z-index: 3;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize;
}
.compare__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2;
  width: 3px; transform: translateX(-50%);
  background: #fff;
  pointer-events: none;
}
.compare__knob {
  position: absolute; top: 50%; left: 50%;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45);
}
.compare__range:focus-visible ~ .compare__handle .compare__knob { outline: 3px solid currentColor; outline-offset: 3px; }

/* --- Bouton WhatsApp flottant (mobile) -------------------------------- */
.wa-float {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--c-wa);
  color: #fff;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .45);
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
.wa-float .icon { width: 30px; height: 30px; }
.js .wa-float:not(.is-visible) { opacity: 0; transform: translateY(24px) scale(.8); pointer-events: none; }
@media (min-width: 960px) { .wa-float { display: none; } }

/* --- Animations au défilement ------------------------------------------
   Le contenu reste visible sans JavaScript : l'état masqué n'existe
   que lorsque la classe .js est posée sur <html>.                       */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition:
    opacity .9s var(--ease) var(--d, 0ms),
    transform 1.1s var(--ease) var(--d, 0ms);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="left"] { transform: translate3d(-40px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(40px, 0, 0); }
.js [data-reveal="zoom"] { transform: scale(.92); }
.js [data-reveal="mask"] {
  opacity: 1;
  transform: scale(1.08);
  clip-path: inset(16% 12% 16% 12% round 24px);
  transition:
    clip-path 1.4s var(--ease) var(--d, 0ms),
    transform 1.8s var(--ease) var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="mask"].is-in { clip-path: inset(0 0 0 0 round 0); }

.split-char { display: inline-block; }
.js [data-split] .split-char {
  opacity: 0;
  transform: translate3d(0, .45em, 0);
  transition: opacity .8s var(--ease) var(--d, 0ms), transform 1.1s var(--ease) var(--d, 0ms);
}
.js [data-split].is-in .split-char { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal], .js [data-split] .split-char { opacity: 1; transform: none; clip-path: none; }
}
