/* Oregon Forward — campaign ad carousel (shared) */

.ad-carousel {
  --ac-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ac-fast: 200ms;
  --ac-bg: #0a241c;
  --ac-glow: rgba(196, 163, 90, 0.45);
  --ac-accent: #c4a35a;
  --ac-accent-soft: #e8d9b0;
  --ac-white: #ffffff;
  --ac-ink: #1a1f1c;
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--ac-bg);
  overflow: hidden;
  isolation: isolate;
}

.ad-carousel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(10, 36, 28, 0.55) 0%, transparent 12%, transparent 88%, rgba(10, 36, 28, 0.55) 100%),
    linear-gradient(180deg, rgba(196, 163, 90, 0.08) 0%, transparent 18%, transparent 82%, rgba(10, 36, 28, 0.35) 100%);
  opacity: 0.85;
}

.ad-carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1168 / 784;
  max-height: min(72vh, 560px);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  background: #0a241c;
}

.ad-carousel-frame:active {
  cursor: grabbing;
}

.ad-carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
  transition: transform var(--ac-fast) var(--ac-ease);
}

.ad-carousel.is-dragging .ad-carousel-track {
  transition: none;
}

.ad-carousel-slide {
  content-visibility: auto;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  padding: 0;
}

.ad-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Controls bar */
.ad-carousel-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(8, 28, 22, 0.88) 55%);
  pointer-events: none;
}

.ad-carousel-controls > * {
  pointer-events: auto;
}

.ad-carousel-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(232, 217, 176, 0.35);
  border-radius: 50%;
  background: rgba(15, 61, 46, 0.72);
  color: var(--ac-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.12),
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 180ms var(--ac-ease),
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.ad-carousel-btn:hover {
  background: rgba(26, 92, 64, 0.92);
  border-color: var(--ac-accent);
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.35),
    0 0 18px var(--ac-glow),
    0 8px 22px rgba(0, 0, 0, 0.4);
}

.ad-carousel-btn:active {
  transform: scale(0.94);
}

.ad-carousel-btn:focus-visible {
  outline: 3px solid var(--ac-accent);
  outline-offset: 2px;
}

.ad-carousel-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ad-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  list-style: none;
  border-radius: 999px;
  background: rgba(10, 36, 28, 0.55);
  border: 1px solid rgba(232, 217, 176, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ad-carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(232, 217, 176, 0.35);
  cursor: pointer;
  transition:
    width 220ms var(--ac-ease),
    background 180ms ease,
    box-shadow 180ms ease;
}

.ad-carousel-dot[aria-current="true"] {
  width: 22px;
  background: var(--ac-accent);
  box-shadow: 0 0 12px var(--ac-glow);
}

.ad-carousel-dot:hover {
  background: var(--ac-accent-soft);
}

.ad-carousel-dot:focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 3px;
}

.ad-carousel-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ad-carousel-label {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 5;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac-accent-soft);
  background: rgba(10, 36, 28, 0.7);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Progress hairline */
.ad-carousel-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 100%;
  z-index: 6;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  pointer-events: none;
}

.ad-carousel-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ac-accent), #f0e2b2);
  box-shadow: 0 0 10px var(--ac-glow);
  transform-origin: left center;
}

.ad-carousel.is-playing .ad-carousel-progress > span {
  animation: ac-progress var(--ac-interval, 3800ms) linear forwards;
}

@keyframes ac-progress {
  from { width: 0%; }
  to { width: 100%; }
}

/* Placement wrappers */
.ad-carousel-hero-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.ad-carousel-hero-wrap--landing {
  margin: 0;
}

.ad-carousel-hero-wrap--index {
  margin: 0 0 1.25rem;
  border-radius: 0;
}

/* Keep the chip off the artwork. Ad headlines sit in the top of every slide. */
.ad-carousel-hero-wrap--index .ad-carousel-label {
  position: relative;
  top: auto;
  left: auto;
  display: inline-block;
  margin: 0.75rem 0 0.65rem 0.85rem;
}

@media (min-width: 720px) {
  .ad-carousel-hero-wrap--index {
    margin: 0 auto 1.5rem;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(196, 163, 90, 0.2),
      0 18px 48px rgba(8, 28, 22, 0.35);
  }

  .ad-carousel-hero-wrap--index .ad-carousel-frame {
    max-height: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-carousel-track {
    transition: none !important;
  }

  .ad-carousel-btn,
  .ad-carousel-dot {
    transition: none !important;
  }

  .ad-carousel.is-playing .ad-carousel-progress > span {
    animation: none !important;
    width: 100%;
  }
}

/* Index hero: full-bleed carousel at top of hero */
.hero:has(> .ad-carousel-hero-wrap--index) {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}

.hero:has(> .ad-carousel-hero-wrap--index) .hero-inner {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-top: 1.75rem;
  padding-bottom: 0.25rem;
}

.hero:has(> .ad-carousel-hero-wrap--index) .ad-carousel-hero-wrap--index {
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
}

@media (min-width: 720px) {
  .hero:has(> .ad-carousel-hero-wrap--index) .ad-carousel-hero-wrap--index {
    margin: 0 auto;
    max-width: 960px;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(196, 163, 90, 0.18),
      0 16px 40px rgba(8, 28, 22, 0.28);
  }
}

/* Landing, desktop: show each whole ad (no cropping), centered with a sensible
   max width, framed like a card. Mobile (<720px) keeps the full-bleed layout. */
@media (min-width: 720px) {
  .ad-carousel-hero-wrap--landing {
    background: linear-gradient(180deg, #0a241c 0%, #0f3d2e 100%);
    padding: 2rem 1.5rem 2.5rem;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel {
    width: min(1240px, 100%);
    margin: 0 auto;
    border-radius: 16px;
    border: 1px solid rgba(196, 163, 90, 0.35);
    box-shadow:
      0 0 0 1px rgba(196, 163, 90, 0.12),
      0 22px 54px rgba(0, 0, 0, 0.42);
  }

  .ad-carousel-hero-wrap--landing .ad-carousel::before {
    display: none;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-frame {
    max-height: none;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-slide img {
    object-fit: contain;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-label {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin: 0.7rem 0 0.7rem 0.9rem;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-controls {
    position: relative;
    background: var(--ac-bg);
    padding: 0.7rem 0.9rem 0.8rem;
  }
}

/* Landing, mobile: keep the artwork clear. Label sits above the ad and the
   arrows/dots sit below it (same treatment as desktop), still full-bleed. */
@media (max-width: 719.98px) {
  .ad-carousel-hero-wrap--landing .ad-carousel::before {
    display: none;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-label {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin: 0.6rem 0 0.6rem 0.75rem;
  }

  .ad-carousel-hero-wrap--landing .ad-carousel-controls {
    position: relative;
    background: var(--ac-bg);
    padding: 0.6rem 0.75rem 0.7rem;
  }
}
