/*
Theme Name: Farmaci e Gravidanza
Theme URI: https://farmaciegravidanza.org/
Author: farmaciegravidanza.org
Description: Tema editoriale per il sito del manuale "Farmaci e Gravidanza".
Version: 1.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: farmaciegravidanza
*/

:root {
  --navy-900: #081d44;
  --navy-800: #0b2552;
  --navy-700: #11316a;
  --navy-600: #1d4288;
  --navy-500: #2d5aa8;
  --sky-300: #a9c8e8;
  --sky-200: #c8ddf0;
  --sky-100: #e3eefa;
  --sky-50:  #f1f7fd;
  --teal-800: #003f3c;
  --teal-700: #00544f;
  --teal-600: #006666;
  --teal-500: #0a807a;
  --teal-100: #dff0ee;
  --ink:    #101c31;
  --ink-2:  #27354c;
  --muted:  #56677f;
  --line:   #d8e3f0;
  --line-2: #eaf0f8;
  --paper:  #ffffff;
  --paper-2:#f6f9fd;
  --warn-bg:#fdf4e9;
  --warn-br:#e3b878;

  --fg: var(--ink);
  --bg: var(--paper);
  --accent: var(--teal-600);
  --accent-ink: #ffffff;
  --brand: var(--navy-700);

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --s9: 96px; --s10: 128px;

  --r-xs: 4px; --r-sm: 10px; --r-md: 18px; --r-lg: 28px; --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(8, 29, 68, .06), 0 2px 8px rgba(8, 29, 68, .05);
  --shadow-md: 0 2px 6px rgba(8, 29, 68, .07), 0 14px 38px rgba(8, 29, 68, .10);
  --shadow-lg: 0 6px 16px rgba(8, 29, 68, .10), 0 30px 70px rgba(8, 29, 68, .16);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 380ms;

  --font-ui: "Figtree", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-accent: "Newsreader", Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --wrap-narrow: 820px;
  --header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--navy-700); }

:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

h1, h2, h3, h4, h5 {
  margin: 0 0 var(--s3);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.018em;
  color: var(--navy-800);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); }
h3 { font-size: clamp(1.18rem, 1.05rem + .55vw, 1.42rem); }
h4 { font-size: 1.05rem; letter-spacing: 0; }

p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.3em; }
li { margin-bottom: var(--s2); }
li:last-child { margin-bottom: 0; }
strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s7) 0; }

.wrap { width: min(100% - 2 * var(--s5), var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--s5), var(--wrap-narrow)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy-800); color: #fff; padding: var(--s3) var(--s5);
  border-radius: 0 0 var(--r-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--navy-800);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
  transition: background var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.site-header.is-stuck { background: rgba(8, 29, 68, .95); backdrop-filter: saturate(140%) blur(10px); box-shadow: var(--shadow-md); }

.header-inner {
  display: flex; align-items: center; gap: var(--s5);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: var(--s3); margin-right: auto; text-decoration: none; }
.brand img { max-height: 44px; width: auto; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  background: linear-gradient(145deg, var(--sky-200), #ffffff);
  color: var(--navy-700); display: grid; place-items: center;
  font-weight: 800; font-size: .96rem; letter-spacing: -.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.04rem; letter-spacing: -.015em; }
.brand-sub { color: var(--sky-300); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

.nav-primary ul { display: flex; align-items: center; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.nav-primary li { margin: 0; position: relative; }
.nav-primary a {
  display: block; padding: 10px var(--s3); border-radius: var(--r-sm);
  color: var(--sky-100); text-decoration: none; font-size: .935rem; font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-primary a:hover, .nav-primary a:focus-visible { color: #fff; background: rgba(255, 255, 255, .1); }
.nav-primary .current-menu-item > a,
.nav-primary .current_page_item > a,
.nav-primary .current-page-ancestor > a { color: #fff; background: rgba(200, 221, 240, .18); }

.nav-primary .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--paper); border-radius: var(--r-sm); padding: var(--s2);
  box-shadow: var(--shadow-lg); display: block;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
}
.nav-primary li:hover > .sub-menu,
.nav-primary li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-primary .sub-menu a { color: var(--ink-2); font-size: .9rem; }
.nav-primary .sub-menu a:hover { background: var(--sky-50); color: var(--navy-700); }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid rgba(200, 221, 240, .4);
  background: transparent; border-radius: var(--r-sm); cursor: pointer; color: #fff;
}
.nav-toggle span { display: block; width: 19px; height: 2px; background: #fff; position: relative; transition: background var(--t-fast) var(--ease); }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 19px; height: 2px; background: #fff;
  transition: transform var(--t-base) var(--ease);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.hero {
  position: relative; overflow: hidden;
  background: var(--navy-800);
  color: var(--sky-100);
  padding: clamp(48px, 3vw + 36px, 84px) 0 0;
}
.hero::before {
  content: ""; position: absolute; inset: auto 0 -45% 38%;
  height: 120%; border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: radial-gradient(120% 90% at 30% 0%, rgba(0, 102, 102, .55), rgba(11, 37, 82, 0) 68%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: 0; top: -32%;
  width: 56%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(200, 221, 240, .18), rgba(200, 221, 240, 0) 62%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
  padding-bottom: clamp(56px, 5vw, 96px);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sky-300); margin-bottom: var(--s4);
}
.hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--teal-500); }
.hero h1 { color: #fff; margin-bottom: var(--s5); }
.hero h1 .accent { font-family: var(--font-accent); font-style: italic; font-weight: 400; color: var(--sky-200); letter-spacing: -.01em; }
.hero-lede { font-size: clamp(1.06rem, 1rem + .35vw, 1.3rem); color: var(--sky-200); max-width: 34ch; line-height: 1.5; }
.hero-lede p { margin-bottom: var(--s2); }
.hero-lede p:last-child { margin-bottom: 0; }

.hero-cover { justify-self: center; position: relative; }
.hero-cover img {
  width: min(100%, 288px); border-radius: var(--r-sm);
  box-shadow: 0 24px 60px rgba(4, 16, 40, .55), 0 2px 0 rgba(255, 255, 255, .12);
  transform: rotate(-2.2deg);
  transition: transform var(--t-slow) var(--ease-out);
}
.hero-cover:hover img { transform: rotate(0deg) translateY(-4px); }
.hero-cover-link { display: block; border-radius: var(--r-sm); }
.hero-cover-link::after { content: ""; position: absolute; inset: 0; }
.hero-cover figcaption {
  margin-top: var(--s4); font-size: .82rem; color: var(--sky-300); text-align: center; max-width: 320px;
}

.hero-wave { display: block; width: 100%; height: auto; margin-bottom: -1px; color: var(--paper); }

.quicknav {
  position: relative; z-index: 2;
  margin-top: calc(-1 * clamp(40px, 5vw, 72px));
  background: var(--paper); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: clamp(20px, 2.4vw, 32px);
}
.quicknav h2 {
  font-family: var(--font-accent); font-style: italic; font-weight: 400;
  font-size: 1.35rem; color: var(--teal-700); margin-bottom: var(--s4); letter-spacing: -.005em;
}
.quicknav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quicknav li { margin: 0; }
.quicknav a {
  display: flex; align-items: center; gap: var(--s3); min-height: 56px;
  padding: var(--s3) var(--s4); border-radius: var(--r-sm);
  background: var(--sky-50); border: 1px solid var(--line-2);
  color: var(--navy-700); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.quicknav a:hover { background: var(--teal-100); border-color: var(--teal-500); transform: translateY(-2px); }
.quicknav a::after { content: "›"; margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--teal-600); }

.section { padding: clamp(52px, 5vw, 92px) 0; }
.section-tinted { background: var(--paper-2); }
.section-sky { background: linear-gradient(180deg, var(--sky-50), var(--paper)); }
.section-head { max-width: 62ch; margin-bottom: var(--s7); }
.section-head p { color: var(--muted); font-size: 1.06rem; margin-bottom: 0; }
.section-kicker {
  display: block; font-size: .76rem; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--teal-600); margin-bottom: var(--s3);
}

.card-grid { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s5);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.card.is-compact { padding: var(--s4) var(--s5); display: flex; align-items: center; min-height: 86px; }
.card.is-compact h3 { margin-bottom: 0; font-size: 1.04rem; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--sky-300); }
.card h3 { margin-bottom: var(--s2); color: var(--navy-700); }
.card h3 a { color: inherit; text-decoration: none; }
.card:hover h3 a { color: var(--teal-700); }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1040px) { .card-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .card-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: minmax(0, 1fr); } }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.card a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .chip {
  width: 44px; height: 44px; border-radius: var(--r-sm); margin-bottom: var(--s4);
  background: var(--teal-100); color: var(--teal-700);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.card .card-link { color: var(--teal-700); font-weight: 600; font-size: .93rem; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-top: var(--s3); }
.card .card-link::after { content: "›"; font-size: 1.15rem; line-height: 1; transition: transform var(--t-fast) var(--ease); }
.card:hover .card-link::after { transform: translateX(3px); }

.page-hero {
  background: var(--navy-800); color: var(--sky-100);
  padding: clamp(36px, 3vw, 54px) 0 clamp(44px, 4vw, 68px);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: 0; bottom: -70%;
  width: 42%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(0, 102, 102, .5), rgba(0, 102, 102, 0) 65%);
}
.page-hero h1 { color: #fff; margin-bottom: var(--s3); position: relative; z-index: 1; max-width: 22ch; }
.page-hero .page-hero-sub { color: var(--sky-200); font-size: 1.05rem; max-width: 60ch; margin: 0; position: relative; z-index: 1; }

.crumbs { position: relative; z-index: 1; margin-bottom: var(--s5); font-size: .85rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; }
.crumbs li { margin: 0; color: var(--sky-300); display: flex; gap: var(--s2); align-items: center; }
.crumbs li + li::before { content: "›"; color: rgba(200, 221, 240, .5); }
.crumbs a { color: var(--sky-200); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #fff; }

.page-body { padding: clamp(40px, 4vw, 64px) 0 clamp(56px, 5vw, 88px); }
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 4vw, 64px); align-items: start; }
.page-layout.no-aside { grid-template-columns: minmax(0, 1fr); }
.page-layout.no-aside > .prose { max-width: 80ch; margin-inline: auto; }
.prose > .contact-grid, .prose > .map-frame, .prose > .sheetgrid, .prose > .card-grid { max-width: none; }

.prose { font-size: 1.02rem; color: var(--ink-2); max-width: 72ch; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin-top: var(--s7); }
.prose h3 { margin-top: var(--s6); color: var(--teal-700); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose a { color: var(--teal-700); }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.5em; }
.prose ul > li::before {
  content: ""; position: absolute; left: .25em; top: .72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500);
}
.prose ol { padding-left: 1.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s5) 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--sky-50); color: var(--navy-700); font-weight: 700; }
.prose blockquote {
  margin: var(--s5) 0; padding: var(--s4) var(--s5);
  border-left: 3px solid var(--teal-500); background: var(--paper-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2); font-style: normal;
}
.table-scroll { overflow-x: auto; }

.doclist { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s2); }
.doclist li, .prose ul.doclist > li, .prose ul.sheetgrid > li { margin: 0; padding-left: 0; }
.doclist li::before, .prose ul.doclist > li::before, .prose ul.sheetgrid > li::before { display: none; }
.doclist a {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--navy-700); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.doclist a:hover { border-color: var(--teal-500); background: var(--teal-100); transform: translateX(2px); }
.doclist a::before {
  content: "PDF"; flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--teal-600); padding: 3px 6px; border-radius: var(--r-xs);
}
.doclist.is-xls a::before { content: "XLS"; background: var(--navy-600); }
.doclist .nolink {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border: 1px dashed var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); color: var(--muted); font-size: .95rem;
}
.pdfgrid .nolink { display: flex; flex-direction: column; gap: var(--s3); height: 100%; color: var(--muted); }
.pdfgrid .nolink .pdfgrid-shot { opacity: .72; }
.pdfgrid .nolink .pdfgrid-label::before { background: var(--muted); }
.doclist.is-plain a::before { content: "›"; background: transparent; color: var(--teal-600); font-size: 1.2rem; padding: 0; }

.backlinks {
  clear: both; margin: var(--s6) 0 0; padding-top: var(--s4);
  border-top: 1px solid var(--line-2); font-size: .9rem; color: var(--muted);
}
.backlinks a { color: var(--teal-700); font-weight: 600; }
.note-en {
  clear: both; margin-top: var(--s6); font-size: .86rem; line-height: 1.6; color: var(--muted);
}

.page-figure {
  margin: var(--s6) 0; max-width: 340px;
}
.page-figure img {
  width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm); background: var(--paper);
}
.page-figure figcaption {
  margin-top: var(--s3); font-size: .86rem; line-height: 1.5; color: var(--muted);
}
@media (min-width: 900px) {
  .page-figure { float: right; margin: var(--s2) 0 var(--s5) var(--s6); max-width: 300px; }
  .page-figure + * { clear: none; }
}

.pdfgrid {
  list-style: none; padding: 0; margin: 0 0 var(--s5);
  display: grid; gap: var(--s5);
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.pdfgrid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 620px) {
  .pdfgrid, .pdfgrid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
  .pdfgrid-label { font-size: .84rem; }
}
.prose ul.pdfgrid > li { margin: 0; padding-left: 0; }
.prose ul.pdfgrid > li::before { display: none; }
.pdfgrid a {
  display: flex; flex-direction: column; gap: var(--s3); height: 100%;
  text-decoration: none; color: var(--navy-700);
}
.pdfgrid-shot {
  display: block; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.pdfgrid-shot img { width: 100%; height: auto; display: block; }
.pdfgrid-shot.is-plain {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 560 / 811; background: var(--sky-100);
  font-family: var(--font-accent); font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 600; color: var(--navy-500);
}
.pdfgrid a:hover .pdfgrid-shot,
.pdfgrid a:focus-visible .pdfgrid-shot {
  border-color: var(--teal-500); box-shadow: var(--shadow-md); transform: translateY(-3px);
}
.pdfgrid .nolink {
  display: flex; flex-direction: column; gap: var(--s3); height: 100%;
  color: var(--muted); cursor: default;
}
.pdfgrid .nolink .pdfgrid-shot { background: var(--paper-2); box-shadow: none; color: var(--muted); }
.pdfgrid .nolink .pdfgrid-label { font-weight: 500; }
.pdfgrid .nolink .pdfgrid-label::before { background: var(--line); color: var(--ink-2); }
.pdfgrid-label {
  display: block; font-size: .9rem; line-height: 1.4; font-weight: 600;
  text-wrap: pretty;
}
.pdfgrid-label::before {
  content: "PDF"; display: inline-block; vertical-align: 1px; margin-right: 7px;
  font-size: .6rem; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--teal-600); padding: 2px 5px; border-radius: var(--r-xs);
}
.pdfgrid a:hover .pdfgrid-label { color: var(--teal-700); }
@media (prefers-reduced-motion: reduce) {
  .pdfgrid-shot { transition: none; }
  .pdfgrid a:hover .pdfgrid-shot { transform: none; }
}

.sheetgrid { list-style: none; padding: 0; margin: 0 0 var(--s5); display: flex; flex-wrap: wrap; gap: var(--s2); }
.sheetgrid li { margin: 0; flex: 1 1 290px; min-width: 0; }
.sheetgrid li::before { display: none; }
.sheetgrid a, .sheetgrid span {
  display: flex; align-items: baseline; gap: var(--s3); height: 100%;
  padding: 11px var(--s4); border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--paper-2); font-size: .92rem; text-decoration: none; color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.sheetgrid a { background: var(--paper); border-color: var(--line); color: var(--navy-700); font-weight: 600; }
.sheetgrid a:hover { border-color: var(--teal-500); background: var(--teal-100); }
.prose .sheetgrid a { gap: var(--s1); }
.sheetgrid .atc { font-family: var(--font-ui); font-weight: 800; font-size: .76rem; letter-spacing: .04em; color: var(--teal-600); flex: none; }
.sheetgrid span .atc { color: var(--muted); }
.sheetgrid a.sheet-upd, .sheetgrid a.sheet-man { align-items: center; }
.sheetgrid a.sheet-man { background: var(--paper-2); border-style: dashed; color: var(--ink-2); font-weight: 500; }
.sheetgrid a.sheet-man:hover { border-style: solid; border-color: var(--teal-500); background: var(--teal-100); }
.sheetgrid a.sheet-upd::after, .sheetgrid a.sheet-man::after {
  margin-left: auto; padding-left: var(--s3); flex: none;
  font-family: var(--font-ui); font-size: .62rem; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.sheetgrid.is-codes li { flex: 1 1 148px; }
.sheetgrid.is-codes a { justify-content: center; align-items: center; padding: 15px var(--s3); }
.sheetgrid.is-codes .atc { font-size: .84rem; letter-spacing: .05em; display: inline; padding: 0; border: 0; background: none; height: auto; color: var(--navy-700); }
.sheetgrid.is-codes a:hover .atc { color: var(--teal-700); }
.sheetgrid a.sheet-upd::after { content: "Aggiornamento"; color: var(--teal-600); }
.sheetgrid a.sheet-man::after { content: "Manuale p. " attr(data-page); color: var(--muted); }

.note {
  background: var(--sky-50); border: 1px solid var(--line);
  border-left: 3px solid var(--navy-500);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--s4) var(--s5); margin: 0 0 var(--s5); font-size: .95rem; color: var(--ink-2);
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--navy-700); }
.note.note-warn { background: var(--warn-bg); border-left-color: var(--warn-br); }

.prose p.arrow { padding-left: 1.2em; text-indent: -1.2em; }
.prose p.arrow::before, .arrow-mark::before {
  content: "\203A"; color: var(--teal-600); font-weight: 800; margin-right: .5em;
}
.arrow-mark::before { margin-right: 0; }

.aside { position: sticky; top: calc(var(--header-h) + 16px); font-size: .94rem; display: grid; gap: var(--s5); }
.aside-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5); }
.aside-box h2 { font-size: 1rem; letter-spacing: 0; margin-bottom: var(--s3); color: var(--navy-700); }
.aside-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.aside-box li { margin: 0; }
.aside-box a { color: var(--ink-2); text-decoration: none; display: block; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.aside-box li:last-child a { border-bottom: 0; }
.aside-box a:hover { color: var(--teal-700); }
.aside-box p { margin-bottom: 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 13px 26px; border-radius: var(--r-pill); font-weight: 600; font-size: .96rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--navy-500); color: var(--navy-700); background: transparent; }
.btn-ghost:hover { background: var(--sky-50); color: var(--navy-800); transform: translateY(-1px); }
.btn-on-dark { border-color: rgba(200, 221, 240, .55); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.map-frame {
  border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); background: var(--sky-50);
}
.map-frame iframe { display: block; width: 100%; height: 420px; border: 0; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s5); margin-bottom: var(--s7); }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5); }
.contact-card h3 { font-size: 1.02rem; margin-bottom: var(--s2); }
.contact-card p { margin-bottom: var(--s2); color: var(--ink-2); font-size: .95rem; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-card .label { display: block; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--teal-600); font-weight: 700; margin-bottom: var(--s2); }

.site-footer { background: var(--navy-900); color: var(--sky-200); position: relative; }
.footer-wave { display: block; width: 100%; height: auto; color: var(--navy-900); margin-bottom: -1px; }
.footer-top { padding: clamp(48px, 4vw, 72px) 0 var(--s7); display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
.footer-brand .brand-name { font-size: 1.12rem; }
.footer-blurb { color: var(--sky-300); font-size: .92rem; margin: var(--s4) 0 var(--s4); max-width: 38ch; }
.footer-blurb a { color: var(--sky-200); }
.footer-blurb a:hover { color: #fff; }
.footer-col h2 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: var(--s4); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col li { margin: 0; }
.footer-col a, .footer-links a { color: var(--sky-200); text-decoration: none; font-size: .92rem; }
.footer-col a:hover, .footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-note { margin: var(--s4) 0 0; font-size: .8rem; line-height: 1.45; color: rgba(200, 221, 240, .66); max-width: 24ch; }
.footer-social { display: flex; gap: var(--s3); margin-top: var(--s4); }
.footer-social a {
  width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center;
  border: 1px solid rgba(200, 221, 240, .3); color: var(--sky-200);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.footer-social a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(200, 221, 240, .7); color: #fff; }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  border-top: 1px solid rgba(200, 221, 240, .18);
  padding: var(--s5) 0 var(--s7);
  font-size: .84rem; color: var(--sky-300);
  display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); justify-content: space-between; align-items: flex-start;
}
.footer-bottom p { margin: 0 0 4px; }
.copyright-block { max-width: 62ch; }

.js-reveal .reveal { opacity: 0; transform: translateY(14px); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .js-reveal .reveal { opacity: 1; transform: none; } }

.error-404 { text-align: center; padding: clamp(64px, 8vw, 128px) 0; }
.error-404 .code { font-size: clamp(4rem, 10vw, 7rem); font-weight: 800; color: var(--sky-200); line-height: 1; letter-spacing: -.04em; }

.search-form { display: flex; gap: var(--s2); }
.search-form input[type="search"] {
  flex: 1; padding: 12px var(--s4); border: 1px solid var(--line); border-radius: var(--r-pill);
  font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink);
}
.search-form input[type="search"]:focus { outline: 3px solid var(--teal-500); outline-offset: 1px; }

.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.result-list li { margin: 0; }

@media (max-width: 1040px) {
  .page-layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
}

@media (max-width: 900px) {
  .quicknav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .hero-cover { justify-self: start; margin-top: var(--s5); }
  .hero-cover img { width: min(100%, 250px); }
  .hero-lede { max-width: 46ch; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .nav-primary {
    order: 4; width: 100%;
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows var(--t-base) var(--ease);
  }
  .nav-primary > div { overflow: hidden; }
  .site-header.nav-open .nav-primary { grid-template-rows: 1fr; }
  .nav-primary ul { flex-direction: column; align-items: stretch; gap: 2px; padding: var(--s3) 0 var(--s5); }
  .nav-primary a { padding: 12px var(--s3); font-size: 1rem; }
  .nav-primary .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; background: rgba(255, 255, 255, .06); padding: var(--s2) var(--s2) var(--s2) var(--s5);
  }
  .nav-primary .sub-menu a { color: var(--sky-200); }
  .nav-primary .sub-menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .header-inner { flex-wrap: wrap; gap: var(--s3); }
}

@media (max-width: 620px) {
  :root { --wrap: 100%; }
  .wrap, .wrap-narrow { width: calc(100% - 2 * var(--s4)); }
  .quicknav ul { grid-template-columns: minmax(0, 1fr); }
  .quicknav { margin-top: calc(-1 * var(--s6)); }
  .sheetgrid { grid-template-columns: minmax(0, 1fr); }
  .sheetgrid.is-codes li { flex: 1 1 116px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .footer-bottom { flex-direction: column; }
  .brand-sub { display: none; }
  .brand img, .brand-mark { max-height: 34px; width: 34px; height: 34px; }
  .brand-name { font-size: .96rem; }
  .map-frame iframe { height: 320px; }
}

.news-grid { margin-top: clamp(40px, 4vw, 64px); align-items: stretch; }
.news-card { display: flex; flex-direction: column; overflow: hidden; }
.news-thumb { margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s4); background: var(--sky-100); }
.news-thumb img { width: 100%; height: 188px; object-fit: cover; display: block; }
.news-meta { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-600); margin-bottom: var(--s2); }
.news-card h3 { margin-bottom: var(--s3); font-size: 1.12rem; }
.news-card > p { font-size: .95rem; }
.news-hero-meta { font-weight: 600; letter-spacing: .05em; text-transform: uppercase; font-size: .88rem; color: var(--sky-300); }
.news-single-figure { margin: 0 0 var(--s5); }
.news-single-figure img { width: 100%; border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.news-back { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line-2); font-size: .95rem; }
.news-back a { color: var(--teal-700); font-weight: 600; text-decoration: none; }
.news-back a:hover { text-decoration: underline; }
