/* Compléments à Tailwind (CDN) */
:root {
  /* Hauteur utile du header sticky pour les ancres (évite le double décalage avec scroll-padding) */
  --header-scroll-offset: 4.25rem;
}

@media (min-width: 640px) {
  :root {
    --header-scroll-offset: 5rem; /* h-20 */
  }
}

html {
  scroll-behavior: smooth;
  /* Une seule logique d’offset : scroll-margin sur les sections cibles */
  scroll-padding-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  /* Encoche / safe area (mobile) */
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Ancre : le haut de section se cale juste sous le header (sans padding-top de section en plus) */
main > section[id] {
  scroll-margin-top: var(--header-scroll-offset);
}

/* L’accueil est en tête de page : pas de marge d’ancre */
main > section#accueil {
  scroll-margin-top: 0;
}

/* Évite le débordement horizontal des grilles de cartes */
main section .grid > * {
  min-width: 0;
}

/* Titres longs sur petits écrans */
main h2,
main h3 {
  overflow-wrap: break-word;
}

/* Sous-menu « Notre offre » : visible au survol ou au focus clavier (sans clic obligatoire) */
.nav-dropdown-flyout {
  display: none;
}

@media (min-width: 1024px) {
  [data-nav-dropdown]:hover .nav-dropdown-flyout,
  [data-nav-dropdown]:focus-within .nav-dropdown-flyout {
    display: block;
  }
}

[data-nav-dropdown].is-open .nav-dropdown-flyout {
  display: block;
}
