/*!
 * CN Slider — on-air show schedule slider (home.php)
 * Self-contained: no Bootstrap or jQuery dependency.
 * Brand red: #ce0300 | Dark: #2c2d32 | Font: Cabin (headings), Arimo (body)
 */

/* Slide photos are all 1920x1080 (16:9). width:90% + max-width keep the box
   itself always at a true 16:9 shape at any viewport size: max-width is
   just the 620px height cap below expressed as a width (620 * 16/9), so once
   a very wide screen hits that cap, the box's width shrinks right along
   with its height instead of staying stretched at 90% with empty fill on
   either side. That's what those two dark bars were — the box was wider
   than the (uncropped, non-stretched) photo it contained. */
.cn-slider {
  position: relative;
  width: 90%;
  max-width: 1102px;
  margin: 0 auto;
  overflow: hidden;
  background: #2c2d32;
  isolation: isolate;
}

.cn-slider__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.cn-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.cn-slider__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

/* ─── Media (background photo + logo) ───────────────────────────────────── */
.cn-slider__media {
  position: absolute;
  inset: 0;
}

.cn-slider__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* contain (not cover): show the whole photo, never crop it. The viewport's
     aspect-ratio matches these photos exactly, so this fills edge-to-edge
     with no letterboxing in practice, while staying safe if a future photo
     doesn't share the same 16:9 ratio. */
  object-fit: contain;
  object-position: center;
}

.cn-slider__overlay {
  position: absolute;
  /* inset: 0; */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.32) 45%,
    rgba(0, 0, 0, 0.05) 100%
  );
}

.cn-slider__logo {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  max-height: 64px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

/* ─── Caption ────────────────────────────────────────────────────────────── */
.cn-slider__caption {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 42px;
  z-index: 2;
  color: #fff;
}

.cn-slider__time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ce0300;
  color: #fff;
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 10px;
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 0.8em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cn-slider__title {
  margin: 0;
  font-family: 'Cabin', sans-serif;
  font-weight: 700;
  font-size: 1.8em;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

/* ─── Prev / next controls ───────────────────────────────────────────────── */
.cn-slider__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.cn-slider__nav:hover,
.cn-slider__nav:focus-visible {
  background: #ce0300;
}
.cn-slider__nav--prev { left: 18px; }
/* Cleared 76px from the edge (not 18px) because the site-wide fixed
   .social-widgets share sidebar (see css/liveradio-template.css) sits at
   right:0, is 57px wide and vertically centered on the viewport — the same
   spot a flush-right button would land in. It's hidden below 768px
   (Bootstrap .hidden-xs), so the 767px breakpoint below reverts to 18px. */
.cn-slider__nav--next { right: 76px; }

/* ─── Dot indicators ─────────────────────────────────────────────────────── */
.cn-slider__dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.cn-slider__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.cn-slider__dot:hover {
  background: rgba(255, 255, 255, 0.75);
}
.cn-slider__dot.is-active {
  background: #ce0300;
  border-color: #ce0300;
  transform: scale(1.25);
}

/* ─── Play / pause toggle ────────────────────────────────────────────────── */
.cn-slider__playpause {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.78em;
  cursor: pointer;
  transition: background 0.25s ease;
}
.cn-slider__playpause:hover {
  background: #ce0300;
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cn-slider__track {
    transition: none;
  }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .cn-slider__title { font-size: 1.5em; }
}

@media (max-width: 767px) {
  .cn-slider__logo { top: 16px; right: 16px; max-height: 46px; }
  .cn-slider__caption { left: 18px; right: 18px; bottom: 30px; }
  .cn-slider__title { font-size: 1.15em; }
  .cn-slider__nav { width: 36px; height: 36px; }
  /* .social-widgets is hidden below 768px (Bootstrap .hidden-xs), so the
     next arrow can sit flush with the edge again here. */
  .cn-slider__nav--next { right: 18px; }
  .cn-slider__dots { bottom: 8px; }
  .cn-slider__playpause { right: 14px; bottom: 8px; }
}

@media (max-width: 479px) {
  .cn-slider__title { font-size: 0.9em; }
  .cn-slider__time { font-size: 0.7em; }
  .cn-slider__caption { bottom: 22px; }
  .cn-slider__nav--prev { left: 8px; }
  .cn-slider__nav--next { right: 8px; }
}
