/* Importazione Font Personalizzato */
@font-face {
    font-family: 'LouizeDisplay';
    src: url('fonts/louize-display-regular.woff2') format('woff2'),
         url('fonts/louize-display-regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Ottimo per il punteggio SEO/Performance */
}

/* Variabili Colore */
:root {
    --bg-color: rgba(255, 246, 230, 0.10); /* Fondo panna */
    --text-color: #000091; /* Blu per i testi */
}

/* Reset Base */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'LouizeDisplay', serif;
    margin: 0;
    overflow: hidden; /* Nasconde la scrollbar principale per non rovinare l'estetica */
}

/* Layout Principale */
.left-panel {
    height: 100vh;
    /* Su mobile il logo prenderà meno spazio, su desktop 100vh */
}

.logo-img {
    max-width: 50%;
    height: auto;
}

/* Motore dello Scroll Snapping */
.right-panel {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory; /* Obbliga lo scorrimento a scattare */
    padding-bottom: 60px; /* Spazio per evitare che il footer copra l'ultimo elemento */
    
    /* Nasconde la scrollbar estetica su Chrome/Safari/Firefox mantenendo la funzione */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.right-panel::-webkit-scrollbar {
    display: none; 
}

/* Singole Sezioni */
.snap-section {
    height: 100vh;
    scroll-snap-align: center; /* Scatta al centro dello schermo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.gallery-img {
    max-width: 90%;      /* Evita che l'immagine tocchi i bordi laterali */
    max-height: 75vh;    /* Evita che l'immagine sbordi in altezza o finisca sotto il footer */
    width: auto;
    height: auto;
    object-fit: contain; /* Forza il browser a mostrare l'immagine intera, mantenendo le sue proporzioni originali */
}

/* Tipografia del blocco testo */
.text-section .content-box {
    max-width: 85%;
    font-size: 1.1rem;
    line-height: 1.4;
}

.text-section h2, .text-section h3, .text-section h4 {
    font-family: 'LouizeDisplay', serif;
    color: var(--text-color);
    text-transform: uppercase;
}
.text-section h2 { font-size: 1.8rem; }
.text-section h3 { font-size: 1.2rem; }
.text-section h4 { font-size: 1.1rem; }

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 100;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--text-color);
    text-decoration: none;
}

/* Cookie Banner (Base) */
.cookie-banner {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background: var(--text-color);
    color: var(--bg-color);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 10px;
    z-index: 999;
    font-family: sans-serif;
    font-size: 0.8rem;
}
.btn-cookie {
    background: var(--bg-color);
    color: var(--text-color);
    border: none;
    padding: 5px 15px;
    margin-left: 15px;
    cursor: pointer;
    font-weight: bold;
}

/* Responsive: Su schermi piccoli mettiamo il logo sopra e lo scorrimento sotto */
@media (max-width: 768px) {
    body { overflow-y: auto; }
    .layout-wrapper { display: block; height: auto; }
    .left-panel { height: 40vh; }
    .right-panel { height: 60vh; width: 100%; }
    .site-footer { padding: 1rem 0; font-size: 0.7rem; }
}

/* =========================================
   VERSIONE MOBILE (Sotto i 768px di larghezza)
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Sblocca lo scorrimento generale della pagina */
    body {
        overflow-y: auto;
    }

    /* 2. Rimuovi le altezze fisse (100vh) per permettere l'impilamento naturale */
    .layout-wrapper {
        height: auto !important; 
    }

    /* 3. Pannello Logo: altezza naturale e un po' di respiro */
    .left-panel {
        height: auto;
        padding: 1rem 1rem;
    }

    .logo-img {
        max-width: 80%; /* Fa respirare un po' di più il logo su mobile */
    }

    /* 4. Pannello di destra: disattiva lo snap e blocca lo scorrimento interno */
    .right-panel {
        height: auto;
        overflow-y: visible;
        scroll-snap-type: none; /* Disattiva lo scatto */
        padding-bottom: 0;
    }

    /* 5. Sezioni interne: altezze basate sul contenuto e non sullo schermo */
    .snap-section {
        height: auto;
        scroll-snap-align: none; /* Disattiva l'allineamento a scatto */
        padding: 2rem 1rem;
    }

    /* 6. Contenitore Gallery: diamo un'altezza minima per non far "saltare" la pagina al click */
    #gallery-container {
        min-height: 50vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-img {
        max-width: 100%;
        max-height: 60vh;
    }

    /* 7. Footer: togliamo la posizione fissa in basso e lo mettiamo nel flusso naturale della pagina */
    .site-footer {
        position: relative;
        padding: 2rem 1rem;
    }
}