/* Pagina */
.spettacoli-page .page{
  padding: 18px;
}

/* Titolo + ricerca */
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.page-title{
  margin: 0;
  font-size: 42px;
  letter-spacing: .5px;
}

.search{
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 0 14px;
  min-width: 280px;
}

/* Layout 2 colonne desktop */
.sp-layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  align-items:start;
}

/* Lista sinistra */
.sp-list{
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 18px;
  overflow:hidden;
  max-height: calc(100vh - 220px);
  overflow:auto;
}

.sp-empty{
  padding: 14px;
  font-weight: 800;
  opacity: .8;
}

.sp-item{
  padding: 12px 14px;
  cursor:pointer;
  border-bottom: 1px solid rgba(0,0,0,.12);
  display:flex;
  gap:10px;
  align-items:center;
}

.sp-item:hover{
  background: rgba(255,255,255,.12);
}

.sp-item.active{
  outline: 2px solid rgba(122,0,0,.35);
  background: rgba(255,255,255,.14);
}

.sp-bullet{
  font-size: 14px;
  opacity: .9;
}

.sp-name{
  font-weight: 900;
}

.sp-year-badge{
  margin-left:auto;
  font-weight: 900;
  opacity:.85;
}

/* Dettaglio destra */
.sp-detail{
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 18px;
  padding: 14px;
  max-height: calc(100vh - 220px);
  overflow:auto;
}

.sp-detail-head{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items:start;
  margin-bottom: 12px;
}

.sp-poster{
  width: 160px;
  height: 220px;
  border-radius: 14px;
  overflow:hidden;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.10);
}

.sp-poster img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.sp-title{
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 4px;
}

.sp-year{
  font-weight: 900;
  opacity: .8;
  margin-bottom: 10px;
}

/* Tabs (menu sezioni) */
.sp-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.sp-tab{
  border: 0;
  cursor:pointer;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  background: rgba(255,255,255,.75);
  color: #1b1b1b;
}

.sp-tab.active{
  background: #7a0000;
  color: #fff;
}

/* Iframe + bottone */
.sp-frame-wrap{
  margin-top: 10px;
}

.btn.primary{
  display:inline-block;
  background:#7a0000;
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  text-decoration:none;
  font-weight:900;
  margin-bottom:10px;
}

.sp-iframe{
  width:100%;
  height: 720px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background:#fff;
}

/* Mobile */
@media (max-width: 1023px){
  .sp-layout{
    grid-template-columns: 1fr;
  }
  .sp-list, .sp-detail{
    max-height: none;
  }
  .sp-detail-head{
    grid-template-columns: 120px 1fr;
  }
  .sp-poster{
    width: 120px;
    height: 170px;
  }
  .sp-iframe{
    height: 520px;
  }
  .search{
    min-width: 220px;
  }
}

/* Mobile: non usare il pannello destro, usiamo accordion inline */
@media (max-width: 1023px){
  .sp-detail{ display:none; }
	
  /* riga: freccia | titolo (a capo) | anno */
  .sp-item{
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 8px 10px;
    align-items: start;
  }
  .sp-bullet{
    grid-column: 1;
    line-height: 1.2;
    margin-top: 2px;
  }
	
  /* dettaglio sotto: occupa tutta la riga */
  .sp-details{
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
	 /* opzionale: riga titolo più pulita */
  .sp-name{
    flex: 1 1 auto;
    min-width: 0;
  }
	
  .sp-year-badge{
    grid-column: 3;
    justify-self: end;
    white-space: nowrap;
    font-weight: 900;
    opacity: .85;
  }

  .sp-details .sp-minihead{
    display:flex;
    gap:10px;
    align-items:flex-start;
    margin-bottom:10px;
  }

  .sp-details .sp-minihead img{
    width: 70px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,.12);
    background:#fff;
  }

  .sp-details .sp-miniinfo{
    font-weight: 800;
    line-height: 1.25;
  }

  .sp-details .sp-miniyear{
    opacity:.8;
    margin-top:4px;
  }

  .sp-details .sp-minitabs{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin: 10px 0 10px;
  }

  .sp-details .sp-minitab{
    border:0;
    border-radius:999px;
    padding:8px 10px;
    font-weight:900;
    cursor:pointer;
    background: rgba(255,255,255,.95);
  }

  .sp-details .sp-minitab.active{
    background:#7a0000;
    color:#fff;
  }

  .sp-details iframe{
    width:100%;
    height: 520px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    background:#fff;
  }
  .sp-name{
    grid-column: 2;
    font-weight: 900;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;   /* spezza anche parole lunghe */
    word-break: break-word;
  }
	

  /* menu a destra, compatto */
  .sp-menu{ margin:0; }
  .sp-menu-btn{
    width:38px;
    height:38px;
    padding:0;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

 /* “Sezione corrente” come pill piccola */
  .sp-current{ margin-top:8px; margin-bottom:10px; }
  .sp-current-pill{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    background: rgba(255,255,255,.85);
    font-weight:900;
  }

  /* dropdown a destra */
  .sp-menu-pop{
    left:auto;
    right:0;
  }

  .sp-menu.open .sp-menu-pop{
    display: block;
  }

  .sp-menu-item{
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 10px;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
  }

  .sp-menu-item:hover{
    background: rgba(0,0,0,.06);
  }

  .sp-menu-item.active{
    background: #7a0000;
    color: #fff;
  }
		
  .sp-minirow{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
  }

.sp-minitext{ min-width: 160px; }

  .sp-minititle{
    font-weight:900;
    line-height:1.15;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
	
	 /* contenitore menu: riferimento per absolute */
  .sp-menu{
    position: relative !important;
    margin: 0 !important;
    z-index: 20;
  }

  /* tendina: NON deve occupare spazio */
  .sp-menu-pop{
    display: none !important;         /* default chiusa */
    position: absolute !important;    /* overlay */
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;

    z-index: 9999 !important;
    width: min(260px, 80vw) !important;

    background: rgba(255,255,255,.98) !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    border-radius: 14px !important;
    padding: 8px !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.22) !important;
  }

  /* solo quando .open */
  .sp-menu.open .sp-menu-pop{
    display: block !important;
  }

  /* items */
  .sp-menu-item{
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 10px;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
  }

  .sp-menu-item.active{
    background: #7a0000;
    color: #fff;
  }
	  .sp-menu{ position: relative !important; margin:0 !important; z-index: 20; }

  .sp-menu-pop{
    display:none !important;
    position:absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9999 !important;
    width: min(260px, 80vw) !important;
    background: rgba(255,255,255,.98) !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    border-radius: 14px !important;
    padding: 8px !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.22) !important;
  }

  .sp-menu.open .sp-menu-pop{ display:block !important; }
}
	



