/* 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: break-word;  /* NO 'anywhere' */
  word-break: normal;
  hyphens: auto;
  min-width: 0;
}

.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{
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,.12);
}
  .sp-head{
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 6px 10px;
    align-items: start;
  }
  .sp-bullet{ grid-column: 1; margin-top: 2px; }
  .sp-name{ grid-column: 2; }
  
.sp-year-badge{
  margin-left: auto;
  flex: 0 0 auto;
  font-weight: 900;
  opacity: .9;
}
.sp-name{
  font-weight: 900;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

  /* 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;
  }
}
/* Album esterno (Amazon/altro) */
.ext-wrap{
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(0,0,0,.10);
}

.ext-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.ext-title{
  font-weight: 900;
  opacity: .9;
}

.ext-iframe{
  width:100%;
  height: 520px;          /* “presentazione” */
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background:#fff;
}

.ext-hint{
  margin-top: 8px;
  font-weight: 800;
  opacity: .75;
  font-size: 12px;
  line-height: 1.25;
}

/* Mobile: un po' più basso */
@media (max-width: 1023px){
  .ext-iframe{ height: 420px; }
}

.foto-list{
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.08);
}

.foto-row{
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 4px 8px;        /* ⬅⬅⬅ CHIAVE: pochissimo padding */
  margin-bottom: 4px;      /* distanza minima tra righe */

  background: rgba(0,0,0,0.15); /* rosso scuro leggero */
  border-radius: 8px;

  text-decoration: none;
  color: inherit;
}

.foto-row:first-child{ border-top: 0; }

.foto-row:hover{ background: rgba(255,255,255,.08); }

.foto-row.active{
  background: rgba(255,255,255,.16);
}

.foto-row-main{
  display: flex;
  flex-direction: column;
  gap: 2px;          /* ⬅ quasi attaccato */
}

.foto-row-title{
  font-weight: 700;
  line-height: 1.1;
}

.foto-row-meta{
  font-size: 12px;
  line-height: 1.1;
  opacity: 0.95;
}

.foto-row-icon{
  flex: 0 0 auto;
  font-weight: 900;
  opacity: .85;
}
/* Mobile: lista righe foto dentro espansione */
.foto-list.inline{
  margin-top: 10px;
}
.foto-row{
  display:block;
  text-decoration:none;
  color: inherit;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 14px 14px;
  margin: 10px 0;
  border: 1px solid rgba(0,0,0,.12);
}

.foto-row:hover{
  filter: brightness(1.05);
}

.foto-row:active{
  transform: translateY(1px);
}

.foto-row-title{
  font-weight: 800;
  letter-spacing: .4px;
}

.foto-row-sub{
  margin-top: 6px;
  font-weight: 600;
  opacity: .95;
}

.foto-row-note{
  margin-top: 8px;
  font-weight: 600;
  opacity: .9;
}
/* =========================
   Lista righe foto (link album)
   ========================= */
.foto-list{
  display:flex;
  flex-direction:column;
  gap:6px;                 /* poco spazio tra le righe */
  margin:10px 0 12px;
  padding:0;
}

.foto-list.inline{
  margin:8px 0 10px;
}

/* Riga */
.foto-row{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:6px 10px;        /* fascia scura bassa */
  border-radius:8px;

  text-decoration:none;
  color: inherit;

  background: rgba(0,0,0,.12);            /* “scuro” leggero */
  border: 1px solid rgba(0,0,0,.10);
  margin:0;                               /* niente margini verticali */
}

.foto-row:hover{ background: rgba(255,255,255,.10); }

.foto-row-main{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.foto-row-title{
  font-weight:800;
  line-height:1.15;
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}

.foto-row-meta{
  font-size:12px;
  line-height:1.1;
  opacity:.95;
}

.foto-row-icon{
  flex:0 0 auto;
  font-weight:900;
  opacity:.85;
  margin-left:10px;
}

/* MOBILE: il dettaglio deve stare SOTTO al titolo (non di lato) */
@media (max-width: 860px) {
  .sp-item {
    display: block !important;   /* oppure flex + column, ma block è perfetto qui */
  }

  .sp-head {
    display: grid !important;
    grid-template-columns: 22px 1fr auto; /* freccia | titolo | anno */
    align-items: center;
    gap: 10px;
  }

  .sp-name {
    min-width: 0;                /* evita comportamenti strani in grid */
    white-space: normal;         /* consente andare a capo bene */
    word-break: break-word;      /* titoli lunghi */
  }

  .sp-details {
    display: block !important;
    width: 100%;
    margin-top: 10px;
  }
}

