/* PGM Technology – foglio di stile comune a tutte le pagine */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Text";
  src: url("../fonts/dm-serif-text.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cornice: #ececec;
  --pannello: #ffffff;
  --testo: #1c1c1c;
  --testo-corpo: #333333;
  --testo-note: #4d4d4d;
  --grigio-pgm: #808080;
  --rosso-scuro: #c40000;
  --logo-w: clamp(11.25rem, 8rem + 12vw, 17.5rem);
  --font-titoli: "DM Serif Text", Georgia, serif;
  --font-testo: "Atkinson Hyperlegible Next", Verdana, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cornice);
  color: var(--testo);
  font-family: var(--font-testo);
  padding: clamp(0.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
}

.pannello,
.piede {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
}

.pannello {
  flex-grow: 1;
  background: var(--pannello);
  border-radius: 3px;
  padding: clamp(1.75rem, 6.5vw, 5.5rem) clamp(1.25rem, 6.5vw, 5.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 7vw, 6rem);
}

.logo { display: block; width: var(--logo-w); max-width: 100%; height: auto; }
.logo-link { display: inline-block; }

.contenuto {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.75rem, 6vw, 6rem);
  align-items: flex-start;
}

.titolo {
  flex: 1 1 18.75rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}

h1 {
  margin: 0;
  font-family: var(--font-titoli);
  font-weight: 400;
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  line-height: 1.12;
  color: var(--testo);
  text-wrap: balance;
}
h1 span { display: block; }

.barra {
  width: calc(var(--logo-w) * 0.3191);
  margin-left: calc(var(--logo-w) * 0.0061);
  height: 4px;
  background: var(--rosso-scuro);
  border-radius: 1px;
}

.testo {
  flex: 1.3 1 22.5rem;
  min-width: 0;
  max-width: 38rem;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  line-height: 1.65;
  color: var(--testo-corpo);
}
.testo p { margin: 0 0 1.1em; }
.testo p:last-child { margin-bottom: 0; }
.testo h2 {
  font-family: var(--font-titoli);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.25;
  color: var(--testo);
  margin: 1.8em 0 0.5em;
}
.testo h2:first-child { margin-top: 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--grigio-pgm);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--testo); }
a:focus-visible { outline: 2px solid var(--testo); outline-offset: 3px; border-radius: 2px; }

.piede {
  padding: 0 clamp(0.25rem, 1.5vw, 1.25rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 2rem;
  font-size: clamp(0.8125rem, 0.78rem + 0.12vw, 0.875rem);
  line-height: 1.6;
  color: var(--testo-note);
}
.piede p { margin: 0; padding: 0.5rem 0; flex: 1 1 26rem; min-width: 0; }
.piede nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.piede nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--testo);
  font-size: clamp(0.875rem, 0.84rem + 0.12vw, 0.9375rem);
}

/* Pagine interne (privacy, storia): una sola colonna di lettura */
.contenuto-pagina {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: clamp(1.75rem, 3.5vw, 2.75rem);
  max-width: 44rem;
}
.contenuto-pagina .titolo,
.contenuto-pagina .testo { flex: none; max-width: none; width: 100%; }

/* Testo leggibile solo dalle tecnologie assistive */
.solo-lettori {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
