/* ── Carousel shell ── */

.carousel-section {
  width: 100%;
}

.carousel-section h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: #1a1a18;
  margin-bottom: 1.25rem;
}

.carousel-wrapper {
  position: relative;
}

/* ── Arrow buttons ── */

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 0;
}

.carousel-btn:hover {
  background: #f0efeb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn svg {
  display: block;
  flex-shrink: 0;
}

.btn-prev {
  left: -20px;
}

.btn-next {
  right: -20px;
}

/* ── Track ── */

.carousel-track-outer {
  overflow: hidden;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  gap: 16px;
  will-change: transform;
}

/* ── Cards ──
   flex-basis controls visible count + half-peeking card.
   Formula: (100% - (N-1)*gap) / (N + 0.5)
   Divisor 2.5 → 2 full cards + half-card peeking on each side.
   Change to 3.5 for 3 full cards, etc. */

.carousel-card {
  flex: 0 0 calc((100% - 32px) / 3.5);
  min-width: 0;
  background: var(--bs-light);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
  box-shadow: var(--bs-box-shadow-sm);
  text-decoration: none;
}

.carousel-card:hover {
  background-color: var(--bs-secondary-bg-subtle);
}

.carousel-card-accent {
  height: 6px;
  border-radius: 3px;
  background: var(--bs-primary);
  width: 100%;
  margin-top: auto;
  margin-bottom: 0.7rem;
  margin-left: 1rem;
}

.carousel-card-heading {
  display: flex;
  flex-direction: row;
}

.carousel-card-title {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--bs-dark);
  margin-top: auto;
  margin-bottom: auto;
}

.carousel-card-body {
  font-size: 0.875rem;
  color: #5f5e5a;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 0.2rem;
}

.carousel-card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  width: fit-content;
}

.carousel-card-icon {
  filter: brightness(0);
  width: 1.6rem;
  margin-right: 1em;
}

.carousel-card-link {
  text-decoration: none;
}

.carousel-card-link::after {
  content: " \2192";
  margin-left: 8px;
  font-weight: bold;
}

/* ── Bottom row: dots + play/pause ── */

.carousel-bottom {
  display: flex;
  align-items: end;
  justify-content: end;
  gap: 12px;
  margin-top: 0.25rem;
}

.carousel-dots {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8c7bf;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: #444441;
  transform: scale(1.4);
}

/* ── Play / pause button ── */

.carousel-playpause {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}

.carousel-playpause:hover {
  background: #f0efeb;
}

.carousel-playpause:active {
  transform: scale(0.93);
}

.carousel-playpause svg {
  display: block;
}

/* ── Progress bar on active dot (shows time until next auto-advance) ── */

.carousel-dot.active.auto-running {
  position: relative;
  overflow: hidden;
}

.carousel-dot.active.auto-running::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #7F77DD;
  transform-origin: left center;
  animation: dot-fill var(--auto-duration, 3s) linear forwards;
}

@keyframes dot-fill {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0% 0 0);
  }
}

/* ── Responsive ── */

/* Tablet / small desktop: pull arrows in a little */

@media (max-width: 768px) {
  .btn-prev {
    left: -12px;
  }
}

@media (max-width: 768px) {
  .btn-next {
    right: -12px;
  }
}

/* Mobile: 1 full card, no peek, arrows overlaid inside */

@media (max-width: 600px) {
  .carousel-card {
    flex: 0 0 100%;
  }
}

/* Move arrows inside the card edges so they stay reachable */

@media (max-width: 600px) {
  .btn-prev {
    left: 8px;
  }
}

@media (max-width: 600px) {
  .btn-next {
    right: 8px;
  }
}

/* Semi-transparent so card content shows through behind them */

@media (max-width: 600px) {
  .carousel-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

@media (max-width: 600px) {
  .carousel-btn:hover {
    background: rgba(240, 239, 235, 0.96);
  }
}

