/* ═══════════════════════════════════════════
   pagina.css — Schermata S3 + tipografia
═══════════════════════════════════════════ */

#pagina { background: var(--deep); flex-direction: column; min-height: 100vh; }

/* ── Barra superiore ─────────────────────── */
.pag-bar {
  padding: .38rem 1.4rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; background: var(--surface);
}
.pag-bar-left {
  font-family: 'Space Mono', monospace;
  font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pag-bar-right {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; color: var(--glow); flex-shrink: 0;
}
.pag-controls {
  display: flex; align-items: center; gap: .3rem;
  flex-shrink: 0; margin-left: .8rem;
}
.ctrl-icon {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 4px; transition: all .15s;
}
.ctrl-icon:active { background: var(--dim); color: var(--text); }
.ctrl-icon svg { width: 14px; height: 14px; }

/* ── Progress bar orbitale ───────────────── */
.pag-progress {
  height: 2px; background: var(--dim); flex-shrink: 0; position: relative;
}
.pag-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--glow), var(--pulse));
  box-shadow: 0 0 8px var(--glow);
  transition: width .4s ease;
  position: relative;
}
.pag-progress-fill::after {
  content: '';
  position: absolute; right: -4px; top: -3px;
  width: 8px; height: 8px;
  background: var(--pulse); border-radius: 50%;
  box-shadow: 0 0 10px var(--pulse), 0 0 20px rgba(0,229,255,.4);
}

/* Glow respiro sul punto della progress */
@keyframes progressBreath {
  0%, 100% { box-shadow: 0 0 10px var(--pulse), 0 0 20px rgba(0,229,255,.4); }
  50%       { box-shadow: 0 0 18px var(--pulse), 0 0 40px rgba(0,229,255,.5); }
}
.pag-progress-fill::after {
  animation: progressBreath 3s ease-in-out infinite;
}

/* ── Corpo testo ─────────────────────────── */
.pag-corpo {
  flex: 1; overflow-y: auto;
  padding: 1.6rem 1.4rem 1rem;
  user-select: none;
}

/* Fade-in ad ogni cambio pagina */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pag-corpo { animation: contentFadeIn .25s ease forwards; }

/* ── Navigazione piede ───────────────────── */
.pag-nav {
  padding: .7rem 1.4rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); flex-shrink: 0;
}

/* Shimmer sui pulsanti prev/next */
@keyframes shimmerBtn {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.nav-btn {
  font-family: 'Space Mono', monospace;
  font-size: .56rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid rgba(74,140,255,.25); padding: .38rem .75rem;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: .3rem;
  background: linear-gradient(
    90deg,
    rgba(74,140,255,.08) 0%,
    rgba(74,140,255,.25) 40%,
    rgba(255,255,255,.15) 50%,
    rgba(74,140,255,.25) 60%,
    rgba(74,140,255,.08) 100%
  );
  background-size: 200% auto;
  animation: shimmerBtn 3s linear infinite;
  color: var(--text);
  transition: border-color .15s;
}
.nav-btn:active { border-color: var(--glow); }
.nav-btn.dis { opacity: .2; pointer-events: none; animation: none; background: none; }

.nav-center { text-align: center; }
.nav-page {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; color: var(--muted);
}

/* Shimmer sul pulsante verifica */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.nav-quiz-call {
  display: none;
  font-family: 'Space Mono', monospace;
  font-size: .56rem; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; margin-top: .25rem;
  background: linear-gradient(
    90deg,
    var(--pulse) 0%,
    rgba(0,229,255,.5) 40%,
    #ffffff 50%,
    rgba(0,229,255,.5) 60%,
    var(--pulse) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s linear infinite;
}
.nav-fc-call {
  display: none;
  font-family: 'Space Mono', monospace;
  font-size: .52rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; margin-top: .2rem;
}

/* ── Tipografia interna ──────────────────── */

.capolettera {
  float: left;
  font-size: 4.8rem; font-weight: 700; line-height: .72;
  color: var(--glow); margin-right: .12rem; margin-top: .1rem; opacity: .6;
}

h2.sez {
  font-family: 'Space Mono', monospace;
  font-size: .62em; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--glow);
  margin: 1.8rem 0 .7rem;
  display: flex; align-items: center; gap: .6rem;
  clear: both;
}
h2.sez::before { content: '//'; color: var(--muted); }
h2.sez::after  { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(74,140,255,.3), transparent); }

p.t {
  font-size: .92em; font-weight: 300;
  color: #8090b8; line-height: 1.9; margin-bottom: 1rem;
}

blockquote.citazione {
  font-size: .88em; font-weight: 300; color: #8090b8;
  border-left: 2px solid var(--glow);
  padding: .7rem 1rem; margin: 1.2rem 0;
  background: rgba(74,140,255,.04);
  border-radius: 0 6px 6px 0; line-height: 1.8;
}
blockquote.citazione.ammonimento {
  border-left: none;
  border: 1px solid rgba(255,64,96,.3);
  background: rgba(255,64,96,.04);
  text-align: center; padding: 1rem;
  border-radius: 6px; color: #c080a0;
}

.ornamento {
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: .5rem; letter-spacing: .4em; text-transform: uppercase;
  color: var(--muted); margin: 1.8rem 0; clear: both;
}

ul.l, ol.l { padding-left: 1.5rem; margin: .6rem 0; }
ul.l li, ol.l li {
  margin-bottom: .4rem;
  font-size: .9em; font-weight: 300;
  color: #8090b8; line-height: 1.7;
}

table.tav { width: 100%; border-collapse: collapse; margin: 1rem 0; }
table.tav th {
  font-family: 'Space Mono', monospace;
  font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding: .4rem .6rem; text-align: left;
}
table.tav td {
  padding: .35rem .6rem; border-bottom: 1px solid var(--line);
  font-size: .84em; font-weight: 300; color: #8090b8;
}
table.tav tr:last-child td { border-bottom: none; }

.mezzo {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem .8rem; margin-bottom: .4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.mezzo-sigla {
  font-family: 'Space Mono', monospace;
  font-size: .62rem; font-weight: 700;
  color: var(--glow); background: rgba(74,140,255,.1);
  padding: .2rem .5rem; border-radius: 4px;
  flex-shrink: 0; min-width: 42px; text-align: center;
  border: 1px solid rgba(74,140,255,.2);
}
.mezzo-nome { font-size: .9em; font-weight: 500; color: var(--text); }
.mezzo-comp { font-size: .8em; font-weight: 300; color: var(--muted); }

.norma {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--glow);
  padding: .75rem .9rem; margin: .7rem 0;
  border-radius: 0 6px 6px 0;
}
.norma-rif {
  font-family: 'Space Mono', monospace;
  font-size: .52rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--glow); margin-bottom: .15rem;
}
.norma-titolo {
  font-size: .92em; font-weight: 600; color: var(--text); margin-bottom: .2rem;
}
.norma-testo {
  font-size: .84em; font-weight: 300; color: #6070a0; line-height: 1.65;
}
