/* CAROUSEL MODULE (carousel-section.css)
   Refined for better grouping, spacing, and scroll visibility.
*/

:root {
  --carousel-item-width: 280px;
  --carousel-item-height: 340px;
  --carousel-gap: 1.5rem;
  --carousel-gutter: 4vw; /* Space between the wrapper and the screen edge */
}

/* Main wrapper with consistent margin to create viewport breathing room */
.carousel-group-wrapper {
  width: calc(100% - (var(--carousel-gutter) * 2));
  max-width: 1400px;
  margin: 0 auto; /* Centering the entire block */
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 10;
  position: relative;
  padding-bottom: 8rem;
}

/* A single labelled strip */
.carousel-section {
  width: 100%;
  padding: 1rem 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header container - contains Label, Line, and Controls */
.carousel-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem; /* Slight internal offset */
  width: 100%;
  box-sizing: border-box;
}

.carousel-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.7;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Subtle line next to label for visual hierarchy */
.carousel-header::after {
  content: "";
  height: 1px;
  flex-grow: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), transparent);
  margin-right: 1rem;
}

/* The scrollable track */
.carousel-container {
  display: flex;
  flex-direction: row;
  gap: var(--carousel-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0.5rem 1.5rem; 
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  
  /* Show scrollbar on hover/active only */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  transition: scrollbar-color 0.3s ease;
}

.carousel-container::-webkit-scrollbar {
  height: 4px;
}

.carousel-container::-webkit-scrollbar-track {
  background: transparent;
}

.carousel-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0);
  border-radius: 10px;
}

.carousel-container:hover::-webkit-scrollbar-thumb,
.carousel-container:active::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
}

.carousel-container.active {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Individual item */
.carousel-item {
  flex: 0 0 auto;
  width: var(--carousel-item-width);
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
  scroll-snap-align: start;
}

.carousel-item--wide {
  width: calc(var(--carousel-item-width) * 1.5);
}

.carousel-item img,
.carousel-item video {
  width: 100%;
  height: var(--carousel-item-height);
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

.carousel-item:hover img,
.carousel-item:hover video {
  transform: scale(1.06);
}

/* Info Overlay */
.carousel-info {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  backdrop-filter: blur(3px);
}

.carousel-item:hover .carousel-info {
  opacity: 1;
}

.carousel-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  color: #fff;
}

.carousel-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

/* Controls nested in header */
.carousel-controls {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.carousel-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border-color: #fff;
}

@media (max-width: 768px) {
  :root {
    --carousel-item-width: 220px;
    --carousel-item-height: 280px;
    --carousel-gutter: 5vw;
  }
}