/* 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;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sp-year-badge{
  margin-left:auto;
  font-weight: 900;
  opacity:.85;
  white-space: nowrap;
}

/* 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: 6px;
}

.sp-note{
  font-weight: 800;
  opacity: .85;
}

/* 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{ display:none; } /* su mobile usiamo accordion inline */
  .search{ min-width: 220px; }
}

/* Mobile: accordion inline */
@media (max-width: 1023px){
  /* 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;
  }
  .sp-year-badge{
    grid-column: 3;
    justify-self: end;
  }
  .sp-name{
    grid-column: 2;
    line-height: 1.15;
  }

  /* dettaglio sotto */
  .sp-details{
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 10px;
  }

  .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 iframe{
    width:100%;
    height: 520px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    background:#fff;
  }
}
