/* =================================================================
   Ads Carousel — Mobile-First
   Prefix: ads-
   Breakpoints: base (<769px), tablet (769px+), desktop (1025px+)
   Pattern: Embla-style — CSS custom prop drives perView, JS reads it
   ================================================================= */

.ads-container {
  --ads-per-view: 1;
  --ads-gap: 8px;
  position: relative;
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

.ads-viewport {
  overflow: hidden;
  width: 100%;
}

.ads-track {
  display: flex;
  gap: var(--ads-gap);
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.ads-track--no-transition {
  transition: none;
}

/* Item sizing: perView items + their gaps exactly fill the viewport.
   calc((100% - (N-1) * gap) / N) */
.ads-item {
  flex: 0 0 calc((100% - (var(--ads-per-view) - 1) * var(--ads-gap)) / var(--ads-per-view));
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.ads-link {
  display: block;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
}

/* Blurred background — fills empty space when image doesn't match 16:9 */
.ads-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ads-bg) center / cover no-repeat;
  filter: blur(20px);
  transform: scale(1.1);
  z-index: 0;
}

.ads-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  border-radius: 8px;
}

/* === Arrows — mobile: outside images === */
.ads-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 12px));
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  color: #444;
  border: 1px solid #ddd;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
  padding: 0;
}

.ads-arrow:hover {
  background: var(--accent, #0096d7);
  color: #fff;
  border-color: var(--accent, #0096d7);
}

.ads-arrow--prev {
  left: 4px;
}

.ads-arrow--next {
  right: 4px;
}

.ads-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* === Dots === */
.ads-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 0;
}

.ads-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.ads-dot:hover {
  background: rgba(0, 0, 0, 0.4);
}

.ads-dot--active {
  background: var(--accent, #0096d7);
  transform: scale(1.25);
}

/* === Tablet (769px+) === */
@media (min-width: 769px) {
  .ads-container[data-layout="twoColumn"] {
    --ads-per-view: 2;
    --ads-gap: 16px;
  }

  .ads-container {
    padding: 0 48px;
  }

  .ads-arrow {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* === Desktop (1025px+) === */
@media (min-width: 1025px) {
  .ads-container {
    padding: 0 52px;
  }

  .ads-arrow {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
}
