/* ======================================================================
   Aperta Platform - Carousel Styles
   Path: /carousel/includes/css/carousel.css
   ====================================================================== */

/* --- Container Layout --- */
#carousel-container {
  width: 90%;
  height: 90%;
  margin: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* --- Carousel Wrapper --- */
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

/* --- Individual Slide --- */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.2s ease-in-out;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

/* --- Slide Image --- */
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  user-select: none;
}

/* --- Caption Area --- */
.caption {
  position: absolute;
  bottom: 25px;
  left: 30px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 70%;
  box-sizing: border-box;
}

.caption h3 {
  margin: 0;
  font-size: 1.6em;
  font-weight: 600;
}

.caption p {
  margin: 6px 0 0;
  font-size: 1.1em;
  line-height: 1.3em;
  opacity: 0.9;
}

/* --- Emphasis Ribbons --- */
.ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8em;
  color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Fresh (≤5 days) */
.ribbon.fresh {
  background: linear-gradient(45deg, rgba(255,77,77,0.8), rgba(255,157,0,0.8));
  animation: pulse 1.6s infinite alternate;
}

/* Recent (≤28 days) */
.ribbon.recent {
  background: rgba(255, 255, 255, 0.7);
  color: #222;
}

/* Ribbon for Learn More */
.ribbon.learn-more {
  bottom: 10px;
  right: 10px;
  top: auto;
  left: auto;
  background: linear-gradient(45deg, rgba(0,123,255,0.8), rgba(0,86,179,0.8));
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.6em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Pulse animation for “NEW” ribbon */
@keyframes pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.1); opacity: 0.85; }
}

/* --- Navigation Buttons --- */
.carousel button.prev,
.carousel button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  font-size: 2em;
  padding: 0 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
  z-index: 5;
}

.carousel button.prev:hover,
.carousel button.next:hover {
  background: rgba(0,0,0,0.6);
}

.carousel button.prev { left: 10px; }
.carousel button.next { right: 10px; }

/* --- Responsive Behavior --- */
@media (max-width: 1024px) {
  #carousel-container {
    width: 95%;
    height: 70%;
  }
  .caption {
    font-size: 0.9em;
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  #carousel-container {
    width: 100%;
    height: 65%;
  }
  .caption {
    bottom: 15px;
    left: 15px;
    padding: 10px;
  }
  .caption h3 { font-size: 1.1em; }
  .caption p { font-size: 0.85em; }
}
