/* ====================================
   CAROUSEL CONTAINER
   ==================================== */
#ps-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f5f5f5;
}

/* ====================================
   CAROUSEL INNER & ITEMS
   ==================================== */
.ps-carousel-inner {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.ps-carousel-item {
  position: relative;
  display: none;
  width: 100%;
  transition: transform 0.6s ease-in-out;
}

.ps-carousel-item.active {
  display: block;
}

.ps-carousel-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ====================================
   FIGURE & IMAGE
   ==================================== */
.ps-carousel-figure {
  position: relative;
  margin: 0;
  width: 100%;
  height: 0;
  padding-bottom: 30.63%; /* Ratio 1110/340 pour maintenir les proportions */
  overflow: hidden;
}

.ps-carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ====================================
   CAPTION (Titre et Description)
   ==================================== */
.ps-carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 60px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  color: #fff;
  text-align: left;
  z-index: 2;
}

.ps-carousel-title {
  margin: 0 0 15px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.ps-carousel-description {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ====================================
   INDICATORS (Points de navigation)
   ==================================== */
.ps-carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ps-carousel-indicators li {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ps-carousel-indicators li:hover {
  background-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.ps-carousel-indicators li.active {
  background-color: #fff;
  border-color: #fff;
  transform: scale(1.2);
}

/* ====================================
   CONTROLS (Flèches de navigation)
   ==================================== */
.ps-carousel-direction {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.ps-carousel-control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin: 0 15px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  pointer-events: all;
  z-index: 10;
}

.ps-carousel-control:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  color: #fff;
}

.ps-carousel-control:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ps-carousel-icon-prev,
.ps-carousel-icon-next {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-carousel-icon-prev i,
.ps-carousel-icon-next i {
  font-size: 28px;
  line-height: 1;
}

/* ====================================
   ANIMATIONS
   ==================================== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.ps-carousel-item.next,
.ps-carousel-item.active.right {
  animation: slideInRight 0.6s ease-in-out;
}

.ps-carousel-item.prev,
.ps-carousel-item.active.left {
  animation: slideInLeft 0.6s ease-in-out;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

/* Tablettes */
@media (max-width: 992px) {
  .ps-carousel-caption {
    padding: 30px 40px;
  }
  
  .ps-carousel-title {
    font-size: 2rem;
  }
  
  .ps-carousel-description {
    font-size: 1rem;
  }
  
  .ps-carousel-control {
    width: 45px;
    height: 45px;
    margin: 0 10px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .ps-carousel-figure {
    padding-bottom: 50%; /* Ratio plus carré sur mobile */
  }
  
  .ps-carousel-caption {
    padding: 20px 25px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  }
  
  .ps-carousel-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  .ps-carousel-description {
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .ps-carousel-control {
    width: 40px;
    height: 40px;
    margin: 0 5px;
  }
  
  .ps-carousel-icon-prev i,
  .ps-carousel-icon-next i {
    font-size: 24px;
  }
  
  .ps-carousel-indicators {
    bottom: 10px;
    gap: 8px;
  }
  
  .ps-carousel-indicators li {
    width: 10px;
    height: 10px;
  }
  
  /* Masquer les flèches sur très petits écrans si nécessaire */
  .hidden-xs {
    display: none !important;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .ps-carousel-caption {
    padding: 15px 20px;
  }
  
  .ps-carousel-title {
    font-size: 1.2rem;
  }
  
  .ps-carousel-description {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }
}

/* ====================================
   ACCESSIBILITÉ
   ==================================== */
@media (prefers-reduced-motion: reduce) {
  .ps-carousel-item,
  .ps-carousel-control,
  .ps-carousel-indicators li {
    transition: none;
  }
  
  @keyframes slideInRight,
  @keyframes slideInLeft {
    from, to {
      transform: translateX(0);
    }
  }
}

/* Focus visible pour l'accessibilité au clavier */
.ps-carousel-control:focus-visible,
.ps-carousel-indicators li:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ====================================
   EFFET HOVER SUR L'IMAGE
   ==================================== */
.ps-carousel-item:hover .ps-carousel-image {
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.ps-carousel-image {
  transition: transform 0.3s ease;
}