/* media-carousel — plein viewport, dots pagination, image + mp4/webm/ogg */
.lws-media-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  background-color: transparent;
  overflow: visible;
  line-height: 0;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  padding: clamp(3.5rem, 8vh, 5rem) clamp(1rem, 3vw, 2.5rem) clamp(2rem, 4vh, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lws-media-carousel .hdc-root {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.lws-media-carousel .hdc-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-height: 0;
  aspect-ratio: var(--hdc-aspect, 16/9);
  max-height: min(var(--hdc-max-height, 100vh), 85vh);
  border-radius: var(--hdc-radius, 8px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  background: transparent;
}

.lws-media-carousel .hdc-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  max-width: 100%;
  align-items: center;
}

.lws-media-carousel .hdc-slide {
  min-width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  flex-shrink: 0;
  height: 100%;
}

.lws-media-carousel .hdc-slide img,
.lws-media-carousel .hdc-slide video {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  max-height: none;
  box-sizing: border-box;
}

.lws-media-carousel .hdc-slide video {
  background-color: transparent;
  cursor: pointer;
}

.lws-media-carousel .hdc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  width: clamp(36px, 4vw, 52px);
  height: clamp(36px, 4vw, 52px);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  margin: 0;
}

.lws-media-carousel .hdc-root.loaded .hdc-arrow { display: flex; }

.lws-media-carousel .hdc-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.08);
}

.lws-media-carousel .hdc-prev { left: clamp(10px, 1.5vw, 22px); }
.lws-media-carousel .hdc-next { right: clamp(10px, 1.5vw, 22px); }

/* Dots : même principe fiches podcast — indiquent le nombre de médias */
.lws-media-carousel .hdc-dots {
  position: relative;
  margin-top: clamp(14px, 2vw, 22px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1vw, 12px);
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 0.35rem 0.5rem;
  line-height: normal;
  opacity: 0;
  transition: opacity 0.3s;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.lws-media-carousel .hdc-root.loaded .hdc-dots { opacity: 1; }

.lws-media-carousel .hdc-dot {
  width: clamp(9px, 1.1vw, 12px);
  height: clamp(9px, 1.1vw, 12px);
  background-color: var(--hdc-dot-idle, #6b5e66);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
  border: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.lws-media-carousel .hdc-dot:hover { background-color: var(--hdc-accent-hover, #E8C070); }
.lws-media-carousel .hdc-dot.active {
  background-color: var(--hdc-accent, #DBAF5C);
  transform: scale(1.25);
}

.lws-media-carousel .hdc-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #808080;
  font-size: clamp(12px, 1.5vw, 16px);
  z-index: 5;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .lws-media-carousel {
    min-height: 0;
    padding: clamp(1.5rem, 4vh, 2.5rem) 0 clamp(1.25rem, 3vh, 2rem);
    background-color: transparent;
  }

  .lws-media-carousel .hdc-root {
    max-width: 100%;
  }

  .lws-media-carousel .hdc-viewport {
    min-height: 0;
    max-height: none;
    aspect-ratio: var(--hdc-aspect, 16/9);
    border-radius: 0;
    background: transparent;
  }

  .lws-media-carousel .hdc-slide img,
  .lws-media-carousel .hdc-slide video {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }

  .lws-media-carousel .hdc-prev { left: 0.65rem; }
  .lws-media-carousel .hdc-next { right: 0.65rem; }

  .lws-media-carousel .hdc-dots {
    margin-top: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lws-media-carousel .hdc-track { transition: none; }
  .lws-media-carousel .hdc-dot { transition: none; }
}
