/*
 * NutritionTV — Performance Booster
 * CSS scoping: applies only when html.ntv-perf-lite is present.
 */

/* Respect system preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

html.ntv-perf-lite {
  scroll-behavior: auto !important;
}

/* 1) Fluidité: réduire animations/transitions (sans casser le JS qui écoute transitionend) */
html.ntv-perf-lite *,
html.ntv-perf-lite *::before,
html.ntv-perf-lite *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* 2) Reveal/IO animations: forcer visible + neutraliser transform */
html.ntv-perf-lite .reveal,
html.ntv-perf-lite .ntv-reveal,
html.ntv-perf-lite .is-reveal,
html.ntv-perf-lite [data-reveal],
html.ntv-perf-lite [data-animate],
html.ntv-perf-lite .ntv-anim {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* 3) Effets coûteux (blur/backdrop-filter, gros shadows) */
html.ntv-perf-lite .ntv-topbar,
html.ntv-perf-lite .ntv-header,
html.ntv-perf-lite .ntv-nav,
html.ntv-perf-lite .glass,
html.ntv-perf-lite .ntv-glass {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html.ntv-perf-lite .ntv-card,
html.ntv-perf-lite .card,
html.ntv-perf-lite [class*="card"],
html.ntv-perf-lite [class*="shadow"],
html.ntv-perf-lite [class*="stage"],
html.ntv-perf-lite [class*="panel"] {
  box-shadow: none !important;
}

html.ntv-perf-lite [style*="backdrop-filter"],
html.ntv-perf-lite [style*="filter:"],
html.ntv-perf-lite [style*="box-shadow"] {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* 4) Gains scroll: content-visibility pour sections longues (activé via class html.ntv-perf-cv) */
@supports (content-visibility: auto) {
  html.ntv-perf-cv main > section,
  html.ntv-perf-cv .ntv-section,
  html.ntv-perf-cv section {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}
