/*
*****Foglio di stile per pop-up lettura estratto libro

 */
  /* --- STILE DEL POP-UP --- */
  dialog {
    border: none;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px; /* Larghezza ideale per una pagina singola leggibile */
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #fcfcfc;
    box-sizing: border-box;
  }
  dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
  }

  /* --- VISUALIZZAZIONE PAGINA --- */
  .book-viewport {
    width: 100%;
    margin-bottom: 20px;
    background: #e0e0e0;
    padding: 12px;
    border-radius: 6px;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
  }
  .book-page {
    display: none; /* Nasconde tutte le pagine */
    justify-content: center;
  }
  .book-page.active {
    display: flex; /* Mostra solo la pagina corrente */
  }
  .book-page img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
    background: white;
    pointer-events: none; /* Evita conflitti del browser con lo swipe */
  }

  /* --- CONTROLLI E PULSANTI --- */
  .nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: sans-serif;
    font-weight: bold;
  }
  
  .nav-controls button {
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #ffffff !important; /* Forza lo sfondo bianco */
    color: #111111 !important;     /* Forza il testo nero antracite */
    font-size: 14px !important;     /* Forza la dimensione del font */
    font-family: sans-serif !important;
    display: inline-block !important;
    visibility: visible !important; /* Impedisce a script esterni di nasconderlo */
  }

  .close-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #d52349;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
  }

  /* --- ADATTAMENTO DISPOSITIVI PIÙ PICCOLI --- */
  @media (max-width: 480px) {
    dialog {
      padding: 12px;
      width: 95%;
    }
    .book-viewport {
      padding: 6px;
    }
    .nav-controls button {
      padding: 8px 12px;
      font-size: 14px;
    }
  }