/* Variabili CSS basate sui colori ufficiali (Linee Guida AgID / Design Italia) */
:root {
    --primary-blue: #0077B3;
    /* Colore base per header e bottoni */
    --link-color: #005a9c;
    --text-color: #1a1a1a;
    --text-muted: #5c5c5c;
    --top-bar-bg: #f5f6f8;
    --bg-light: #f9f9f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Titillium Web', sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    background-color: #ffffff;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* TOP BAR */
.top-bar {
    background-color: var(--top-bar-bg);
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    position: relative;
    z-index: 10;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
}

.region {
    font-weight: 600;
    color: #333;
}



.login-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.user-login {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-icon-circle {
    display: none;
    /* Only show on mobile in this specific format if needed, but we used it in HTML */
}

/* HEADER */
.main-header {
    padding: 7px 0;
    background: #ffffff;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: -60px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.search-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: #004d9e;
}

/* Hamburger Menu (Hidden on Desktop) */
.nav-toggle-input {
    display: none;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 100;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-blue);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* NAVIGAZIONE */
.main-nav {
    background-color: var(--primary-blue);
    position: relative;
    z-index: 10;
}

.nav-container {
    display: flex;
    justify-content: space-between;
}

.nav-container ul {
    list-style: none;
    display: flex;
}

.nav-container a {
    color: white;
    text-decoration: none;
    padding: 20px 20px;
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.2s;
}

.nav-container a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* MAIN CONTENT */
.main-content {
    min-height: 400px;
    padding: 80px 0;
}

.intro-section {
    max-width: 900px;
    /* Impedisce al testo di allargarsi troppo rovinando l'estetica */
    margin: 0 auto;
}

.intro-section p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 24px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.2;
    margin-bottom: 30px;
}

.section-image-title {
    max-height: 420px;
    max-width: 100%;
    margin: 0 auto 30px auto;
    display: block;
}

/* FOOTER */
.main-footer {
    background-color: #ffffff;
    padding: 40px 0;
    border-top: 1px solid #e5e5e5;
}

.footer-top {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-col h4 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: var(--link-color);
    text-decoration: underline;
    font-size: 0.85rem;
    line-height: 2.2;
}

.footer-col a:hover {
    color: var(--primary-blue);
}

/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 1.4s ease;
    /* Fade-out timing per lo schema a scomparsa */
}

#splash-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#logo-target {
    height: 146px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -25px;
    margin-top: -15px;
}

#logo-target img {
    height: 146px;
    width: auto;
}

/* --- ANIMAZIONI START --- */
.anim-top {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-fade {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-top.in-view,
.anim-left.in-view,
.anim-fade.in-view {
    opacity: 1;
    transform: translate(0, 0);
}

.anim-bounce {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.anim-bounce.in-view {
    opacity: 1;
    transform: scale(1);
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 16px 36px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    background-color: #004d9e;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    color: white;
}

/* GALLERIA GENTE DISTRATTA - DESKTOP */
.gente-gallery-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4%;
    align-items: center;
    justify-content: space-between;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 1200px;
    margin-top: calc(-12vw + 40px);
    margin-bottom: 50px;
    padding: 0 5%;
    box-sizing: border-box;
}

.patrocinio-img {
    transition-delay: 0.1s;
    height: 60%;
    width: auto;
    max-width: 32%;
    object-fit: contain;
    flex-shrink: 1;
    cursor: zoom-in;
    transform: translateY(20px);
}

.logo-video {
    transition-delay: 0.1s;
    height: 100%;
    flex: 1;
    min-width: 0;
    object-fit: contain;
    transform: translateY(calc(-9vw + 45px));
}

.cast-video-el {
    transition-delay: 0.1s;
    height: 60%;
    width: auto;
    max-width: 32%;
    object-fit: contain;
    flex-shrink: 1;
    transform: translateY(20px);
}

.cta-wrapper {
    text-align: center;
    margin-top: -450px;
    margin-bottom: 200px;
    position: relative;
    z-index: 100;
}

/* --- RESPONSIVITÀ MOBILE --- */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* Top Bar Mobile */
    .top-bar-content {
        flex-direction: row;
        /* Horizontal as per screenshot */
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    .login-text {
        display: none;
        /* Hide text "Accedi..." on mobile */
    }

    .user-icon-circle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid #e0e0e0;
        color: var(--primary-blue);
    }

    /* Header Mobile */
    .header-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        gap: 0;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1001;
        margin-left: 30px;
        /* Totale : 30px a destra */
    }

    .logo-area {
        flex-direction: row;
        /* Logo and text side-by-side */
        text-align: right;
        gap: 10px;
        flex: 1;
        justify-content: center;
        position: relative;
    }

    #logo-target {
        height: 50px !important;
        /* Half size roughly */
        margin: 0 !important;
        position: absolute;
        left: 65px;
        /* Manteniamo il logo al suo posto */
    }

    .logo-text {
        font-size: 1.2rem;
        position: relative;
        left: 30px;
        /* Totale : 30px a destra */
    }

    #logo-target img {
        height: 50px !important;
        width: auto !important;
    }

    .header-right {
        gap: 5px;
    }

    .social-links,
    .search-label {
        display: none;
        /* Hide social and "Cerca" text */
    }

    .search-btn {
        width: 36px;
        height: 36px;
    }

    /* Nav Mobile - Hamburger Logic */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-blue);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-toggle-input:checked~.main-nav {
        display: block;
    }

    /* Change hamburger appearance when open */
    .nav-toggle-input:checked+.hamburger-menu span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }

    .nav-toggle-input:checked+.hamburger-menu span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle-input:checked+.hamburger-menu span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }

    .nav-container {
        flex-direction: column;
    }

    .nav-container ul {
        flex-direction: column;
        width: 100%;
    }

    .nav-container a {
        text-align: left;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1rem;
    }

    /* Content Mobile */
    .section-title {
        font-size: 1.4rem;
        /* Slightly smaller as requested */
    }

    .intro-section p {
        font-size: 1.05rem;
    }

    /* GALLERY GENTE DISTRATTA MOBILE - Pre-existing adjustments slightly refined */
    .gente-gallery-row {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .patrocinio-img, .logo-video, .cast-video-el {
        width: 90%;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .cta-wrapper {
        margin-top: 20px !important;
        margin-bottom: 50px !important;
    }

    .cta-button {
        width: 90%;
        padding: 14px 20px;
        font-size: 1.1rem;
    }

    /* Footer Mobile */
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }

    .footer-logos {
        justify-content: center;
    }

    .footer-logos>div {
        flex-direction: column;
        gap: 10px;
    }
}