/*
Theme Name: Psicofarmacologia.it
Theme URI: https://www.psicofarmacologia.it
Author: Dott. Valerio Rosso
Description: Tema accademico essenziale per Psicofarmacologia.it — il riferimento italiano di psicofarmacologia clinica. Palette rigorosamente in scala di grigi, sfondo bianco, tipografia serif. Include il tipo di contenuto "Capitoli" con indice e sommario automatici.
Version: 1.8.2
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: psicofarmacologia
Tags: one-column, custom-menu, editor-style, translation-ready
*/

/* =====================================================================
   PSICOFARMACOLOGIA.it — Sistema grafico
   Sfondo bianco, testo nero, solo sfumature di grigio.
   ===================================================================== */

/* ------------------ Reset essenziale ------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

/* Nessun elemento può sfondare la larghezza dello schermo */
body { overflow-x: clip; }

/* Le ancore interne non finiscono sotto la testata fissa */
[id] { scroll-margin-top: 5.5rem; }

/* ------------------ Variabili ------------------ */
:root {
  --ink:        #141414;
  --ink-soft:   #2f2f2f;
  --muted:      #5f5f5f;
  --faint:      #8a8a8a;
  --line:       #e4e4e4;
  --line-mid:   #cfcfcf;
  --line-strong:#9a9a9a;
  --bg:         #ffffff;
  --tint:       #f6f6f6;
  --tint-2:     #ededed;
  --black:      #000000;

  --serif: "Spectral", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 42rem;
  --wrap: 72rem;
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
}

/* ------------------ Base ------------------ */
body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  font-size: 18px;
  line-height: 1.72;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.16; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin-top: 2.6em; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.28rem; margin-top: 2em; }
h4 { font-size: 1.06rem; margin-top: 1.6em; }
p { margin: 0 0 1.15rem; }
strong { font-weight: 600; }
sup { font-size: .7em; line-height: 0; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: var(--line-strong); transition: text-decoration-color .15s, color .15s; }
a:hover { text-decoration-color: var(--ink); }

.eyebrow { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.22rem; line-height: 1.62; color: var(--ink-soft); }
.small { font-size: .82rem; }
.sans { font-family: var(--sans); }
.secnum { font-family: var(--sans); font-weight: 600; color: var(--faint); font-size: .78em; letter-spacing: .04em; margin-right: .55rem; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ------------------ Layout ------------------ */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }

/* ------------------ Testata ------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(6px); /* Safari iOS */
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: .7rem; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__glyph { width: 30px; height: 30px; flex: none; }
.brand__text { font-family: var(--serif); font-weight: 700; font-size: 1.06rem; letter-spacing: .01em; line-height: 1; }
.brand__text .dot-it { color: var(--faint); font-weight: 600; }
.brand__text .brand__sub { display: block; font-family: var(--sans); font-weight: 500; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 1.4rem; font-family: var(--sans); font-size: .82rem; font-weight: 500; letter-spacing: .02em; list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a { text-decoration: none; color: var(--ink-soft); padding-bottom: 2px; border-bottom: 1.5px solid transparent; display: inline-block; }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a, .nav a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); }
@media (max-width: 720px) {
  .nav { gap: .9rem; font-size: .74rem; flex-wrap: wrap; justify-content: flex-end; }
  .brand__text { font-size: .95rem; }
}

/* ------------------ Ricerca nel sito ------------------ */
.site-nav { display: flex; align-items: center; gap: 1.1rem; }

.search-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.search-toggle svg { width: 17px; height: 17px; }
.search-toggle:hover, .search-toggle[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); background: var(--tint); }
.search-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.site-search { border-top: 1px solid var(--line); background: var(--tint); }
.site-search__inner { padding-block: 1.1rem 1.2rem; }
.search-form { display: flex; align-items: center; gap: .6rem; background: var(--bg); border: 1px solid var(--line-mid); padding: .35rem .35rem .35rem .75rem; }
.search-form__icon { width: 18px; height: 18px; flex: none; color: var(--faint); }
.search-form__field {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--serif); font-size: 1rem; color: var(--ink);
  border: 0; outline: 0; background: transparent; padding: .5rem 0;
  -webkit-appearance: none; appearance: none; /* Safari iOS */
}
.search-form__field::placeholder { color: var(--faint); }
.search-form__field::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-form__submit {
  flex: none; font-family: var(--sans); font-size: .74rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: #fff; border: 0; padding: .62rem 1.1rem; cursor: pointer;
}
.search-form__submit:hover { background: var(--ink-soft); }
.search-form__close {
  flex: none; background: transparent; border: 0; color: var(--faint);
  font-size: 1.4rem; line-height: 1; padding: 0 .5rem; cursor: pointer;
}
.search-form__close:hover { color: var(--ink); }
.search-form__hint { font-family: var(--sans); font-size: .74rem; color: var(--muted); margin: .6rem 0 0; }
.search-form__hint em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--line-mid); }

/* Etichetta del tipo di contenuto nei risultati */
.result-type { display: inline-block; font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-mid); padding: .1rem .45rem; margin-bottom: .4rem; }
.result-type--capitolo { color: var(--ink); border-color: var(--ink); }

@media (max-width: 640px) {
  .site-nav { gap: .7rem; }
  .search-toggle { width: 31px; height: 31px; }
  .search-form { flex-wrap: wrap; padding: .5rem; gap: .4rem; }
  .search-form__field { flex: 1 1 60%; font-size: .95rem; }
  .search-form__submit { flex: 1 1 100%; order: 3; padding: .6rem; }
  .search-form__hint { font-size: .7rem; }
}

/* ------------------ Masthead ------------------ */
.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner { padding-block: clamp(2.5rem, 7vw, 5rem); text-align: center; }
.masthead__eyebrow { margin-bottom: 1.4rem; }
/* Il titolo scala con la larghezza del CONTENITORE, non della finestra.
   PERCHÉ: «PSICOFARMACOLOGIA.it» è un unico token senza spazi. Dimensionandolo in vw
   il font continuava a crescere fino al tetto del clamp mentre il contenitore si fermava
   a --wrap (72rem): oltre ~1230px di finestra il testo eccedeva la colonna e andava a capo
   spezzandosi DENTRO la parola (la «t» di .it finiva su una riga da sola).
   Con cqw (1cqw = 1% della larghezza di .masthead__inner) il rapporto testo/colonna resta
   costante a ogni larghezza, quindi il titolo sta sempre su una riga.
   NON rimettere vw qui, e NON rimettere overflow-wrap: break-word: è quello che
   autorizzava la rottura a metà parola invece di lasciare il token intero. */
.masthead__inner { container-type: inline-size; }
.masthead__title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.2rem, 6.2vw, 5.4rem);        /* fallback per browser senza unità cq */
  font-size: clamp(1.2rem, 6.6cqw, 5.4rem);
  letter-spacing: -0.03em; line-height: 1; text-transform: uppercase;
  max-width: 100%; overflow-wrap: normal; word-break: normal; hyphens: none;
}
@media (min-width: 640px) { .masthead__title { letter-spacing: -0.025em; line-height: .98; } }
.masthead__title .dot-it { color: var(--faint); font-weight: 500; text-transform: lowercase; letter-spacing: 0; }
.masthead__rule { width: 64px; height: 2px; background: var(--ink); margin: 1.6rem auto; }
.masthead__sub { font-size: 1.2rem; color: var(--ink-soft); max-width: 40rem; margin-inline: auto; }
.masthead__meta { margin-top: 1.6rem; font-family: var(--sans); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.masthead__meta span { display: inline-flex; align-items: center; gap: .5rem; }
.masthead__meta span::before { content: ""; width: 4px; height: 4px; background: var(--line-strong); border-radius: 50%; }
.masthead__meta span:first-child::before { display: none; }
.masthead--page { padding-block: clamp(2rem, 5vw, 3.2rem); text-align: left; }

/* ------------------ Sezioni ------------------ */
.section { padding-block: clamp(2.4rem, 6vw, 4.2rem); }
.section + .section { border-top: 1px solid var(--line); }
.section__head { margin-bottom: 2rem; }
.section__head h2 { border: 0; margin: .3rem 0 0; padding: 0; }
.mt-0 { margin-top: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 2.4rem 0; }

/* ------------------ Schede ------------------ */
/* Tutte le griglie usano minmax(0, 1fr): `1fr` da solo non si restringe sotto il
   contenuto e fa sfondare il layout sugli schermi stretti. */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid > * { min-width: 0; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--bg); padding: 1.7rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; min-width: 0; overflow-wrap: break-word; }
a.card:hover { background: var(--tint); text-decoration: none; }
.card__num { font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .12em; color: var(--faint); }
.card__title { font-family: var(--serif); font-weight: 600; font-size: 1.24rem; line-height: 1.2; }
.card__desc { font-size: .92rem; color: var(--muted); line-height: 1.55; }
.card__more { margin-top: auto; font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }

/* ------------------ Documento (capitolo / post) ------------------ */
.doc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-block: clamp(2rem, 5vw, 3.4rem); align-items: start; }
/* IMPORTANTE: `1fr` equivale a `minmax(auto, 1fr)` e il minimo `auto` impedisce alla
   colonna di restringersi sotto la larghezza minima del contenuto → il testo sfonda
   lo schermo sui telefoni. Serve `minmax(0, 1fr)` + `min-width: 0` sugli elementi. */
@media (max-width: 940px) { .doc { grid-template-columns: minmax(0, 1fr); } }
.doc > * { min-width: 0; }
.doc--single { display: block; padding-block: clamp(2rem, 5vw, 3.4rem); }
.doc--single .article { margin-inline: auto; }

.toc { position: sticky; top: 5rem; font-family: var(--sans); font-size: .82rem; align-self: start; }
body.admin-bar .toc { top: 7rem; }
.toc__label { font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .32rem 0 .32rem .8rem; margin-left: -.8rem; color: var(--muted); text-decoration: none; line-height: 1.35; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.toc a.sub { padding-left: 1.7rem; font-size: .78rem; color: var(--faint); }
@media (max-width: 940px) {
  .toc { position: static; margin-bottom: 1.5rem; border: 1px solid var(--line); padding: 1.1rem 1.2rem; background: var(--tint); }
  .toc__label { border: 0; margin-bottom: .4rem; }
  .toc ol { columns: 2; column-gap: 1.5rem; }
}

.article { max-width: var(--measure); min-width: 0; overflow-wrap: break-word; }
.article ul, .article ol { padding-left: 1.3rem; margin: 0 0 1.15rem; }
.article li { margin-bottom: .4rem; }
.article ul { list-style: none; }
.article ul > li { position: relative; }
.article ul > li::before { content: "—"; position: absolute; left: -1.3rem; color: var(--faint); }

.doc-head { border-bottom: 2px solid var(--ink); padding-bottom: 1.5rem; margin-bottom: 2.2rem; }
.doc-head .kicker { margin-bottom: 1rem; }
.doc-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.doc-head .byline { font-family: var(--sans); font-size: .84rem; color: var(--muted); margin-top: 1.1rem; display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.doc-head .byline strong { color: var(--ink); font-weight: 600; }
.doc-head .byline .sep { color: var(--line-strong); }

/* ------------------ Riquadri ------------------ */
.box { background: var(--tint); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 1.15rem 1.3rem; margin: 1.8rem 0; }
.box__label { font-family: var(--sans); font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin-bottom: .5rem; display: flex; align-items: center; gap: .55rem; }
.box__label::before { content: ""; width: 14px; height: 1px; background: var(--ink); }
.box p { font-size: .95rem; line-height: 1.6; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box--def { border-left-color: var(--black); }
.box--pearl { border-left-style: double; border-left-width: 4px; }
.box--warn { border-left-style: dashed; }
.box--deep { background: var(--bg); border-left-color: var(--line-strong); }

/* ------------------ Tabelle ------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.9rem 0; min-width: 0; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-family: var(--sans); }
table.data caption { text-align: left; font-family: var(--sans); font-size: .74rem; letter-spacing: .04em; color: var(--muted); margin-bottom: .7rem; }
table.data caption b { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
table.data th, table.data td { text-align: left; padding: .62rem .8rem; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data thead th { border-bottom: 2px solid var(--ink); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink); font-weight: 700; }
table.data tbody tr:last-child td { border-bottom: 1px solid var(--line-mid); }
table.data tbody th { font-weight: 600; color: var(--ink); font-family: var(--serif); font-size: .95rem; }
table.data tr:hover td, table.data tr:hover th { background: var(--tint); }

/* ------------------ Figure ------------------ */
figure.fig { margin: 2.2rem 0; min-width: 0; max-width: 100%; }
figure.fig .fig__frame { border: 1px solid var(--line); background: var(--bg); padding: 1.4rem; min-width: 0; overflow-x: auto; }
figure.fig svg { margin-inline: auto; width: 100%; max-width: 100%; height: auto; display: block; }
figure.fig figcaption { font-family: var(--sans); font-size: .8rem; color: var(--muted); line-height: 1.5; margin-top: .8rem; }
figure.fig figcaption b { color: var(--ink); font-weight: 700; }

blockquote.pull { border: 0; margin: 2.2rem 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--ink); font-size: 1.28rem; line-height: 1.5; font-style: italic; color: var(--ink-soft); }
blockquote.pull cite { display: block; margin-top: .7rem; font-size: .82rem; font-style: normal; font-family: var(--sans); color: var(--muted); letter-spacing: .02em; }

a.cit { text-decoration: none; font-family: var(--sans); font-size: .72em; font-weight: 600; color: var(--ink); border: 1px solid var(--line-mid); border-radius: 2px; padding: 0 .28em; margin-left: .12em; vertical-align: .12em; }
a.cit:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.references { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.references h2 { border: 0; padding: 0; margin: 0 0 1rem; font-size: 1.15rem; }
.references ol { font-family: var(--sans); font-size: .8rem; line-height: 1.55; color: var(--muted); padding-left: 1.4rem; }
.references li { margin-bottom: .6rem; }
.references li::marker { color: var(--faint); }
.references a { color: var(--ink-soft); }

.note { font-family: var(--sans); font-size: .82rem; color: var(--muted); background: var(--tint); border: 1px solid var(--line); padding: 1rem 1.15rem; margin: 1.8rem 0; }
.note b { color: var(--ink); }

/* ------------------ Indice generale ------------------ */
.idx-intro { max-width: var(--measure); }
.idx-part { margin-top: 2.6rem; }
.idx-part__head { display: flex; align-items: baseline; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .3rem; }
.idx-part__no { font-family: var(--sans); font-weight: 700; font-size: .74rem; letter-spacing: .18em; color: var(--faint); text-transform: uppercase; white-space: nowrap; }
.idx-part__title { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; }
.idx-ch { display: flex; align-items: baseline; gap: .9rem; padding: .62rem 0; border-bottom: 1px solid var(--line); }
.idx-ch__no { font-family: var(--sans); font-weight: 600; font-size: .82rem; color: var(--faint); flex: none; width: 2.2rem; }
.idx-ch__title { font-family: var(--serif); font-size: 1.06rem; min-width: 0; overflow-wrap: break-word; }
.idx-ch a { text-decoration: none; }
.idx-ch a:hover { text-decoration: underline; text-underline-offset: 3px; }
.idx-ch__desc { display: block; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: .15rem; line-height: 1.45; }
.idx-ch__status { margin-left: auto; flex: none; font-family: var(--sans); font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--line-mid); padding: .12rem .5rem; align-self: center; white-space: nowrap; }
.idx-ch__status.ready { color: var(--ink); border-color: var(--ink); }

/* ------------------ Blog ------------------ */
.post-list { display: flex; flex-direction: column; }
.post-item { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.6rem; padding: 1.7rem 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.post-item > * { min-width: 0; overflow-wrap: break-word; }
.post-item:hover { text-decoration: none; }
.post-item:hover .post-item__title { text-decoration: underline; text-underline-offset: 3px; }
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item__date { font-family: var(--sans); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); line-height: 1.5; }
.post-item__cat { display: block; color: var(--ink); font-weight: 600; margin-top: .3rem; }
.post-item__title { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; line-height: 1.2; margin-bottom: .4rem; }
.post-item__excerpt { font-size: .96rem; color: var(--muted); line-height: 1.55; }
@media (max-width: 620px) { .post-item { grid-template-columns: 1fr; gap: .4rem; } }
.tag { display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-mid); padding: .18rem .6rem; margin: 0 .3rem .3rem 0; text-decoration: none; }
a.tag:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

.pagination { margin-top: 2.5rem; font-family: var(--sans); font-size: .84rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .35rem .75rem; border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.pagination .page-numbers.current, .pagination .page-numbers:hover { border-color: var(--ink); color: var(--ink); }

/* ------------------ Piè di pagina ------------------ */
.site-footer { border-top: 2px solid var(--ink); margin-top: 3rem; }
.site-footer__inner { padding-block: 2.6rem; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.site-footer__inner > * { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.site-footer h4 { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: .9rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; font-family: var(--sans); font-size: .86rem; display: block; padding: .18rem 0; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer .foot-brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; margin-bottom: .6rem; }
.site-footer .foot-brand .dot-it { color: var(--faint); }
.site-footer p { font-family: var(--sans); font-size: .82rem; color: var(--muted); line-height: 1.55; }
.foot-legal { border-top: 1px solid var(--line); }
.foot-legal__inner { padding-block: 1.3rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--sans); font-size: .74rem; color: var(--faint); }

.disclaimer { font-family: var(--sans); font-size: .78rem; color: var(--muted); line-height: 1.55; background: var(--tint); border-top: 1px solid var(--line); }
.disclaimer .wrap { padding-block: 1.4rem; }
.disclaimer b { color: var(--ink); }

/* ------------------ Compatibilità blocchi WordPress ------------------ */
.article .wp-block-image { margin: 2rem 0; }
.article .wp-block-image figcaption { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.article .wp-block-table table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; }
.article .wp-block-table td, .article .wp-block-table th { border-bottom: 1px solid var(--line); padding: .62rem .8rem; text-align: left; }
.article .wp-block-quote { border-left: 2px solid var(--ink); padding-left: 1.4rem; margin: 2.2rem 0; font-style: italic; color: var(--ink-soft); }
.article .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
.aligncenter { margin-inline: auto; }

/* =====================================================================
   MOBILE — Chrome e Safari (iOS)
   ===================================================================== */
@media (max-width: 640px) {
  body { font-size: 17px; line-height: 1.68; }

  /* Testata compatta */
  .site-header__inner { padding-block: .55rem; gap: .75rem; }
  .brand__glyph { width: 26px; height: 26px; }
  .brand__text { font-size: .9rem; }
  .brand__text .brand__sub { font-size: .52rem; letter-spacing: .14em; }
  .nav { gap: .85rem; font-size: .78rem; }

  /* Masthead */
  .masthead__inner { padding-block: 2.4rem; }
  .masthead__eyebrow { margin-bottom: 1rem; font-size: .62rem; letter-spacing: .16em; }
  .masthead__rule { margin: 1.1rem auto; width: 48px; }
  .masthead__sub { font-size: 1.02rem; }
  .masthead__meta { margin-top: 1.1rem; gap: .45rem .9rem; font-size: .62rem; letter-spacing: .1em; }
  .masthead--page h1 { font-size: clamp(1.5rem, 6.4vw, 2.4rem) !important; }

  /* Testo e titoli */
  h2 { font-size: 1.42rem; margin-top: 2.1em; }
  h3 { font-size: 1.14rem; }
  .lead { font-size: 1.08rem; }
  .doc-head h1 { font-size: clamp(1.55rem, 6.6vw, 2.2rem); }
  .doc-head .byline { gap: .4rem .8rem; font-size: .76rem; }
  .doc-head .byline .sep { display: none; }
  blockquote.pull { font-size: 1.1rem; padding-left: 1rem; }

  /* Sommario del capitolo: una colonna, niente due colonne strette */
  .toc ol { columns: 1; }
  .toc { padding: .95rem 1rem; }

  /* Riquadri, figure, tabelle */
  .box { padding: 1rem 1.05rem; margin: 1.4rem 0; }
  .box p { font-size: .92rem; }
  figure.fig { margin: 1.6rem 0; }
  figure.fig .fig__frame { padding: .7rem; }
  figure.fig figcaption { font-size: .76rem; }
  .table-wrap { margin: 1.5rem 0; }
  table.data { font-size: .84rem; }
  table.data th, table.data td { padding: .5rem .6rem; }
  /* Suggerisce lo scorrimento orizzontale della tabella */
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* Elenchi: il trattino non finisce fuori dal bordo */
  .article ul { padding-left: 1.1rem; }
  .article ul > li::before { left: -1.1rem; }

  /* Indice generale */
  .idx-part__head { flex-direction: column; gap: .15rem; align-items: flex-start; }
  .idx-part__title { font-size: 1.15rem; }
  .idx-ch { flex-wrap: wrap; gap: .5rem; }
  .idx-ch__no { width: 1.8rem; }
  .idx-ch__title { font-size: 1rem; flex: 1 1 70%; }
  .idx-ch__status { margin-left: 2.3rem; font-size: .58rem; }

  /* Blog */
  .post-item { padding: 1.3rem 0; }
  .post-item__title { font-size: 1.2rem; }
  .post-item__date { font-size: .68rem; }

  /* Schede */
  .card { padding: 1.35rem 1.25rem; }

  /* Piè di pagina */
  .site-footer__inner { padding-block: 2rem; }
  .foot-legal__inner { flex-direction: column; gap: .35rem; }
}

/* Schermi molto stretti (iPhone SE e simili) */
@media (max-width: 360px) {
  .brand__text .brand__sub { display: none; }
  .nav { font-size: .74rem; gap: .7rem; }
}

/* ------------------ Stampa ------------------ */
@media print {
  .site-header, .site-footer, .toc, .nav, .disclaimer { display: none; }
  body { font-size: 11pt; color: #000; }
  .doc { display: block; }
  a { color: #000; text-decoration: none; }
  .box, table.data, figure.fig { break-inside: avoid; }
}

/* =====================================================================
   PARTE VIII — Psicofarmaci in Italia
   Regola non negoziabile: min-width 0 e minmax(0, 1fr) ovunque ci sia
   una griglia, o il layout sfonda sui telefoni (vedi trappola 8).
   ===================================================================== */

/* Formula bruta, con i pedici */
.formula { font-family: var(--sans); font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.formula sub { font-size: .72em; }

/* Contatore in testa all'indice */
.mol-count { display: flex; align-items: baseline; gap: .55rem; margin-bottom: 2.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.mol-count__n { font-family: var(--serif); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.mol-count__l { font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Blocco di classe farmacologica */
.mol-class { margin-bottom: 2.8rem; }
.mol-class__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .5rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.mol-class__title { font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); min-width: 0; }
.mol-class__n { font-family: var(--sans); font-size: .74rem; color: var(--faint); flex: none; }

/* Griglia delle schede */
.mol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.mol-card { display: flex; flex-direction: column; gap: .3rem; min-width: 0; padding: 1rem 1.1rem; background: var(--bg); text-decoration: none; color: inherit; overflow-wrap: break-word; transition: background .15s; }
.mol-card:hover { background: var(--tint); text-decoration: none; }
.mol-card__name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.mol-card__formula { font-size: .74rem; color: var(--muted); }
.mol-card__lead { font-family: var(--sans); font-size: .78rem; line-height: 1.45; color: var(--muted); }

/* Indice alfabetico */
.mol-az { margin-top: 3.4rem; }
.mol-az__group { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.mol-az__letter { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--line-strong); }
.mol-az__list { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; min-width: 0; }
.mol-az__list a { font-family: var(--sans); font-size: .9rem; text-decoration: none; border-bottom: 1px solid var(--line-mid); }
.mol-az__list a:hover { border-bottom-color: var(--ink); }

/* Cartellino di identità in testa alla scheda */
.mol-id { border: 1px solid var(--line); border-left: 3px solid var(--ink); margin: 1.8rem 0 2.2rem; }
.mol-id__row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 1rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); }
.mol-id__row:last-child { border-bottom: 0; }
.mol-id__k { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.mol-id__v { font-size: .96rem; min-width: 0; overflow-wrap: break-word; }

/* Figura della formula di struttura */
.struct { margin: 1.6rem 0 2rem; }
.struct__frame { border: 1px solid var(--line); background: var(--bg); padding: 1.2rem; display: flex; justify-content: center; }
.struct__frame svg { max-width: 100%; height: auto; }
.struct figcaption { font-family: var(--sans); font-size: .78rem; color: var(--faint); margin-top: .5rem; }

/* Campo non ancora verificato: si dichiara, non si inventa */
.da-verificare { font-family: var(--sans); font-size: .8rem; color: var(--muted); background: var(--tint); border: 1px dashed var(--line-strong); padding: .5rem .8rem; display: inline-block; }

@media (max-width: 640px) {
  .mol-grid { grid-template-columns: minmax(0, 1fr); }
  .mol-id__row { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .mol-az__group { grid-template-columns: 2rem minmax(0, 1fr); gap: .7rem; }
  .mol-count__n { font-size: 2rem; }
}

/* Barra di avanzamento della Parte VIII */
.mol-progress { margin-bottom: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.mol-progress__nums { display: flex; align-items: baseline; gap: .4rem; margin-bottom: .7rem; flex-wrap: wrap; }
.mol-progress__done { font-family: var(--serif); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.mol-progress__sep  { font-family: var(--serif); font-size: 1.6rem; color: var(--line-strong); }
.mol-progress__tot  { font-family: var(--serif); font-size: 1.6rem; color: var(--muted); }
.mol-progress__label { font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: .5rem; }
.mol-progress__bar { height: 4px; background: var(--tint-2); position: relative; overflow: hidden; }
.mol-progress__bar span { position: absolute; inset: 0 auto 0 0; background: var(--ink); display: block; }

/* Nota introduttiva di ciascun gruppo */
.mol-group__note { font-family: var(--sans); font-size: .84rem; line-height: 1.5; color: var(--muted); margin: -.4rem 0 1rem; max-width: 46rem; }

/* Rimando alla Parte VIII dall'indice generale */
.part8-teaser { display: block; border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 1.4rem 1.6rem; margin-top: 2.6rem; text-decoration: none; color: inherit; transition: background .15s; }
.part8-teaser:hover { background: var(--tint); text-decoration: none; }
.part8-teaser__kicker { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.part8-teaser__title { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; margin: .35rem 0 .4rem; }
.part8-teaser__desc { font-family: var(--sans); font-size: .92rem; line-height: 1.55; color: var(--ink-soft); max-width: 44rem; }
.part8-teaser__meta { font-family: var(--sans); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .8rem; }
