/**
 * Edusex — améliorations visuelles page d'accueil (CSS uniquement).
 * Activé uniquement avec body.edusex-home (voir enhancements.js).
 * (Plus Jakarta Sans est déjà chargée dans index.css.)
 */

/* -------------------------------------------------------------------------- */
/* Global (home only)                                                        */
/* -------------------------------------------------------------------------- */

body.edusex-home {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

/* Scrollbar (global OK — léger impact hors home) */
html {
  scrollbar-width: thin;
  scrollbar-color: #3498db #f0f0f0;
}

html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: #f0f0f0;
}

html::-webkit-scrollbar-thumb {
  background: #3498db;
  border-radius: 999px;
}

/* -------------------------------------------------------------------------- */
/* Navbar — .scrolled ajouté par JS                                           */
/* -------------------------------------------------------------------------- */

nav.fixed.top-0.left-0.right-0.z-50 {
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease;
}

nav.fixed.top-0.left-0.right-0.z-50.scrolled {
  background-color: rgba(255, 255, 255, 0.92) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* -------------------------------------------------------------------------- */
/* Scroll reveal — sections                                                   */
/* -------------------------------------------------------------------------- */

body.edusex-home main > section {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.65s ease-out,
    transform 0.65s ease-out;
  transition-delay: var(--edusex-reveal-delay, 0s);
}

body.edusex-home main > section.edusex-in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger : grilles et cartes à l'intérieur des sections visibles */
body.edusex-home main > section:not(:first-of-type):not(.edusex-in-view) .grid > * {
  opacity: 0;
  transform: translateY(18px);
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > * {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.55s ease-out,
    transform 0.55s ease-out;
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > *:nth-child(1) {
  transition-delay: 0.05s;
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > *:nth-child(2) {
  transition-delay: 0.12s;
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > *:nth-child(3) {
  transition-delay: 0.19s;
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > *:nth-child(4) {
  transition-delay: 0.26s;
}

body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > *:nth-child(n + 5) {
  transition-delay: 0.33s;
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* DOM : body.edusex-home main > section:first-of-type                       */
/*       = section.relative.isolate.overflow-hidden (Index.tsx)             */
/*       3ᵉ enfant direct = div.mx-auto.max-w-7xl…relative (contenu + grille)  */
/* -------------------------------------------------------------------------- */

@keyframes edusex-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fond hero + motif ::before (z-0) ; contenu principal au-dessus (z-1) */
body.edusex-home main > section:first-of-type {
  background: linear-gradient(135deg, #ebf3fb 0%, #fafcff 60%, #eaf4fb 100%);
}

body.edusex-home main > section:first-of-type::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2.5' cy='2.5' r='1.15' fill='%231a5276'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

body.edusex-home main > section:first-of-type > div:nth-child(1),
body.edusex-home main > section:first-of-type > div:nth-child(2) {
  z-index: 0;
}

body.edusex-home main > section:first-of-type > div.max-w-7xl.relative {
  position: relative;
  z-index: 1;
}

/* !important : enhancements.css est chargé avant le CSS Vite — nécessaire pour gagner sur Tailwind */
body.edusex-home main > section:first-of-type .animate-slide-up h1 {
  font-size: clamp(2.15rem, 4.8vw, 3.35rem) !important;
  font-weight: 800 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.03em;
  color: #0a1f3c !important;
  animation: edusex-fadeInUp 0.8s ease-out both;
}

body.edusex-home main > section:first-of-type .animate-slide-up h1 span.font-semibold.text-primary {
  color: #1a6fc4 !important;
}

body.edusex-home main > section:first-of-type .animate-slide-up > p:nth-of-type(1) {
  color: #2c3e50 !important;
  font-size: 1.05rem !important;
  line-height: 1.8 !important;
  animation: edusex-fadeInUp 0.8s ease-out 0.12s both;
}

body.edusex-home main > section:first-of-type .animate-slide-up > p:nth-of-type(2) {
  color: #34495e !important;
  border-left: 4px solid #1a6fc4;
  background: rgba(26, 111, 196, 0.06);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

body.edusex-home main > section:first-of-type .hidden.lg\:block .rounded-2xl.bg-stone-100 {
  border-radius: 1.35rem;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.075);
  transition: box-shadow 0.4s ease;
}

body.edusex-home main > section:first-of-type .lg\:hidden .rounded-2xl.bg-stone-100 {
  border-radius: 1.25rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.07);
}

/*
 * CTA : HomeConfiguredButton (asChild) rend un <a> directement sous div.mb-8.flex
 * (pas de <a> imbriqué — éviter :nth-child(2) a qui ne matche jamais).
 */
body.edusex-home main > section:first-of-type .animate-slide-up > div.mb-8.flex > :first-child {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

body.edusex-home main > section:first-of-type .animate-slide-up > div.mb-8.flex > :first-child:hover {
  transform: scale(1.03);
}

/* CTA secondaire « En savoir plus » — 2ᵉ enfant du bloc flex */
body.edusex-home main > section:first-of-type .animate-slide-up > div.mb-8.flex > :nth-child(2) {
  border: 2px solid #1a6fc4;
  color: #1a6fc4;
  background: transparent;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.3s ease;
}

body.edusex-home main > section:first-of-type .animate-slide-up > div.mb-8.flex > :nth-child(2):hover {
  background: #1a6fc4;
  color: #ffffff;
  border-color: #1a6fc4;
}

/* -------------------------------------------------------------------------- */
/* Statistiques                                                               */
/* -------------------------------------------------------------------------- */

body.edusex-home main section.edusex-stats-section {
  background: linear-gradient(135deg, #ebf5fb, #d6eaf8) !important;
  padding-top: 60px !important;
  padding-bottom: 60px !important;
  border-color: transparent !important;
}

body.edusex-home main section.edusex-stats-section > div.pointer-events-none {
  opacity: 0.5;
}

body.edusex-home main section.edusex-stats-section .grid > div {
  background: #fff !important;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 30px !important;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

body.edusex-home main section.edusex-stats-section .grid > div:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

body.edusex-home main section.edusex-stats-section .tabular-nums {
  color: #1a5276 !important;
  font-size: 2.5rem !important;
  font-weight: 800 !important;
}

body.edusex-home main section.edusex-stats-section .tabular-nums.edusex-counting {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------- */
/* Approche pédagogique (features)                                            */
/* -------------------------------------------------------------------------- */

body.edusex-home main section.edusex-pedagogy-section h2 {
  position: relative;
  font-size: 2rem !important;
  font-weight: 700 !important;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem !important;
}

body.edusex-home main section.edusex-pedagogy-section h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 60px;
  height: 3px;
  margin-left: -30px;
  background: #3498db;
  border-radius: 2px;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group {
  transition: all 0.3s ease;
  position: relative;
  border-top: 3px solid transparent;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(1) {
  border-top-color: #3498db;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(2) {
  border-top-color: #2ecc71;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(3) {
  border-top-color: #e74c3c;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(4) {
  border-top-color: #f39c12;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

body.edusex-home main section.edusex-pedagogy-section .group .mb-5.flex.h-16.w-16 {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

body.edusex-home main section.edusex-pedagogy-section .group .mb-5.flex.h-16.w-16::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  z-index: -1;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.35), rgba(26, 82, 118, 0.2));
  padding: 12px;
  box-sizing: content-box;
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(2) .mb-5.flex.h-16.w-16::before {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.4), rgba(26, 82, 118, 0.15));
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(3) .mb-5.flex.h-16.w-16::before {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.35), rgba(243, 156, 18, 0.2));
}

body.edusex-home main section.edusex-pedagogy-section .grid.gap-6 > div.group:nth-child(4) .mb-5.flex.h-16.w-16::before {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.45), rgba(52, 152, 219, 0.2));
}

/* -------------------------------------------------------------------------- */
/* Audiences — parcours                                                       */
/* -------------------------------------------------------------------------- */

@keyframes edusex-fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes edusex-fadeInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body.edusex-home main section.edusex-audiences-section.edusex-in-view .grid.gap-14 > div:first-child.edusex-audiences-text {
  animation: edusex-fadeInLeft 0.75s ease-out both;
}

body.edusex-home main section.edusex-audiences-section.edusex-in-view .edusex-audiences-visual.edusex-parallax-ready {
  animation: edusex-fadeInRight 0.75s ease-out both;
}

body.edusex-home main section.edusex-audiences-section .group.flex.items-start.gap-4.rounded-2xl {
  border-left: 4px solid #3498db;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

body.edusex-home main section.edusex-audiences-section .group.flex.items-start.gap-4.rounded-2xl:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

body.edusex-home main section.edusex-audiences-section .edusex-audiences-visual [class*="rounded-[1.75rem]"] {
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* -------------------------------------------------------------------------- */
/* Footer CTA                                                                 */
/* -------------------------------------------------------------------------- */

body.edusex-home main section.edusex-footer-cta-section [class*="rounded-[2rem]"][class*="bg-gradient-hero"] {
  position: relative;
  overflow: hidden;
}

body.edusex-home main section.edusex-footer-cta-section [class*="rounded-[2rem]"][class*="bg-gradient-hero"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Ccircle cx='20' cy='30' r='28' fill='%23ffffff'/%3E%3Ccircle cx='90' cy='95' r='40' fill='%23ffffff'/%3E%3Cpath d='M0 80 Q40 60 80 80 T120 70 L120 120 L0 120 Z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: 280px 280px;
}

body.edusex-home main section.edusex-footer-cta-section [class*="rounded-[2rem]"] > .relative.mx-auto {
  position: relative;
  z-index: 2;
}

@keyframes edusex-pulse-soft {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

body.edusex-home main section.edusex-footer-cta-section .max-w-3xl .flex.justify-center > a:first-of-type {
  font-size: 1.05rem !important;
  padding: 16px 40px !important;
  border-radius: 50px !important;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
  animation: edusex-pulse-soft 3s ease-in-out infinite;
}

body.edusex-home main section.edusex-footer-cta-section .max-w-3xl .flex.justify-center > a:first-of-type:hover {
  background-color: #fff !important;
  color: #1a5276 !important;
  transform: scale(1.05);
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body.edusex-home main > section,
  body.edusex-home main > section.edusex-in-view .grid > *,
  body.edusex-home main > section:first-of-type .animate-slide-up h1,
  body.edusex-home main > section:first-of-type .animate-slide-up > p:nth-of-type(1),
  body.edusex-home main section.edusex-footer-cta-section .max-w-3xl .flex.justify-center > a:first-of-type {
    animation: none !important;
    transition: none !important;
  }

  body.edusex-home main > section {
    opacity: 1 !important;
    transform: none !important;
  }

  body.edusex-home main > section:not(:first-of-type):not(.edusex-in-view) .grid > *,
  body.edusex-home main > section:not(:first-of-type).edusex-in-view .grid > * {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0s !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Hero — trust line (icône)                                                    */
/* -------------------------------------------------------------------------- */

/* Icônes : classe Tailwind text-success/90, pas .text-success seul */
body.edusex-home main > section:first-of-type .animate-slide-up div.border-t .inline-flex svg {
  color: hsl(var(--success));
}
