/* Sabatini al volo – v0.5 (7/11/2026). Tutto con prefisso sab- per non toccare il tema.
   I pulsanti hanno selettori «rinforzati» (button.… / .sab-velo …): il tema Hello colora
   di rosa ogni [type=button], anche al passaggio e al fuoco. */

/* il periodo preso dalla selezione, e (facoltativo) i periodi già pronti */
::highlight(sab-periodo) { background-color: rgba(224, 35, 31, .16); }
::highlight(sab-pronte)  { background-color: rgba(233, 196, 106, .40); }

/* ---------- pulsante sotto la selezione ---------- */
button.sab-pulsante {
  position: fixed; z-index: 99998; margin: 0;
  font: 700 17px/1.2 "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: #fff; background: #e0231f; border: 0; border-radius: 999px;
  padding: 11px 20px; box-shadow: 0 4px 14px rgba(0,0,0,.2); cursor: pointer;
  white-space: nowrap; text-transform: none; letter-spacing: normal; width: auto;
}
button.sab-pulsante[hidden] { display: none; }
button.sab-pulsante:hover, button.sab-pulsante:focus { background: #c01a17; color: #fff; }
button.sab-pulsante:focus-visible { outline: 3px solid #16399b; outline-offset: 2px; }
button.sab-pulsante.sab-spento,
button.sab-pulsante.sab-spento:hover,
button.sab-pulsante.sab-spento:focus { background: #fff; color: #555; border: 1px solid #ccc; font-weight: 400; cursor: default; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* ---------- riquadro sopra la pagina ---------- */
html.sab-aperto { overflow: hidden; }
.sab-velo {
  position: fixed; inset: 0; z-index: 99999; box-sizing: border-box;
  background: rgba(20,20,20,.55); padding: 2vh 2vw;
  display: flex; align-items: center; justify-content: center;
}
.sab-velo[hidden] { display: none; }
.sab-velo *, .sab-velo *::before, .sab-velo *::after { box-sizing: border-box; }
.sab-pannello {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: #1a1a1a;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  width: min(1120px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  text-align: left; line-height: 1.4; letter-spacing: normal;
}
.sab-testata { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 22px; border-bottom: 1px solid #eee; }
.sab-titolo { font-weight: 700; font-size: 20px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sab-interruttore { font-size: 16px; color: #555; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; margin: 0; }
.sab-velo .sab-interruttore input { width: 18px; height: 18px; accent-color: #e0231f; margin: 0; }

/* pulsanti del riquadro: base comune, poi le varianti */
.sab-velo button {
  font-family: inherit; font-weight: 400; line-height: 1.2; text-transform: none; letter-spacing: normal;
  margin: 0; width: auto; box-shadow: none; transition: background-color .2s;
}
.sab-velo .sab-chiudi, .sab-velo .sab-torna {
  background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; color: #444; cursor: pointer;
}
.sab-velo .sab-chiudi { font-size: 22px; line-height: 1; }
.sab-velo .sab-torna { font-size: 17px; white-space: nowrap; }
.sab-velo .sab-chiudi:hover, .sab-velo .sab-chiudi:focus,
.sab-velo .sab-torna:hover, .sab-velo .sab-torna:focus { background: #f2f2f2; color: #222; }
.sab-velo .sab-torna[hidden], .sab-scelta[hidden], .sab-vista[hidden] { display: none; }

.sab-vista { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.sab-palco { padding: 8px 12px 0; display: flex; justify-content: center; }
.sab-svg { display: block; width: 100%; height: auto; max-height: 56vh; overflow: visible; }
.sab-svg-camera { height: min(56vh, 58vw); }   /* periodo intero: la camera si sposta, il riquadro resta fermo */

/* la frase sotto lo schema: le parole si colorano quando entrano nello schema */
.sab-riga { display: grid; padding: 4px 20px 0; }
.sab-frase { grid-area: 1 / 1; align-self: center; font-size: 26px; line-height: 1.6; text-align: center; color: #8a8a8a; opacity: 0; transition: opacity .5s; margin: 0; }
.sab-frase.on { opacity: 1; }
.sab-pz { color: #8a8a8a; border-bottom: 5px solid transparent; padding: 0 1px; transition: color .5s, border-color .5s; }
.sab-pz.on { color: #1a1a1a; }
.sab-pz.on.sab-verbo { border-color: #e0231f; }
.sab-pz.on.sab-soggetto { border-color: #4a7fd8; }
.sab-pz.on.sab-oggetto_diretto { border-color: #35d2ee; }
.sab-pz.on.sab-oggetto_indiretto { border-color: #1fc3c3; }
.sab-pz.on.sab-circostante, .sab-pz.on.sab-espansione { border-color: #e9c46a; }
.sab-pz.on.sab-congiunzione { border-color: #1f9d57; color: #1f9d57; font-weight: 700; }

.sab-didascalia { min-height: 3.2em; font-size: 20px; line-height: 1.45; color: #333; text-align: center; padding: 6px 28px; display: flex; align-items: center; justify-content: center; }
.sab-didascalia b { color: #1a1a1a; }
.sab-nome { display: none; color: #777; font-size: .9em; }
.sab-con-nomi .sab-nome { display: inline; }

.sab-comandi { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 6px 16px 18px; }
.sab-velo .sab-comandi button {
  font-size: 17px; padding: 9px 18px; border: 1px solid #bbb; border-radius: 8px;
  background: #fff; color: #1a1a1a; cursor: pointer; white-space: nowrap;
}
.sab-velo .sab-comandi button:hover, .sab-velo .sab-comandi button:focus { background: #f2f2f2; color: #1a1a1a; border-color: #999; }
.sab-velo .sab-comandi button:disabled, .sab-velo .sab-comandi button:disabled:hover { opacity: .4; cursor: default; background: #fff; border-color: #bbb; }

/* mappa del periodo: le frasi e le parole che le legano */
.sab-scelta { padding: 18px 24px 26px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.sab-intro { font-size: 20px; margin: 0; color: #333; }
.sab-per { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 14px; border: 1px solid #e6e6e6; border-radius: 12px; }
.sab-velo .sab-per button {
  font-size: 21px; text-align: left; white-space: normal; padding: 13px 18px;
  border: 1px solid #ddd; border-left: 6px solid #e0231f; border-radius: 10px;
  background: #fff; color: #1a1a1a; cursor: pointer;
}
.sab-velo .sab-per button:hover, .sab-velo .sab-per button:focus { background: #fdf3f2; color: #1a1a1a; border-color: #ddd; border-left-color: #e0231f; }
.sab-velo .sab-per button.sab-intero { border-left-color: #1f9d57; font-weight: 700; }
.sab-velo .sab-per button.sab-intero:hover, .sab-velo .sab-per button.sab-intero:focus { background: #eef8f2; border-left-color: #1f9d57; }
.sab-velo button:focus-visible { outline: 3px solid #16399b; outline-offset: 2px; }
.sab-legame { align-self: flex-start; margin-left: 22px; font-size: 18px; font-weight: 700; padding: 2px 12px; border-radius: 999px; }
.sab-legame.sab-coord { color: #1f9d57; background: #bfe8cf; }
.sab-legame.sab-sub { color: #e0231f; background: #fbe3e1; }
.sab-legame.sab-altro { color: #555; background: #ececec; }
.sab-per-no { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 10px; color: #8a8a8a; font-size: 19px; }
.sab-per-stato { font-size: 15px; font-style: italic; }

/* ---------- elementi dello schema ---------- */
.sab-svg text { font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; user-select: none; }
.sab-el { opacity: 0; transition: opacity .6s ease; }
.sab-el.on { opacity: 1; }
.sab-cresci { transform: scale(.15); transform-box: fill-box; transform-origin: center; transition: transform .9s cubic-bezier(.34,1.35,.5,1), opacity .5s ease; }
.sab-cresci.on { transform: scale(1); }
.sab-traccia { stroke-dasharray: var(--L); stroke-dashoffset: var(--L); transition: stroke-dashoffset 1.4s ease, opacity .3s; }
.sab-traccia.on { stroke-dashoffset: 0; }
.sab-lbl { font-size: 20px; fill: #444; }
.sab-coref { font-style: italic; fill: #7b2fbe; }
.sab-prep { font-weight: 700; fill: #1a1a1a; }
.sab-lbl-ovale { font-size: 20px; font-weight: 700; letter-spacing: .06em; }
.sab-lbl-nome, .sab-solo-nomi { display: none; }
.sab-con-nomi .sab-lbl-nome, .sab-con-nomi .sab-solo-nomi { display: inline; }
.sab-con-nomi .sab-lbl-dom { display: none; }
.sab-istantaneo, .sab-istantaneo * { transition: none !important; }


/* ---------- «Nel tempo»: la linea della storia (colori della CP «Fatti e sfondo») ---------- */
.sab-velo .sab-comandi button.sab-tempo { border-color: #534AB7; color: #3C3489; font-weight: 700; }
.sab-velo .sab-comandi button.sab-tempo:hover, .sab-velo .sab-comandi button.sab-tempo:focus { background: #EEEDFE; color: #3C3489; border-color: #534AB7; }
.sab-velo .sab-comandi button.sab-tempo[hidden] { display: none; }
.sab-velo .sab-per button.sab-btempo { border-left-color: #534AB7; color: #3C3489; }
.sab-velo .sab-per button.sab-btempo:hover, .sab-velo .sab-per button.sab-btempo:focus { background: #EEEDFE; border-left-color: #534AB7; color: #3C3489; }
.sab-tl-item { opacity: 0; transition: opacity .6s ease; }
.sab-tl-item.on { opacity: .28; }
.sab-tl-item.on.acceso { opacity: 1; }
.sab-tl-item.acceso .sab-tl-segno { stroke-width: 6; }
.sab-tl-pres { transition: opacity .7s ease; }
.sab-tl-pass { opacity: 0; transition: opacity .7s ease; }
.sab-tl-passato .sab-tl-pres { opacity: 0; }
.sab-tl-passato .sab-tl-pass { opacity: 1; }
.sab-pz.on.sab-tsfondo { border-color: #534AB7; border-bottom-style: dashed; }
.sab-pz.on.sab-tfatto { border-color: #EF9F27; }
.sab-pz.on.sab-tcornice { border-color: #8a8a8a; }

@media (max-width: 640px) {
  .sab-testata { gap: 8px; padding: 8px 8px 8px 14px; }
  .sab-titolo { font-size: 18px; }
  .sab-interruttore { font-size: 15px; white-space: nowrap; }
  .sab-lungo { display: none; }
  .sab-velo .sab-torna { padding: 8px 6px; }
  .sab-svg { max-height: 46vh; }
  .sab-svg-camera { height: min(46vh, 70vw); }
  .sab-frase { font-size: 21px; }
  .sab-didascalia { font-size: 18px; padding: 6px 14px; }
  .sab-velo .sab-per button { font-size: 18px; }
  .sab-palco.sab-palco-tempo { overflow-x: auto; justify-content: flex-start; }
  .sab-palco-tempo .sab-svg-tempo { min-width: 860px; max-height: none; }
}

/* ---------- v0.5: tasto nella pagina (accende e spegne) ---------- */
.sab-tasto-riga { margin: 0 0 14px; }
button.sab-tasto {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; width: auto; max-width: 100%;
  font: 700 17px/1.25 "Trebuchet MS", "Segoe UI", system-ui, sans-serif; text-align: left;
  color: #b3201c; background: #fff; border: 2px solid #e0231f; border-radius: 999px;
  padding: 5px 16px 5px 5px; cursor: pointer; white-space: normal; text-transform: none;
  letter-spacing: normal; box-shadow: none; user-select: none; -webkit-user-select: none;
}
button.sab-tasto:hover, button.sab-tasto:focus { background: #fdf3f2; color: #b3201c; border-color: #e0231f; }
button.sab-tasto.sab-acceso, button.sab-tasto.sab-acceso:hover, button.sab-tasto.sab-acceso:focus { background: #e0231f; color: #fff; border-color: #e0231f; }
button.sab-tasto:focus-visible { outline: 3px solid #16399b; outline-offset: 2px; }
.sab-tasto .sab-g {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: #e0231f; color: #fff;
  font: italic 700 19px/1 Georgia, "Times New Roman", serif;
}
button.sab-tasto.sab-acceso .sab-g { background: #fff; color: #e0231f; }

/* ---------- v0.5: sotto la selezione, «Guarda» e (per chi modifica l'articolo) «Analizza» ---------- */
.sab-barra { position: fixed; z-index: 99998; display: flex; gap: 8px; }
.sab-barra[hidden] { display: none; }
.sab-barra button.sab-pulsante { position: static; }
.sab-barra button.sab-lab-btn { background: #1a1a1a; }
.sab-barra button.sab-lab-btn:hover, .sab-barra button.sab-lab-btn:focus { background: #3a3a3a; color: #fff; }

/* ---------- v0.5: il laboratorio sopra la pagina ---------- */
.sab-pannello.sab-pannello-lab { width: min(1200px, 100%); height: 100%; }
.sab-lab-frame { flex: 1; display: block; width: 100%; min-height: 0; border: 0; background: #fff; }
