/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --tmc-accent-red: #ef4444;
  --tmc-accent-orange: #f97316;
  --tmc-btn-white-fg: #111111;
}

/* ── Base player ─────────────────────────────────────────────────────────── */
.tmc-ao-vivo-live-player {
  position: relative;
  max-width: 100%;
}

.tmc-ao-vivo-live-player .tmc-ao-vivo-iframe-wrap {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  overflow: hidden;
  border-radius: 16px;
}

.tmc-ao-vivo-live-player .tmc-ao-vivo-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Active (selected) slide gets a 4px white frame. view.js marks the most
   visible carousel item with .is-active via IntersectionObserver; the rule
   covers both the live wrap and the previous-card wraps (.tmc-ao-vivo-iframe-wrap
   is shared by both). box-sizing: border-box keeps the 56.25% padding-top
   ratio coherent without inflating the card width. */
.tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item.is-active .tmc-ao-vivo-iframe-wrap {
  border: 4px solid #fff;
  box-sizing: border-box;
}

/* Slides fora de destaque ficam em 40% de opacidade; o ativo volta a 100%.
   Transição suave acompanha o scroll-snap conforme o IntersectionObserver
   move a classe .is-active. */
.tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item {
  opacity: 0.4;
  transition: opacity 250ms ease;
}
.tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item.is-active {
  opacity: 1;
}

.tmc-ao-vivo-live-player .tmc-ao-vivo-fallback {
  padding: 24px;
  background: #f0f0f1;
  text-align: center;
  color: #50575e;
  border-radius: 16px;
}

.tmc-ao-vivo-block-placeholder {
  padding: 24px;
  border: 1px dashed #c3c4c7;
  background: #f6f7f7;
  text-align: center;
  color: #50575e;
}

/* ── Overlay — transparent shell, only bottom and center are interactive ──── */
.tmc-ao-vivo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
}

/* Bottom-half gradient scrim for text readability */
.tmc-ao-vivo-overlay::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.85) 100%
  );
  pointer-events: none;
  border-radius: 0 0 16px 16px;
}

/* ── Central play button ─────────────────────────────────────────────────── */
.tmc-ao-vivo-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 0;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 200ms ease,
    background 200ms ease;
  flex-shrink: 0;
  z-index: 11;
}

.tmc-ao-vivo-play-center:hover,
.tmc-ao-vivo-play-center:focus-visible {
  transform: translate(-50%, -50%) scale(1.07);
  background: rgba(255, 255, 255, 0.88);
}

.tmc-ao-vivo-play-center:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.tmc-ao-vivo-play-center svg {
  pointer-events: none;
}

/* ── Bottom content block ────────────────────────────────────────────────── */
.tmc-ao-vivo-overlay__bottom {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 5%;
  pointer-events: auto;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

/* ── Pills row ───────────────────────────────────────────────────────────── */
.tmc-ao-vivo-overlay__pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tmc-ao-vivo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.tmc-ao-vivo-pill--live {
  background: #e96509;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px;
}

.tmc-ao-vivo-pill__dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
}

.tmc-ao-vivo-pill__dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  animation: tmc-ao-vivo-pill-dot-pulse 1.2s infinite;
  pointer-events: none;
}

@keyframes tmc-ao-vivo-pill-dot-pulse {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

.tmc-ao-vivo-pill--praca {
  background: #f5f5f5;
  border: none;
  color: #050505;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

/* ── Title ───────────────────────────────────────────────────────────────── */
.tmc-ao-vivo-overlay__title {
  margin: 0;
  color: #fff;
  font-size: 66px;
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* When the live broadcast is NOT tied to a program, the title is the raw
 * YouTube video title — usually much longer — so we shrink it. Only the
 * current live item is affected; previous-program cards keep their own
 * (program-derived) title at the default 60px. The data-orphan-live attribute
 * is toggled by view.js on the wrapper. */
.tmc-ao-vivo-live-player[data-orphan-live='1']
  .tmc-ao-vivo-carousel__item--live
  .tmc-ao-vivo-overlay__title {
  font-size: 1.5rem;
}

/* ── Subtitle ────────────────────────────────────────────────────────────── */
.tmc-ao-vivo-overlay__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
}

/* ── Action buttons row ──────────────────────────────────────────────────── */
.tmc-ao-vivo-overlay__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Base button */
.tmc-ao-vivo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 16px 20px;
  border-radius: 999px;
  border: 0;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.tmc-ao-vivo-btn:hover,
.tmc-ao-vivo-btn:focus-visible {
  transform: translateY(-1px);
}

.tmc-ao-vivo-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.tmc-ao-vivo-btn svg {
  pointer-events: none;
  flex-shrink: 0;
}

/* Orange primary — "Assista agora" */
.tmc-ao-vivo-btn--primary {
  background: var(--tmc-accent-orange, #f97316);
  color: #fff;
}

.tmc-ao-vivo-btn--primary:hover,
.tmc-ao-vivo-btn--primary:focus-visible {
  background: #ea580c;
}

/* White fill — "Ouvir" */
.tmc-ao-vivo-btn--white {
  background: #fff;
  color: var(--tmc-btn-white-fg, #111);
  border: 0;
}

.tmc-ao-vivo-btn--white:hover,
.tmc-ao-vivo-btn--white:focus-visible {
  background: #f3f4f6;
}

/* White outline — "Informações sobre o programa" */
.tmc-ao-vivo-btn--outline {
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
}

.tmc-ao-vivo-btn--outline:hover,
.tmc-ao-vivo-btn--outline:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

/* ── Chevron icon ────────────────────────────────────────────────────────── */
.tmc-ao-vivo-chevron {
  /* SVG path "M6 15l6-6 6 6" draws a ∧ (up) shape by default — correct for
       "panel is closed". When the panel opens we rotate to ∨ (down) so the
       icon consistently points toward the direction the panel moves. */
  transform: rotate(0deg);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

/* When the description button carries aria-expanded="true", rotate chevron */
.tmc-ao-vivo-btn--outline[aria-expanded='true'] .tmc-ao-vivo-chevron {
  transform: rotate(180deg);
}

/* ── Info "i" icon ───────────────────────────────────────────────────────────
   Hidden on desktop (the button shows its text label + chevron). It replaces
   the circular "i" glyph on the compact mobile button (see the media query). */
.tmc-ao-vivo-info-icon {
  display: none;
}

.tmc-ao-vivo-info-icon svg {
  display: block;
}

/* ── Overlay hidden state (after play is triggered) ─────────────────────── */
.tmc-ao-vivo-overlay.is-hidden,
.tmc-ao-vivo-overlay.is-hidden::after {
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

/* Children that declare pointer-events: auto must also yield */
.tmc-ao-vivo-overlay.is-hidden .tmc-ao-vivo-overlay__bottom,
.tmc-ao-vivo-overlay.is-hidden .tmc-ao-vivo-play-center {
  pointer-events: none;
}

/* ── Listen-mode overlay ─────────────────────────────────────────────────── */
.tmc-ao-vivo-listen-mode {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  border-radius: 16px;
}

.tmc-ao-vivo-listen-mode[hidden] {
  display: none;
}

.tmc-ao-vivo-listen-mode__indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.tmc-ao-vivo-listen-mode__pulse {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tmc-accent-red, #ef4444);
  animation: tmc-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes tmc-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

/* ── Info card ───────────────────────────────────────────────────────────── */

/*
 * The info card lives INSIDE .tmc-ao-vivo-overlay, just above
 * .tmc-ao-vivo-overlay__bottom. It is hidden by default; the overlay gains
 * .is-info-open when the "Informações" button is toggled.
 */
.tmc-ao-vivo-overlay__info-card {
  display: none; /* shown via .is-info-open rule below */
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: calc(5% + 72px); /* sit above the actions row */
  grid-template-columns: 200px 1fr 2fr 1fr;
  gap: 20px;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  padding: 20px;
  z-index: 15;
  pointer-events: auto;
  max-width: 85%;
}

/* Show the card when the overlay has the open class */
.tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-overlay__info-card {
  display: grid;
}

/* Hide default bottom-left UI while info is open */
.tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-overlay__pills,
.tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-overlay__title,
.tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-overlay__subtitle {
  display: none;
}

/* Close (×) button — only used by the full-screen mobile info panel. */
.tmc-ao-vivo-info-card__close {
  display: none;
}

/* Scroll wrapper is transparent to layout by default (desktop grid sees the
   meta/description/schedule as direct grid items). On mobile it becomes the
   single scrollable region so the thumb and × stay fixed. */
.tmc-ao-vivo-info-card__scroll {
  display: contents;
}

/* ── Info card columns ───────────────────────────────────────────────────── */

/* Column 1: thumbnail */
.tmc-ao-vivo-info-card__thumb-wrap {
  flex-shrink: 0;
  width: 200px;
  height: 113px; /* 16:9 */
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  align-self: center;
}

.tmc-ao-vivo-info-card__thumb-wrap--empty {
  display: none;
}

.tmc-ao-vivo-info-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.tmc-ao-vivo-info-card__thumb[hidden] {
  display: none;
}

/* Column 2: watching label + title + subtitle */
.tmc-ao-vivo-info-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: flex-start;
  padding-top: 2px;
}

.tmc-ao-vivo-info-card__watching-label {
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
}

.tmc-ao-vivo-info-card__title {
  margin: 2px 0 0;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.tmc-ao-vivo-info-card__subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.tmc-ao-vivo-info-card__subtitle[hidden] {
  display: none;
}

/* Column 3: description */
.tmc-ao-vivo-info-card__description {
  align-self: flex-start;
}

.tmc-ao-vivo-info-card__description p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.45;

  /* Clamp to 4 lines */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Column 4: schedule */
.tmc-ao-vivo-info-card__schedule {
  align-self: flex-start;
}

.tmc-ao-vivo-info-card__schedule p {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

/* ── Carousel wrapper ────────────────────────────────────────────────────── */
.tmc-ao-vivo-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tmc-ao-vivo-carousel::-webkit-scrollbar {
  display: none;
}

/* ── Full-bleed carousel (frontend only) ─────────────────────────────────── */
.tmc-ao-vivo-carousel.is-frontend-carousel {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-inline: clamp(16px, 4vw, 64px);
  scroll-padding-inline: clamp(16px, 4vw, 64px);
  box-sizing: border-box;
}

/*
 * When maxHeight is set the cards are narrower than the viewport, so we push
 * the first card to the horizontal center by computing the remaining space on
 * each side: (100vw - card_width) / 2, where card_width = maxHeight * 16/9.
 * max() ensures we never go below the default gutter when cards are wide.
 */
.tmc-ao-vivo-live-player[style*='--tmc-ao-vivo-max-height']
  .tmc-ao-vivo-carousel.is-frontend-carousel {
  padding-inline-start: max(
    clamp(16px, 4vw, 64px),
    calc((100vw - var(--tmc-ao-vivo-max-height) * 16 / 9) / 2)
  );
  padding-inline-end: max(
    clamp(16px, 4vw, 64px),
    calc((100vw - var(--tmc-ao-vivo-max-height) * 16 / 9) / 2)
  );
  scroll-padding-inline-start: max(
    clamp(16px, 4vw, 64px),
    calc((100vw - var(--tmc-ao-vivo-max-height) * 16 / 9) / 2)
  );
}

/* ── Carousel items ──────────────────────────────────────────────────────── */
.tmc-ao-vivo-carousel__item {
  flex: 0 0 95%;
  min-width: 0;
  scroll-snap-align: start;
}

.tmc-ao-vivo-carousel.is-frontend-carousel .tmc-ao-vivo-carousel__item {
  flex: 0 0 calc(100% - clamp(16px, 4vw, 64px) * 2 - 16px);
}

/* ── Previous program card ───────────────────────────────────────────────── */

/*
 * .tmc-ao-vivo-previous-card reuses all .tmc-ao-vivo-iframe-wrap rules
 * (border-radius, box-shadow, 16:9 ratio) but contains a background-image
 * div instead of an iframe.
 */
.tmc-ao-vivo-prev-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  border-radius: 16px;
}

/* Previous cards never show the red AO VIVO pill */
.tmc-ao-vivo-previous-card .tmc-ao-vivo-pill--live {
  display: none;
}

/* ── Responsive carousel sizing ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .tmc-ao-vivo-carousel__item {
    flex: 0 0 92%;
  }

  .tmc-ao-vivo-carousel.is-frontend-carousel .tmc-ao-vivo-carousel__item {
    flex: 0 0 calc(100% - clamp(16px, 4vw, 64px) * 2 - 16px);
  }
}

/* ── Max-height constraint (user-configurable via block attribute) ────────── */

/*
 * When --tmc-ao-vivo-max-height is set on the wrapper, we need to do more than
 * just set max-height. The live player uses `padding-top: 56.25%` to hold 16:9,
 * which means the intrinsic height scales freely with width and `max-height` alone
 * cannot reduce it. We must neutralize the padding-top trick and apply an explicit
 * height when the variable is present.
 *
 * The `[style*="--tmc-ao-vivo-max-height"]` attribute selector fires only when the
 * inline style is actually written (i.e. the user set a non-zero maxHeight value).
 * Default behavior (no style attribute → no constraint) is fully preserved.
 */

/* Fallback: apply max-height softly so natural layouts are lightly clamped */
.tmc-ao-vivo-live-player .tmc-ao-vivo-iframe-wrap {
  max-height: var(--tmc-ao-vivo-max-height, none);
}

/*
 * Hard override: when the variable is explicitly defined, neutralize the
 * padding-top ratio trick and lock both the live player and previous-program
 * cards to the requested height.
 */
.tmc-ao-vivo-live-player[style*='--tmc-ao-vivo-max-height'] .tmc-ao-vivo-iframe-wrap,
.tmc-ao-vivo-live-player[style*='--tmc-ao-vivo-max-height'] .tmc-ao-vivo-previous-card {
  padding-top: 0;
  height: var(--tmc-ao-vivo-max-height);
  max-height: var(--tmc-ao-vivo-max-height);
  width: calc(var(--tmc-ao-vivo-max-height) * 16 / 9);
  max-width: 100%;
}

/* Prevent carousel flex items from forcing the inner wrapper to full width */
.tmc-ao-vivo-live-player[style*='--tmc-ao-vivo-max-height'] .tmc-ao-vivo-carousel__item {
  flex: 0 0 auto;
}

/* ── Editor live-preview ─────────────────────────────────────────────────── */

/*
 * .tmc-ao-vivo-editor-preview is added by useBlockProps in editor.js.
 * It now wraps a .tmc-ao-vivo-carousel (carousel layout) so we only need
 * overflow:hidden and relative positioning — the carousel itself defines
 * width/height for the cards.  The old aspect-ratio: 16/9 single-card layout
 * is replaced by the carousel's natural height driven by the card items.
 */
.tmc-ao-vivo-editor-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* The thumbnail/bg div sits absolute inside the iframe-wrap */
.tmc-ao-vivo-editor-iframe-wrap > div:first-child {
  position: absolute;
  inset: 0;
}

/*
 * Loading and empty states — rendered inside a carousel__item which already
 * holds the 16:9 ratio via .tmc-ao-vivo-iframe-wrap. Keep them as full-bleed
 * fills so they look correct regardless of card size.
 */
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-editor-loading,
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-editor-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  padding: 16px;
  background: #111;
  border-radius: 16px;
}

/*
 * When no maxHeight is set the carousel items are sized by the 56.25% padding-top
 * trick on .tmc-ao-vivo-iframe-wrap. That works correctly in the editor because
 * the carousel__item flex width drives the height calculation.
 *
 * When maxHeight IS set the [style*="--tmc-ao-vivo-max-height"] selectors on
 * .tmc-ao-vivo-live-player already handle the override (height + width fixed),
 * so no additional rule is needed here.
 */

/* Suppress hover/focus transform on play button — inert in editor */
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-play-center,
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-play-center:hover,
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-play-center:focus-visible {
  transform: translate(-50%, -50%);
  cursor: default;
}

/* Suppress hover/focus transform on action buttons — inert in editor */
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-btn,
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-btn:hover,
.tmc-ao-vivo-editor-preview .tmc-ao-vivo-btn:focus-visible {
  transform: none;
  cursor: default;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Collapse info card grid to single column on mid-sized viewports */
@media (max-width: 900px) {
  .tmc-ao-vivo-overlay__info-card {
    grid-template-columns: 1fr;
    bottom: calc(5% + 60px);
    max-width: 100%;
    right: 5%;
    padding: 16px;
    gap: 12px;
    max-height: 55%;
    overflow-y: auto;
  }

  .tmc-ao-vivo-info-card__thumb-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .tmc-ao-vivo-info-card__description p {
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 640px) {
  /* Card radius on mobile is 12px (live player + previous card surfaces). */
  .tmc-ao-vivo-live-player .tmc-ao-vivo-iframe-wrap,
  .tmc-ao-vivo-prev-bg {
    border-radius: 12px;
  }

  .tmc-ao-vivo-play-center {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  .tmc-ao-vivo-play-center svg {
    width: 24px;
    height: 24px;
  }

  .tmc-ao-vivo-pill--praca {
    display: none;
  }

  /* Ações em linha: "Assista agora" (e "Ouvir") à esquerda; o ícone "i" é
       empurrado para a direita via margin-left:auto na regra do botão abaixo. */
  .tmc-ao-vivo-overlay__actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .tmc-ao-vivo-btn {
    flex: 0 0 auto;
    justify-content: center;
    padding: 10px 16px;
  }

  .tmc-ao-vivo-btn--outline {
    padding: 8.5px 16px;
  }

  /* Info card opens as a panel covering only the player card area, with a 5px
       margin all around. The panel itself does not scroll — the × and the thumb
       stay fixed; only the inner content scrolls (see __scroll below). */
  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-overlay__info-card {
    position: absolute;
    inset: 5px;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 14px;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 64px 28px 0;
    overflow: hidden;
    z-index: 16;
  }

  /* Thumb stays fixed at the top of the panel. */
  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__thumb-wrap {
    flex-shrink: 0;
  }

  /* Only this region scrolls. */
  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__scroll {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
  }

  .tmc-ao-vivo-info-card__close {
    display: inline-flex;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    z-index: 2;
  }

  /* Thumbnail fixed at 153px wide (16:9). */
  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__thumb-wrap {
    width: 153px;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  /* Larger type + full (un-clamped) description in the full-screen panel. */
  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__watching-label {
    font-size: 16px;
  }

  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__title {
    font-size: 28px;
  }

  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__subtitle {
    font-size: 14px;
  }

  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__description p {
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  .tmc-ao-vivo-overlay.is-info-open .tmc-ao-vivo-info-card__schedule p {
    font-size: 18px;
  }
}

/* ── Block width: full-bleed (toda a largura da janela) ──────────────────────
 *
 * O carrossel frontend já usa full-bleed (100vw + margens negativas, regra
 * .is-frontend-carousel acima) e, com --tmc-ao-vivo-max-height, centraliza o
 * card na viewport via padding-inline calculado sobre 100vw. Por isso o bloco
 * NÃO deve receber max-width/centralização própria — senão fica preso ao
 * container (main) e cria bordas laterais. Garantimos largura total aqui.
 */
.tmc-ao-vivo-live-player {
  width: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* ── Mobile poster ───────────────────────────────────────────────────────────
 *
 * No desktop o poster fica oculto (o iframe é exibido normalmente). Na versão
 * mobile (≤640px) o card destaque deixa de exibir o vídeo em reprodução e passa
 * a mostrar a imagem (thumb mobile do programa, ou a destacada/YouTube como
 * fallback) num retângulo fixo de 340×540, radius 20, alinhado à esquerda.
 * Ao tocar em "Assista agora", o view.js revela o vídeo e solicita fullscreen.
 */
.tmc-ao-vivo-mobile-poster {
  display: none; /* desktop: vídeo visível, poster oculto */
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  border-radius: inherit;
  z-index: 5; /* acima do iframe, abaixo do overlay (z-index: 10) */
}

@media (max-width: 640px) {
  /* O bloco ocupa toda a largura e encosta à esquerda na versão mobile. */
  .tmc-ao-vivo-live-player {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Remove as calhas para o card de 340px encostar à esquerda no mobile. */
  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel.is-frontend-carousel {
    padding-inline: 0;
    scroll-padding-inline: 0;
  }

  /* Card destaque vira um retângulo fixo 340×540 alinhado à esquerda.
       Especificidade casa a regra geral .is-frontend-carousel ... __item
       (4 classes) e vence por vir depois no arquivo. */
  .tmc-ao-vivo-live-player
    .tmc-ao-vivo-carousel.is-frontend-carousel
    .tmc-ao-vivo-carousel__item--live {
    flex: 0 0 340px;
    max-width: 100%;
  }

  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--live .tmc-ao-vivo-iframe-wrap {
    padding-top: 0;
    width: 340px;
    max-width: 100%;
    height: 540px;
    border-radius: 20px;
    margin-right: auto; /* alinhado à esquerda */
  }

  /* Exibe o poster por cima do iframe (que segue mudo, sob a imagem).
       O play abre o vídeo num modal, então o poster permanece no card. */
  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--live .tmc-ao-vivo-mobile-poster {
    display: block;
  }

  /* Cards de programas anteriores acompanham o destaque: retrato 340×540.
       Sem isso, o align-items:stretch + padding-top 56.25% (16:9) deixa-os com
       altura divergente do card destaque. */
  .tmc-ao-vivo-live-player
    .tmc-ao-vivo-carousel.is-frontend-carousel
    .tmc-ao-vivo-carousel__item--previous {
    flex: 0 0 340px;
    max-width: 100%;
  }

  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--previous .tmc-ao-vivo-previous-card {
    padding-top: 0;
    width: 340px;
    max-width: 100%;
    height: 540px;
    border-radius: 20px;
  }

  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--previous .tmc-ao-vivo-prev-bg {
    border-radius: 20px;
  }

  /* Tipografia do overlay reduzida no mobile. */
  .tmc-ao-vivo-overlay__title {
    font-size: 40px;
  }

  .tmc-ao-vivo-overlay__subtitle {
    font-size: 16px;
    line-height: 1; /* 100% */
  }

  /* Botão "Informações sobre o programa" vira um ícone circular (ⓘ), usando o
       SVG de info. O rótulo textual é mantido no DOM (font-size:0) para leitores
       de tela. A borda some porque o próprio SVG já desenha o círculo.
       Especificidade (classe + atributo) vence as regras de botão acima. */
  .tmc-ao-vivo-btn--outline[data-action='description'] {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin-left: auto; /* empurra o ícone "i" para a direita */
    padding: 0;
    border-color: transparent;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    justify-content: center;
  }

  .tmc-ao-vivo-btn--outline[data-action='description'] .tmc-ao-vivo-chevron {
    display: none;
  }

  .tmc-ao-vivo-btn--outline[data-action='description'] .tmc-ao-vivo-info-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
  }

  .tmc-ao-vivo-btn--outline[data-action='description'] .tmc-ao-vivo-info-icon svg {
    width: 100%;
    height: 100%;
  }
}

/* ── Video modal ─────────────────────────────────────────────────────────────
 *
 * Aberto pelo view.js (apenas no mobile) ao tocar em "Assista agora". Exibe o
 * vídeo num diálogo de largura 100% sobre um backdrop escuro, em vez de
 * fullscreen nativo.
 */
.tmc-ao-vivo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh; /* preenche exatamente a tela visível, sem ultrapassar */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tmc-ao-vivo-modal[hidden] {
  display: none;
}

.tmc-ao-vivo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.tmc-ao-vivo-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  z-index: 1;
}

.tmc-ao-vivo-modal__video {
  position: relative;
  width: 100%;
  height: 100dvh; /* o YouTube faz o letterbox do 16:9 dentro da tela cheia */
  background: #000;
  overflow: hidden;
}

.tmc-ao-vivo-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tmc-ao-vivo-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.tmc-ao-vivo-modal__close:hover,
.tmc-ao-vivo-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

/* Trava a rolagem do body enquanto o modal está aberto. */
body.tmc-ao-vivo-modal-open {
  overflow: hidden;
}

/* Variante "boxed": modal centralizado em uma caixa 16:9 (usado pelos cards de
   programa anterior), em vez do overlay em tela cheia do play ao vivo. */
.tmc-ao-vivo-modal--boxed {
  padding: 16px;
}

.tmc-ao-vivo-modal--boxed .tmc-ao-vivo-modal__dialog {
  width: 100%;
  max-width: 960px;
  height: auto;
}

.tmc-ao-vivo-modal--boxed .tmc-ao-vivo-modal__video {
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

/* ── Floating sticky mini-player ─────────────────────────────────────────────
   When the live video has been played and more than 50% of it scrolls out of
   view, view.js pins it to the bottom-right corner (20px margin). The selector
   carries the same specificity as the --tmc-ao-vivo-max-height overrides above
   and comes later in the file, so it wins for the floating state. */
.tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--live .tmc-ao-vivo-iframe-wrap--floating {
  position: fixed;
  right: 20px;
  bottom: 100px;
  left: auto;
  top: auto;
  width: min(400px, calc(100vw - 40px));
  height: auto;
  max-height: none;
  padding-top: 0; /* neutralize the 16:9 padding-ratio trick */
  aspect-ratio: 16 / 9;
  margin: 0;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  animation: tmc-ao-vivo-float-in 200ms ease-out;
}

@keyframes tmc-ao-vivo-float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Close (×) button shown only on the floating mini-player. Pauses the video
   and dismisses the mini-player. */
.tmc-ao-vivo-float-close {
    position: absolute;
    top: 8px;
    right: 8px;
    /* Above the overlay (z-index: 10) and the iframe so it stays clickable. */
    z-index: 20;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: background-color 150ms ease;
}

.tmc-ao-vivo-float-close:hover,
.tmc-ao-vivo-float-close:focus-visible {
    background-color: rgba(0, 0, 0, 0.85);
}

@media (max-width: 640px) {
  .tmc-ao-vivo-live-player .tmc-ao-vivo-carousel__item--live .tmc-ao-vivo-iframe-wrap--floating {
    width: min(320px, calc(100vw - 40px));
  }
}

/* Skeleton left in the player's original spot while it is floating. Its height
   is set inline by view.js to match the player exactly. */
.tmc-ao-vivo-player-skeleton {
  /* width/height are set inline by view.js to the player's exact footprint. */
  max-width: 100%;
  border-radius: 16px;
  background-color: #2a2a2a;
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: tmc-ao-vivo-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes tmc-ao-vivo-skeleton-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmc-ao-vivo-player-skeleton {
    animation: none;
  }
}

/* ── Carousel nav arrows ─────────────────────────────────────────────────────
   Aparecem só em desktop (>= 769px). Posicionadas absolute em cima do carousel,
   ancoradas no .tmc-ao-vivo-live-player (que já é position:relative).
*/
.tmc-ao-vivo-carousel__nav {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  transition: background-color 200ms ease, opacity 200ms ease;
}

.tmc-ao-vivo-carousel__nav:hover {
  background: rgba(0, 0, 0, 0.85);
}

.tmc-ao-vivo-carousel__nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.tmc-ao-vivo-carousel__nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.tmc-ao-vivo-carousel__nav--prev {
  left: 16px;
}

.tmc-ao-vivo-carousel__nav--next {
  right: 16px;
}

@media (min-width: 769px) {
  .tmc-ao-vivo-carousel__nav {
    display: inline-flex;
  }
}
