/* ============================================
   WRAPPER ET CONTENEURS
   ============================================ */
.gallery {
  position: relative;
  height: 100%;
  background-color: var(--Surface-Background-Secondary-Default);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Carousel wrapper (variante embed) */
.carousel-wrapper.card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* Carousel mobile dans le contenu de la modal */
.post-modal .mobile-carousel {
  display: block;
}

/* ============================================
   CAROUSEL PRINCIPAL
   ============================================ */

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  touch-action: pan-x pinch-zoom;
}

.carousel.full-size {
  width: 100%;
  height: 100%;
}

.carousel::-webkit-scrollbar {
  display: none;
}

/* Variante embed (post-card) */
.carousel.card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: transparent;
  touch-action: pan-x pinch-zoom;
  aspect-ratio: 4 / 3;
}

/* ============================================
   SLIDES
   ============================================ */

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}

/* Variante embed - images en cover avec ratio 4:3 */
.carousel.card .carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.carousel.card .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
}

/* ============================================
   FLÈCHES DE NAVIGATION
   ============================================ */

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--Surface-Background-Tertiary-Default);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all ease-out 0.15s;
  pointer-events: auto;
  box-shadow: 0 0.5px 0.5px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px 0 rgba(27, 11, 50, 0.06);
  opacity: 0;
}

.carousel-prev svg,
.carousel-next svg {
  width: 20px;
  height: 20px;
  display: block;
}

.carousel-prev svg path,
.carousel-next svg path {
  fill: var(--Content-Information-Primary);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

.gallery:hover .carousel-prev,
.gallery:hover .carousel-next,
.carousel-wrapper.card:hover .carousel-prev,
.carousel-wrapper.card:hover .carousel-next {
  opacity: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: var(--Surface-Background-Tertiary-Hovered);
}

.carousel-wrapper.card .carousel-prev,
.carousel-wrapper.card .carousel-next {
  background-color: var(--Surface-Background-Tertiary-Default);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  box-shadow: 0 0.5px 0.5px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px 0 rgba(27, 11, 50, 0.06);
  z-index: 10;
  opacity: 0;
}

.carousel-wrapper.card .carousel-prev svg,
.carousel-wrapper.card .carousel-next svg {
  width: 20px;
  height: 20px;
}

.carousel-wrapper.card .carousel-prev svg path,
.carousel-wrapper.card .carousel-next svg path {
  fill: var(--Content-Information-Primary);
}

.carousel-wrapper.card .carousel-prev:hover,
.carousel-wrapper.card .carousel-next:hover {
  background-color: var(--Surface-Background-Tertiary-Hovered);
}

.post-modal .mobile-carousel .carousel-prev,
.post-modal .mobile-carousel .carousel-next {
  display: none;
}

/* ============================================
   INDICATEURS (DOTS)
   ============================================ */

.carousel-indicators {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
  pointer-events: auto;
}

.carousel-indicators .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all ease-out 0.15s;
  opacity: 0.5;
  pointer-events: auto;
  position: relative;
  z-index: 11;
  box-shadow: 0 0.5px 0.5px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px 0 rgba(27, 11, 50, 0.06);
}

.carousel-indicators .indicator.active {
  opacity: 1;
  background-color: var(--Content-Information-Inverted);
}

.carousel-wrapper.card .carousel-indicators {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}

.carousel-wrapper.card .carousel-indicators .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all ease-out 0.15s;
  opacity: 0.5;
  pointer-events: auto;
  position: relative;
  z-index: 11;
  box-shadow: 0 0.5px 0.5px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px 0 rgba(27, 11, 50, 0.06);
}

.carousel-wrapper.card .carousel-indicators .indicator.active {
  opacity: 1;
  background-color: var(--Content-Information-Inverted);
}

.carousel-wrapper.card:has(.carousel-slide:only-child) .carousel-prev,
.carousel-wrapper.card:has(.carousel-slide:only-child) .carousel-next,
.carousel-wrapper.card:has(.carousel-slide:only-child) .carousel-indicators {
  display: none;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media screen and (max-width: 766px) {
  .post-modal .mobile-carousel .carousel {
    touch-action: pan-x pinch-zoom;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }

  .post-modal .mobile-carousel .carousel-slide {
    pointer-events: auto;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
  }

  .post-modal .mobile-carousel .carousel-slide img {
    pointer-events: auto;
    object-fit: cover;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
  }

  .post-card .carousel-wrapper.card .carousel {
    touch-action: pan-x pinch-zoom;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }

  .post-card .carousel-wrapper.card .carousel-slide {
    pointer-events: auto;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
  }

  .post-card .carousel-wrapper.card .carousel-slide img {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
  }

  /* Styles uniquement pour les slides avec fond blanc (slides 2, 3, 4) */
  .onboarding-carousel-wrapper.slide-2 .onboarding-slide-text,
  .onboarding-carousel-wrapper.slide-3 .onboarding-slide-text {
    padding-top: 40px;
    background: linear-gradient(to top, var(--Surface-Background-Tertiary-Default) 50%, rgba(255, 255, 255, 0) 100%);
  }

}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */

@media screen and (min-width: 767px) {
  .gallery {
    display: flex;
    width: 100%;
    height: 100%;
  }

  .post-card .carousel-wrapper.card:hover .carousel-prev,
  .post-card .carousel-wrapper.card:hover .carousel-next {
    opacity: 1;
  }

  .post-modal .mobile-carousel {
    display: none;
  }

  .post-modal .gallery .carousel-prev,
  .post-modal .gallery .carousel-next {
    display: flex;
  }
}

/* ============================================
   ONBOARDING CAROUSEL
   ============================================ */

.onboarding-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.onboarding-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x pinch-zoom;
}

.onboarding-carousel::-webkit-scrollbar {
  display: none;
}

.onboarding-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 48px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 16px;
  background-color: var(--Surface-Background-Tertiary-Default);
}

.onboarding-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.onboarding-slide-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14, 7, 22, 0) 60%, rgba(14, 7, 22, 0.6) 100%);
}

.onboarding-slide-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.onboarding-slide-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  width: 100%;
}

.onboarding-title {
  text-wrap: balance;
}

.onboarding-slide:first-child .onboarding-title {
  color: var(--Content-Information-Inverted);
}

.onboarding-description {
  font-weight: var(--medium);
  font-size: 1rem;
  line-height: normal;
  color: var(--Content-Information-Secondary);
  margin: 0;
  text-wrap: balance;
}

.onboarding-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.onboarding-btn {
  margin: 0;
  cursor: pointer;
}

.onboarding-indicators {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
  width: 100%;
  justify-content: center;
  pointer-events: none;
}

.onboarding-indicators .onboarding-indicator {
  pointer-events: auto;
}

.onboarding-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all ease-out 0.15s;
  opacity: 0.5;
  box-shadow: 0 0.5px 0.5px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px 0 rgba(27, 11, 50, 0.06);
}

.onboarding-indicator.active {
  opacity: 1;
  background-color: var(--Content-Information-Inverted);
}

.onboarding-carousel-wrapper.slide-2 .onboarding-indicator.active,
.onboarding-carousel-wrapper.slide-3 .onboarding-indicator.active,
.onboarding-carousel-wrapper.slide-4 .onboarding-indicator.active {
  background-color: var(--Content-Information-Primary);
}

.onboarding-carousel-wrapper.slide-2 .onboarding-indicator:not(.active),
.onboarding-carousel-wrapper.slide-3 .onboarding-indicator:not(.active),
.onboarding-carousel-wrapper.slide-4 .onboarding-indicator:not(.active) {
  background-color: rgba(14, 7, 22, 0.5);
}

@media screen and (max-width: 767px) {
  .onboarding-slide {
    padding: 24px;
  }

  .onboarding-slide-content {
    gap: 20px;
  }
}

@media screen and (min-width: 768px) {
  .onboarding-carousel-wrapper {
    height: 100%;
  }

  .onboarding-carousel {
    height: 100%;
  }

  .onboarding-slide {
    height: 100%;
  }
}

