/* BW FUTURE TV â€” Programme carousel, clean layout v2.3
   Replace the entire old carousel CSS with this stylesheet.
   Markup: status, time, one-line programme name, orange format chip.
   No pictures, topic or guest description. */

.bwftv-carousel,
.bwftv-carousel * {
  box-sizing: border-box;
}

.bwftv-carousel[hidden],
.bwftv-carousel-shortcode-hidden {
  display: none !important;
}

/* Optional spacing fix for an otherwise empty Shortcode block */
.wp-block-shortcode:has(> .bwftv-carousel[hidden]) {
  display: none !important;
}

.bwftv-carousel {
  --bwftv-orange: #ff6817;
  --bwftv-ink: #0b1f3b;
  --bwftv-gap: 12px;

  display: block;
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 22px clamp(16px, 2.6vw, 38px) 25px;
  background: linear-gradient(145deg, #153558, #0b1f3b 80%);
  color: #fff;
  font-family: inherit;
}

.bwftv-carousel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(to right, var(--bwftv-orange) 0 33%, transparent 33% 100%);
}

.bwftv-carousel__shell {
  width: 100%;
  max-width: 1800px;
  min-width: 0;
  margin: 0 auto;
}

.bwftv-carousel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 17px;
}

.bwftv-carousel__identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.bwftv-carousel__eyebrow {
  display: block;
  color: #c7d8ec;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .1em;
}

.bwftv-carousel__heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.bwftv-carousel__heading strong {
  color: #fff;
  font-size: clamp(19px, 1.6vw, 25px);
  font-weight: 800;
  line-height: 1.25;
}

.bwftv-carousel__heading > span {
  color: #c7d8ec;
  font-size: 12px;
  line-height: 1.4;
}

.bwftv-carousel__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bwftv-carousel__arrows {
  display: none;
  align-items: center;
  gap: 8px;
}

.bwftv-carousel__arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  appearance: none;
  border: 1px solid #6e859f;
  border-radius: 8px;
  color: #fff;
  background: #213c5c;
  cursor: pointer;
}

.bwftv-carousel__arrow:disabled {
  opacity: .32;
  cursor: default;
}

.bwftv-carousel .bwftv-carousel__all,
.bwftv-carousel .bwftv-carousel__all:hover {
  color: #fff;
  text-decoration: none;
}

.bwftv-carousel .bwftv-carousel__all {
  padding-bottom: 5px;
  border-bottom: 2px solid var(--bwftv-orange);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  white-space: nowrap;
}

.bwftv-carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--bwftv-gap);
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.bwftv-carousel__track::-webkit-scrollbar {
  display: none;
}

/* Cross-browser width: 5 Ã— (20% - 9.6px) + 4 Ã— 12px = 100%.
   Avoid dividing by 5 inside calc(), which is unreliable in older browsers. */
.bwftv-carousel .bwftv-carousel__card {
  display: flex;
  flex: 0 0 calc(20% - 9.6px);
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  min-width: 0;
  min-height: 180px;
  margin: 0;
  padding: 17px 18px;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  background: #fff;
  color: var(--bwftv-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  text-decoration: none;
  scroll-snap-align: start;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.bwftv-carousel .bwftv-carousel__card:hover {
  border-color: #b9c8d7;
  color: var(--bwftv-ink);
  box-shadow: 0 7px 16px rgba(0, 0, 0, .18);
}

.bwftv-carousel .bwftv-carousel__card--past {
  background: #e3e8ed;
  border-color: #d2d9e0;
}

.bwftv-carousel .bwftv-carousel__card--live,
.bwftv-carousel .bwftv-carousel__card--live:hover {
  background: linear-gradient(120deg, #fff1e6 0%, #ffe2cf 48%, #ffd7bd 100%);
  border: 5px solid var(--bwftv-orange);
  color: var(--bwftv-ink);
  /* Equal external width: border stays inside border-box. */
  padding: 13px 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45),
              0 0 17px rgba(255, 104, 23, .34);
}

.bwftv-carousel__content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.bwftv-carousel__meta {
  display: block;
  max-width: 100%;
  margin: 0;
  color: #607389;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bwftv-carousel__card--live .bwftv-carousel__meta {
  color: #bb4309;
}

.bwftv-carousel__card--live .bwftv-carousel__meta::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--bwftv-orange);
  vertical-align: 1px;
}

.bwftv-carousel__time {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--bwftv-ink);
  font-size: clamp(21px, 1.65vw, 30px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bwftv-carousel__card--live .bwftv-carousel__time {
  color: #572709;
}

.bwftv-carousel__name {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--bwftv-ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bwftv-carousel__format-chip {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid #ffb487;
  border-radius: 999px;
  background: #fff1e6;
  color: #cf510a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Legacy elements are hidden if an older JS file is still cached. */
.bwftv-carousel__media,
.bwftv-carousel__detail,
.bwftv-carousel__format {
  display: none !important;
}

.bwftv-carousel__arrow:focus-visible,
.bwftv-carousel__track:focus-visible,
.bwftv-carousel .bwftv-carousel__card:focus-visible,
.bwftv-carousel .bwftv-carousel__all:focus-visible {
  outline: 3px solid #ff9d66;
  outline-offset: 3px;
}

/* Tablet: 3 equal-width cards, navigation via arrows. */
@media (min-width: 768px) and (max-width: 1199px) {
  .bwftv-carousel {
    padding: 20px 22px 24px;
  }

  .bwftv-carousel__arrows {
    display: flex;
  }

  .bwftv-carousel .bwftv-carousel__card {
    flex-basis: calc(33.333333% - 8px);
    min-height: 170px;
    padding: 16px;
  }

  .bwftv-carousel .bwftv-carousel__card--live {
    padding: 12px;
  }

  .bwftv-carousel__time {
    font-size: clamp(22px, 2.7vw, 30px);
  }
}

/* Mobile: all available cards stacked, without horizontal scrolling. */
@media (max-width: 767px) {
  .bwftv-carousel {
    padding: 18px 15px 22px;
  }

  .bwftv-carousel__header {
    align-items: flex-start;
    gap: 10px;
  }

  .bwftv-carousel__heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .bwftv-carousel__controls {
    align-self: flex-start;
  }

  .bwftv-carousel__arrows {
    display: none;
  }

  .bwftv-carousel__track {
    flex-direction: column;
    overflow: visible;
    scroll-snap-type: none;
    scroll-behavior: auto;
    gap: 9px;
  }

  .bwftv-carousel .bwftv-carousel__card {
    flex: 0 0 auto;
    width: 100%;
    min-height: 127px;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .bwftv-carousel .bwftv-carousel__card--live {
    padding: 10px 12px;
  }

  .bwftv-carousel__content {
    gap: 6px;
  }

  .bwftv-carousel__time {
    font-size: clamp(23px, 7vw, 30px);
  }

  .bwftv-carousel__meta {
    font-size: 11px;
  }

  .bwftv-carousel__name {
    font-size: 14px;
  }

  .bwftv-carousel__format-chip {
    font-size: 11px;
    padding: 4px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bwftv-carousel__track {
    scroll-behavior: auto;
  }

  .bwftv-carousel .bwftv-carousel__card {
    transition: none;
  }
}

.bwftv-carousel a,
.bwftv-carousel a:hover,
.bwftv-carousel a:focus {
    text-decoration: none !important;
}