/* Finitions visuelles ajoutées par-dessus le design (chargées sur toutes les pages). */

:root {
  --brand-wine: #521214;
  --brand-green: #91A849;
  --brand-yellow: #F3B916;
  --brand-orange: #DA7A29;
  --brand-cream: #FBF5EC;
  /* Fonds des sections : blanc en alternance avec une teinte claire. */
  --bg-white: #FFFFFF;
  --bg-alt: #F5F7F0;
}

/* Les ancres (#agenda, mentions légales…) ne passent plus sous l'en-tête collant. */
html { scroll-padding-top: 120px; }

/* Barre de défilement aux couleurs du site. */
html { scrollbar-color: var(--brand-green) var(--brand-cream); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--brand-cream); }
::-webkit-scrollbar-thumb { background: var(--brand-green); border-radius: 999px; border: 2px solid var(--brand-cream); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-orange); }

/* Focus clavier visible et soigné. */
:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 3px; border-radius: 10px; }

/* Grain papier très léger : donne de la chaleur et de la matière aux aplats. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 190;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.07 0 0 0 0 0.08 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Barre de progression de lecture. */
.sc-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 120;
  pointer-events: none;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-yellow) 55%, var(--brand-orange));
  transform-origin: 0 50%;
  transform: scaleX(0);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(243, 185, 22, .55);
}

/* Bouton retour en haut, avec anneau de progression. */
.sc-top {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border: none;
  padding: 0;
  border-radius: 50%;
  background: var(--brand-wine);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(82, 18, 20, .28);
  opacity: 0;
  transform: translateY(18px) scale(.8);
  pointer-events: none;
  transition: opacity 350ms ease, transform 450ms cubic-bezier(.2, .8, .2, 1), background 250ms;
}
.sc-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.sc-top:hover { background: var(--brand-orange); transform: translateY(-4px); }
.sc-top svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sc-top circle { fill: none; stroke-width: 3; }
.sc-top .sc-top-track { stroke: rgba(255, 255, 255, .18); }
.sc-top .sc-top-ring { stroke: var(--brand-yellow); stroke-linecap: round; transition: stroke-dashoffset 120ms linear; }
.sc-top-arrow {
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url(https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/arrow-up.svg) center/contain no-repeat;
  mask: url(https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/arrow-up.svg) center/contain no-repeat;
}
@media (max-width: 1099.98px) {
  /* Au-dessus de la barre d'actions mobile. */
  .sc-top { left: auto; right: 16px; bottom: 96px; width: 46px; height: 46px; }
}

/* Reflet lumineux qui balaie les boutons « Prise de rendez-vous » au survol. */
a[href*="monsuividietplus"][style*="border-radius:999px"] { position: relative; overflow: hidden; isolation: isolate; }
a[href*="monsuividietplus"][style*="border-radius:999px"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  transition: left 0s;
}
a[href*="monsuividietplus"][style*="border-radius:999px"]:hover::after { left: 120%; transition: left 750ms cubic-bezier(.2, .8, .2, 1); }

/* Le surligneur jaune du titre d'accueil passe à la ligne sur petit écran au lieu de déborder. */
[data-rotator] [data-rot] > span {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (max-width: 640px) {
  [data-rotator] { display: inline-grid !important; max-width: 100%; }
  [data-rotator] [data-rot] { white-space: normal !important; }
}

/* Titres : coupures de ligne équilibrées. */
h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Zoom doux des photos au survol de leur cadre. */
[style*="overflow:hidden"]:not([data-slides]) > img[style*="object-fit:cover"] {
  transition: transform 900ms cubic-bezier(.2, .8, .2, 1), filter 900ms ease;
}
@media (hover: hover) {
  [style*="overflow:hidden"]:not([data-slides]):hover > img[style*="object-fit:cover"] {
    transform: scale(1.06) !important;
    filter: saturate(1.08);
    transition: transform 900ms cubic-bezier(.2, .8, .2, 1), filter 900ms ease !important;
  }
}

/* Les photos chargées à la demande apparaissent en fondu au lieu de « clignoter ». */
img.sc-img { opacity: 0; transition: opacity 700ms ease; }
img.sc-img.is-loaded { opacity: 1; }

/* Liens dans le texte : soulignement animé. */
a[style^="color:#"] {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 350ms cubic-bezier(.2, .8, .2, 1), color 250ms;
}
a[style^="color:#"]:hover, a[style^="color:#"]:focus-visible { background-size: 100% 1.5px; }

/* Défilement fluide (Lenis) sur ordinateur. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  img.sc-img { opacity: 1; transition: none; }
  .sc-top, .sc-progress, a[href*="monsuividietplus"]::after { transition: none !important; }
}
