/* Pagina */
.rassegne-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 */
.rs-layout{ display:grid; grid-template-columns:420px 1fr; gap:18px; align-items:start; min-height: 600px; }

/* Lista */
.rs-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;
}
.rs-empty{ padding:14px; font-weight:800; opacity:.8; }

/* Riga rassegna */
.rs-item{ padding:0; }
.rs-item-header{
  padding: 12px 14px;
  cursor:pointer;
  display:flex;
  gap:10px;
  align-items:center;
  border-bottom: 1px solid rgba(0,0,0,.12);
}
.rs-item:hover .rs-item-header{ background: rgba(255,255,255,.12); }
.rs-item.active .rs-item-header{
  outline: 2px solid rgba(122,0,0,.35);
  background: rgba(255,255,255,.14);
}
.rs-item .rs-bullet{ transition: transform .15s ease; }
.rs-item.active .rs-bullet{ transform: rotate(90deg); }
.rs-bullet{ font-size:14px; opacity:.9; }
.rs-name{ font-weight:900; }

/* Sottolista edizioni */
.rs-sublist{
  padding: 10px 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.05);
}
.rs-subitem{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.70);
  cursor:pointer;
  font-weight:900;
  text-align:left;
}
.rs-subitem:hover{ background: rgba(255,255,255,.82); }
.rs-subitem.active{ background:#7a0000; color:#fff; border-color: rgba(0,0,0,.05); }
.rs-subleft{ display:flex; gap:8px; align-items:baseline; }
.rs-subyear{ line-height:1.15; opacity:.92; }
.rs-subedi{ display:inline-block; opacity:.95; }
@media (max-width:420px){ .rs-subedi{ display:block; margin-top:2px; } }

/* Dettaglio */
.rs-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;
}
.rs-detail-head{ display:grid; grid-template-columns:160px 1fr; gap:14px; align-items:start; margin-bottom:12px; }
.rs-logo{
  width:160px; height:160px;
  border-radius:14px; overflow:hidden;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.10);
  display:flex; align-items:center; justify-content:center;
}
.rs-logo img{ width:100%; height:100%; object-fit:contain; display:block; background:#fff; }
.rs-title{ font-size:28px; font-weight:900; margin-bottom:4px; }
.rs-sub{ font-weight:900; opacity:.8; margin-bottom:10px; }

/* Tabs */
.rs-tabs{ display:flex; flex-wrap:wrap; gap:8px; }
.rs-tab{ border:0; cursor:pointer; border-radius:999px; padding:10px 14px; font-weight:900; background: rgba(255,255,255,.75); color:#1b1b1b; }
.rs-tab.active{ background:#7a0000; color:#fff; }

/* Iframe + bottone */
.rs-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;
}
.rs-iframe{
  width:100%;
  height:720px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background:#fff;
}

/* Spettacoli */
.rs-shows{
  margin:12px 0;
  padding:12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background: rgba(255,255,255,.72);
}
.rs-shows-title{ font-weight:900; margin-bottom:10px; }
.rs-shows-table{ display:flex; flex-direction:column; gap:8px; }
.rs-show-row{
  display:grid;
  grid-template-columns:120px 1fr;
  gap:10px;
  padding:10px;
  border-radius:12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.75);
}
.rs-show-date{ font-weight:900; opacity:.9; }
.rs-show-text{ font-weight:800; line-height:1.2; }
.rs-show-sub{ opacity:.85; font-weight:800; margin-top:4px; }
.rs-show-link{ text-decoration: underline; }

/* Messaggi */
.rs-message{
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  font-weight: 900;
}

/* Inline detail (mobile) */
.rs-detail.inline{ max-height:none; overflow:visible; margin-top:12px; }

/* Mobile */
@media (max-width:820px){
  .rs-layout{ grid-template-columns:1fr; }
  .rs-list, .rs-detail{ max-height:none; }
  .rs-detail-head{ grid-template-columns:120px 1fr; }
  .rs-logo{ width:120px; height:120px; }
  .rs-iframe{ height:520px; }
  .search{ min-width:220px; }
}
@media (max-width:600px){ .rs-item-header{ align-items:flex-start; gap:6px; } }
@media (max-width:480px){
  .rs-sublist{ padding-left:18px; }
  .rs-subitem{ padding:10px 12px; }
}

/* Assicura che l'attributo hidden funzioni anche con display:flex */
.rs-sublist[hidden]{ display:none !important; }

/* Marker usato solo per riposizionare il dettaglio: non deve occupare spazio in grid */
#rsDetailHome{ display:none; }

.rs-detail[hidden]{display:none !important;}

.btn.secondary{
  display:inline-block;
  background: rgba(255,255,255,.75);
  color:#1b1b1b;
  padding:10px 14px;
  border-radius:999px;
  text-decoration:none;
  font-weight:900;
  border: 1px solid rgba(0,0,0,.12);
  margin: 0 0 10px;
}

#backToShows[hidden]{display:none !important;}

.rs-years{
  font-weight: 900;
  opacity: .8;
  font-size: 12px;
  margin-top: 2px;
}



/* Fix overflow bottoni su mobile */
@media (max-width: 520px){
  .rs-detail{ padding: 12px; }
  .rs-detail-head{ grid-template-columns: 96px 1fr; gap: 10px; }
  .rs-logo{ width:96px; height:96px; }
  .rs-title{ font-size:22px; }
  .rs-tabs{
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }
  .rs-tab{
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1;
    max-width: 100%;
    white-space: nowrap;
  }
}

/* Ulteriore fix wrap bottoni (tab) su mobile stretto */
@media (max-width: 420px){
  .rs-tabs{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .rs-tab{
    width: 100%;
    justify-self: stretch;
    text-align: center;
    white-space: normal;
  }
}


/* Fix definitivo: tab sempre dentro lo schermo (mobile) */
.rs-meta{ min-width: 0; }
.rs-tabs{ min-width: 0; }
.rs-tab{ min-width: 0; }

@media (max-width: 560px){
  .rs-tabs{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .rs-tab{
    width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 360px){
  .rs-tabs{
    grid-template-columns: 1fr;
  }
}