/* Player centrale della Home: due canali nella stessa scatola.
   1) Diretta TV — il player dello streaming.
   2) Videopresentazioni — il canale continuo con le videoslide in sequenza.
   Il secondo canale prende il posto del primo quando viene attivato. */

main#top > .home-player-embed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  aspect-ratio: auto;
  border: 1px solid rgba(68, 50, 56, .18);
  border-radius: 22px;
  background: #171522;
  overflow: hidden;
}

/* Barra dei canali: dice sempre che cosa è in onda e lascia cambiare canale. */
#homePlayerEmbed .home-channel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: linear-gradient(180deg, #211e30 0%, #191623 100%);
}

#homePlayerEmbed .home-channel-now {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #f4ead9;
  font: 850 .7rem/1.1 system-ui, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

#homePlayerEmbed .home-channel-now-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a3c;
  box-shadow: 0 0 0 4px rgba(255, 90, 60, .18);
}

#homePlayerEmbed[data-home-channel-state="slide"] .home-channel-now-dot {
  background: #ffd166;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .2);
}

#homePlayerEmbed .home-channel-now-slide { display: none; }

#homePlayerEmbed[data-home-channel-state="slide"] .home-channel-now-live { display: none; }
#homePlayerEmbed[data-home-channel-state="slide"] .home-channel-now-slide { display: inline; }

#homePlayerEmbed .home-channel-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}

#homePlayerEmbed .home-channel-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #cbc2b4;
  font: 850 .78rem/1 system-ui, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

#homePlayerEmbed .home-channel-tab:hover {
  color: #fff5e2;
  background: rgba(255, 255, 255, .08);
}

#homePlayerEmbed .home-channel-tab:focus-visible {
  outline: 3px solid rgba(255, 209, 102, .45);
  outline-offset: 2px;
}

#homePlayerEmbed .home-channel-tab[aria-selected="true"] {
  background: linear-gradient(135deg, #ffe9b0 0%, #f6bf4d 58%, #dfa02c 100%);
  color: #2b1c07;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

/* Il riquadro del video resta 16:9: cambia solo quello che ci gira dentro. */
#homePlayerEmbed .home-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f0d16;
}

#homePlayerEmbed .home-player-pane {
  position: absolute;
  inset: 0;
}

#homePlayerEmbed .home-player-pane[hidden] { display: none !important; }

#homePlayerEmbed .home-player-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f0d16;
}

#homePlayerEmbed .home-player-status {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: 82%;
  margin: 0;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(9, 8, 14, .82);
  color: #f6efe3;
  font: 750 .84rem/1.3 system-ui, sans-serif;
  text-align: center;
  transform: translate(-50%, -50%);
}

#homePlayerEmbed .home-player-status[hidden] { display: none !important; }

/* Banner del secondo canale: spiega le videopresentazioni e riporta in diretta. */
#homePlayerEmbed .home-slide-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 22px;
  padding: 17px 20px 19px;
  border-top: 1px solid rgba(255, 209, 102, .24);
  background: linear-gradient(135deg, #24202f 0%, #171522 72%);
}

#homePlayerEmbed .home-slide-banner[hidden] { display: none !important; }

#homePlayerEmbed .home-slide-banner-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* Pulsante di soccorso: compare solo se il canale non si apre nella
   finestrella, e lo apre a tutto schermo. */
#homePlayerEmbed .home-slide-open {
  position: absolute;
  top: calc(50% + 34px);
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255, 209, 102, .55);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe9b0 0%, #f6bf4d 58%, #dfa02c 100%);
  color: #2b1c07;
  font: 900 .84rem/1 system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transform: translate(-50%, 0);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
}

#homePlayerEmbed .home-slide-open:hover { filter: brightness(1.05); }

#homePlayerEmbed .home-slide-open:focus-visible {
  outline: 3px solid rgba(255, 209, 102, .6);
  outline-offset: 3px;
}

#homePlayerEmbed .home-slide-open[hidden] { display: none !important; }

#homePlayerEmbed .home-slide-banner h3 {
  margin: 0;
  color: #fff7e8;
  font: 900 clamp(1.12rem, 2.4vw, 1.55rem)/1.14 Georgia, serif;
  letter-spacing: -.01em;
}

#homePlayerEmbed .home-slide-banner-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid rgba(255, 209, 102, .5);
  border-radius: 999px;
  background: rgba(255, 209, 102, .12);
  color: #ffe3a4;
  font: 850 .84rem/1 system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

#homePlayerEmbed .home-slide-banner-back:hover {
  border-color: #ffd166;
  background: linear-gradient(135deg, #ffe9b0 0%, #f6bf4d 58%, #dfa02c 100%);
  color: #2b1c07;
}

#homePlayerEmbed .home-slide-banner-back:focus-visible {
  outline: 3px solid rgba(255, 209, 102, .5);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  main#top > .home-player-embed { border-radius: 16px; }

  #homePlayerEmbed .home-slide-open {
    top: calc(50% + 30px);
    min-height: 44px;
    padding: 0 16px;
    font-size: .78rem;
  }

  #homePlayerEmbed .home-channel-bar {
    padding: 10px 11px;
  }

  #homePlayerEmbed .home-channel-switch {
    width: 100%;
    justify-content: stretch;
  }

  #homePlayerEmbed .home-channel-tab {
    flex: 1 1 0;
    min-height: 42px;
    padding: 0 10px;
    font-size: .74rem;
  }

  #homePlayerEmbed .home-slide-banner {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 15px 14px 17px;
  }

  #homePlayerEmbed .home-slide-banner-back {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 380px) {
  #homePlayerEmbed .home-channel-now { font-size: .64rem; }
}
