@font-face {
  font-family: "Besley";
  src: url("/scopri/besley-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --color-primary: #7a1f3d;
  --color-brand: #3b1022;
  --color-link: #6e1d38;
  --color-bg: #f5f2e9;
  --color-surface: #fffdf7;
  --color-surface-2: #ece8dc;
  --color-fg: #251c20;
  --color-muted: #655a5f;
  --color-border: #d8cfd0;
  --color-focus: #2964dc;
  --color-wine-dark: #3b1022;
  --color-wine-deep: #250c17;
  --color-wine-light: #e7b3c4;
  --yes-bg: #e2f1e6;
  --yes-fg: #14532d;
  --no-bg: #fbe5e5;
  --no-fg: #921c1c;
  --warn-bg: #fdf0d3;
  --warn-fg: #6b3d00;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Besley", Georgia, serif;
  --radius: 14px;
  --wrap: 1240px;
  --gutter: clamp(18px, 4vw, 44px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-brand: #f0a3bb;
    --color-link: #f0a3bb;
    --color-bg: #1b1517;
    --color-surface: #262023;
    --color-surface-2: #312a2d;
    --color-fg: #f2ecea;
    --color-muted: #b8acb0;
    --color-border: #433a3e;
    --color-focus: #8ab4ff;
    --yes-bg: #1f3a26;
    --yes-fg: #a9dcb5;
    --no-bg: #44201f;
    --no-fg: #f0b2ad;
    --warn-bg: #3d2f0e;
    --warn-fg: #f2d58f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font: 1rem/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--color-wine-light); color: var(--color-wine-deep); }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; left: 12px; top: -100px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: var(--color-surface); color: var(--color-fg); font-weight: 700; }
.skip:focus { top: 12px; }

header.top {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  color: var(--color-fg);
  backdrop-filter: blur(16px);
}
header.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 76px;
  padding-block: 10px;
}
header.top .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--color-brand);
  font: 750 1.45rem/1 var(--font-display);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand img, .brand svg { display: block; width: 34px; height: 34px; color: var(--color-primary); }
.head-links { display: flex; align-items: center; gap: 6px 22px; }
header.top .head-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-fg);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}
header.top .head-links a:hover { color: var(--color-primary); }
header.top .head-links .lang-link { color: var(--color-muted); font-size: 0.75rem; letter-spacing: 0.08em; }

.page-hero {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: clamp(52px, 7vw, 88px) 0;
  background:
    radial-gradient(circle at 82% 12%, rgb(190 85 120 / 0.22), transparent 32%),
    linear-gradient(145deg, var(--color-wine-dark), var(--color-wine-deep) 72%);
  color: #f7f0f1;
}
.page-hero::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -210px;
  top: -310px;
  border: 1px solid rgb(231 179 196 / 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgb(231 179 196 / 0.025);
  pointer-events: none;
}
.page-hero .wrap { position: relative; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--color-wine-light);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.3;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 25px; height: 1px; background: currentColor; }
.page-hero h1 {
  max-width: 18ch;
  margin-bottom: 18px;
  color: #faf4f2;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  letter-spacing: -0.045em;
}
.page-hero .lead, .page-hero .intro {
  max-width: 62ch;
  margin: 0;
  color: #ddcdd3;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
  line-height: 1.65;
}
.page-hero .updated { margin: 18px 0 0; color: #cbb8bf; font-size: 0.875rem; }

main { max-width: none; margin: 0; padding: 0; }
main > .wrap, main.wrap { padding-top: clamp(36px, 5vw, 64px); padding-bottom: clamp(56px, 8vw, 96px); }
.doc { max-width: 1120px; }
.content-body > .intro { max-width: 72ch; color: var(--color-muted); font-size: 1.05rem; }
h2 { margin: 42px 0 14px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
h3 { margin: 26px 0 10px; font-size: 1.25rem; }
.note-warn {
  max-width: 78ch;
  margin: 26px 0;
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--warn-fg) 28%, transparent);
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: 0 18px 48px -42px rgb(59 16 34 / 0.5);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
caption { padding: 18px 20px; text-align: left; font: 650 1.2rem/1.3 var(--font-display); }
th, td { padding: 15px 18px; border-top: 1px solid var(--color-border); text-align: left; vertical-align: top; overflow-wrap: break-word; }
thead th { background: var(--color-surface-2); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
tbody th { min-width: 11rem; font-weight: 700; }
tbody td:nth-child(3) { min-width: 10rem; }
tbody td:nth-child(4) { min-width: 8rem; }
td.cite { min-width: 18rem; }
.src-org { display: block; color: var(--color-muted); font-size: 0.875rem; font-weight: 400; }
.quote { display: block; margin: 4px 0; padding: 7px 9px; border-radius: 8px; background: var(--color-surface-2); font: 0.8125rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; }
.tag.yes { background: var(--yes-bg); color: var(--yes-fg); }
.tag.no { background: var(--no-bg); color: var(--no-fg); }
.tag.limit { background: var(--warn-bg); color: var(--warn-fg); }
ul.attr { max-width: 80ch; padding-left: 1.25rem; }
ul.attr li { margin: 6px 0; }
.disclaimer { max-width: 80ch; margin-top: 38px; padding: 22px 24px; border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary); border-radius: 0 var(--radius) var(--radius) 0; background: var(--color-surface); }
.disclaimer h2 { margin-top: 0; }
.flush-top { margin-top: 0; }
.flush-bottom { margin-bottom: 0; }

.article-layout { max-width: 980px; }
.prose > section { margin-bottom: 46px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.prose > section:first-child { padding-top: 0; border-top: 0; }
.prose h2 { margin-top: 0; color: var(--color-fg); }
.prose h3 { color: var(--color-primary); }
.prose p { color: var(--color-muted); line-height: 1.8; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.4rem; }
.prose li { margin-bottom: 9px; }
.accent-box { margin: 24px 0; padding: 22px 24px; border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary); border-radius: 0 18px 18px 0; background: var(--color-surface); }
.accent-box h3 { margin-top: 0; }
.accent-box p:last-child { margin-bottom: 0; }
.related-vitigni, .related-terroir, .related-denominazioni { margin: 24px 0; padding: 22px 24px; border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface); }
.related-vitigni h3, .related-terroir h3, .related-denominazioni h3 { margin: 0 0 12px; color: var(--color-fg); }
.related-vitigni ul, .related-terroir ul, .related-denominazioni ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.related-vitigni li, .related-terroir li, .related-denominazioni li { margin: 0; }
.related-vitigni a, .related-terroir a, .related-denominazioni a { display: inline-flex; align-items: center; min-height: 40px; padding: 5px 13px; border: 1px solid var(--color-border); border-radius: 999px; text-decoration: none; }
.related-vitigni a:hover, .related-terroir a:hover, .related-denominazioni a:hover { border-color: var(--color-primary); background: var(--color-surface-2); }
.cta-section { padding: clamp(26px, 5vw, 42px) !important; border: 0 !important; border-radius: 24px; background: linear-gradient(145deg, var(--color-wine-dark), var(--color-wine-deep)); color: #f8f0f2; }
.cta-section h2 { color: #faf4f2; }
.cta-section p { color: #ddcdd3; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 8px; padding: 0 23px; border-radius: 999px; background: #a43c61; color: #fffaf7; font-size: 0.9375rem; font-weight: 650; text-decoration: none; transition: transform 160ms, background-color 160ms; }
.cta:hover { background: #b84b70; transform: translateY(-2px); }
.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.article-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }

footer.bottom { padding: 34px 0; background: #1c0911; color: #b39aa4; font-size: 0.875rem; }
footer.bottom .wrap { display: flex; flex-wrap: wrap; gap: 4px 24px; }
footer.bottom a { display: inline-flex; align-items: center; min-height: 44px; margin: 0; color: #dfc9d1; text-decoration: none; }
footer.bottom a:hover { color: #ffffff; }

@media (max-width: 720px) {
  header.top .wrap { min-height: 68px; }
  .brand { font-size: 1.3rem; }
  .brand img, .brand svg { width: 31px; height: 31px; }
  .head-links { gap: 4px 14px; }
  .page-hero h1 { font-size: clamp(2.65rem, 12vw, 4rem); }
  .table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  table, tbody, tr, th, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  caption { display: block; padding: 0 0 12px; }
  tbody tr { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface); }
  tbody th { min-width: 0; border-top: 0; background: var(--color-surface-2); font-size: 1rem; }
  td { padding: 12px 16px; }
  td.cite, tbody td:nth-child(3), tbody td:nth-child(4) { min-width: 0; }
  td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--color-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
  .article-layout { padding-inline: var(--gutter); }
  .prose > section { margin-bottom: 36px; padding-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta { transition: none; }
  .cta:hover { transform: none; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #ffffff; color: #000000; }
  header.top, footer.bottom, .skip, .article-nav { display: none; }
  .page-hero { padding: 0 0 20px; background: none; color: #000000; }
  .page-hero::before, .eyebrow { display: none; }
  .page-hero h1, .page-hero .lead, .page-hero .intro, .page-hero .updated { color: #000000; }
  main > .wrap, main.wrap { padding: 0; }
  a { color: #000000; }
  h2, h3 { break-after: avoid; }
  tr, li, section { break-inside: avoid; }
  thead { display: table-header-group; }
}
