/* ============================================================
   BASE.CSS — reset, variabili, tipografia, layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ── Variabili ─────────────────────────────────────────────── */
:root {
    /* Palette presa dal logo: bianco puro, antracite del lettering,
       cremisi del sottotitolo. Niente altro di identitario. */
    --crimson:      #A1052C;
    --crimson-dark: #7B0421;
    --crimson-soft: #F7E7EB;
    --ink:          #353533;
    --ink-soft:     #4A4A47;
    --paper:        #F4F2EF;
    --paper-dark:   #E3DFD9;

    /* Alias storici: il markup esistente usa ancora questi nomi */
    --orange:       var(--crimson);
    --orange-dark:  var(--crimson-dark);
    --dark:         var(--ink);
    --dark-mid:     var(--ink-soft);
    --cream:        var(--paper);
    --cream-dark:   var(--paper-dark);
    --stone:        #EBE7E1;
    --sage:         #6F7A5A;
    --sage-light:   #9AA487;

    --text:         #3A3A38;
    --text-muted:   #6B6B66;
    --white:        #ffffff;

    --font-display: 'Archivo', 'Arial Black', Arial, sans-serif;
    --font-body:    'Source Sans 3', 'Segoe UI', sans-serif;

    /* Il logo è squadrato: angoli quasi vivi in tutto il sito */
    --radius-sm:    2px;
    --radius-md:    4px;
    --radius-lg:    6px;

    --shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:    0 6px 24px rgba(0,0,0,0.12);
    --shadow-lg:    0 16px 48px rgba(0,0,0,0.18);

    --transition:   0.3s ease;
    --max-width:    1200px;
    --nav-height:   68px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Tipografia ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    line-height: 1.15;
    color: var(--ink);
    /* Parole lunghe come "NATURALISTICHE" su schermo stretto non ci stanno
       su una riga e non hanno spazi dove spezzarsi: la sillabazione le manda
       a capo in modo leggibile, break-word è la rete di sicurezza. */
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Titoli maiuscoli e compatti, come il lettering del logo */
h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.005em;
}
h2 {
    font-size: clamp(1.5rem, 3.4vw, 2.3rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.005em;
}
h3 { font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

p { margin-bottom: 1rem; color: var(--text-muted); line-height: 1.8; }
p:last-child { margin-bottom: 0; }

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

/* ── Layout ─────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 24px;
}

.section--alt {
    background: var(--cream);
}

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

.section__header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 56px;
}

.section__header h2 {
    margin-bottom: 16px;
}

.section__header p {
    font-size: 1.1rem;
}

/* ── Bottoni ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}
.btn--primary:hover {
    background: var(--orange-dark);
    border-color: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(161,5,44,0.30);
}

.btn--outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn--outline:hover {
    background: var(--white);
    color: var(--orange);
    transform: translateY(-2px);
}

.btn--outline-dark {
    background: transparent;
    color: var(--orange);
    border-color: var(--orange);
}
.btn--outline-dark:hover {
    background: var(--orange);
    color: var(--white);
    transform: translateY(-2px);
}

.btn--lg { padding: 16px 40px; font-size: 1.05rem; }

/* ── Hero ─────────────────────────────────────────────────────
   Immagine a piena altezza, titolo bianco enorme appoggiato in
   basso a sinistra. L'immagine è il contenuto, il testo ci sta sopra.
   ------------------------------------------------------------ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;          /* su mobile esclude le barre del browser */
    display: flex;
    align-items: flex-end;
    text-align: left;
    color: var(--white);
    overflow: hidden;
    padding: calc(var(--nav-height) + 40px) 0 72px;
}

/* Le pagine interne hanno lo stesso hero della home: a tutto schermo.
   La classe resta per compatibilità col markup esistente. */
.hero--short {
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--nav-height) + 40px) 0 72px;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transform: scale(1.04);
    transition: transform 8s ease;
}

.hero:hover .hero__bg {
    transform: scale(1.0);
}

/* Scuro solo dove serve leggere: in basso, e appena sotto la navbar */
.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top, rgba(20,20,19,0.82) 0%, rgba(20,20,19,0.42) 34%, rgba(20,20,19,0.05) 62%, rgba(20,20,19,0.28) 100%);
}

.hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.hero__content h1 {
    color: var(--white);
    font-size: clamp(2.6rem, 10vw, 7.5rem);
    line-height: 0.9;
    letter-spacing: -0.025em;
    margin-bottom: 22px;
    text-wrap: balance;
}

.hero__subtitle {
    font-size: clamp(1.05rem, 2vw, 1.5rem);
    color: var(--white);
    font-weight: 300;
    max-width: 46ch;
    margin-bottom: 14px;
    opacity: 0.95;
}

/* Ricalca il sottotitolo del logo: condensato, maiuscolo, spaziato */
.hero__date {
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 32px;
    opacity: 0.92;
}

.hero__buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Freccia che invita a scorrere */
.hero::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 26px;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border-right: 2px solid rgba(255,255,255,0.75);
    border-bottom: 2px solid rgba(255,255,255,0.75);
    transform: rotate(45deg);
    animation: heroGiu 2.4s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes heroGiu {
    0%, 100% { transform: rotate(45deg) translate(0, 0);      opacity: 0.45; }
    50%      { transform: rotate(45deg) translate(5px, 5px);  opacity: 1; }
}

@media (max-width: 768px) {
    .hero, .hero--short { padding-bottom: 56px; }
    /* 9.5vw tiene "NATURALISTICHE" e "INFORMAZIONI" dentro i 375px
       senza doverle spezzare */
    .hero__content h1 { font-size: clamp(1.8rem, 9.5vw, 2.6rem); }
    .hero__subtitle { font-size: 1rem; }
    .hero::after { display: none; }
}

/* ── Banner avviso ──────────────────────────────────────────── */
.notice-banner {
    background: var(--stone);
    border-left: 5px solid var(--orange);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    text-align: center;
    margin-bottom: 48px;
}
.notice-banner p { margin: 0; }
.notice-banner p:first-child {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 8px;
}
.notice-banner p:last-child { margin-bottom: 0; }

.notice-banner--warning {
    background: #fef3c7;
    border-left-color: #d97706;
}
.notice-banner--warning p:first-child { color: #b45309; }

.notice-banner + .notice-banner { margin-top: -32px; }

/* ── CTA section ────────────────────────────────────────────── */
.cta-section {
    padding: 80px 24px;
    background: linear-gradient(120deg, var(--crimson) 0%, var(--ink) 100%);
    color: var(--white);
    text-align: center;
}
.cta-section h2 { color: var(--white); margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.88); margin-bottom: 32px; font-size: 1.1rem; }

/* ── Griglia generica ───────────────────────────────────────── */
.grid {
    display: grid;
    gap: 28px;
}
/* Il min() evita che su schermi molto stretti la colonna resti larga 300px
   in uno spazio che ne ha 288: senza, la scheda esce dallo schermo. */
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

/* ── Utilità di allineamento ────────────────────────────────── */
.centrata { text-align: center; }

.testo-guida {
    max-width: 640px;
    margin: 16px auto 28px;
}

/* ── Separatore decorativo ──────────────────────────────────── */
.divider {
    width: 56px;
    height: 4px;
    background: var(--orange);
    border-radius: 2px;
    margin: 0 auto 32px;
}

/* ── Responsive base ────────────────────────────────────────── */
@media (max-width: 768px) {
    .section { padding: 56px 16px; }
    .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .btn--lg { padding: 14px 24px; }
    /* Le etichette lunghe ("Scopri il significato di Apolje →") su schermi
       stretti superano la larghezza: qui possono andare a capo. */
    .btn {
        white-space: normal;
        max-width: 100%;
        text-align: center;
        padding: 12px 22px;
    }
}
