/* ==========================================================================
   site.css — Améliorations responsive, animations et accessibilité
   Serena Sun — Centre esthétique à Sanary-sur-Mer
   ========================================================================== */

/* ── Défilement fluide & décalage des ancres ────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* Évite que la navbar fixe cache les titres des sections */
section[id],
footer[id] {
  scroll-margin-top: 105px;
}

/* ── Navigation mobile : glissement depuis le haut ──────────────────────── */
/*
 * On remplace le basculement display:none/flex (non animable) par une
 * transition opacity + transform. Le menu reste dans le flux (display:flex)
 * mais est invisible via opacity/visibility jusqu'à l'ouverture.
 */
@media screen and (max-width: 991px) {
  .w-nav[data-collapse='medium'] .w-nav-menu {
    display: flex !important;       /* annule le display:none de webflow.css */
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 1000;
    background-color: var(--navy, #07394c);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
  }

  .w-nav[data-collapse='medium'] .w-nav-menu.w--nav-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Liens du menu mobile : cible tactile ≥ 44 px + séparateurs discrets */
  .w-nav-menu .navlinks {
    display: block;
    min-height: 44px;
    padding: 12px 20px;
    line-height: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .w-nav-menu .navlinks:last-child {
    border-bottom: none;
  }
}

/* ── Hamburger : caché sur desktop, zone tactile agrandie sur mobile ────── */
@media screen and (min-width: 992px) {
  .menu-button.w-nav-button {
    display: none !important;
  }
}

@media screen and (max-width: 991px) {
  .menu-button.w-nav-button {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Galerie : zoom + voile navy au survol ──────────────────────────────── */
.gallery-lightbox {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: 7px;
  cursor: pointer;
}

.gallery-image {
  transition: transform 0.4s ease;
  display: block;
  width: 100%;
  height: 100%;
}

/* Voile navy semi-transparent au survol */
.gallery-lightbox::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(7, 57, 76, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 7px;
}

@media (hover: hover) {
  .gallery-lightbox:hover .gallery-image {
    transform: scale(1.06);
  }

  .gallery-lightbox:hover::after {
    opacity: 1;
  }
}

/* ── Cartes services : élévation au survol ──────────────────────────────── */
.service-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(7, 57, 76, 0.15);
    border-color: var(--aqua, #b8cdcf);
  }
}

/* ── Cartes expertise : élévation au survol ─────────────────────────────── */
.expertise-core-content-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .expertise-core-content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }
}

/* ── FAQ accordéon : animation max-height ───────────────────────────────── */
/*
 * Webflow masque les listes déroulantes via display:none.
 * On annule ce comportement et on utilise max-height pour une transition fluide.
 */
.dropdown .w-dropdown-list {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.dropdown .w-dropdown-list.w--open {
  max-height: 500px;  /* valeur supérieure à la hauteur maximale attendue */
}

/* Icône flèche : rotation à l'ouverture */
.dropdown-toggle.w--open .icon-2 {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.dropdown-toggle .icon-2 {
  transition: transform 0.3s ease;
}

/* ── Onglets : transition de fondu ──────────────────────────────────────── */
/*
 * Le fondu est géré en JS (opacity inline) — ce sélecteur assure que la
 * transition CSS est disponible pour les éléments nouvellement affichés.
 */
.w-tab-pane {
  transition: opacity 0.3s ease;
}

/* ── Focus visible (accessibilité clavier) ──────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--aqua, #b8cdcf);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Les composants Webflow désactivent outline par défaut — on le rétablit */
.w-nav-button:focus-visible,
.w-tab-link:focus-visible,
.w-dropdown-toggle:focus-visible,
.w-button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--aqua, #b8cdcf);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Cibles tactiles : minimum 44 × 44 px ──────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .button,
  .w-button,
  .link-button,
  .tablink,
  .w-tab-link,
  .w-dropdown-toggle,
  .w-nav-button {
    min-height: 44px;
  }
}

/* ── Boutons CTA footer : pleine largeur sur très petits écrans ─────────── */
@media screen and (max-width: 479px) {
  .cta-wrapper .button {
    display: block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Corrections mobile (≤ 767px) ───────────────────────────────────────── */
@media screen and (max-width: 767px) {

  /* Lignes de séparation pleine largeur dans la section about
   * (qui a un padding horizontal de 4vw à ce breakpoint) */
  .about-section > .div-block-12 {
    margin-left: -4vw;
    margin-right: -4vw;
    width: calc(100% + 8vw);
  }

  /* Hero : rapproche le H1 du paragraphe (layout était space-between) */
  .hero-core {
    justify-content: center;
    gap: 4vh;
    padding-top: 90px; /* laisse de la place pour la navbar (105px) */
  }

  .hero-header {
    margin-top: 0; /* annule le margin-top: 150px du CSS Webflow */
  }

  /* Footer : aligne les blocs sur toute la largeur */
  .footer-flex {
    align-items: stretch;
  }

  .cta-wrapper {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .footer-menu-grid {
    width: 100%;
  }

  .footer-menu-flex {
    align-items: flex-start;
  }

  /* Annule le justify-self: center des w-node (webflow CSS l. 1961)
   * qui centre les blocs Navigation / Coordonnées dans la grille */
  #w-node-_9b1a09f7-039e-7d35-4a09-96b36a2132de-b10465bc,
  #w-node-_9b1a09f7-039e-7d35-4a09-96b36a2132e8-b10465bc {
    justify-self: stretch;
    text-align: left;
  }
}

/* ── Hero : position de fond corrigée sur mobile ────────────────────────── */
@media screen and (max-width: 479px) {
  .hero-section {
    background-position: 0 0, 50% 0;
  }
}
