/**
 * M1Press Slider & Video Styles
 * Styles pour les shortcodes slider et video
 */

/* ==========================================================================
   SLIDER STYLES
   ========================================================================== */

.m1press-slider {
  position: relative;
  width: 100%;
  margin: 2rem 0;
}

.m1press-slider .swiper {
  width: 100%;
  overflow: hidden;
}

.m1press-slider .swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.m1press-slider .swiper-slide {
  height: auto;
  display: flex;
  flex-direction: column;
}

/* Navigation buttons */
.m1press-slider .swiper-button-prev,
.m1press-slider .swiper-button-next {
  color: var(--primary-color, #007bff);
  width: 44px;
  height: 44px;
}

.m1press-slider .swiper-button-prev:after,
.m1press-slider .swiper-button-next:after {
  font-size: 24px;
  font-weight: bold;
}

/* Pagination dots */
.m1press-slider .swiper-pagination {
  position: relative;
  margin-top: 1rem;
}

.m1press-slider .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: #ccc;
  opacity: 1;
  transition: all 0.3s ease;
}

.m1press-slider .swiper-pagination-bullet-active {
  background: var(--primary-color, #007bff);
  width: 24px;
  border-radius: 6px;
}

/* Slider de logos */
.slider_logo_marques .slider-image-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.slider_logo_marques img {
  max-width: 100%;
  height: auto;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.slider_logo_marques a:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Slider content (avec cards) */
.slider_content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   VIDEO STYLES
   ========================================================================== */

.m1press-video-wrapper {
  margin: 2rem 0;
  width: 100%;
}

/* Responsive video container (16:9) */
.video-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
}

.video-responsive.ratio-4-3 {
  padding-bottom: 75%; /* 4:3 ratio */
}

.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Video file (non-embed) */
.m1press-video-file {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Fallback et erreurs */
.m1press-video-fallback,
.m1press-video-error {
  padding: 2rem;
  text-align: center;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 4px;
}

.m1press-video-fallback a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color, #007bff);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.m1press-video-fallback a:hover {
  background: var(--primary-color-dark, #0056b3);
}

.m1press-video-error {
  color: #d9534f;
  background: #f2dede;
  border-color: #ebccd1;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .m1press-slider .swiper-button-prev,
  .m1press-slider .swiper-button-next {
    width: 32px;
    height: 32px;
  }
  
  .m1press-slider .swiper-button-prev:after,
  .m1press-slider .swiper-button-next:after {
    font-size: 18px;
  }
  
  .slider_logo_marques .slider-image-item {
    padding: 0.5rem;
  }
}

/* ==========================================================================
   COMPATIBILITÉ AVEC LE THÈME
   ========================================================================== */

/* Si Swiper.js n'est pas chargé, afficher les slides en grille */
.m1press-slider:not(.swiper-initialized) .swiper-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.m1press-slider:not(.swiper-initialized) .swiper-slide {
  width: auto !important;
}

.m1press-slider:not(.swiper-initialized) .swiper-button-prev,
.m1press-slider:not(.swiper-initialized) .swiper-button-next,
.m1press-slider:not(.swiper-initialized) .swiper-pagination {
  display: none;
}
