/* ===== SELF-HOSTED FONTS (GDPR compliant — no third-party requests) ===== */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/manrope-300.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/manrope-400.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/manrope-500.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/manrope-700.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/manrope-800.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/newsreader-300.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/newsreader-400.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/newsreader-500.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/newsreader-600.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/newsreader-700.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 300; font-display: swap; src: url('../fonts/newsreader-300i.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/newsreader-400i.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 500; font-display: swap; src: url('../fonts/newsreader-500i.woff2') format('woff2'); }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ===== SUPERFICI (carta) ===== */
  --bg-primary: #F5F1EA;      /* fondo pagina */
  --bg-secondary: #FBF9F5;    /* pannelli, card */
  --bg-tertiary: #E3E1DC;     /* filetti decorativi, divisori */
  --bg-dark: #1A1814;         /* sezioni scure */
  --paper-sunken: #EDE8DF;    /* livello intermedio: righe alternate, placeholder */

  /* ===== INCHIOSTRO ===== */
  --text-primary: #1A1814;
  --text-body: #332F28;       /* corpo dei saggi: più morbido del nero pieno */
  --text-secondary: #4A4640;
  --text-muted: #6B665C;
  --text-light: #FBF9F5;

  /* ===== ACCENTO ===== */
  --accent: #B54A25;          /* 4.70:1 su --bg-primary */
  --accent-dark: #8E3818;     /* stati hover/active su fondo CHIARO — 7.4:1 */
  --accent-light: #D0775A;    /* SOLO su fondo scuro — 5.46:1 su --bg-dark */
  --accent-wash: #F3E4DC;     /* selezione, stati soft */
  --accent-rule: rgba(181, 74, 37, 0.28);

  /* ===== BORDI ===== */
  --border-subtle: #E3E1DC;   /* decorativo: filetti, celle */
  --border-control: #8B8474;  /* controlli interattivi — 3.30:1, requisito 1.4.11 */

  /* ===== TIPOGRAFIA ===== */
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num-tabular: tabular-nums lining-nums;

  /* ===== LAYOUT ===== */
  --max-width: 1360px;
  --gap: 32px;
  --measure: 34em;            /* ~68-72 caratteri nel corpo serif */
  --header-h: 89px;           /* 24 + 40 logo + 24 + 1 bordo */

  /* ===== MOVIMENTO ===== */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  /* l'header sticky non deve coprire il bersaglio delle ancore */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* ===== HEADER ===== */
.site-header {
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.main-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.main-nav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Il selettore di lingua è il controllo più importante per il pubblico
   internazionale: l'area cliccabile era ~17x16px (WCAG 2.5.8 chiede 24x24).
   11.5px era anche un valore mezzo-pixel, sfocato su schermi non-retina. */
.lang-switch {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.lang-switch a,
.lang-switch span.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

.lang-switch a:hover,
.lang-switch a.active,
.lang-switch [aria-current] {
  color: var(--text-primary);
  font-weight: 700;
}

.lang-switch span[aria-hidden] {
  margin: 0 2px;
}

.search-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== HERO ===== */
.hero {
  padding: 80px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 110px);
  line-height: 0.92;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.hero-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 40px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.85;
}

.hero-image {
  background: var(--bg-tertiary);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plate-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== ABOUT SECTION ===== */
.about-section {
  padding: 80px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-sublabel {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.about-text {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 48px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--bg-tertiary);
  padding-top: 32px;
}

.stat-item .stat-value {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--text-primary);
}

.stat-item .stat-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== SECTION CARDS ===== */
.sections-block {
  padding: 80px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.sections-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}

.sections-header h2 {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;
}

.link-arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.link-arrow:hover {
  color: var(--text-primary);
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.section-card {
  padding: 32px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  transition: border-color 0.2s;
}

.section-card:hover {
  border-color: var(--text-muted);
}

.section-card .card-plate {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-card .card-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.section-card h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 8px;
}

.section-card .card-subtitle {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== ARTICLES GRID ===== */
.articles-section {
  padding: 80px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}

.articles-header h2 {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;
}

.featured-article {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.featured-article .article-image {
  background: var(--bg-tertiary);
  aspect-ratio: 4/3;
  overflow: hidden;
}

.featured-article .article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-article .article-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.article-num {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.featured-article h3 {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
}

.featured-article p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.article-card {
  transition: transform 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
}

.article-card .card-image {
  background: var(--bg-tertiary);
  aspect-ratio: 4/3;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}

.article-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Il fondo sottostante è chiaro (SVG #F5F1EA) su 28 card su 29: il bianco
   trasparente dava 1.09:1. Pastiglia scura → 8.45:1 su qualunque fondo. */
.article-card .card-image .plate {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 10px;
  color: var(--text-light);
  background: rgba(26, 24, 20, 0.78);
  padding: 2px 6px;
  letter-spacing: 0.08em;
  font-variant-numeric: var(--num-tabular);
}

.article-card .article-cat {
  margin-bottom: 4px;
}

.article-card h4 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.article-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== MUSEUM ATLAS (dark section) ===== */
.atlas-section {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 80px 0;
}

.atlas-section h2 {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 48px;
}

.atlas-table {
  width: 100%;
  border-collapse: collapse;
}

.atlas-table tr {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.atlas-table td {
  padding: 20px 0;
  font-size: 15px;
  vertical-align: middle;
}

.atlas-table .row-num {
  font-family: var(--font-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.55); /* era 0.4 = 3.81:1, sotto soglia AA */
  width: 60px;
  font-variant-numeric: var(--num-tabular);
}

.atlas-table .row-city {
  font-weight: 600;
  width: 180px;
}

.atlas-table .row-museum {
  color: rgba(255,255,255,0.7);
}

.atlas-table .row-count {
  text-align: right;
  color: rgba(255,255,255,0.5);
  width: 100px;
}

.atlas-table .row-link {
  text-align: right;
  width: 100px;
}

.atlas-table .row-link a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  transition: color 0.2s;
}

.atlas-table .row-link a:hover {
  color: white;
}

/* ===== QUOTE SECTION ===== */
.quote-section {
  padding: 80px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: center;
}

.quote-image {
  margin: 0;
  background: var(--paper-sunken);
  overflow: hidden;
  position: relative;
}

.quote-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.02);
}

.quote-image figcaption {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: var(--num-tabular);
}

.quote-content blockquote {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.quote-attribution {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.quote-attribution strong {
  color: var(--text-primary);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  padding: 64px 0 32px;
  border-top: 1px solid var(--bg-tertiary);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--bg-tertiary);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== PUBLICATIONS LIST ===== */
.publications-list {
  list-style: none;
  margin: 16px 0 32px 0;
  padding: 0;
}

.publications-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.publications-list li:last-child {
  border-bottom: none;
}

/* ===== ARTICLE PAGE ===== */
.article-header {
  padding: 40px 0 0;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb .sep {
  margin: 0 8px;
}

.article-header-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: start;
}

.article-header .article-cat {
  margin-bottom: 8px;
}

.article-header h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.article-lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.article-meta-card {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  padding: 32px;
}

.meta-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 14px;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row .meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-row .meta-value {
  color: var(--text-primary);
  text-align: right;
}

.article-hero-image {
  margin: 48px 0;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.article-hero-image img {
  width: 100%;
}

.article-hero-image .caption {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Article body layout — 3-column */
.article-body-layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 48px;
  padding: 48px 0 80px;
}

.article-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.article-sidebar-right {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-section {
  margin-bottom: 40px;
}

.sidebar-section h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  transition: color 0.2s;
}

.toc-list a:hover {
  color: var(--text-primary);
}

.toc-list .toc-num {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 20px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
  transition: color 0.2s;
}

.sidebar-link:hover {
  color: var(--text-primary);
}

.sidebar-link .link-icon {
  font-size: 16px;
}

/* Article content
   Il corpo dei saggi va in SERIF: è prosa scientifica da leggere per intero,
   non interfaccia. Prima ereditava Manrope mentre Sintesi, Punti chiave e
   Bibliografia erano già in serif — registro invertito e incoerente.
   34em a 19px ≈ 68-72 caratteri per riga (prima: 720px/17px ≈ 81). */
.article-content-body {
  max-width: var(--measure);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.62;
  color: var(--text-body);
  overflow-wrap: break-word;
  text-wrap: pretty;
  font-feature-settings: "liga" 1, "kern" 1;
}

.article-content-body h2 {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 48px 0 20px;
  color: var(--text-primary);
  text-wrap: balance;
}

.article-content-body h2:first-child {
  margin-top: 0;
}

.article-content-body h3 {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  margin: 36px 0 16px;
  color: var(--text-primary);
  text-wrap: balance;
}

.article-content-body p {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin-bottom: 0;
}

.article-content-body p + p {
  margin-top: 1.35em;
}

/* L'apparato resta in sans: didascalie, tabelle, note */
.article-content-body figcaption,
.article-content-body table,
.article-content-body small {
  font-family: var(--font-sans);
}

.article-content-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content-body em {
  font-style: italic;
}

.article-content-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 32px 0;
  background: var(--bg-secondary);
}

.article-content-body blockquote p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-primary);
}

.article-content-body figure {
  margin: 32px 0;
}

.article-content-body figure img {
  width: 100%;
}

.article-content-body figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

.article-content-body ul,
.article-content-body ol {
  margin: 20px 0 24px 24px;
  color: inherit;
}

.article-content-body li {
  font-family: inherit;
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.article-content-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em; /* in em: non taglia i discendenti del serif */
  text-decoration-color: var(--accent-rule);
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

/* Su fondo chiaro l'hover deve SCURIRE: --accent-light dava 2.88:1 */
.article-content-body a:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--accent-dark);
}

.article-content-body a:active {
  color: var(--accent-dark);
  background: var(--accent-wash);
}

.article-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.article-content-body table th,
.article-content-body table td {
  padding: 10px 12px;
  border: 1px solid var(--bg-tertiary);
  text-align: left;
}

.article-content-body table th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.article-content-body iframe {
  max-width: 100%;
  margin: 24px 0;
}

/* Author attribution */
.article-attribution {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--bg-tertiary);
}

.attribution-authors {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.attribution-cite {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

/* Glossary — right sidebar style */
.glossary-section {
  margin: 0;
  padding: 0;
}

.glossary-header {
  margin-bottom: 20px;
}

.glossary-header h2 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.glossary-intro {
  display: none;
}

.glossary-list {
  display: block;
}

.glossary-list dt {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
  color: var(--accent);
  padding: 14px 0 2px;
  border-top: none;
}

.glossary-list dt:first-child {
  padding-top: 0;
}

.glossary-list dd {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-bottom: 8px;
  margin-left: 0;
}

/* Drop cap — con corpo serif servono metriche diverse.
   Il margine negativo allinea OTTICAMENTE la lettera al margine della colonna. */
.article-content-body .drop-cap::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.4em;
  line-height: 0.86;
  margin: 0.02em 0.12em 0 -0.04em;
  color: var(--accent);
  font-weight: 400;
}

/* Il capolettera non deve mai cadere dentro il box Sintesi.
   Presidio CSS: la correzione strutturale è in add_drop_cap(). */
.article-content-body .executive-summary .drop-cap::first-letter,
.article-content-body .key-takeaways .drop-cap::first-letter {
  font-family: inherit;
  float: none;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  color: inherit;
  font-weight: inherit;
}

/* Download card in sidebar */
.download-card {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-control); /* era --bg-tertiary = 1.24:1 */
  border-radius: 0;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.download-card:hover {
  border-color: var(--accent-dark);
  background: var(--bg-primary);
}

.download-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.download-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Share buttons */
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 32px; /* target >= 24px, WCAG 2.5.8 */
  border: 1px solid var(--border-control); /* era --bg-tertiary = 1.16:1 */
  border-radius: 0; /* coerenza: il sistema è squadrato, non a pillole */
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.share-btn:hover {
  border-color: var(--accent-dark);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Riscontro visibile dopo "Copia link" / "Copia citazione" */
.share-btn.is-done {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
}

/* Related articles */
.related-section {
  padding: 80px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.related-section h2 {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 48px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ===== ARCHIVE PAGE ===== */
.archive-header {
  padding: 60px 0;
}

.archive-header-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 64px;
  align-items: start;
}

.archive-header h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.archive-header h1 .num-highlight {
  color: var(--accent);
}

.archive-desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.archive-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.archive-stat .stat-value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
}

.archive-stat .stat-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Search and filter */
.archive-filters {
  padding: 32px 0;
  border-top: 1px solid var(--bg-tertiary);
  border-bottom: 1px solid var(--bg-tertiary);
  margin-bottom: 48px;
}

.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 0; /* era 300px: causava overflow sotto i 360px */
  padding: 12px 16px;
  /* il bordo è l'UNICO segnale visivo del campo: serve >= 3:1 */
  border: 1px solid var(--border-control);
  background: var(--bg-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s var(--ease);
}

.search-input:focus {
  border-color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  padding: 8px 16px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-control); /* era --bg-tertiary = 1.16:1 */
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

/* hover e stato selezionato DEVONO essere distinguibili: prima erano identici,
   quindi sfiorando un filtro sembrava di averlo attivato */
.filter-tag:hover {
  background: var(--bg-secondary);
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.filter-tag.active,
.filter-tag[aria-pressed="true"] {
  background: var(--bg-dark);
  color: var(--text-light);
  border-color: var(--bg-dark);
}

.filter-tag.active:hover,
.filter-tag[aria-pressed="true"]:hover {
  background: var(--text-body);
  border-color: var(--text-body);
  color: var(--text-light);
}

.filter-tag .count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
  font-variant-numeric: var(--num-tabular);
}

.filter-tag.active .count,
.filter-tag[aria-pressed="true"] .count {
  color: rgba(255,255,255,0.6);
}

/* Archive article list */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

/* Chronological table */
.chrono-section {
  margin-top: 64px;
  border-top: 1px solid var(--bg-tertiary);
  padding-top: 48px;
}

.chrono-section h3 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 32px;
}

.chrono-table {
  width: 100%;
  border-collapse: collapse;
}

.chrono-table thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 0;
  border-bottom: 2px solid var(--bg-tertiary);
  text-align: left;
}

.chrono-table tbody tr {
  border-bottom: 1px solid var(--bg-tertiary);
  transition: background 0.15s;
}

.chrono-table tbody tr:hover {
  background: var(--bg-secondary);
}

.chrono-table td {
  padding: 16px 0;
  padding-right: 16px;
  font-size: 14px;
  vertical-align: middle;
}

.chrono-table .col-num {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--text-muted);
  width: 70px;
}

.chrono-table .col-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  width: 180px;
}

.chrono-table .col-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
}

.chrono-table .col-title a {
  color: var(--text-primary);
  transition: color 0.2s;
}

.chrono-table .col-title a:hover {
  color: var(--accent);
}

.chrono-table .col-pages {
  color: var(--text-muted);
  width: 80px;
}

.chrono-table .col-format a {
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
}

/* ===== SEO CONTENT BLOCKS ===== */

.executive-summary {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: 28px 32px;
  margin-bottom: 40px;
  border-radius: 0;
}
.executive-summary h2 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
/* Sintesi e Punti chiave sono APPARATO: restano in sans, così si distinguono
   dal corpo del saggio che ora è in serif. */
.executive-summary p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.executive-summary p + p {
  margin-top: 0.9em;
}

/* Era background: var(--bg-primary), cioè lo stesso colore del body:
   il pannello risultava invisibile. Terza superficie. */
.key-takeaways {
  background: var(--paper-sunken);
  border: none;
  border-top: 1px solid var(--bg-tertiary);
  border-bottom: 1px solid var(--bg-tertiary);
  padding: 24px 28px;
  margin-bottom: 36px;
  border-radius: 0;
}
.key-takeaways h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.key-takeaways ul {
  list-style: none;
  padding: 0;
}
.key-takeaways li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}
/* Filetto invece del pallino: linguaggio da apparato critico */
.key-takeaways li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.bibliography {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--bg-tertiary);
}
.bibliography h2 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.bibliography ol {
  padding-left: 24px;
}
.bibliography li {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 32px 0;
  border-radius: 0;
  background: var(--bg-dark);
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== SEGNAPOSTO VIDEO (click-to-load) =====
   Il video non viene caricato all'apertura della pagina: senza il consenso
   informato dell'utente nessuna richiesta raggiunge Google. */

.video-consent {
  padding-bottom: 0;
  height: auto;
  background: var(--bg-dark);
}

.video-consent-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  aspect-ratio: 16 / 9;
  justify-content: center;
  padding: 28px clamp(20px, 5vw, 48px);
  background: none;
  border: 0;
  text-align: left;
  color: var(--text-light);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.video-consent-btn:hover {
  background: rgba(251, 249, 245, 0.05);
}

.video-consent-icon svg {
  width: 44px;
  height: 44px;
  color: var(--accent-light); /* 5.46:1 su --bg-dark */
}

.video-consent-cta {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.video-consent-note {
  font-size: 13px;
  line-height: 1.5;
  max-width: 52ch;
  /* #C9C3B8 su #1A1814 = 10.4:1 */
  color: #C9C3B8;
  font-weight: 400;
}

.video-consent-policy {
  margin: 0;
  padding: 12px clamp(20px, 5vw, 48px) 16px;
  border-top: 1px solid rgba(251, 249, 245, 0.14);
  font-size: 12px;
}

.video-consent-policy a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.video-consent-policy a:hover {
  color: var(--text-light);
}

@media (max-width: 520px) {
  .video-consent-btn {
    aspect-ratio: auto;
    padding: 24px 18px;
  }
  .video-consent-icon svg {
    width: 34px;
    height: 34px;
  }
}

/* ===== THUMBNAIL OVERLAY COMPOSITE ===== */

.thumb-composite {
  position: relative;
  overflow: hidden;
}
.thumb-composite img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.thumb-svg-only {
  width: 100%;
  height: 100%;
  display: block;
}
.thumb-composite .plate {
  z-index: 2;
}

/* ===== COOKIE BANNER ===== */

/* Esplicito: se in futuro si aggiungesse un display su .cookie-banner,
   l'attributo hidden verrebbe silenziosamente ignorato. */
.cookie-banner[hidden] {
  display: none;
}

/* Il banner è position:fixed con z-index 9999: senza compensazione, l'ultimo
   elemento raggiunto con Tab finisce nascosto sotto di esso (WCAG 2.4.11). */
body:has(#cookie-banner:not([hidden])) {
  padding-bottom: 96px;
}

@media (max-width: 768px) {
  body:has(#cookie-banner:not([hidden])) {
    padding-bottom: 172px;
  }
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 16px 0;
  font-size: 14px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-inner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.cookie-link {
  color: var(--accent-light);
  text-decoration: underline;
  font-size: 13px;
}
.cookie-btn {
  padding: 10px 24px;
  min-height: 40px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.18s var(--ease);
}
/* era --accent-light: bianco su #D0775A dava 3.25:1 */
.cookie-btn:hover {
  background: var(--accent-dark);
}

/* ===== PRIVACY PAGE ===== */

.privacy-content {
  max-width: 720px;
  padding: 48px 0 80px;
}
.privacy-content h2 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text-primary);
}
.privacy-content h2:first-child {
  margin-top: 0;
}
/* L'informativa è apparato, non prosa d'autore: va in sans.
   Il serif è riservato al corpo dei saggi. */
.privacy-content p {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.privacy-content h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text-primary);
}
.privacy-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}
.privacy-content li {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.privacy-content code {
  font-size: 0.9em;
  background: var(--paper-sunken);
  padding: 1px 5px;
}
.privacy-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg-tertiary);
}
.privacy-content a {
  color: var(--accent);
}

/* ===== ACCESSIBILITY ===== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  position: fixed;
  left: 0;
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}
.menu-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .sections-grid,
  .articles-grid,
  .archive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .hero-grid,
  .about-grid,
  .article-header-grid,
  .archive-header-grid {
    grid-template-columns: 1fr;
  }

  .featured-article {
    grid-template-columns: 1fr;
  }

  .article-body-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar,
  .article-sidebar-right {
    position: static;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
  }

  .article-sidebar-right {
    order: 3;
  }

  .sidebar-section {
    flex: 1;
    min-width: 200px;
  }

  .glossary-intro {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
  }

  .quote-grid {
    grid-template-columns: 1fr;
  }

  .sections-grid,
  .articles-grid,
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .atlas-section h2 {
    font-size: 40px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 16px 24px;
    z-index: 100;
  }
  .main-nav.nav-open {
    display: flex;
  }
  .main-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-tertiary);
    font-size: 16px;
  }
  .main-nav a:last-child {
    border-bottom: none;
  }

  .site-header .container {
    position: relative;
  }

  .hero h1 {
    font-size: 40px;
  }

  .sections-grid,
  .articles-grid,
  .archive-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }

  .archive-stats {
    grid-template-columns: 1fr;
  }

  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Le celle a larghezza fissa (60/180/100px sull'atlante, 70/180/80px sulla
     tabella cronologica) non venivano azzerate da nessuna media query:
     sotto i 500px il contenuto sfondava di oltre 200px. */
  .atlas-table .row-num,
  .atlas-table .row-city,
  .atlas-table .row-count,
  .atlas-table .row-link,
  .chrono-table .col-num,
  .chrono-table .col-cat,
  .chrono-table .col-pages {
    width: auto;
  }

  .atlas-table,
  .chrono-table {
    font-size: 13px;
  }

  .atlas-table td {
    padding: 14px 0;
  }
}

/* ===== TELEFONI PICCOLI (360-430px): fascia prima non coperta ===== */

@media (max-width: 520px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: clamp(32px, 11vw, 44px);
  }

  .article-content-body {
    font-size: 18px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .executive-summary,
  .key-takeaways {
    padding: 20px 18px;
  }

  /* I filtri diventano una fascia scorrevole invece di andare a capo 6 volte */
  .filter-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scroll-snap-type: x proximity;
  }

  .filter-tag {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

/* ===== TABELLE LARGHE: scorrimento nel proprio contenitore ===== */

/* Il wrapper è aggiunto lato PHP da wrap_wide_tables(); il ruolo region +
   tabindex mantengono la tabella raggiungibile e annunciata. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  /* ombre laterali: segnalano che c'è altro contenuto oltre il bordo */
  background:
    linear-gradient(to right, var(--bg-primary) 30%, rgba(245, 241, 234, 0)) left / 32px 100% no-repeat,
    linear-gradient(to left, var(--bg-primary) 30%, rgba(245, 241, 234, 0)) right / 32px 100% no-repeat;
}

.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.table-scroll > table {
  margin: 0;
  min-width: 34em;
}

/* ===== UTILITÀ ===== */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visibile quando riceve il focus (skip-link, campi nascosti focalizzabili) */
.visually-hidden:focus,
.visually-hidden:focus-within {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

::selection {
  background: var(--accent-wash);
  color: var(--text-primary);
}

/* ===== MOVIMENTO RIDOTTO ===== */

/* scroll-behavior: smooth su testi con 12 ancore e 8.000 parole è la causa
   più comune di nausea per chi ha disturbi vestibolari. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .article-card:hover {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-secondary: #2A2620;
    --text-muted: #3E3A33;
    --border-control: #5C564A;
    --accent: #9A3A18;
  }
}

/* ===== LIGHTBOX GALLERIA =====
   Prima il click su una miniatura portava fuori dal sito, su un file
   immagine nudo senza didascalia. <dialog> nativo: nessuna libreria. */

.lightbox {
  padding: 0;
  border: 0;
  max-width: min(1200px, 92vw);
  max-height: 90vh;
  background: var(--bg-dark);
  box-shadow: var(--shadow-4, 0 24px 56px -20px rgba(26, 24, 20, 0.5));
}

.lightbox::backdrop {
  background: rgba(26, 24, 20, 0.92);
}

.lightbox img {
  display: block;
  max-width: min(1200px, 92vw);
  max-height: 78vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  padding: 14px 20px 18px;
  color: rgba(251, 249, 245, 0.75); /* --text-light al 75%: 12.6:1 su --bg-dark */
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.lightbox-caption:empty,
.lightbox-caption[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: rgba(26, 24, 20, 0.72);
  color: var(--text-light);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s var(--ease);
}

.lightbox-close:hover {
  background: var(--bg-dark);
}

@media (max-width: 520px) {
  .lightbox {
    max-width: 96vw;
  }
  .lightbox img {
    max-width: 96vw;
    max-height: 68vh;
  }
}

/* ===== STAMPA =====
   Il pulsante "Stampa / salva in PDF" è il modo con cui questo pubblico
   archivia i saggi: l'output di stampa è a tutti gli effetti il formato
   alternativo del documento. */

@media print {
  @page {
    margin: 22mm 20mm 20mm;
  }

  html {
    font-size: 11pt;
    scroll-behavior: auto;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .cookie-banner,
  .skip-link,
  .article-sidebar,
  .article-sidebar-left,
  .share-buttons,
  .download-card,
  .related-section,
  .menu-toggle,
  .breadcrumb,
  .essay-pager,
  .progress-track,
  .lang-switch {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .article-body-layout {
    display: block;
    padding: 0;
  }

  .article-content-body {
    max-width: none;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
  }

  .article-header h1 {
    font-size: 24pt;
    line-height: 1.1;
  }

  .article-meta-card {
    border: none;
    padding: 0;
    margin-bottom: 12mm;
    background: none;
  }

  /* Il glossario diventa appendice in fondo */
  .article-sidebar-right {
    display: block;
    break-before: page;
  }

  .article-content-body h2,
  .article-content-body h3 {
    break-after: avoid;
  }

  .article-content-body h2 {
    font-size: 14pt;
    margin-top: 10mm;
  }

  .article-content-body h3 {
    font-size: 12pt;
  }

  .article-content-body p {
    orphans: 3;
    widows: 3;
  }

  .article-content-body figure,
  .article-content-body table,
  .article-content-body blockquote,
  .key-takeaways {
    break-inside: avoid;
  }

  .table-scroll {
    overflow: visible;
    background: none;
  }

  .article-content-body a {
    color: #000;
    text-decoration: none;
  }

  /* Su carta i riferimenti servono espliciti */
  .article-content-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #444;
    word-break: break-all;
  }

  .article-content-body table th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .article-content-body::after {
    content: "Aquila Corde Armoniche — ricerche.aquilacorde.com";
    display: block;
    margin-top: 8mm;
    padding-top: 3mm;
    border-top: 0.5pt solid #000;
    font-family: var(--font-sans);
    font-size: 8pt;
  }
}
