/* ========================================================================
   MAIN.CSS
   Base globale del sito: variabili, reset, tipografia, layout e utility.
   Non inserire qui stili specifici di singole pagine o componenti complessi.
======================================================================= */

/* -----------------------------
   Design tokens
----------------------------- */
:root {
  --navy: #0f2440;
  --navy-dark: #081830;
  --gold: #c9a96e;
  --gold-light: #e2c992;
  --gold-dark: #a8863f;
  --gold-deep: #866832;

  --white: #ffffff;
  --off-white: #f7f5f1;

  --text: #1e3358;
  --text-mid: #3a5080;
  --text-light: #8a9ab8;

  --border: rgba(28, 52, 91, 0.10);

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Bentham", Georgia, serif;

  /* La colonna del testo. Larga cosi le righe entrano in meno capoversi, e
     le schermate della home restano dentro l'altezza dello schermo. */
  --max: 1360px;
  --nav-h: 68px;
  /* Riempimento sotto le schermate che restano ferme. Lo legge anche
     "schermate.js" per sapere quanto spazio serve davvero. */
  --schermata-sotto: 44px;
  --pad-x: 40px;
  --section-pad: 120px;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

/* -----------------------------
   Reset base
----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* La barra in alto è fissa: chi arriva a una sezione da un collegamento
   deve vederne il titolo, non trovarlo coperto. */
section[id],
aside[id] {
  scroll-margin-top: var(--nav-h);
}

body {
  min-width: 320px;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.8;
  /* "clip" e non "hidden": hidden trasformerebbe la pagina in un contenitore
     che scorre per conto suo, e le sezioni della home smetterebbero di restare
     ferme mentre la successiva le scivola sopra. */
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--gold);
  color: var(--white);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

/* -----------------------------
   Tipografia condivisa
----------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.12;
  color: var(--navy);
}

h1 em,
h2 em,
h3 em,
h4 em {
  font-style: italic;
  color: var(--gold-dark);
}

p {
  color: var(--text-mid);
}

strong {
  color: var(--text);
  font-weight: 400;
}

/* -----------------------------
   Header sezione riutilizzabile
----------------------------- */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.section-eyebrow-line {
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.section-eyebrow span {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-title {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  margin-bottom: 20px;
}

.section-title--white {
  color: var(--white);
}

.section-title--white em {
  color: var(--gold-light);
}

.section-lead {
  max-width: 560px;
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-mid);
}

.section-lead--white {
  color: rgba(255, 255, 255, 0.74);
}

.gold-rule {
  width: 36px;
  height: 1px;
  margin: 28px 0;
  background: var(--gold);
}

/* -----------------------------
   Accessibilità
----------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 9999;
  background: var(--gold);
  color: var(--navy);
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 8px;
}

/* -----------------------------
   Utility leggere
----------------------------- */
.no-scroll {
  overflow: hidden;
}

/* -----------------------------
   Responsive globale
----------------------------- */
@media (max-width: 960px) {
  :root {
    --pad-x: 32px;
    --section-pad: 90px;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 60px;
    --pad-x: 24px;
    --section-pad: 72px;
  }
}

@media (max-width: 480px) {
  :root {
    --pad-x: 20px;
    --section-pad: 60px;
  }

  body {
    font-size: 17px;
  }

  .section-title {
    font-size: clamp(1.75rem, 7vw, 2.4rem);
  }
}
