/** CAT MENU START **/
#catMenuWrapper {
  width: 100%;
  position: relative;
}

/* bottone mobile */
.catMenu-mobile-toggle {
  display: none;
  width: 100%;
  padding: 14px 16px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #3b63dc 0%, #db1461 100%);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.catMenu {
  position: relative;
  display: flex;
  margin: 20px 0 20px !important;
  justify-content: space-around;
  flex-direction: row;
  border-bottom: 1px solid #343434;
  padding-bottom: 20px;
  column-gap: 12px;
}

.catMenu .dropdown {
  flex: 1;
  width: 100%;
  position: relative;
}

.catMenu .dropdown > a,
.catMenu a.catMenu-item,
.catMenu a.btn-secondary.dropdown-toggle {
  color: #f6f4e6;
  text-decoration: none;
  font-size: 16px;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  width: 100%;
  text-align: center;
  border-radius: 6px;
  transition: all 0.3s ease-in-out;
  padding: 10px 14px;
  background: linear-gradient(135deg, #db1461 0%, #3b63dc 100%);
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.catMenu .dropdown > a:hover,
.catMenu a.catMenu-item:hover,
.catMenu a.btn-secondary.dropdown-toggle:hover {
  background: linear-gradient(135deg, #db146121 0%, #3b63dc2e 100%);
  color: #fff;
}

.catMenu .dropdown-menu {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 !important;
  min-width: 190px;
  box-shadow: none;
  margin-top: 6px !important;
}

.catMenu .dropdown-menu .dropdown-item {
  padding: 0;
  margin: 0;
  background: transparent;
}

.catMenu .dropdown-menu .dropdown-item + .dropdown-item {
  margin-top: 8px;
}

.catMenu .dropdown-menu .dropdown-item a {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, #db1461 0%, #3b63dc 100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.catMenu .dropdown-menu .dropdown-item a:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* mobile cat menu */
@media only screen and (max-width: 767px) {
  .catMenu-mobile-toggle {
    display: block;
  }

  .catMenu {
    display: none;
    flex-direction: column;
    width: 100%;
    border-bottom: 1px solid #343434;
    padding-bottom: 0;
    row-gap: 8px;
    margin-top: 12px !important;
  }

  .catMenu.open {
    display: flex;
  }

  .catMenu .dropdown {
    width: 100%;
  }

  .catMenu .dropdown > a,
  .catMenu a.catMenu-item,
  .catMenu a.btn-secondary.dropdown-toggle {
    width: 100%;
    min-height: 54px;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #1c1c1c;
  }

  .catMenu .dropdown-menu {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;
    width: 100%;
    min-width: 100%;
    margin-top: 0 !important;
    padding: 8px !important;
    border-radius: 0;
    background: #111;
    box-shadow: none;
  }

  .catMenu .dropdown-menu .dropdown-item a {
    min-height: 48px;
    font-size: 13px;
    border-radius: 6px;
    background: linear-gradient(135deg, #2a0d1d 0%, #182447 100%);
  }
}

/** CAT MENU END **/

/** NEXT EVENT START **/
div#next-event {
  border-top: 1px solid #343434;
  padding-top: 20px;
}
/* Altezza massima locandine: indipendente dal numero di slide visibili */
#next-event .owl-item img {
  width: auto;
  max-width: 100%;
  max-height: min(24vh, 145px);
  margin: 0 auto;
  object-fit: contain;
}

/** NEXT EVENT END **/

/** user Section START **/
.users-section {
  position: relative;
  margin: 20px 0 20px !important;
  border-top: 1px solid #343434;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.userMenu {
  position: relative;
  display: flex;
  margin: 0 0 20px;
  justify-content: space-around;
  flex-direction: row;
  width: 100%;
}

.userMenu > * {
  display: flex;
  width: calc(100% / 5.1);
  text-align: center;
  color: #f6f4e6;
  font-size: 16px;
  align-items: center;
  justify-content: center;
}

.userMenu > div {
  display: flex;
  width: calc(100% / 5.1);
  text-align: center;
  color: #f6f4e6;
  font-size: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.userMenu > div > b {
  color: red;
  margin-bottom: 5px;
  font-size: 20px;
}

.userMenu a {
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 2px;
  transition: all 0.5s ease-in-out;
  padding: 10px;
  background: linear-gradient(135deg, #db146121 0%, #3b63dc2e 100%);
  height: 70px;
}

.userMenu a:hover {
  background: linear-gradient(135deg, #db1461 0%, #3b63dc 100%);
  color: white;
}

@media only screen and (max-width: 797px) {
  .userMenu {
    flex-direction: column;
    margin-left: -20px;
    width: calc(100% + 40px);
  }

  .userMenu a {
    width: 100%;
    background: linear-gradient(135deg, #db146121 0%, #3b63dc2e 100%);
  }

  .userMenu a:not(:last-child) {
    margin-bottom: 5px;
  }

  .userMenu > div {
    width: 100%;
    padding: 25px;
  }
}

.users-section .users .this-user {
  display: flex;
  align-items: center;
  flex-direction: row;
  margin-bottom: 10px;
  float: left;
  background: #f7f7f7;
  margin-right: 5px;
  padding: 10px 15px;
  border-radius: 5px;
  min-width: calc(100% / 5 - 10px);
  margin-left: 5px;
}

@media only screen and (max-width: 1150px) {
  .users-section .users .this-user {
    min-width: calc(100% / 4 - 10px);
  }
}

@media only screen and (max-width: 880px) {
  .users-section .users .this-user {
    min-width: calc(100% / 3 - 10px);
  }
}

.users-section .users .this-description {
  max-height: 190px;
  overflow: hidden;
  overflow-y: auto;
}

.users-section .users .this-user .this-user__img {
  background: linear-gradient(135deg, #3b63dc 0%, #db1461 100%);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 40px;
  display: flex;
  margin-right: 10px;
}

.users-section .users .this-user .this-user__img img {
  width: 24px;
}

.users-section .users .this-user h3 {
  font-size: 16px;
}

@media only screen and (max-width: 797px) {
  .users-section .users .this-user {
    width: calc(50% - 10px);
  }

  .users-section .users .this-user:nth-child(even) {
    margin-right: 0;
  }
}

@media only screen and (max-width: 450px) {
  .users-section .users .this-user {
    width: calc(100% - 10px);
  }
}

.show-users {
  cursor: pointer;
  font-size: 10px;
  padding: 10px;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.25px;
  -webkit-transition: all 0.3s ease 0s;
  -moz-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
  background: linear-gradient(135deg, #db1461 0%, #3b63dc 100%);
  text-align: center;
  max-width: 400px;
  font-weight: 600;
  border-radius: 2px;
  display: block;
}

.show-users:hover {
  color: white;
}

/** user Section END **/

/** home logged carousel block **/
.main-slide-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  row-gap: 20px;
  align-items: stretch;
}

.left-sponsor,
.right-sponsor,
.owl-col {
  width: 100%;
  max-width: 100%;
}

.left-sponsor,
.right-sponsor {
  flex: 0 0 100%;
}

.owl-col {
  flex: 0 0 100%;
  position: relative;
}

/* card style per i 3 blocchi */
.left-sponsor,
.right-sponsor,
.owl-col {
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* immagini sponsor */
.sponsor-img-box {
  width: 100%;
}

.sponsor-img-box img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
}

.right-sponsor .sponsor-img-box img {
  margin: 0;
}

/* Sponsor: annulla margine e padding delle slide generiche di carousel.css,
   così l'immagine è a filo con la card (allineata a menu e linea) */
.left-sponsor .item-slide,
.right-sponsor .item-slide {
  margin: 0;
  box-shadow: none;
}

.left-sponsor .item-slide .item-slide-img.sponsor-img-box,
.right-sponsor .item-slide .item-slide-img.sponsor-img-box {
  padding: 0;
}

/* media centrale responsive */
.item-slide-video iframe,
.item-slide-video video,
.item-slide-video embed {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.item-slide-img img {
  display: block;
  width: 100%;
  height: auto;
}

.empty-live-slide {
  min-height: 260px;
  margin: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #141414 0%, #212121 100%);
}

.empty-live-message {
  width: 100%;
  text-align: center;
  color: #f6f4e6;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 48px 56px;
  text-transform: uppercase;
}

/* badge LIVE sempre sopra e più a destra */
#diretta-carousel .live,
#diretta-carousel .live-badge,
#diretta-carousel .live-label,
.live,
.live-badge,
.live-label {
  position: absolute;
  top: 10px;
  left: 28px;
  z-index: 50;
}

/* nasconde sempre controlli dei caroselli sponsor */
#left-carousel .owl-nav,
#left-carousel .owl-dots,
#right-carousel .owl-nav,
#right-carousel .owl-dots {
  display: none !important;
}

/* solo il carosello centrale mostra la nav */
#diretta-carousel .owl-nav {
  display: block !important;
}

#diretta-carousel .owl-nav.disabled {
  display: block !important;
}

#diretta-carousel .owl-dots {
  display: none !important;
}

/* frecce centrali con barre laterali gradient */
#diretta-carousel .owl-nav button.owl-prev,
#diretta-carousel .owl-nav button.owl-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 40px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1;
  z-index: 5;
  transition: opacity 0.3s ease;
}

#diretta-carousel .owl-nav button.owl-prev {
  left: 0;
  background: linear-gradient(135deg, #3b63dc 0%, #db1461 100%) !important;
}

#diretta-carousel .owl-nav button.owl-next {
  right: 0;
  background: linear-gradient(135deg, #db1461 0%, #3b63dc 100%) !important;
}

#diretta-carousel .owl-nav button.owl-prev:hover,
#diretta-carousel .owl-nav button.owl-next:hover {
  opacity: 0.85;
}

#diretta-carousel .owl-nav button.owl-prev span,
#diretta-carousel .owl-nav button.owl-next span {
  line-height: 1;
  display: block;
  position: relative;
  top: -1px;
}

/* sicurezza: nessuna freccia ereditata sui lati */
.left-sponsor .owl-nav,
.right-sponsor .owl-nav,
.left-sponsor .owl-prev,
.left-sponsor .owl-next,
.right-sponsor .owl-prev,
.right-sponsor .owl-next {
  display: none !important;
}

/* layout desktop 20 | 60 | 20 */
@media only screen and (min-width: 768px) {
  .main-slide-wrap {
    flex-direction: row;
    /* FIX: center invece di stretch → il player non si allunga artificialmente
       quando gli sponsor sono più alti, evitando lo spazio nero sotto */
    align-items: center;
    column-gap: 20px;
    row-gap: 0;
  }

  .left-sponsor,
  .right-sponsor {
    flex: 20 1 0%;
    width: auto;
    max-width: none;
    align-self: stretch;
  }

  .owl-col {
    flex: 60 1 0%;
    width: auto;
    max-width: none;
  }
}
/* ottimizzazione mobile sponsor e live */
@media only screen and (max-width: 767px) {
  .main-slide-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 14px;
    column-gap: 0;
    align-items: stretch;
  }


  .owl-col {
    order: 1;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  .left-sponsor {
    order: 2;
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    min-height: 120px;
    max-height: 150px;
    padding-right: 7px;
  }

  .right-sponsor {
    order: 3;
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    min-height: 120px;
    max-height: 150px;
    padding-left: 7px;
  }

  .sponsor-img-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 150px;
    padding: 10px 14px;
  }

  .sponsor-img-box img {
    width: auto;
    max-width: 100%;
    max-height: 120px;
    height: auto;
    object-fit: contain;
  }

  .item-slide-video,
  .item-slide-video iframe,
  .item-slide-video video,
  .item-slide-video embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: unset;
    max-height: 240px;
  }

  .item-slide-img img {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
  }

  #diretta-carousel .live,
  #diretta-carousel .live-badge,
  #diretta-carousel .live-label,
  .live,
  .live-badge,
  .live-label {
    top: 8px;
    left: 46px;
    z-index: 50;
  }

  #diretta-carousel .owl-nav button.owl-prev,
  #diretta-carousel .owl-nav button.owl-next {
    width: 28px;
    font-size: 28px !important;
  }

  #diretta-carousel .owl-nav button.owl-prev {
    left: 0;
  }

  #diretta-carousel .owl-nav button.owl-next {
    right: 0;
  }

  .empty-live-slide {
    min-height: 190px;
  }

  .empty-live-message {
    font-size: 16px;
    padding: 32px 34px;
  }
}



/* manage embedded player */
/** LIVE PLAYER START **/
.live-container {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.live-player-shell {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
}

.live-player-embed {
  width: 100%;
}

.live-player-embed iframe,
.live-player-embed video {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
  border: 0;
  background: #000;
  min-height: 70vh;
}

/* Desktop */
@media only screen and (min-width: 992px) {
  .live-player-shell {
    max-width: 1200px;
  }

  .live-player-embed iframe,
  .live-player-embed video {
    min-height: 70vh;
    max-height: 80vh;
  }
}

/* Tablet */
@media only screen and (max-width: 991px) {
  .live-player-embed iframe,
  .live-player-embed video {
    min-height: 56vw;
    max-height: 75vh;
  }
}

/* Mobile */
@media only screen and (max-width: 767px) {
  .live-player-embed iframe,
  .live-player-embed video {
    min-height: 60vw;
    max-height: 65vh;
  }
}

/** LIVE PLAYER END **/

/* Bottoni super-piccoli per live */
/* Forza font-size solo sui bottoni .btn-xxs, anche se hanno .btn, .btn-sm ecc. */
.btn.btn-xxs, .btn-xxs {
    font-size: 10px !important;
    padding: 1px 3px !important;
    line-height: 1.2 !important;
}

/* Chat live: lista con scroll interno e ultimo messaggio sempre raggiungibile */
#chat #messages {
  width: 100%;
}

#chat #message-list {
  width: 100%;
  min-height: 50px;
  max-height: clamp(180px, 34vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 8px;
}

#chat #message-list li {
  padding: 3px 4px;
}

@media only screen and (max-width: 767px) {
  #chat #message-list {
    max-height: 40vh;
  }
}

#next-event .js-poster-zoom { cursor: zoom-in; }

.poster-lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
/* display solo quando aperto, altrimenti sovrascrive il display:none nativo */
.poster-lightbox[open] { display: flex; overflow: auto; }
.poster-lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }

.poster-lightbox__img {
    margin: auto; /* centra, ma non taglia quando l'immagine è più grande dello schermo */
    max-width: 95vw;
    max-height: 95dvh;
    object-fit: contain;
    cursor: zoom-in;
}
.poster-lightbox.is-zoomed .poster-lightbox__img {
    max-width: none;
    max-height: none;
    width: 200%;
    cursor: zoom-out;
}

.poster-lightbox__close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

body:has(.poster-lightbox[open]) { overflow: hidden; }
