:root {
    --viterbo-blue: #0033a0;
    --viterbo-gold: #ffc72c;
    --peperino: #444444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Montserrat', sans-serif; background-color: #f4f4f4; color: var(--peperino); overflow-x: hidden; }

/* NAVBAR */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 8%; background: var(--viterbo-blue);
    position: fixed; width: 100%; z-index: 1000; border-bottom: 4px solid var(--viterbo-gold);
}
.logo { font-family: 'Cinzel Decorative', serif; color: white; font-weight: bold; font-size: 1.5rem; }
.logo span { color: var(--viterbo-gold); }

/* MENU CON FONT GOTICO */
.nav-links { display: flex; list-style: none; }
.nav-links a { 
    color: white; 
    text-decoration: none; 
    margin-left: 30px; 
    font-weight: 600; 
    font-size: 1.1rem; 
    text-transform: uppercase; 
    font-family: 'MedievalSharp', cursive; 
}

/* HAMBURGER */
.menu-toggle { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: white; transition: 0.3s; }

/* HERO */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 51, 160, 0.45), rgba(0, 51, 160, 0.45)), 
                url('https://upload.wikimedia.org/wikipedia/commons/5/57/Palazzo_dei_Papi_%28Viterbo%29_2022.jpg') center/cover no-repeat;
    display: flex; align-items: flex-end; justify-content: center; text-align: center; color: white; padding-bottom: 15vh;
}
.hero h1 { font-family: 'UnifrakturMaguntia', cursive; font-size: 7rem; color: var(--viterbo-gold); }

/* HERO - Spaziature testi */
.hero-content h1 { margin: 20px 0; line-height: 1.1; }
.hero-content p { margin-bottom: 30px; font-size: 1.2rem; }
.kicker { display: block; margin-bottom: 10px; }

/* STORIA */
.section { padding: 100px 10%; }
.split { display: flex; gap: 50px; align-items: center; }

/* IMMAGINE SECONDA - FISSA SU PC, ADATTIVA SU MOBILE */
.viterbo-palace-real { 
    flex: none;
    width: 450px; 
    height: 350px;
    background: url('https://upload.wikimedia.org/wikipedia/commons/e/ef/Schott%2C_Franz_%E2%80%93_Parte_seconda_dell%27itinerario_d%27Italia%2C_doue_si_contiene_la_descrittione_di_Roma%2C_1647_%E2%80%93_BEIC_IE4171477_Viterbo.jpg') center/cover no-repeat;
    border: 8px solid var(--viterbo-blue);
    box-shadow: 15px 15px 0 var(--viterbo-gold);
}

.viterbo-loggia-real { 
    flex: none;
    width: 640px; 
    height: 457px;
    background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Viterbo%2C_palazzo_e_loggia_dei_papi%2C_02.jpg/960px-Viterbo%2C_palazzo_e_loggia_dei_papi%2C_02.jpg') center/cover no-repeat !important;
    border: 8px solid var(--viterbo-blue);
    box-shadow: 15px 15px 0 var(--viterbo-gold);
}


h2 { font-family: 'Almendra Display', serif; font-size: 3rem; color: var(--viterbo-blue); }

.img-block.viterbo-loggia-real, 
.img-block.viterbo-palace-real {
    display: block;
    background-size: cover !important;
    background-position: center !important;
}


/* BOTTONE ENTRA NEL BORGO */
.cta-gold {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 35px;
    background-color: var(--viterbo-gold);
    color: var(--viterbo-blue) !important;
    text-decoration: none;
    font-family: 'MedievalSharp', cursive;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
    border-radius: 5px;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}
.cta-gold:hover { background-color: white; transform: scale(1.05); }

/* IDENTITÀ */
.dark { background-color: var(--viterbo-blue); color: white; }
.center-h { text-align: center; margin-bottom: 40px; font-size: 2.5rem; color: var(--viterbo-gold); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card { padding: 40px; border: 1px solid var(--viterbo-gold); text-align: center; }
.card h3 { font-family: 'MedievalSharp', cursive; color: var(--viterbo-gold); font-size: 1.8rem; }

/* FOOTER BLU SU GIALLO */
footer { 
    padding: 40px 8%; 
    background-color: var(--viterbo-gold);
    color: var(--viterbo-blue);
    text-align: center; 
    border-top: 4px solid var(--viterbo-blue);
}
footer p { font-weight: 600; }
footer i { color: var(--viterbo-blue); font-style: normal; font-weight: bold; font-family: 'MedievalSharp', cursive; }

/* REGOLE MOBILE */
@media (max-width: 768px) {
    .menu-toggle { display: block; z-index: 1001; }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--viterbo-blue);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active { left: 0; }

    .nav-links li { margin: 20px 0; width: 100%; text-align: center; }

    .nav-links a { font-size: 2rem; margin-left: 0; font-family: 'MedievalSharp', cursive; }

    /* Fix per l'immagine che spingeva il menu */
    .viterbo-palace-real { 
        width: 100% !important; 
        height: 250px !important;
        margin: 20px 0;
    }

    .split { flex-direction: column; text-align: center; }

    .hero h1 { font-size: 4rem; }

    /* ANIMAZIONE X */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}