/* 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: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.lws-media-carousel .hdc-dot:hover { background-color: #DBAF5C; border-color: #DBAF5C; }
.lws-media-carousel .hdc-dot.active {
  background-color: #C7BBB3;
  border-color: #C7BBB3;
  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; }
}

.lws-media-carousel--embedded {
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.lws-media-carousel--embedded .hdc-root {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: stretch;
  justify-content: stretch;
}
.lws-media-carousel--embedded .hdc-viewport {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  padding: 0;
  box-sizing: border-box;
}
.lws-media-carousel--embedded .hdc-slide {
  overflow: hidden;
}
.lws-media-carousel--embedded .hdc-slide img,
.lws-media-carousel--embedded .hdc-slide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  background: #111111;
}
.lws-media-carousel--embedded .hdc-dots {
  display: none;
}
.lws-media-carousel--embedded .hdc-toolbar {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 4px 4px;
  flex-shrink: 0;
}
.lws-media-carousel--embedded .hdc-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
  overflow: visible;
  line-height: 0;
}
@media (max-width: 899px) {
  .lws-media-carousel--embedded .hdc-thumbs {
    flex-wrap: nowrap;
    justify-content: safe center;
    overflow-x: auto;
    max-height: 48px;
  }
}
.lws-media-carousel--embedded .hdc-toolbar > .hdc-arrow {
  position: static;
  transform: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
}
.lws-media-carousel--embedded .hdc-toolbar > .hdc-arrow:hover {
  transform: scale(1.08);
}
.lws-media-carousel--embedded .hdc-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  position: relative;
}
.lws-media-carousel--embedded .hdc-thumb.active {
  border-color: #DBAF5C;
}
.lws-media-carousel--embedded .hdc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lws-media-carousel--embedded .hdc-thumb-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 4px;
  color: #DBAF5C;
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
}
.hdc-thumb-eye {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(24, 20, 22, 0.55);
  border-radius: inherit;
  pointer-events: none;
}
.hdc-thumb.active .hdc-thumb-eye {
  display: flex;
}
.hdc-thumb-eye .lws-lucide {
  color: #ffffff;
  width: 18px;
  height: 18px;
}
.lws-media-carousel .hdc-expand,
.lws-media-carousel .hdc-close {
  position: absolute;
  z-index: 4;
  top: 0.65rem;
  right: 0.65rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #f4efe8;
  background: rgba(24, 20, 22, 0.85);
  cursor: pointer;
}
.lws-media-carousel .hdc-close[hidden] {
  display: none;
}
.lws-media-carousel--embedded .hdc-viewport .hdc-expand {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}
.lws-media-carousel.is-expanded .hdc-expand {
  display: none;
}
.lws-media-carousel.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-height: 100svh;
  margin: 0;
  padding: 3.5rem 1.25rem 1.25rem;
  background: #111111;
}
.lws-media-carousel--embedded.is-expanded .hdc-viewport {
  max-height: calc(100svh - 8rem);
}
