/* ========================================================================== 
   style-recensione-separato.css — Letture.eu
   --------------------------------------------------------------------------
   VERSIONE CENTRALIZZATA — PRODUZIONE

   Scopo
   - Gestire esclusivamente la struttura editoriale delle pagine Recensioni:
     colonna, box, immagini, pulsanti, tipografia e utilità accessibili.
   - Non gestire header e footer: la loro resa è centralizzata
     nel CSS condiviso per header e footer.
   - Non gestire banner o preferenze di consenso: la loro resa è centralizzata
     nel CSS condiviso per il consenso.

   Note operative
   - Caricare questo CSS prima dei CSS specifici o sovraordinati.
   - Mantenere qui solo regole relative al contenuto editoriale centrale.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1) VARIABILI GLOBALI
   -------------------------------------------------------------------------- */
:root{
  /* Larghezza “colonna” editoriale mobile-first e desktop compatta. */
  --larghezza-colonna: 360px;

  /* Box recensione */
  --colore-bordo: #ccc;
  --colore-sfondo-box: #f9f9f9;

  /* Testo */
  --colore-testo: #000;

  /* Font */
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",
               sans-serif;
}


/* --------------------------------------------------------------------------
   2) BASE DOCUMENTO E TIPOGRAFIA
   -------------------------------------------------------------------------- */
html{
  text-size-adjust: 100%;
}

body{
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--colore-testo);
  font-family: var(--font-base);
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
  word-spacing: 0.02rem;
  hyphens: auto;
}

/* Spazio editoriale tra header e contenuto, con margini laterali minimi. */
main#maincontent{
  padding-top: 16px;
  padding-left: 12px;
  padding-right: 12px;
  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   3) ACCESSIBILITÀ: FOCUS + SKIP-LINK + VISUALLY-HIDDEN
   -------------------------------------------------------------------------- */

/* Focus visibile generale (WCAG). */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible{
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Skip-link: compare solo su focus/tastiera. */
.skip-link{
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  z-index: 9999;
}
.skip-link:focus,
.skip-link:active{
  left: 0.75rem;
  top: 0.75rem;
}

/* Utility: contenuto per screen reader senza impatto visivo. */
.visually-hidden{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* --------------------------------------------------------------------------
   4) COLONNA EDITORIALE
   -------------------------------------------------------------------------- */
.contenitore-proporzionato,
.box-recensione,
.box-riviste,
.pulsante-libro,
.recensione-lingue-correlate,
figcaption,
.titolo-numero,
.titolo-sezione{
  width: 100%;
  max-width: var(--larghezza-colonna);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   5) TITOLI PAGINA / TITOLI SEZIONE
   -------------------------------------------------------------------------- */
.titolo-sezione{
  margin: 0.35rem auto 0.35rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.titolo-numero{
  margin: 0.25rem auto 0.85rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}


/* --------------------------------------------------------------------------
   6) FIGURE / COPERTINE / FIGCAPTION
   -------------------------------------------------------------------------- */
figure{
  margin: 0;
  padding: 0;
}

figcaption{
  font-size: 0.75rem;
  text-align: center;
  margin-top: 0.3rem;
  color: #444;
}

figure.contenitore-proporzionato figcaption strong{
  font-size: 1.15rem;
  line-height: 1.25;
  display: inline-block;
  font-weight: 700;
}

/* Contenitore copertina: nessun padding/border che alteri il calcolo. */
figure.contenitore-proporzionato{
  width: 100%;
  max-width: var(--larghezza-colonna);
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

/* Copertina diretta: immagine sempre larga quanto la colonna. */
figure.contenitore-proporzionato > img,
figure.contenitore-proporzionato img.img-fissa{
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Caso limite: immagine incapsulata in un link. */
figure.contenitore-proporzionato > a{
  display: block;
  width: 100%;
}
figure.contenitore-proporzionato > a > img{
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Copertina “poster” con wrapper a ratio fisso. */
figure.contenitore-proporzionato .ratio-ebook{
  width: 100%;
  max-width: 100%;
  display: block;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

figure.contenitore-proporzionato .poster-ebook{
  display: block;
  width: 100%;
  height: 100%;
}


/* --------------------------------------------------------------------------
   7) BOX EDITORIALE — RECENSIONE / RIVISTE
   -------------------------------------------------------------------------- */
.box-recensione,
.box-riviste{
  margin-top: 1.2rem;
  padding: 0.75rem;
  background: var(--colore-sfondo-box);
  border: 1px solid var(--colore-bordo);
  border-radius: 0.5rem;
  text-align: justify;
}

.titolo-recensione,
.box-recensione h1,
.box-riviste h1{
  margin: 0.12rem 0 0.6rem 0;
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
}

.box-recensione p,
.box-riviste p{
  margin: 0 0 1rem 0;
  line-height: 1.45;
  font-size: 1rem;
  text-align: justify;

  hyphens: auto;
}


/* --------------------------------------------------------------------------
   8) LINK VERSIONI LINGUISTICHE
   -------------------------------------------------------------------------- */
.recensione-lingue-correlate{
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.recensione-lingue-correlate .label{
  display: block;
  margin-bottom: 0.35rem;
}

.lingue-linkset{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.lingue-linkset a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.lingue-linkset a[aria-current="page"]{
  font-weight: 700;
  text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   9) CTA / PULSANTI LIBRO
   -------------------------------------------------------------------------- */
.pulsante-libro{
  display: block;
  margin: 0.9rem auto;
  padding: 0.5rem 0.8rem;
  border-radius: 2rem;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  text-align: center;
  font-size: 0.95rem;
  text-decoration: none;
  overflow-wrap: break-word;
}

.pulsante-libro:hover{
  background: #000;
  color: #fff;
}

.pulsante-libro:focus,
.pulsante-libro:focus-visible{
  outline: 2px solid #000;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   10) ROBUSTEZZA LINK LUNGHI — INFORMATIVE / URL ESTERNI
   -------------------------------------------------------------------------- */
main#maincontent,
.box-recensione,
.box-riviste,
.pulsante-libro,
.recensione-lingue-correlate{
  overflow-wrap: anywhere;
  word-break: normal;
}

.box-recensione a,
.box-riviste a{
  overflow-wrap: anywhere;
  word-break: normal;
}

/* --------------------------------------------------------------------------
   11) NOSCRIPT — MESSAGGIO IN ASSENZA DI JAVASCRIPT
   -------------------------------------------------------------------------- */
.gestisci-consenso-wrap noscript p{
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   12) RESPONSIVE 320–480 PX
   -------------------------------------------------------------------------- */
@media (max-width: 480px){
  main#maincontent{
    padding-left: 10px;
    padding-right: 10px;
  }

  .box-recensione,
  .box-riviste{
    padding: 0.65rem;
  }

  .box-recensione p,
.box-riviste p{
    font-size: 0.95rem;
    line-height: 1.42;
  }

  .titolo-recensione,
  .box-recensione h1,
  .box-riviste h1{
    font-size: 1.55rem;
  }

  .titolo-sezione{
    font-size: 1.2rem;
  }

  .titolo-numero{
    font-size: 1.05rem;
  }

  figure.contenitore-proporzionato figcaption strong{
    font-size: 1.05rem;
  }
}
