/* Association Kit V0.34 — architecture de pages par régions indépendantes.
 *
 * Une page suit désormais : Hero → Section → Titre → Contenu.
 * Seul le viewport du carrousel défile horizontalement. Le titre, la section
 * et les contrôles restent dans le flux normal.
 */

body.aks-template-club.aks-club-style-editorial .aks-builder-page {
  overflow-x: clip;
}

body.aks-template-club.aks-club-style-editorial .aks-page-hero-region {
  position: relative;
  width: 100%;
  overflow: visible;
}

body.aks-template-club.aks-club-style-editorial .aks-page-section {
  position: relative;
  width: 100%;
  overflow: visible;
}

body.aks-template-club.aks-club-style-editorial .aks-page-section__inner {
  display: block;
  min-width: 0;
  overflow: visible;
}

body.aks-template-club.aks-club-style-editorial .aks-page-section__heading,
body.aks-template-club.aks-club-style-editorial .aks-page-section__content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-inline: auto;
  overflow: visible;
}

/* Largeurs indépendantes du titre et du contenu. */
body.aks-template-club.aks-club-style-editorial :is(.aks-page-section__heading--inherit,.aks-page-section__content--inherit) {
  max-width: none;
}
body.aks-template-club.aks-club-style-editorial :is(.aks-page-section__heading--narrow,.aks-page-section__content--narrow) {
  max-width: 780px;
}
body.aks-template-club.aks-club-style-editorial :is(.aks-page-section__heading--normal,.aks-page-section__content--normal) {
  max-width: 1120px;
}
body.aks-template-club.aks-club-style-editorial :is(.aks-page-section__heading--wide,.aks-page-section__content--wide) {
  max-width: 1340px;
}
body.aks-template-club.aks-club-style-editorial :is(.aks-page-section__heading--full,.aks-page-section__content--full) {
  max-width: none;
}

/* Le rythme titre/contenu appartient à la section, pas à la collection. */
body.aks-template-club.aks-club-style-editorial .aks-page-section__heading + .aks-page-section__content {
  margin-top: 28px;
}
body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--compact .aks-page-section__heading + .aks-page-section__content {
  margin-top: 16px;
}
body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--normal .aks-page-section__heading + .aks-page-section__content {
  margin-top: 28px;
}
body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--airy .aks-page-section__heading + .aks-page-section__content {
  margin-top: 44px;
}

body.aks-template-club.aks-club-style-editorial .aks-page-section__heading .aks-builder-heading,
body.aks-template-club.aks-club-style-editorial .aks-page-section__heading .aks-editorial-heading {
  max-width: 100%;
}

/* Une collection ne crée plus sa propre marge supérieure : le rythme est géré
   par la séparation Titre / Contenu. */
body.aks-template-club.aks-club-style-editorial .aks-page-section__content > .aks-builder-collection {
  margin-top: 0;
}

/* -------------------------------------------------------------------------
   Carrousel : root → viewport scrollable → track → slides → controls.
   ------------------------------------------------------------------------- */
body.aks-template-club.aks-club-style-editorial .aks-carousel,
body.aks-template-club.aks-club-style-editorial .aks-builder-collection {
  position: relative;
  min-width: 0;
  overflow: visible;
}

body.aks-template-club.aks-club-style-editorial .aks-carousel__viewport,
body.aks-template-club.aks-club-style-editorial .aks-builder-collection__viewport {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

/* Neutralise les anciennes règles qui faisaient défiler la piste elle-même. */
body.aks-template-club.aks-club-style-editorial .aks-carousel__track,
body.aks-template-club.aks-club-style-editorial .aks-builder-collection__track {
  min-width: 0;
  overflow: visible !important;
  scroll-snap-type: none !important;
}

/* Desktop : les présentations responsive restent des grilles. */
@media (min-width: 821px) {
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--responsive .aks-builder-collection__track,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--grid .aks-builder-collection__track,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--mosaic .aks-builder-collection__track {
    display: grid;
  }

  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--carousel .aks-carousel__viewport {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
  }

  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--carousel .aks-builder-collection__track {
    display: flex;
    align-items: stretch;
    gap: 20px;
    width: max-content;
    min-width: 100%;
  }

  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--carousel .aks-builder-collection__track > * {
    flex: 0 0 min(390px, 30vw);
    scroll-snap-align: start;
  }
}

/* Les cartes d'un groupe partagent la hauteur du plus grand élément de la
   ligne ou du carrousel, sans imposer cette hauteur aux autres groupes. */
body.aks-template-club.aks-club-style-editorial .aks-builder-collection--courses .aks-builder-collection__track {
  align-items: stretch;
}
body.aks-template-club.aks-club-style-editorial .aks-builder-collection--courses .aks-builder-collection__track > *,
body.aks-template-club.aks-club-style-editorial .aks-builder-collection--courses .aks-club-editorial-course-card {
  height: 100%;
}
body.aks-template-club.aks-club-style-editorial .aks-builder-collection--courses .aks-club-editorial-course-card__body {
  min-height: 100%;
}

/* Les commandes sont des enfants directs du root et ne défilent jamais. */
body.aks-template-club.aks-club-style-editorial .aks-carousel > .aks-carousel-controls {
  position: relative;
  z-index: 2;
}

/* -------------------------------------------------------------------------
   Mobile et tablette étroite.
   ------------------------------------------------------------------------- */
@media (max-width: 820px) {
  body.aks-template-club.aks-club-style-editorial .aks-page-section {
    overflow: visible !important;
  }

  body.aks-template-club.aks-club-style-editorial .aks-page-section__heading {
    position: relative;
    z-index: 2;
    overflow: visible !important;
  }

  body.aks-template-club.aks-club-style-editorial .aks-page-section__heading + .aks-page-section__content {
    margin-top: 18px;
  }
  body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--compact .aks-page-section__heading + .aks-page-section__content {
    margin-top: 10px;
  }
  body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--normal .aks-page-section__heading + .aks-page-section__content {
    margin-top: 18px;
  }
  body.aks-template-club.aks-club-style-editorial .aks-page-section-gap--airy .aks-page-section__heading + .aks-page-section__content {
    margin-top: 28px;
  }

  body.aks-template-club.aks-club-style-editorial .aks-carousel__viewport,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--responsive .aks-builder-collection__viewport,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--carousel .aks-builder-collection__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  body.aks-template-club.aks-club-style-editorial .aks-carousel__viewport::-webkit-scrollbar,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection__viewport::-webkit-scrollbar {
    display: none;
  }

  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--responsive .aks-builder-collection__track,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--carousel .aks-builder-collection__track {
    display: flex !important;
    width: 100%;
    min-width: 100%;
    align-items: stretch;
    gap: 12px !important;
    padding: 2px 30px 8px 0 !important;
  }

  /* Cours : la carte suivante reste volontairement visible. */
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--courses:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track > * {
    flex: 0 0 calc(100% - 34px) !important;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  /* Chaque slide Équipe représente déjà une page de profils. */
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--team:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track > * {
    flex: 0 0 100% !important;
    min-width: 0;
    scroll-snap-align: start;
  }

  /* Les événements restent complets pour ne pas couper les dates. */
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--events:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track {
    padding-right: 0 !important;
  }
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--events:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track > * {
    flex: 0 0 100% !important;
    min-width: 0;
    scroll-snap-align: start;
  }

  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--gallery:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track > *,
  body.aks-template-club.aks-club-style-editorial .aks-builder-collection--documents:is(.aks-builder-collection--responsive,.aks-builder-collection--carousel) .aks-builder-collection__track > * {
    flex: 0 0 calc(100% - 28px) !important;
    min-width: 0;
    scroll-snap-align: start;
  }

  body.aks-template-club.aks-club-style-editorial .aks-carousel > .aks-carousel-controls {
    margin-top: 10px !important;
  }

  /* Les titres appartiennent au header de section et ne sont jamais rognés
     par le viewport horizontal. */
  body.aks-template-club.aks-club-style-editorial .aks-page-section__heading .aks-editorial-heading,
  body.aks-template-club.aks-club-style-editorial .aks-page-section__heading .aks-editorial-heading__ghost,
  body.aks-template-club.aks-club-style-editorial .aks-page-section__heading .aks-editorial-heading__title {
    overflow: visible !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.aks-template-club.aks-club-style-editorial .aks-carousel__viewport {
    scroll-behavior: auto;
  }
}

/* Le rendu natif historique encapsule encore son contenu métier. Cette
   compatibilité reste localisée en attendant une migration dédiée. */
body.aks-template-club.aks-club-style-editorial
.aks-page-section--native_content
> .aks-page-section__inner > .aks-page-section__content {
  display: contents;
}
