/* ------------------------------
   FONT
------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600&display=swap');

/* ------------------------------
   RESET DI BASE
------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ------------------------------
   STRUTTURA GENERALE
------------------------------ */

body {
    font-family: "Nunito", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7;
}

/* ------------------------------
   SIDEBAR
------------------------------ */

.sidebar {
    width: 250px;
    background-color: #ffffff;
    padding: 30px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    border-right: 1px solid #ddd;
}

.sidebar h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #245f89;
}

.sidebar a {
    display: block;
    margin-bottom: 12px;
    color: #245f89;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.2s ease;
}

.sidebar a:hover {
    opacity: 0.7;
}

/* ------------------------------
   PULSANTE AUDIO
------------------------------ */

.sidebar-audio {
    margin-top: 40px;
    text-align: center;
}

.audio-icon {
    background-color: #245f89;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.audio-icon:hover {
    background-color: #1a4a6b;
}

#audio-player {
    display: none;
}

/* ------------------------------
   HERO
------------------------------ */

.hero {
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px;
    position: relative;
}

.hero img {
    max-height: 50vh;
    width: 100%;
    object-fit: cover;
}

/* Overlay */
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(36, 95, 137, 0.25);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.2rem;
}

/* ------------------------------
   ANIMAZIONI
------------------------------ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-content h1,
.hero-content p {
    animation: fadeUp 0.8s ease-out;
}

/* ------------------------------
   CONTENUTO PAGINA
------------------------------ */

.pagina-testo {
    margin-left: 250px;
    padding: 40px;
    max-width: 800px;
}

.pagina-testo h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #245f89;
    animation: fadeUp 0.8s ease-out;
}

/* Spazio sopra il primo titolo */
.pagina-testo h2:first-of-type {
    margin-top: 45px;
}

.pagina-testo h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 10px;
    color: #245f89;
    animation: fadeUp 0.8s ease-out;
}

.pagina-testo p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* ------------------------------
   FOOTER
------------------------------ */

.footer {
    margin-left: 250px;
    padding: 40px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

.footer a {
    color: #245f89;
    text-decoration: none;
}

/* ------------------------------
   VERSIONE MOBILE OTTIMIZZATA
------------------------------ */

@media (max-width: 768px) {

    /* Sidebar */
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 20px;
        text-align: center;
    }

    .sidebar a {
        display: inline-block;
        margin: 6px 8px;
        font-size: 1rem;
    }

    /* HERO */
    .hero {
        margin-left: 0;
        padding: 20px;
        margin-bottom: 35px;
    }

    .hero img {
        max-height: 35vh;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* Contenuto */
    .pagina-testo {
        margin-left: 0;
        padding: 24px;
        max-width: 100%;
    }

    .pagina-testo h2 {
        margin-bottom: 28px;
    }

    .pagina-testo p {
        margin-bottom: 24px;
        line-height: 1.7;
    }

    /* Footer */
    .footer {
        margin-left: 0;
        padding: 25px;
    }
}

/* ------------------------------
   DARK MODE
------------------------------ */

@media (prefers-color-scheme: dark) {

    body {
        background-color: #1e1e1e;
        color: #e6e6e6;
    }

    .sidebar {
        background-color: #2a2a2a;
        border-bottom: 1px solid #444;
    }

    .sidebar a {
        color: #8bb7d6;
    }

    .footer {
        background-color: #2a2a2a;
        border-top: 1px solid #444;
    }
}
