/**
 * Page Smoothness
 * Overrides Bootstrap :root { scroll-behavior: smooth } which causes sticky wheel scroll.
 *
 * When smoothness is enabled, JS owns animation (page-smoothness.js).
 * CSS scroll-behavior stays auto so it cannot stack with the shared controller.
 */

/* Default / disabled: native snappy scroll */
html {
  scroll-behavior: auto !important;
}

/* Soft Drift / Balanced Ease / Fluid Glide — JS controller; no CSS double-easing */
html:has(body.cplthm-smooth-soft_drift),
html:has(body.cplthm-smooth-balanced_ease),
html:has(body.cplthm-smooth-fluid_glide) {
  scroll-behavior: auto !important;
}

body.cplthm-smooth-soft_drift,
body.cplthm-smooth-balanced_ease,
body.cplthm-smooth-fluid_glide {
  overscroll-behavior-y: contain;
}

/* Balanced Ease — header offset for in-page destinations (JS reads this too) */
html:has(body.cplthm-smooth-balanced_ease) {
  scroll-padding-top: var(--cpl-overlay-header-height, 80px);
}

@media (hover: none) and (pointer: coarse) {
  body.cplthm-smooth-soft_drift,
  body.cplthm-smooth-balanced_ease,
  body.cplthm-smooth-fluid_glide {
    overscroll-behavior-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  html:has(body.cplthm-smooth-soft_drift),
  html:has(body.cplthm-smooth-balanced_ease),
  html:has(body.cplthm-smooth-fluid_glide) {
    scroll-behavior: auto !important;
  }

  body.cplthm-smooth-soft_drift,
  body.cplthm-smooth-balanced_ease,
  body.cplthm-smooth-fluid_glide {
    overscroll-behavior-y: auto;
  }
}
