/* 
 * Carousel Styles for Stradiax Website
 * Contains all styles related to carousels and sliders
 */

/* === Standard Carousel Styles === */
.carousel .carousel-item img {
  height: 340px;
  object-fit: cover;
}

.carousel .carousel-item .position-absolute {
  z-index: 2;
}

.carousel .carousel-item .rounded-3 {
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Carousel text overlay styles */
.carousel-caption, 
.carousel-text-overlay {
  background: rgba(0, 0, 0, 0.60);
  color: #fff;
  padding: 1.25rem 2rem;
  border-radius: 0.5rem;
  max-width: 80vw;
  left: 2rem;
  bottom: 2rem;
  position: absolute;
}

.carousel-caption h2, 
.carousel-text-overlay h2,
.carousel-caption span, 
.carousel-text-overlay span,
.carousel-caption .fw-semibold, 
.carousel-text-overlay .fw-semibold,
.carousel-caption .text-secondary, 
.carousel-text-overlay .text-secondary,
.carousel-caption .text-muted, 
.carousel-text-overlay .text-muted {
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.33);
}

.carousel-caption span, 
.carousel-text-overlay span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #ffe082 !important;
  display: block;
  margin-bottom: 0.5rem;
}

.carousel-caption .text-secondary, 
.carousel-text-overlay .text-secondary {
  color: #b3e5fc !important;
}

.carousel-caption .text-muted, 
.carousel-text-overlay .text-muted {
  color: #f5f5f5 !important;
}

/* Carousel typography */
.carousel-headline {
  font-size: 1.1rem;
}

.carousel-badge {
  font-size: 0.85rem;
  font-weight: 500;
}

.carousel-date {
  font-size: 0.90rem;
}

/* === Coverflow Carousel === */
.coverflow-carousel {
  position: relative;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 900px;
  margin: 2rem auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  padding: 0;
  z-index: 2;
  overflow: hidden;
  left: 0;
  right: 0;
}

.coverflow-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0;
  position: relative;
  overflow: visible;
  min-height: 380px;
  margin: 0 auto;
}

.coverflow-item {
  position: absolute;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: all 0.45s cubic-bezier(.4,1.7,.6,1);
  z-index: 1;
  pointer-events: none;
  width: 32vw;
  height: 22vw;
  max-width: 540px;
  max-height: 380px;
  min-width: 240px;
  min-height: 180px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  border-radius: 2rem;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 30px;
  visibility: hidden;
}

.coverflow-item.coverflow-center {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 3;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  pointer-events: auto;
  visibility: visible;
  left: 50%;
  top: 50%;
  width: 38vw;
  height: 24vw;
  max-width: 640px;
  max-height: 420px;
  aspect-ratio: 1.5 / 1;
  overflow: visible;
}

/* Hide content in non-center cards */
.coverflow-item:not(.coverflow-center) .coverflow-caption {
  opacity: 0;
  visibility: hidden;
}

.coverflow-item.coverflow-left {
  opacity: 0.85;
  transform: translate(-180%, -50%) scale(0.8) rotateY(12deg);
  z-index: 2;
  filter: blur(0.5px) grayscale(0.08);
  pointer-events: auto;
  visibility: visible;
  left: 50%;
  top: 50%;
}

.coverflow-item.coverflow-right {
  opacity: 0.85;
  transform: translate(80%, -50%) scale(0.8) rotateY(-12deg);
  z-index: 2;
  filter: blur(0.5px) grayscale(0.08);
  pointer-events: auto;
  visibility: visible;
  left: 50%;
  top: 50%;
}

.coverflow-item img {
  width: 100%;
  height: 70%;
  object-fit: cover;
  object-position: center center;
  border-radius: 1.25rem 1.25rem 0 0;
}

.coverflow-caption {
  padding: 1.3rem 1.5rem 0.8rem 1.5rem;
  text-align: left;
  transition: all 0.3s ease;
}

/* Additional content that shows on hover */
.coverflow-additional-content {
  height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  padding: 0 1.5rem;
}

.coverflow-item.coverflow-center:hover .coverflow-additional-content {
  height: auto;
  max-height: 120px;
  opacity: 1;
  padding-bottom: 2.5rem;
}

/* Adjust the main caption padding when hovering to make room for additional content */
.coverflow-item.coverflow-center:hover .coverflow-caption {
  padding-bottom: 0.2rem;
}

.coverflow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #333;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: all 0.2s;
}

.coverflow-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.coverflow-btn-left {
  left: 1vw;
}

.coverflow-btn-right {
  right: 1vw;
}

/* === Responsive Styles === */
@media (min-width: 1600px) {
  .coverflow-item.coverflow-center {
    width: 600px;
    height: 380px;
    max-width: 600px;
    max-height: 380px;
  }
  
  .coverflow-item.coverflow-left,
  .coverflow-item.coverflow-right {
    width: 480px;
    height: 320px;
  }
  
  .coverflow-item.coverflow-left {
    transform: translate(-180%, -50%) scale(0.8) rotateY(12deg);
  }
  
  .coverflow-item.coverflow-right {
    transform: translate(80%, -50%) scale(0.8) rotateY(-12deg);
  }
}

@media (max-width: 1200px) {
  .coverflow-carousel {
    min-height: 450px;
  }
  
  .coverflow-item {
    width: 50vw;
    height: 35vw;
    min-height: 320px;
  }
  
  .coverflow-item.coverflow-center {
    transform: translate(-50%, -50%) scale(1.05);
  }
  
  .coverflow-item.coverflow-left {
    transform: translate(-110%, -50%) scale(0.85) rotateY(8deg);
    opacity: 0.75;
  }
  
  .coverflow-item.coverflow-right {
    transform: translate(10%, -50%) scale(0.85) rotateY(-8deg);
    opacity: 0.75;
  }
  
  .coverflow-caption {
    padding: 1rem 1.25rem;
  }
  
  .carousel-headline {
    font-size: 1rem;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (max-width: 900px) {
  .coverflow-carousel {
    min-height: 420px;
  }
  
  .coverflow-item {
    width: 70vw;
    height: 50vw;
    min-height: 300px;
    border-radius: 1.5rem;
  }
  
  .coverflow-item img {
    height: 65%;
    border-radius: 1.5rem 1.5rem 0 0;
  }
  
  .coverflow-item.coverflow-center {
    transform: translate(-50%, -50%) scale(1);
    z-index: 5;
  }
  
  .coverflow-item.coverflow-left {
    transform: translate(-105%, -50%) scale(0.85) rotateY(6deg);
    opacity: 0.7;
    z-index: 1;
  }
  
  .coverflow-item.coverflow-right {
    transform: translate(5%, -50%) scale(0.85) rotateY(-6deg);
    opacity: 0.7;
    z-index: 1;
  }
  
  .coverflow-caption {
    padding: 0.9rem 1.1rem;
  }
  
  .coverflow-caption .small {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }
  
  .carousel-badge, .carousel-date {
    font-size: 0.7rem;
  }
  
  .carousel-headline {
    font-size: 0.9rem;
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .coverflow-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
    top: 40%;
  }
}

@media (max-width: 767.98px) {
  .carousel-caption, 
  .carousel-text-overlay {
    left: 0.5rem;
    right: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    max-width: 95vw;
    bottom: 1rem;
  }
  
  .carousel .carousel-item img {
    height: 200px;
  }
}

@media (max-width: 600px) {
  .coverflow-carousel {
    min-height: 400px;
  }
  
  .coverflow-item {
    width: 80vw;
    height: 60vw;
    min-height: 280px;
    border-radius: 1rem;
  }
  
  .coverflow-item img {
    height: 60%;
    border-radius: 1rem 1rem 0 0;
  }
  
  .coverflow-item.coverflow-center {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .coverflow-item.coverflow-left {
    transform: translate(-110%, -50%) scale(0.8) rotateY(5deg);
    opacity: 0.6;
  }
  
  .coverflow-item.coverflow-right {
    transform: translate(10%, -50%) scale(0.8) rotateY(-5deg);
    opacity: 0.6;
  }
  
  .coverflow-caption {
    padding: 0.75rem 1rem;
  }
  
  .coverflow-caption .small {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .carousel-badge, .carousel-date {
    display: inline-block;
    font-size: 0.65rem;
    margin-top: 0.1rem;
  }
  
  .carousel-headline {
    font-size: 0.85rem;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .coverflow-btn {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    top: 40%;
  }
}
