/* AvioWeather — pagine legal (privacy / terms)
   OPMET Editorial · light only · stesso sistema di index.html */

:root {
  --bg:           #fafafa;
  --bg-card:      #ffffff;
  --bg-subtle:    #f4f4f5;
  --bg-tint:      #f9fafb;
  --fg:           #0a0a0a;
  --fg-2:         #525252;
  --fg-3:         #a3a3a3;
  --border:       #e5e5e5;
  --border-strong:#d4d4d8;
  --hairline:     #ececed;
  --accent:       #1d3a8a;
  --accent-soft:  #eef2fb;
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--fg);
  font-size: 16px; line-height: 1.6; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ── Nav (replicata da index.html) ────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,250,0.85);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 15px; color: var(--fg);
}
.brand-mark { width: 26px; height: 26px; border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; padding: 8px 12px;
  font-size: 14px; color: var(--fg-2); font-weight: 500; border-radius: 8px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--fg); background: rgba(0,0,0,0.04); }
.nav-links a.cta { background: var(--fg); color: #fff; padding: 8px 14px; margin-left: 6px; font-weight: 500; }
.nav-links a.cta:hover { background: #000; }
.nav-links .desktop-only { display: inline-flex; }
@media (max-width: 800px) { .nav-links .desktop-only { display: none; } }

.lang-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border); background: transparent;
  font: inherit; font-size: 13px; color: var(--fg-2);
  padding: 6px 24px 6px 10px; border-radius: 8px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.lang-select:hover { border-color: var(--border-strong); color: var(--fg); }

/* ── Hero ─────────────────────────────────────────────────── */
.legal-hero {
  position: relative;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.legal-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(to right, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: calc((100% - 56px) / 12) 100%; background-position: 28px 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
  mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
}
.legal-hero-inner {
  position: relative; z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.legal-hero-meta { justify-content: center; }
.eyebrow { justify-content: center; }
.eyebrow::before { display: none; }

.eyebrow {
  font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-3);
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
}
.eyebrow::before { content: ''; display: inline-block; width: 24px; height: 1px; background: var(--border-strong); }

.legal-hero h1 {
  font-size: clamp(36px, 5vw, 56px); line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 600;
  margin: 0 0 16px;
  text-wrap: balance;
}
.legal-hero p {
  font-size: 17px; color: var(--fg-2); margin: 0 auto; max-width: 60ch;
  text-wrap: pretty;
}
.legal-hero-meta {
  margin-top: 30px; display: flex; align-items: center; gap: 14px;
  font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--fg-3);
  flex-wrap: wrap;
}
.legal-hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.legal-hero-meta a { color: var(--fg-2); border-bottom: 1px dotted var(--border-strong); transition: color .2s var(--ease), border-color .2s var(--ease); }
.legal-hero-meta a:hover { color: var(--fg); border-bottom-color: var(--fg-3); }

/* ── Body ─────────────────────────────────────────────────── */
.legal-body {
  padding: 56px 0 96px;
  flex: 1;
}
.legal-body-inner {
  max-width: 760px;
  margin: 0 auto;
}
.legal-actions { justify-content: center; }

/* Le card stesse sono centrate (max-width + margin auto). Il loro contenuto:
   heading (§ 01 + h2) centrato, paragrafi e bullet allineati a sinistra —
   il testo lungo letto in scansione orizzontale resta scorrevole, mentre il
   blocco resta visivamente centrato con il resto della pagina. */
#legal-body .section-head,
.legal-card-head { justify-content: center; }

#legal-body .section p,
#legal-body .section ul,
.legal-card p,
.legal-card ul { text-align: left; }

/* Container per il contenuto (stato di caricamento + render dinamico) */
#legal-body { min-height: 280px; }

/* Riga di metadati che la legal.js estrae dal primo paragrafo
   ("Ultimo aggiornamento: …") — resa come label mono. */
#legal-body .meta-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Geist Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-3);
  padding: 6px 14px; border: 1px solid var(--hairline); border-radius: 6px;
  margin: 0 auto 36px;
  width: max-content; max-width: 100%;
  background: var(--bg-card);
}
#legal-body .meta-row .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

/* Card di sezione: una per ogni blocco "\n\n" del payload API */
#legal-body .section,
.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 12px;
  transition: border-color .25s var(--ease);
}
#legal-body .section:hover,
.legal-card:hover { border-color: var(--border-strong); }

#legal-body .section-head,
.legal-card-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 14px; flex-wrap: wrap;
}
#legal-body .section-num,
.legal-card-num {
  font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--fg-3);
  flex-shrink: 0;
}
#legal-body h2,
.legal-card h2 {
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
  margin: 0; line-height: 1.3; color: var(--fg);
}

#legal-body p,
.legal-card p {
  font-size: 15px; color: var(--fg-2); line-height: 1.65;
  margin: 0 0 12px;
}
#legal-body p:last-child,
.legal-card p:last-child { margin-bottom: 0; }
#legal-body strong,
.legal-card strong { color: var(--fg); font-weight: 600; }

#legal-body ul,
.legal-card ul {
  list-style: none; padding: 0; margin: 12px 0;
}
#legal-body ul li,
.legal-card ul li {
  position: relative; padding-left: 22px;
  font-size: 15px; color: var(--fg-2); line-height: 1.65;
  margin: 0 0 6px;
}
#legal-body ul li:last-child,
.legal-card ul li:last-child { margin-bottom: 0; }
#legal-body ul li::before,
.legal-card ul li::before {
  content: '—'; position: absolute; left: 0; top: 0;
  color: var(--fg-3); font-family: 'Geist Mono', monospace; font-weight: 500;
}

#legal-body a,
.legal-card a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
#legal-body a:hover,
.legal-card a:hover { border-bottom-color: var(--accent); }

.legal-card .gdpr-pill {
  display: inline-flex; align-items: center;
  font-family: 'Geist Mono', monospace; font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 7px; border-radius: 4px;
  vertical-align: 0.18em; flex-shrink: 0;
}

/* Stato di caricamento e fallback */
#legal-body .loading,
#legal-body .error {
  font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--fg-3);
  padding: 36px 0; text-align: center;
}
#legal-body .error a {
  color: var(--accent); border-bottom: 1px solid var(--accent);
}

/* ── Actions row + footer ─────────────────────────────────── */
.legal-actions {
  margin-top: 40px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  background: transparent; color: var(--fg);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--fg-3); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost .arrow { transition: transform .2s var(--ease); display: inline-block; }
.btn-ghost:hover .arrow { transform: translateX(-2px); }

.legal-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 0 40px;
  font-family: 'Geist Mono', monospace; font-size: 11px;
  color: var(--fg-3);
  background: var(--bg-card);
  text-align: center;
  letter-spacing: 0.04em;
}
.legal-footer .row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; margin-bottom: 6px;
}
.legal-footer .row a {
  color: var(--fg-3);
  transition: color .2s var(--ease);
}
.legal-footer .row a:hover { color: var(--fg); }
.legal-footer .row .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong);
}
.legal-footer .copyright {
  font-family: 'Geist', sans-serif; font-size: 12px;
  letter-spacing: -0.005em; color: var(--fg-3);
}
