/* Lido Pino d'Oro — shared stylesheet of the legal pages (privacy.html, cookie.html, termini.html, 404.html).
   Self-contained: the design tokens of index.html are repeated here so the pages never depend on its inline CSS.
   Palette: cream #FFF2D7 / #FFF7E4, ink #302B1F, gold #986D0C (accents; #8A6208 for text, 4.9:1 on cream) / #F5DCA4 (buttons) /
   #FFD776 (highlight). Type: DM Serif Display (h1), DM Serif Text (h2/h3), Questrial (body) from
   assets/fonts/fonts.css (self-hosted); Georgia / Arial are the fallbacks. */

:root {
  --crema: #FFF2D7;
  --crema-chiara: #FFF7E4;
  --crema-chiarissima: #FFFBF1;
  --inchiostro: #302B1F;
  --inchiostro-tenue: #5C5443;      /* secondary text, 6.9:1 on cream */
  --bruno: #624F23;
  --oro: #986D0C;                   /* rules, accents, decoration */
  --oro-testo: #8A6208;             /* gold for text on cream: 4.9:1 (#986D0C measures only 4.2:1 on #FFF2D7) */
  --oro-chiaro: #F5DCA4;
  --oro-sole: #FFD776;
  --oro-sabbia: #F8D587;
  --grigio-oro: #B5A98A;
  --linea: rgba(181, 169, 138, .4);  /* #B5A98A66 */
  --ombra: 0 4px 10px rgba(48, 43, 31, .27);  /* #302B1F44 */
  --max: 1200px;
  --todo-bg: #fff27a;
  --todo-line: #b8860b;
  /* sentinel read by 404.html to know whether this stylesheet resolved from the current URL */
  --legal-css: loaded;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
/* anchors land below the sticky header */
[id] { scroll-margin-top: 5.75rem; }
::selection { background: var(--bruno); color: var(--oro-chiaro); }

body {
  font-family: 'Questrial', 'Century Gothic', Arial, sans-serif;
  font-size: 1.05rem;
  color: var(--inchiostro);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Text', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.1;
  color: var(--inchiostro);
  overflow-wrap: anywhere;
}
h1 { font-family: 'DM Serif Display', Georgia, 'Times New Roman', serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
strong { font-weight: 700; }

:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; border-radius: 4px; }

.container { width: min(var(--max), 100% - 2rem); margin-inline: auto; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--inchiostro); color: var(--oro-chiaro); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  transition: top .15s ease;
}
.skip:focus { top: 1rem; }

/* ---------- Header ---------- */
.legal-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 242, 215, .9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linea);
}
.legal-header .nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.brand-logo { height: 50px; width: auto; flex: none; }
.brand-name {
  font-family: 'DM Serif Text', Georgia, serif; font-size: 1.3rem; font-weight: 400; letter-spacing: .005em;
  line-height: 1.1; white-space: nowrap;
}
.brand-name small {
  display: block; font-family: 'Questrial', 'Century Gothic', Arial, sans-serif; font-size: .58rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--oro-testo); margin-top: .15rem;
}

/* Language toggle: only useful with JavaScript (without it both languages stay visible). */
.lang-toggle { display: none; }
.js .lang-toggle {
  display: inline-flex; align-items: center; flex: none;
  border: 1px solid var(--inchiostro); border-radius: 999px; padding: 3px;
  background: rgba(255, 251, 241, .6);
}
.lang-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--inchiostro); padding: .45rem .9rem; border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.lang-btn:hover { background: var(--oro-chiaro); }
.lang-btn[aria-pressed="true"] {
  background: var(--inchiostro);
  color: var(--oro-sole);
  box-shadow: var(--ombra);
}
.lang-btn .lang-short { display: none; }

/* ---------- Article ---------- */
main { flex: 1 0 auto; }
.legal {
  max-width: 72ch;
  margin-inline: auto;
  padding: clamp(2.5rem, 7vh, 5rem) 0 clamp(2.5rem, 7vh, 4.5rem);
}
.legal + .legal { border-top: 1px solid var(--linea); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--oro-testo);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--oro); flex: none; }

.legal h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.05; margin: .6rem 0 1rem; }
.legal .meta { color: var(--inchiostro-tenue); font-size: .92rem; max-width: 62ch; }
.legal .meta + .meta { margin-top: .3rem; }

.legal h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  margin: 2.8rem 0 .9rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--linea);
}
.legal h3 { font-size: 1.35rem; margin: 1.6rem 0 .5rem; }
.legal h2 + h3 { margin-top: .6rem; }
.legal p { margin: 0 0 .9rem; }
.legal p:last-child { margin-bottom: 0; }
.legal ul, .legal ol { margin: 0 0 1rem 1.3rem; }
.legal li { margin-bottom: .35rem; }
.legal li > ul, .legal li > ol { margin-top: .35rem; margin-bottom: .35rem; }
.legal a {
  color: var(--oro-testo); text-decoration: underline; text-decoration-color: rgba(138, 98, 8, .5);
  text-underline-offset: .18em; overflow-wrap: anywhere;
  transition: color .2s ease, letter-spacing .2s ease, text-decoration-color .2s ease;
}
.legal a:hover { color: var(--inchiostro); text-decoration-color: var(--inchiostro); letter-spacing: .03em; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em; background: var(--crema-chiarissima);
  border: 1px solid var(--linea); border-radius: 4px; padding: .05em .4em;
  overflow-wrap: anywhere;
}
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.legal dt { font-family: 'DM Serif Text', Georgia, serif; color: var(--inchiostro-tenue); }
.legal dd { overflow-wrap: anywhere; }

/* Plain-language summary: cream card with the gold frame of the page's cards */
.summary {
  margin: 1.8rem 0 .5rem;
  padding: 1.3rem 1.5rem;
  background: var(--crema-chiara);
  border: 2px solid var(--oro-sole);
  border-radius: 8px;
  box-shadow: var(--ombra);
}
.summary h2 { margin: 0 0 .6rem; padding: 0; border: 0; font-size: 1.5rem; }
.summary ul { margin-bottom: 0; }

/* Table of contents */
.toc { margin: 1.6rem 0 0; font-size: .94rem; }
.toc h2 { border: 0; padding: 0; margin: 0 0 .5rem; font-size: 1.35rem; }
.toc ol { columns: 2; column-gap: 2rem; margin-left: 1.2rem; }
.toc li { break-inside: avoid; }

/* Tables */
.table-wrap { overflow-x: auto; margin: .6rem 0 1.2rem; -webkit-overflow-scrolling: touch; }
.legal table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; min-width: 34rem; background: var(--crema-chiarissima); border: 1px solid var(--linea); border-radius: 8px; box-shadow: var(--ombra); overflow: hidden; }
.legal th, .legal td {
  padding: .7rem .8rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--linea);
}
.legal tr:last-child > td, .legal tr:last-child > th[scope="row"] { border-bottom: 0; }
.legal th {
  font-family: 'Questrial', 'Century Gothic', Arial, sans-serif; font-weight: 400;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--oro-testo);
  background: var(--crema-chiara);
}
.legal th[scope="row"] { font-size: .92rem; letter-spacing: 0; text-transform: none; color: var(--inchiostro); background: transparent; }
.legal caption { text-align: left; font-family: 'DM Serif Text', Georgia, serif; font-style: italic; font-size: .92rem; color: var(--inchiostro-tenue); padding: 0 0 .5rem; caption-side: top; }
.legal table code { white-space: nowrap; overflow-wrap: normal; }

/* Placeholders the owner must replace before going live */
.todo {
  background: var(--todo-bg);
  color: var(--inchiostro);
  outline: 2px dashed var(--todo-line);
  outline-offset: 1px;
  padding: 0 .3em;
  border-radius: 3px;
  font-weight: 500;
  font-style: normal;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.legal .note {
  font-size: .92rem; color: var(--inchiostro-tenue); padding: .8rem 1rem;
  border: 1px dashed var(--oro); border-radius: 8px; background: var(--crema-chiarissima);
  margin: 0 0 1rem;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(3rem, 10vw, 7rem) 0 clamp(2rem, 6vw, 4rem); }
.notfound .code {
  font-family: 'DM Serif Display', Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(6rem, 20vw, 11rem);
  line-height: 1; color: var(--grigio-oro); letter-spacing: -.02em;
}
.notfound h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: .4rem 0 .8rem; }
.notfound p { color: var(--inchiostro-tenue); max-width: 48ch; margin: 0 auto .9rem; }
.notfound .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin: 1.8rem 0 1.6rem; }
.notfound .links { font-size: .9rem; color: var(--inchiostro-tenue); }
.notfound .links a { color: var(--oro-testo); text-decoration: underline; text-decoration-color: rgba(138, 98, 8, .5); text-underline-offset: .18em; transition: color .2s ease, letter-spacing .2s ease; }
.notfound .links a:hover { color: var(--inchiostro); letter-spacing: .03em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.7rem; border-radius: 6px; font-size: 1rem; line-height: 1.2;
  letter-spacing: .01em; color: var(--inchiostro);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, letter-spacing .2s ease;
  cursor: pointer; border: 1px solid transparent;
}
.btn-gold { background: var(--oro-chiaro); box-shadow: var(--ombra); }
.btn-gold:hover { transform: translateY(-4px); box-shadow: 0 0 20px var(--oro-chiaro); letter-spacing: .06em; }
.btn-outline { border-color: var(--inchiostro); background: rgba(245, 220, 164, .33); }
.btn-outline:hover { background: var(--crema-chiarissima); transform: translateY(-4px); box-shadow: 0 0 10px rgba(255, 251, 241, .7); letter-spacing: .06em; }
/* buttons inside an article are not text links (.legal a has the same specificity as .btn) */
.legal .btn, .legal .btn:hover { color: var(--inchiostro); text-decoration: none; }
.legal .btn:hover { letter-spacing: .06em; }

/* ---------- Footer: dark band like the main site ---------- */
.legal-footer {
  background: var(--inchiostro);
  color: var(--crema);
  padding: 2.6rem 0 2.2rem;
  font-size: .84rem;
}
.legal-footer .container { display: grid; gap: .8rem; text-align: center; justify-items: center; }
.footer-brand {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: 'DM Serif Text', Georgia, serif; font-size: 1.35rem; line-height: 1; color: var(--crema);
  margin-bottom: .4rem;
}
/* The gold diamond monogram cropped out of the logo (x 142–330, y 0–183 of the 500×326 PNG), 44px tall. */
.footer-brand::before {
  content: ""; flex: none; width: 45.2px; height: 44px;
  background: url("logo.png") no-repeat; background-size: 120.2px auto; background-position: -34.1px 0;
}
.legal-line { line-height: 2; overflow-wrap: anywhere; color: rgba(255, 242, 215, .82); }
.footer-links a { color: var(--oro-chiaro); text-decoration: underline; text-decoration-color: rgba(245, 220, 164, .45); text-underline-offset: .18em; transition: color .2s ease, letter-spacing .2s ease; }
.footer-links a:hover { color: var(--oro-sole); letter-spacing: .04em; }
.legal-footer .copy { font-size: .76rem; color: rgba(255, 242, 215, .7); }
.legal-footer :focus-visible { outline-color: var(--oro-sole); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .brand-logo { height: 44px; }
  .brand-name { font-size: 1.1rem; }
  .lang-btn { padding: .45rem .75rem; }
  .lang-btn .lang-long { display: none; }
  .lang-btn .lang-short { display: inline; }
  .legal dl { grid-template-columns: 1fr; gap: 0 0; }
  .legal dt { margin-top: .5rem; }
  .toc ol { columns: 1; }
  .btn { width: 100%; }
  /* Tables become stacked cards: the row header on top, each cell prefixed by its column label
     (data-label). The header row stays in the DOM for assistive technology, visually hidden. */
  .table-wrap { overflow: visible; }
  .legal table { min-width: 0; display: block; padding: .2rem .9rem; }
  .legal tbody, .legal tr, .legal td, .legal th[scope="row"], .legal caption { display: block; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .legal tr { padding: .7rem 0 .8rem; border-bottom: 1px solid var(--linea); }
  .legal tr:last-child { border-bottom: 0; }
  .legal th[scope="row"] { padding: 0 0 .35rem; border: 0; font-family: 'DM Serif Text', Georgia, serif; font-size: 1.05rem; }
  .legal td { padding: .2rem 0 .35rem; border: 0; }
  .legal td::before {
    content: attr(data-label); display: block;
    font-family: 'Questrial', 'Century Gothic', Arial, sans-serif; font-size: .66rem; letter-spacing: .14em;
    text-transform: uppercase; color: var(--oro-testo); margin-bottom: .1rem;
  }
  .legal td:not([data-label])::before { content: none; }
}
@media (max-width: 420px) {
  .brand-name small { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .btn-gold:hover, .btn-outline:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; }
  .legal-header, .skip, .lang-toggle, .btn, .notfound .actions, .footer-brand { display: none !important; }
  .legal { max-width: none; padding: 0 0 1.5rem; }
  .legal h2 { break-after: avoid; }
  .legal a { color: #000; }
  .legal a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; }
  .summary, .legal .note, .legal table { box-shadow: none; background: #fff; }
  .table-wrap { overflow: visible; }
  .legal table { min-width: 0; }
  .todo { background: var(--todo-bg) !important; outline: 2px dashed var(--todo-line); }
  .legal-footer { background: #fff; color: #000; border-top: 1px solid #999; }
  .legal-line, .legal-footer .copy { color: #000; }
  .footer-links a { color: #000; }
}
