/**
 * Galeries DZS Video Gallery : ratio 16/9, contrôles utilisables sur mobile.
 */

/* Conteneur : hauteur auto pour laisser place aux vignettes sous le lecteur */
.entry-content .videogallery-con,
.im-premium-shell .im-premium-activity-body .videogallery-con {
  width: min(100%, 42rem) !important;
  max-width: 42rem !important;
  height: auto !important;
  max-height: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
  border-radius: 16px !important;
}

.entry-content .videogallery,
.im-premium-shell .im-premium-activity-body .videogallery {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  border-radius: 16px !important;
}

/* Zone vidéo : 16/9 */
.entry-content .videogallery .sliderMain,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  max-height: none !important;
  overflow: hidden !important;
  position: relative !important;
  background: #000;
  border-radius: 16px 16px 0 0;
}

.entry-content .videogallery .sliderMain > .sliderCon,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain > .sliderCon {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.entry-content .videogallery .sliderMain .vplayer,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain .vplayer {
  width: 100% !important;
  height: 100% !important;
}

.entry-content .videogallery .sliderMain .vplayer.currItem,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain .vplayer.currItem {
  opacity: 1 !important;
  visibility: visible !important;
}

.entry-content .videogallery .sliderMain video,
.entry-content .videogallery .sliderMain iframe,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain video,
.im-premium-shell .im-premium-activity-body .videogallery .sliderMain iframe {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Barre de contrôle au-dessus des vignettes */
.entry-content .videogallery .vplayer .controls,
.im-premium-shell .im-premium-activity-body .videogallery .vplayer .controls {
  z-index: 30 !important;
  pointer-events: auto !important;
  min-height: 2.75rem;
  height: auto !important;
}

.entry-content .videogallery .vplayer .vp-inner .pauseSimple,
.entry-content .videogallery .vplayer .vp-inner .playSimple,
.im-premium-shell .im-premium-activity-body .videogallery .vplayer .vp-inner .pauseSimple,
.im-premium-shell .im-premium-activity-body .videogallery .vplayer .vp-inner .playSimple {
  pointer-events: auto !important;
  touch-action: manipulation;
}

.entry-content .videogallery .main-navigation.menu-bottom,
.im-premium-shell .im-premium-activity-body .videogallery .main-navigation.menu-bottom {
  position: relative;
  z-index: 5;
}

@media (max-width: 920px) {
  body.page:not(.home) .entry-content .videogallery-con,
  body.page:not(.home) .entry-content .videogallery,
  .im-premium-shell .im-premium-activity-body .videogallery-con,
  .im-premium-shell .im-premium-activity-body .videogallery {
    width: calc(100% - 2 * var(--im-page-mobile-pad, 0.65rem)) !important;
    max-width: calc(100% - 2 * var(--im-page-mobile-pad, 0.65rem)) !important;
  }

  /*
   * Vidéos auto-hébergées (ex. Le Chant des Cerises) :
   * contrôles natifs iOS/Android plus fiables que le skin custom.
   */
  .videogallery .vplayer.im-mobile-native-controls .controls,
  .videogallery .vplayer.im-mobile-native-controls .big-play-btn,
  .videogallery .vplayer.im-mobile-native-controls .video-overlay,
  .videogallery .vplayer.im-mobile-native-controls .cover-image {
    display: none !important;
    pointer-events: none !important;
  }

  .videogallery .vplayer.im-mobile-native-controls video {
    pointer-events: auto !important;
    object-fit: contain;
    background: #000;
  }
}
