/*
 * mail-front: foglio di stile unico per tutte le pagine del sito.
 * I segnaposto #1a5d7e e #7fc4e8 vengono sostituiti dal build con
 * theme.accent e theme.accentDark del sito (contrasto AA verificato dal build).
 * Niente font esterni, niente immagini: solo il font di sistema.
 */

:root {
  color-scheme: light dark;
  --accent: #1a5d7e;
  --bg: #ffffff;
  --surface: #f4f6f8;
  --text: #1f2328;
  --muted: #4f5863;
  --border: #d9dee4;
  --todo-bg: #fff1b8;
  --todo-text: #3d2e00;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7fc4e8;
    --bg: #14171b;
    --surface: #1c2127;
    --text: #e6e9ed;
    --muted: #a3acb7;
    --border: #2f363e;
    --todo-bg: #4d3d00;
    --todo-text: #fff1b8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  overflow-wrap: break-word;
}

.wrap {
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 2px; }

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

/* Link "vai al contenuto": visibile solo con il focus da tastiera */
.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.skip:focus { top: 1rem; }

.draft-banner {
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--todo-bg);
  color: var(--todo-text);
  font-weight: 600;
  text-align: center;
}

mark.todo {
  padding: 0 0.25em;
  border-radius: 3px;
  background: var(--todo-bg);
  color: var(--todo-text);
  outline: 1px dashed currentColor;
  font-weight: 600;
}

/* Intestazione */
.site-header { border-bottom: 1px solid var(--border); }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.brand .glyph { flex: none; color: var(--accent); }

.lang ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang li + li { margin-top: 0; }

.lang a {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  text-decoration: none;
}

.lang a:hover { text-decoration: underline; }

.lang a[aria-current="true"] {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  font-weight: 600;
}

/* Contenuto */
main {
  display: block;
  padding-block: 2rem 3rem;
}

main:focus { outline: none; }

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  line-height: 1.35;
}

p { margin: 0 0 0.75rem; }

.lead {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

li + li { margin-top: 0.35rem; }

.card {
  margin: 1rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card > :last-child { margin-bottom: 0; }

.notice { border-left: 4px solid var(--accent); }

.checks {
  padding-left: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.4rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

dl { margin: 0; }
dd { margin: 0; }

.contacts dt {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.contacts dt:first-child { margin-top: 0; }
.contacts dd { overflow-wrap: anywhere; }

.purpose {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.facts dt {
  margin-top: 0.5rem;
  font-weight: 600;
}

.facts dt:first-child { margin-top: 0; }

@media (min-width: 36rem) {
  .contacts,
  .facts {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 0.5rem 1rem;
  }

  .contacts dt,
  .facts dt { margin-top: 0; }
}

.note,
.updated {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Piè di pagina */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap { padding-block: 1.5rem 2.5rem; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: 1rem;
}

.legal { font-style: normal; }
.legal span + span::before { content: " · "; }
.legal a { overflow-wrap: anywhere; }

/* Stampa: bianco e nero, niente navigazione, indirizzi dei link visibili */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #333333;
    --border: #999999;
    --accent: #000000;
  }

  body { font-size: 11pt; }
  .skip, .lang, .footer-nav { display: none; }
  .site-header, .site-footer { border-color: #999999; }
  .card { break-inside: avoid; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.875em; }
}
