/* Procol — Guida (docs.procol.it). © 2026 Patrizio Anselmi e Matteo Cinquini. Software proprietario. */
/* Stessa palette e stessi caratteri della Home (www_home/css/site.css): buio, carta calda, luce di sicurezza ambra. */

:root {
  --ink: #090909;
  --ink-2: #0f0f0f;
  --ink-3: #151515;
  --ink-4: #1b1b1a;
  --line: rgba(236, 232, 223, 0.1);
  --line-2: rgba(236, 232, 223, 0.18);
  --paper: #ece8df;
  --text: #dcd8cf;
  --muted: #a39f96;
  --faint: #8f8b83;
  --safe: #f2a541;
  --safe-hi: #f6b863;
  --safe-dim: rgba(242, 165, 65, 0.1);
  --on-safe: #1a1206;

  --serif: ui-serif, 'New York', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --top-h: 3.6rem;
  --side-w: 17rem;
  --toc-w: 14rem;
  --measure: 70ch;
  --radius: 0.375rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
  font-size: clamp(16px, 0.25vw + 13px, 17px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 1.25rem);
  background: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
/* Resa sottile del testo solo sugli schermi Retina: su un monitor a 1x il chiaro su scuro «antialiased» perde
   spessore e i testi piccoli sembrano fuori fuoco. Lì si lascia la resa del sistema. */
@media (min-resolution: 1.5dppx) {
  body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
svg { flex: none; }
::selection { background: var(--safe); color: var(--on-safe); }
:focus-visible { outline: 2px solid var(--safe); outline-offset: 3px; border-radius: 3px; }
[hidden] { display: none !important; }

.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--safe); color: var(--on-safe); padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip:focus { top: 0.5rem; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 2.25rem; padding: 0 1rem; white-space: nowrap;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--safe); color: var(--on-safe);
  font: 600 0.85rem/1 var(--sans); letter-spacing: 0.01em; text-decoration: none;
  transition: background 0.25s, box-shadow 0.4s var(--ease);
}
.btn:hover { background: var(--safe-hi); box-shadow: 0 0 1.8rem 0.05rem rgba(242, 165, 65, 0.32); }
.iconbtn {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  color: var(--muted); transition: color 0.2s, background 0.2s;
}
.iconbtn svg { width: 1.3rem; height: 1.3rem; }
.iconbtn:hover { color: var(--paper); background: rgba(236, 232, 223, 0.06); }
.iconbtn:focus-visible { outline: 2px solid var(--safe); outline-offset: 1px; }

/* ---------- testata ---------- */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  background: rgba(9, 9, 9, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__in { height: 100%; display: flex; align-items: center; gap: 1.25rem; padding-inline: clamp(0.75rem, 2vw, 1.75rem); }
.top__menu { display: none; margin-left: -0.4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--paper); font: italic 400 1.3rem/1 var(--serif); white-space: nowrap; }
.brand__mark { width: 1.55rem; height: 1.55rem; }
.brand__tag {
  /* maiuscole monospaziate con interlinea 1: senza correzione stanno sopra la metà della barra. La scritta scende di
     0,24em dentro la sua casella (alto più, basso meno): la casella e la linea di separazione restano centrate */
  margin-left: 0.2rem; padding: calc(0.3rem + 0.24em) 0 calc(0.3rem - 0.24em) 0.75rem; border-left: 1px solid var(--line-2);
  font: 500 0.66rem/1 var(--mono); font-style: normal; letter-spacing: 0.2em; text-transform: uppercase; color: var(--safe);
}
.top__links { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.top__home { font-size: 0.85rem; color: var(--muted); text-decoration: none; transition: color 0.2s; white-space: nowrap; }
.top__home:hover { color: var(--paper); }
/* selettore della lingua: IT · EN, la lingua della pagina accesa */
.top__lang { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.08em; color: var(--faint); text-decoration: none; white-space: nowrap; padding: calc(0.45rem + 0.12em) 0.2rem calc(0.45rem - 0.12em); transition: color 0.2s; } /* maiuscole: vedi .brand__tag */
.top__lang:hover { color: var(--paper); }
.top__lang-on { color: var(--safe); }
.top__find { display: none; }

/* ---------- ricerca ---------- */
.search { position: relative; flex: 0 1 26rem; margin-left: clamp(0.5rem, 4vw, 4rem); }
.search__icon { position: absolute; left: 0.8rem; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; display: grid; }
.search__icon svg { width: 1.05rem; height: 1.05rem; }
.search__input {
  width: 100%; height: 2.35rem; padding: 0 0.9rem 0 2.35rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--ink-2); color: var(--paper);
  font: 400 0.9rem/1 var(--sans); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
.search__input::placeholder { color: var(--faint); }
.search__input:focus { border-color: rgba(242, 165, 65, 0.6); background: var(--ink-3); box-shadow: 0 0 0 3px rgba(242, 165, 65, 0.12); }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__close { display: none; }
.search__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.5rem); z-index: 60;
  min-width: min(32rem, 92vw); max-height: min(70vh, 34rem); overflow: auto; overscroll-behavior: contain;
  background: var(--ink-3); border: 1px solid var(--line-2); border-radius: 0.6rem;
  box-shadow: 0 1.5rem 4rem -1rem rgba(0, 0, 0, 0.9);
  padding: 0.35rem;
}
.search__item {
  display: block; padding: 0.7rem 0.85rem; border-radius: 0.4rem; text-decoration: none; color: var(--text);
  border-left: 2px solid transparent;
}
.search__item[aria-selected="true"], .search__item:hover { background: rgba(236, 232, 223, 0.06); border-left-color: var(--safe); }
.search__where { display: block; font: 500 0.66rem/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.25rem; }
.search__head { display: block; font: 400 1.02rem/1.3 var(--serif); color: var(--paper); }
.search__snip { display: block; margin-top: 0.25rem; font-size: 0.84rem; line-height: 1.5; color: var(--muted); }
.search__item mark { background: none; color: var(--safe); }
.search__empty { padding: 1rem; margin: 0; font-size: 0.88rem; color: var(--muted); }

/* ---------- impaginazione ---------- */
.layout {
  /* a tutta larghezza a ogni misura (decisione dell'8/11/2026): barra laterale al bordo sinistro, indice al destro */
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr);
}
.side {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.side__head { display: none; }
.side__scroll { overflow-y: auto; overscroll-behavior: contain; padding: 1.75rem 1rem 2rem 1.25rem; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; flex: 1; }
.side__group + .side__group { margin-top: 1.6rem; }
.side__label { margin: 0 0 0.5rem 0.6rem; font: 500 0.66rem/1.2 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a {
  position: relative; display: grid; grid-template-columns: 1.3rem 1fr; align-items: baseline;
  padding: 0.36rem 0.6rem; border-radius: 0.35rem;
  font-size: 0.89rem; line-height: 1.35; color: var(--muted); text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.side li a:hover { color: var(--paper); background: rgba(236, 232, 223, 0.04); }
.side__n { font: 500 0.7rem/1 var(--mono); color: var(--faint); }
.side li a.is-current { color: var(--paper); background: rgba(236, 232, 223, 0.06); }
.side li a.is-current::before {
  content: ''; position: absolute; left: -0.65rem; top: 50%; width: 0.38rem; height: 0.38rem; translate: 0 -50%; border-radius: 50%;
  background: var(--safe); box-shadow: 0 0 0.6rem rgba(242, 165, 65, 0.75);
}
.side li a.is-current .side__n { color: var(--safe); }
.side__foot { display: none; }
.scrim { display: none; }

.main {
  display: grid; grid-template-columns: minmax(0, 1fr);
  padding: clamp(2rem, 4vw, 3.75rem) clamp(1.25rem, 4vw, 4rem) 4rem;
  gap: 3rem;
}
.doc { min-width: 0; max-width: 52rem; }

/* ---------- indice della pagina ---------- */
.toc { display: none; }
@media (min-width: 1200px) {
  .main { grid-template-columns: minmax(0, 1fr) var(--toc-w); }
  .toc {
    display: block; position: sticky; top: calc(var(--top-h) + 2.25rem); align-self: start;
    max-height: calc(100vh - var(--top-h) - 4rem); overflow-y: auto; scrollbar-width: thin;
    padding-left: 1.25rem; border-left: 1px solid var(--line);
  }
}
.toc__label { margin: 0 0 0.75rem; font: 500 0.66rem/1.2 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a {
  position: relative; display: block; padding: 0.28rem 0; font-size: 0.82rem; line-height: 1.4;
  color: var(--faint); text-decoration: none; transition: color 0.15s;
}
.toc li.toc__h3 a { padding-left: 0.85rem; font-size: 0.79rem; }
.toc li a:hover { color: var(--paper); }
.toc li a.is-active { color: var(--paper); }
.toc li a.is-active::before {
  content: ''; position: absolute; left: calc(-1.25rem - 1px); top: 0.2rem; bottom: 0.2rem; width: 1px; background: var(--safe);
  box-shadow: 0 0 0.5rem rgba(242, 165, 65, 0.8);
}
.toc__top { display: inline-block; margin-top: 1.25rem; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); text-decoration: none; }
.toc__top:hover { color: var(--safe); }

/* ---------- testa del capitolo ---------- */
.doc__head { padding-bottom: 2rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--line); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em; margin: 0 0 1.1rem;
  font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--safe);
}
.dot { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--safe); box-shadow: 0 0 0.6rem 0.1rem rgba(242, 165, 65, 0.55); }
.doc__title {
  margin: 0; max-width: 20em;
  font: 400 clamp(2.3rem, 4.4vw, 3.6rem)/1.04 var(--serif); letter-spacing: -0.018em; color: var(--paper);
  text-wrap: balance;
}
.doc__lead { margin: 1.1rem 0 0; max-width: 38em; font-size: clamp(1.06rem, 1.4vw, 1.2rem); line-height: 1.55; color: var(--muted); text-wrap: pretty; }

/* ---------- testo ---------- */
.prose { font-size: 1.0625rem; line-height: 1.75; }
.prose > * { max-width: var(--measure); }
.prose > figure, .prose > .table-wrap, .prose > .chapters { max-width: none; }
.prose p { margin: 0 0 1.15em; text-wrap: pretty; }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--paper); font-family: var(--serif); font-weight: 400; text-wrap: balance; }
.prose h2 { margin: 3.2rem 0 1rem; padding-top: 2.2rem; border-top: 1px solid var(--line); font-size: clamp(1.6rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: 2.2rem 0 0.6rem; font-size: 1.32rem; line-height: 1.25; }
.prose h4 { margin: 1.8rem 0 0.5rem; font: 600 0.95rem/1.4 var(--sans); }
.anchor {
  margin-left: 0.4em; padding: 0 0.15em; color: var(--faint); text-decoration: none;
  font: 400 0.75em/1 var(--mono); opacity: 0; transition: opacity 0.15s, color 0.15s;
}
h2:hover > .anchor, h3:hover > .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--safe); }
@media (hover: none) { .anchor { opacity: 0.45; } }

.prose a { color: var(--paper); text-decoration: underline; text-decoration-color: rgba(242, 165, 65, 0.55); text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color 0.15s, text-decoration-color 0.15s; }
.prose a:hover { color: var(--safe-hi); text-decoration-color: var(--safe); }
.prose h2 a.anchor, .prose h3 a.anchor { text-decoration: none; color: var(--faint); }
.prose strong { color: var(--paper); font-weight: 600; }
.prose em { font-style: italic; color: var(--paper); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--faint); }
.prose ol li::marker { font: 500 0.85em var(--mono); color: var(--safe); }
.prose li > p { margin-bottom: 0.5em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.prose code {
  font: 0.86em/1 var(--mono); padding: 0.15em 0.4em; border-radius: 0.25rem;
  background: var(--ink-3); border: 1px solid var(--line); color: var(--paper);
}
.prose pre { overflow-x: auto; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); font-size: 0.88rem; line-height: 1.6; }
.prose pre code { padding: 0; border: 0; background: none; }
kbd {
  display: inline-block; min-width: 1.75em; padding: 0.18em 0.45em 0.12em; margin: 0 0.05em;
  font: 500 0.78em/1.25 var(--mono); text-align: center; color: var(--paper); vertical-align: 0.08em;
  background: linear-gradient(var(--ink-4), var(--ink-3));
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 0.3rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* blockquote semplice */
.prose blockquote { margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.25rem; border-left: 2px solid var(--line-2); color: var(--muted); font-family: var(--serif); font-size: 1.1rem; }
.prose blockquote p:last-child { margin-bottom: 0; }

/* riquadri: In camera oscura, Attenzione */
.callout {
  position: relative; margin: 2rem 0; padding: 1.1rem 1.35rem 1.15rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 1rem; line-height: 1.7;
}
.callout > :last-child { margin-bottom: 0; }
.callout > p:first-child > strong:first-child {
  display: block; margin-bottom: 0.35rem;
  font: 500 0.68rem/1.4 var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
}
.callout--camera {
  background: linear-gradient(100deg, rgba(242, 165, 65, 0.1), rgba(242, 165, 65, 0.025) 70%);
  border-left: 2px solid var(--safe);
  box-shadow: inset 0 0 0 1px rgba(242, 165, 65, 0.08);
}
.callout--camera > p:first-child > strong:first-child { color: var(--safe); }
.callout--camera > p:first-child > strong:first-child::before {
  content: ''; display: inline-block; width: 0.42rem; height: 0.42rem; margin-right: 0.6em; vertical-align: 0.1em; border-radius: 50%;
  background: var(--safe); box-shadow: 0 0 0.6rem 0.1rem rgba(242, 165, 65, 0.55);
}
.callout--attenzione {
  background: rgba(236, 232, 223, 0.045);
  border-left: 2px solid var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.callout--attenzione > p:first-child > strong:first-child { color: var(--paper); }
.callout--attenzione > p:first-child > strong:first-child::before {
  content: '!'; display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; margin-right: 0.6em; vertical-align: 0.05em;
  border-radius: 50%; background: var(--paper); color: var(--ink); font: 700 0.7rem/1 var(--sans); letter-spacing: 0;
}

/* tabelle */
.table-wrap { margin: 1.8rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.table-wrap:focus-visible { outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.prose th {
  text-align: left; padding: 0.75rem 1rem; white-space: nowrap;
  font: 500 0.68rem/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  background: var(--ink-3); border-bottom: 1px solid var(--line-2);
}
.prose td { padding: 0.7rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:first-child td { border-top: 0; }
.prose td:first-child { color: var(--paper); }
.prose tbody tr:hover td { background: rgba(236, 232, 223, 0.025); }
.prose td kbd { white-space: nowrap; }

/* schermate */
.shot { margin: 2.2rem 0; }
.shot__zoom { display: block; position: relative; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--ink-3);
  box-shadow: 0 0 0 1px var(--line-2), 0 1.5rem 3.5rem -1.5rem rgba(0, 0, 0, 0.9); }
.shot__zoom img { display: block; width: 100%; transition: transform 0.6s var(--ease), opacity 0.3s; }
.shot__zoom::after {
  content: ''; position: absolute; right: 0.75rem; bottom: 0.75rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; opacity: 0;
  background: rgba(9, 9, 9, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-6 6M4 20l6-6' fill='none' stroke='%23ece8df' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 1rem no-repeat;
  border: 1px solid var(--line-2); transition: opacity 0.2s;
}
.shot__zoom:hover::after, .shot__zoom:focus-visible::after { opacity: 1; }
@media (hover: none) { .shot__zoom::after { opacity: 0.85; } }
.shot figcaption, .lightbox figcaption {
  margin-top: 0.75rem; font-size: 0.84rem; line-height: 1.5; color: var(--muted); max-width: var(--measure);
}
.shot figcaption::before { content: ''; display: inline-block; width: 1.2rem; height: 1px; margin-right: 0.6rem; vertical-align: 0.3em; background: var(--safe); }
.shot--missing .shot__ph {
  display: flex; flex-direction: column; justify-content: center; gap: 0.6rem;
  aspect-ratio: 16 / 9; padding: clamp(1rem, 4vw, 2.5rem);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, rgba(236, 232, 223, 0.02) 0 10px, transparent 10px 20px),
    radial-gradient(120% 90% at 50% 40%, #171716, #0d0d0d);
}
.shot__ph-tag { font: 500 0.66rem/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--safe); }
.shot__ph-alt { font: 400 clamp(1rem, 2vw, 1.25rem)/1.4 var(--serif); color: var(--paper); max-width: 36em; }
.shot__ph-file { font: 0.72rem/1 var(--mono); color: var(--faint); }
.inline-img { display: inline; vertical-align: middle; max-height: 1.6em; width: auto; }
.inline-missing { color: var(--faint); font-style: italic; }

/* ingrandimento */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5, 5, 5, 0.94); color: var(--text); cursor: zoom-out;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.7); }
.lightbox[open] { display: grid; place-items: center; animation: lb-in 0.25s var(--ease); }
@keyframes lb-in { from { opacity: 0; } }
.lightbox__fig { margin: 0; padding: clamp(0.75rem, 3vw, 3rem); display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox__fig img { max-width: 100%; max-height: calc(100dvh - 7rem); width: auto; height: auto; object-fit: contain; border-radius: 0.25rem; box-shadow: 0 0 0 1px var(--line-2); }
.lightbox figcaption { text-align: center; }
.lightbox__close { position: fixed; top: 0.75rem; right: 0.75rem; background: rgba(20, 20, 20, 0.8); color: var(--paper); }

/* elenco dei capitoli (pagina iniziale) */
.chapters { margin-top: 3.2rem; }
.chapters__group + .chapters__group { margin-top: 2rem; }
.chapters__label { margin: 0 0 0.8rem; font: 500 0.68rem/1.2 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.chapters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.prose .chapters__card {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2);
  text-decoration: none; color: var(--text); transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
.prose .chapters__card:hover { border-color: rgba(242, 165, 65, 0.45); background: var(--ink-3); color: var(--text); }
.chapters__title { font: 400 1.12rem/1.25 var(--serif); color: var(--paper); }
.chapters__n { font: 500 0.72rem/1 var(--mono); color: var(--safe); margin-right: 0.55rem; vertical-align: 0.15em; }
.chapters__desc { font-size: 0.84rem; line-height: 1.5; color: var(--muted); }

/* capitoli vicini */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pager__card {
  display: flex; flex-direction: column; gap: 0.45rem; padding: 1rem 1.2rem 1.15rem;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.pager__card:hover { border-color: rgba(242, 165, 65, 0.45); background: var(--ink-2); }
.pager__card--next { text-align: right; align-items: flex-end; grid-column: 2; }
.pager__dir { display: inline-flex; align-items: center; gap: 0.3rem; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.pager__dir svg { width: 0.95rem; height: 0.95rem; }
.pager__card:hover .pager__dir { color: var(--safe); }
.pager__title { font: 400 1.15rem/1.25 var(--serif); color: var(--paper); }

/* piede */
.foot { border-top: 1px solid var(--line); }
.foot__in { padding: 2.25rem clamp(1.25rem, 4vw, 4rem) 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; font-size: 0.8rem; color: var(--faint); }
.brand--small { font-size: 1.05rem; }
.brand--small .brand__mark { width: 1.25rem; height: 1.25rem; }
.foot__motto { margin: 0; font-family: var(--serif); color: var(--muted); font-size: 0.9rem; }
.foot__legal { margin: 0 0 0 auto; max-width: 46rem; }

/* ---------- testata allineata alle colonne (da 900 px): il logo sopra la barra laterale, la ricerca dove comincia il
   testo, i collegamenti a destra fin dove finisce il contenuto (8/11/2026). Gli stessi margini di .top__in e .main ---------- */
@media (min-width: 900px) {
  /* a sinistra il rientro delle voci della barra laterale (1,25rem di .side__scroll + 0,6rem di .side__label) */
  .top__in { padding-left: 1.85rem; padding-right: clamp(1.25rem, 4vw, 4rem); }
  .top__in > .brand { flex: 0 0 calc(var(--side-w) - 1.85rem); }
  .search { margin-left: calc(clamp(1.25rem, 4vw, 4rem) - 1.25rem); }
  /* il piè di pagina con gli stessi margini della testata */
  .foot__in { padding-left: 1.85rem; padding-right: clamp(1.25rem, 4vw, 4rem); }
}

/* ---------- sotto i 900 px: indice a scomparsa ---------- */
@media (max-width: 899.98px) {
  .layout { display: block; }
  .top__menu { display: inline-grid; }
  .side {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; height: auto; align-self: stretch;
    width: min(21rem, 86vw); background: var(--ink-2); border-right: 1px solid var(--line-2);
    transform: translateX(-102%); visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0s linear 0.32s;
    box-shadow: 1.5rem 0 4rem -1rem rgba(0, 0, 0, 0.9);
  }
  .is-nav-open .side { transform: none; visibility: visible; transition: transform 0.32s var(--ease), visibility 0s; }
  .side__head { display: flex; align-items: center; justify-content: space-between; height: var(--top-h); padding: 0 0.6rem 0 1.25rem; border-bottom: 1px solid var(--line); flex: none; }
  .side__title { margin: 0; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
  .side__scroll { padding-top: 1.25rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
  .side li a { padding-block: 0.55rem; font-size: 0.95rem; }
  .side__foot { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
  .side__foot a { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0.6rem; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
  .side__foot svg { width: 0.9rem; height: 0.9rem; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .is-nav-open .scrim { opacity: 1; pointer-events: auto; }
  .is-nav-open { overflow: hidden; }
  .main { padding-top: 2rem; }
  .top__home { display: none; }
}

/* sotto i 720 px: la ricerca si apre a tutta larghezza dal pulsante con la lente */
@media (max-width: 719.98px) {
  .top__in { gap: 0.5rem; }
  .top__links { gap: 0.25rem; }
  .top__find { display: inline-grid; }
  /* il selettore della lingua si riduce alla lingua di destinazione («EN» o «IT») */
  .top__lang > span:not(:last-child) { display: none; }
  .top__lang { padding-inline: 0.45rem; }
  .brand__tag { padding-left: 0.6rem; }
  .search {
    display: none; position: fixed; left: 0; right: 0; top: 0; z-index: 80; margin: 0;
    height: var(--top-h); padding: 0 0.5rem 0 0.75rem; align-items: center; gap: 0.25rem;
    background: var(--ink-2); border-bottom: 1px solid var(--line-2);
  }
  .is-search-open .search { display: flex; }
  /* un backdrop-filter farebbe da contenitore ai figli fixed: il pannello dei risultati resterebbe alto quanto la testata */
  .is-search-open .top { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .search__icon { left: 1.55rem; }
  .search__input { flex: 1; height: 2.5rem; font-size: 1rem; }
  .search__close { display: inline-grid; }
  .search__panel {
    position: fixed; left: 0; right: 0; top: var(--top-h); bottom: 0; min-width: 0; max-height: none;
    border-radius: 0; border: 0; border-top: 1px solid var(--line); padding: 0.5rem 0.5rem max(1rem, env(safe-area-inset-bottom));
  }
  .search__item { padding-block: 0.85rem; }
  .pager { grid-template-columns: 1fr; }
  .pager__card--next { grid-column: 1; }
  .foot__legal { margin-left: 0; }
  .prose { font-size: 1.03rem; }
  .prose th, .prose td { padding-inline: 0.7rem; }
  .prose table { font-size: 0.88rem; }
}
@media (max-width: 380px) {
  .brand__tag { display: none; }
}

/* ---------- movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- stampa ---------- */
@media print {
  :root { --paper: #000; --text: #111; --muted: #333; --faint: #555; --line: #ccc; --line-2: #999; --safe: #000; }
  html, body { background: #fff; color: #111; font-size: 11pt; }
  .top, .side, .scrim, .toc, .pager, .anchor, .skip, .lightbox, .shot__zoom::after, .search { display: none !important; }
  .layout, .main { display: block; padding: 0; max-width: none; }
  .doc { max-width: none; }
  .doc__title { font-size: 26pt; color: #000; }
  .eyebrow .dot { box-shadow: none; }
  .prose { font-size: 11pt; line-height: 1.55; }
  .prose > * { max-width: none; }
  .prose h2 { border-top-color: #ccc; break-after: avoid; }
  .prose h3 { break-after: avoid; }
  .prose a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 0.85em; color: #555; }
  .shot, .callout, .table-wrap, tr { break-inside: avoid; }
  .shot__zoom { box-shadow: 0 0 0 1px #ccc; background: none; }
  .callout { background: none !important; box-shadow: none !important; border-left-color: #000; }
  .callout--attenzione > p:first-child > strong:first-child::before { background: #000; color: #fff; }
  .table-wrap { background: none; overflow: visible; }
  .prose th { background: #f2f2f2; color: #000; }
  kbd { background: #fff; color: #000; box-shadow: none; }
  .prose code { background: none; color: #000; border-color: #ccc; }
  .shot--missing .shot__ph { background: none; aspect-ratio: auto; padding: 1rem; }
  .prose a { text-decoration-color: #999; }
  .chapters__card { background: none; }
  .foot { border-top-color: #ccc; }
  .foot__in { padding: 1rem 0 0; }
}

/* ---------- offerte della licenza (licenza.md) e avviso «Acquista» ---------- */
.offers { margin: 1.25rem 0; border-top: 1px solid var(--line); }
.offer { display: grid; grid-template-columns: 5rem 1fr auto auto; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.offer__l { font-family: var(--serif); font-size: 1.1rem; color: var(--paper); }
.offer__n { font-size: 0.82rem; color: var(--faint); }
.offer__p { font: 500 0.95rem var(--mono); color: var(--text); text-align: right; }
.offer__buy { padding: 0.45rem 1rem; font-size: 0.85rem; }
@media (max-width: 520px) {
  .offer { grid-template-columns: 1fr auto auto; }
  .offer__n { display: none; }
}
.soon { max-width: 26rem; padding: 1.5rem 1.75rem; border: 1px solid var(--line-2); border-radius: 0.6rem; background: var(--ink-3); color: var(--text); }
.soon::backdrop { background: rgba(0, 0, 0, 0.6); }
.soon__t { margin: 0 0 0.5rem; font: italic 400 1.3rem/1.3 var(--serif); color: var(--paper); }
.soon__p { margin: 0 0 1.25rem; line-height: 1.5; color: var(--muted); }
.soon form { display: flex; flex-direction: column; align-items: flex-start; }
.soon .btn { align-self: flex-end; }

/* ---------- la guida aperta dall'app del Mac (?mac, classe is-mac: vedi docs.js) ----------
   Fuori il sito e l'app del web; i blocchi solo-web spariscono, i solo-mac compaiono. Senza is-mac il contrario. */
.solo-mac { display: none; }
.is-mac div.solo-mac { display: block; }
.is-mac span.solo-mac { display: inline; }
.is-mac li.solo-mac { display: list-item; }
.is-mac .solo-web,
.is-mac .top__home,
.is-mac .top__links .btn,
.is-mac .side__foot { display: none !important; }
/* una voce d'elenco fatta solo di testo del web non lascia il pallino vuoto */
.is-mac li:has(> .solo-web:only-child) { display: none; }
