/* ===========================================================================
   goEnergy · Base
   Reset, fondamentali tipografici, contenitori, accessibilità. Nessun componente.
   =========================================================================== */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

/* === HEADINGS === */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-extra);
  line-height: var(--leading-tight);
  color: var(--color-primary-dark);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: clamp(1.75rem, 5vw, 2.25rem); letter-spacing: var(--tracking-normal); }
h3 { font-size: clamp(1.25rem, 4vw, 1.75rem); font-weight: var(--weight-bold); }
h4 { font-size: var(--text-lg); font-weight: var(--weight-bold); }

p { text-wrap: pretty; overflow-wrap: break-word; }

/* === FOCUS (mai rimosso senza sostituto) === */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  font-weight: var(--weight-bold);
  color: var(--color-text-inverted);
  background-color: var(--color-cta);
  border-radius: var(--radius-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--space-4); }

/* === CONTENITORI === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--text   { max-width: var(--max-width-text); }
.container--narrow { max-width: var(--max-width-narrow); }

/* === SR-ONLY === */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === SEZIONE GENERICA === */
.section { padding-block: var(--section-y); }
.section--tint { background-color: var(--color-bg-secondary); }
.section--flush-bottom { padding-bottom: 0; }

.section-head { max-width: var(--max-width-text); margin-inline: auto; text-align: center; }
.section-head h2 {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-primary-dark);
}
.section-head p {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-md);
}
