/* ===========================
   DESIGN SYSTEM (CSS Custom Properties)
   =========================== */
:root {
  /* palette (WCAG-friendly contrast) */
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #0f172a;            /* slate-900 */
  --muted: #475569;           /* slate-600 */
  --border: #e2e8f0;          /* slate-200 */
  --brand: #0ea5e9;           /* sky-500 */
  --brand-600: #0284c7;       /* sky-600 */
  --brand-700: #0369a1;       /* sky-700 */
  --accent: #22c55e;          /* green-500 */
  --danger: #ef4444;          /* red-500 */
  --warning: #f59e0b;         /* amber-500 */

  /* typography & rhythm */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 6px 20px rgba(2,8,23,.08);
  --container: 1100px;

  /* spacing scale */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;           /* slate-900ish */
    --surface: #0f172a;      /* slate-800/900 */
    --text: #e5e7eb;         /* slate-200 */
    --muted: #cbd5e1;        /* slate-300 */
    --border: #1f2937;       /* slate-700 */
    --brand: #38bdf8;        /* sky-400 */
    --brand-600: #0ea5e9;    /* sky-500/600 */
    --brand-700: #0284c7;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.35);
  }
}

/* ===========================
   BASE / RESET
   =========================== */
*,
*::before,
*::after { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--brand) 70%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection { background: color-mix(in oklab, var(--brand) 35%, transparent); }

/* Containers */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Visually hidden (still accessible) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: white;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* ===========================
   HEADER & PRIMARY NAV
   =========================== */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(120%) blur(6px);
}
header .container {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-4);
}
header [itemtype*="Organization"] a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
header nav[aria-label="Menu principale"] ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: clamp(.75rem, 2vw, 1.25rem);
}
header nav a {
  display: inline-block;
  padding: .5rem .25rem;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text);
}
header nav a[aria-current="page"] {
  color: var(--brand-700);
}
header nav a:hover {
  background: var(--surface);
  text-decoration: none;
}

/* Mobile nav (wrap) */
@media (max-width: 720px) {
  header .container { grid-template-columns: 1fr; gap: var(--space-3); }
  header nav[aria-label="Menu principale"] ul { flex-wrap: wrap; }
}

/* ===========================
   BREADCRUMB
   =========================== */
nav[aria-label="Breadcrumb"] {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
nav[aria-label="Breadcrumb"] .container {
  padding-block: var(--space-3);
}
nav[aria-label="Breadcrumb"] ol {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0; padding: 0; list-style: none;
  font-size: .9375rem;
}
nav[aria-label="Breadcrumb"] li { color: var(--muted); }
nav[aria-label="Breadcrumb"] a { color: var(--muted); }
nav[aria-label="Breadcrumb"] li+li::before {
  content: "›";
  color: var(--muted);
  margin-inline: .25rem .25rem;
}

/* ===========================
   MAIN / ARTICLE
   =========================== */
main[role="main"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12);
  padding-block: var(--space-8);
}
@media (min-width: 980px) {
  main[role="main"] {
    grid-template-columns: minmax(0, 1fr) 320px; /* content + sidebar */
    align-items: start;
  }
}

article {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 2.5vw, 2rem);
}

.article-header h1 {
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  color: var(--muted);
  font-size: .9375rem;
}
.article-meta address { font-style: normal; }

[itemprop="articleBody"] section + section { margin-top: var(--space-8); }
[itemprop="articleBody"] h2 {
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  margin: var(--space-6) 0 var(--space-2);
}
[itemprop="articleBody"] h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  margin-top: var(--space-4);
}
[itemprop="articleBody"] p { margin: .5rem 0 1rem; color: var(--text); }

figure {
  margin: var(--space-6) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
figure img { display: block; width: 100%; }
figure figcaption {
  font-size: .9rem;
  color: var(--muted);
  padding: .75rem 1rem;
  background: color-mix(in oklab, var(--surface) 85%, var(--bg));
  border-top: 1px solid var(--border);
}

/* ===========================
   FORMS (Accessible)
   =========================== */
form, fieldset { border: 0; margin: 0; padding: 0; }
#contact-form {
  margin-top: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
#contact-form fieldset + fieldset { margin-top: var(--space-6); }

legend {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.form-group { margin-bottom: var(--space-5); }
.form-group label {
  display: inline-block;
  font-weight: 600;
  margin-bottom: .35rem;
}
label.required span[aria-label] { color: var(--danger); font-weight: 700; }

.form-help {
  color: var(--muted);
  font-size: .9rem;
  margin-top: .35rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  appearance: none;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
textarea { resize: vertical; min-height: 150px; }

input::placeholder,
textarea::placeholder { color: color-mix(in oklab, var(--muted) 70%, transparent); }

/* Focus/hover states */
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 20%, transparent);
}

/* Validation states (progressive enhancement) */
:where(input, select, textarea)[aria-invalid="true"],
:where(input, select, textarea).is-invalid {
  border-color: var(--danger);
  background: color-mix(in oklab, var(--danger) 6%, var(--bg));
}
.error-message {
  color: var(--danger);
  font-size: .9rem;
  margin-top: .35rem;
  min-height: 1.1em;
}

/* Character counter */
.character-count {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .35rem;
}

/* Honeypot */
.honeypot { position: absolute !important; left: -9999px; }

/* Checkboxes & radios */
.checkbox-group, .radio-group { margin-top: var(--space-4); }
.checkbox-item, .radio-item {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  align-items: start;
  gap: .6rem;
  margin-botto


  /* Breadcrumb */
nav[aria-label="breadcrumb"] {
  font-size: 0.95rem;
  margin: 1rem 0;
}

nav[aria-label="breadcrumb"] ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

nav[aria-label="breadcrumb"] li {
  display: flex;
  align-items: center;
}

nav[aria-label="breadcrumb"] li + li::before {
  content: "›";
  padding: 0 0.5rem;
  color: #666;
}

nav[aria-label="breadcrumb"] a {
  text-decoration: none;
  color: #0073e6;
}

nav[aria-label="breadcrumb"] a:hover {
  text-decoration: underline;
}

nav[aria-label="breadcrumb"] [aria-current="page"] {
  font-weight: 600;
  color: #333;
}
