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

/* ---- FONT DI BASE ---- */
body {
    animation: fadeIn 1.5s ease;
    font-family: 'Source Sans Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0;
    color: #333;
    line-height: 1.7;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- GERARCHIA TITOLI ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', serif;
    font-weight: 400;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

h2 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 6px;
}

h4 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 5px;
}

h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- PULSANTE TORNA SU ---- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

/* ---- PULSANTE PLAY ---- */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    color: white;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%) scale(1.08);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
}

.play-btn .play-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 2px;
}

.play-btn .play-text {
    font-family: 'Raleway', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

.play-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@keyframes pulse-play {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 255, 255, 0.2);
    }
}

.play-btn:not(.hidden) {
    animation: pulse-play 2s ease-in-out infinite;
}

/* ---- HERO VIDEO ---- */
.hero-video {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.hero-video video {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 90vh;
    width: auto;
    max-width: none;
    z-index: 0;
}

/* ---- HERO OVERLAY ---- */
.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 20px;
    max-width: 900px;
    width: 100%;
    height: 110vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    pointer-events: none;
}

.hero-overlay::-webkit-scrollbar {
    display: none;
}

.hero-content {
    pointer-events: auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 40px 20px 60px;
}

.hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    width: 100%;
}

.hero-overlay h1 {
    font-family: 'Raleway', serif;
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 0 2px 30px rgba(0,0,0,0.5);
    letter-spacing: 6px;
    margin: 0;
    text-align: center;
}

.hero-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 1px 20px rgba(0,0,0,0.3);
    margin-top: -15px;
    padding: 0 20px;
}

/* ---- HERO CON IMMAGINE (invece del video) ---- */
.hero-image {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* ---- IMMAGINE DI SOSTITUZIONE (come il video in pausa) ---- */
.hero-bg-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 🔥 Come il video: si adatta all'altezza dello schermo */
    height: 100vh;
    width: auto;
    max-width: none;
    z-index: 0;
    object-fit: contain; /* 🔥 Mostra tutta l'immagine senza tagli */
}

/* ---- SEZIONE SOTTO IL VIDEO (sfondo nero) ---- */
.hero-after {
    width: 100%;
    background: #000000;
    padding: 0px 0px 0px;
    border-bottom: 1px solid #222;
}

.hero-after-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hero-invitation {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    line-height: 1.8;
    letter-spacing: 0.5px;
    max-width: 700px;
    margin: 0;
    text-transform: uppercase;
}

/* Freccia Galleria (fuori dal video) */
.hero-after .hero-scroll {
    text-align: center;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease;
    animation: bounce 2s infinite;
    margin: 0;
}

.hero-after .hero-scroll:hover {
    color: rgba(255, 255, 255, 0.9);
}

.hero-after .hero-scroll .arrow {
    display: block;
    font-size: 2rem;
    margin-top: 5px;
}

/* Nascondi la vecchia freccia nel video */
.hero-content .hero-scroll {
    display: none;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ---- TESTO INTRODUTTIVO GALLERIA ---- */
.gallery-intro {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 40px 20px 10px;
}

.gallery-hint {
	font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: black;
    letter-spacing: 1px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    text-transform: uppercase;
}

/* ---- GALLERIA ---- */
.gallery {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
    padding: 0 20px;
}

/* SINGOLA OPERA */
.opera {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.opera img {
    width: 33.333%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.opera img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    filter: brightness(0.7);
}

.opera .titolo-opera {
    margin-top: 12px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #555;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ---- TESTO FINALE GALLERIA ---- */
.gallery-ending {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 40px 20px 20px;
}

.ending-text {
    font-family: 'Raleway', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: black;
    line-height: 1.8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

/* ---- OVERLAY ---- */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
    color: white;
}

.overlay.attivo {
    display: flex;
}

.overlay img {
    max-height: 60vh;
    max-width: 90%;
    border-radius: 8px;
    margin-bottom: 30px;
}

.overlay h2 {
    font-family: 'Raleway', serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: white;
}

.overlay h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 1px;
    opacity: 0.85;
}

.overlay p {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.2rem;
    max-width: 600px;
    opacity: 0.85;
    font-weight: 300;
}

.overlay .chiudi {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.overlay .chiudi:hover {
    transform: rotate(90deg);
}

/* ---- OVERLAY CON SCROLL ---- */
.overlay-content {
    max-height: 85vh;
    overflow-y: auto;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.overlay-content::-webkit-scrollbar {
    width: 5px;
}
.overlay-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.overlay-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
.overlay-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.overlay img {
    max-height: 50vh;
    max-width: 90%;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.overlay p {
    text-align: center;
    padding: 0 20px 20px;
    width: 100%;
    max-width: 700px;
}

/* ---- FRECCE DI NAVIGAZIONE OVERLAY ---- */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.05);
}

.nav-prev {
    left: 30px;
}

.nav-next {
    right: 30px;
}

.overlay-counter {
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(2px);
}

/* ---- SE LA GALLERIA È VUOTA ---- */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.2rem;
}

.empty-message a {
    color: #666;
    text-decoration: underline;
}

.empty-message a:hover {
    color: #333;
}

/* ---- FOOTER ---- */
.site-footer {
    width: 100%;
    background: #1a1a1a;
    color: #888;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid #333;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.footer-content p {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.2rem;
    margin: 0;
    color: white;
    text-transform:uppercase;
}

.footer-email {
    color: #f0d8b0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

.footer-email:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-candidati {
    font-size: 0.85rem;
    color: #888;
}

.footer-candidati .footer-email {
    font-weight: 400;
}

.footer-divider {
    color: #555;
    margin: 0 10px;
}

/* ======================================== */
/*             RESPONSIVE                   */
/* ======================================== */

@media (max-width: 768px) {
    .hero-video video {
        height: auto;
        width: 100vw;
    }

    .play-btn {
        width: 80px;
        height: 80px;
    }
    .play-btn .play-icon {
        font-size: 2.2rem;
    }
    .play-btn .play-text {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }

    .hero-overlay {
        padding: 30px 15px;
    }

    .hero-content {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .hero-overlay h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
        margin-top: 5px;
    }

    /* Sezione sotto il video */
    .hero-after {
        padding: 40px 20px 30px;
    }

    .hero-invitation {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .hero-after .hero-scroll {
        font-size: 0.75rem;
    }

    .hero-after .hero-scroll .arrow {
        font-size: 1.5rem;
    }

    /* Galleria */
    .opera img {
        width: 100%;
        border-radius: 0;
    }

    .gallery-hint {
        font-size: 0.85rem;
    }

    .ending-text {
        font-size: 0.95rem;
        padding: 20px 15px 0;
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }

    .overlay h2 {
        font-size: 2rem;
    }
    .overlay h3 {
        font-size: 1rem;
    }
    .overlay p {
        font-size: 1rem;
    }

    .nav-arrow {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }
    .nav-prev {
        left: 10px;
    }
    .nav-next {
        right: 10px;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }

    .footer-content p {
        font-size: 0.8rem;
    }
    .footer-candidati {
        font-size: 0.75rem;
    }
    .footer-divider {
        display: none;
    }
    .footer-contact {
        display: flex;
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .play-btn {
        width: 65px;
        height: 65px;
    }
    .play-btn .play-icon {
        font-size: 1.8rem;
    }
    .play-btn .play-text {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }

    .hero-overlay h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-top: 4px;
    }

    .hero-after {
        padding: 30px 15px 25px;
    }

    .hero-invitation {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .hero-after .hero-scroll {
        font-size: 0.65rem;
    }

    .hero-after .hero-scroll .arrow {
        font-size: 1.2rem;
    }

    .hero-content {
        padding: 20px 15px;
    }

    .gallery-hint {
        font-size: 0.75rem;
        padding-bottom: 10px;
    }

    .ending-text {
        font-size: 0.85rem;
        padding: 15px 10px 0;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
    .nav-prev {
        left: 5px;
    }
    .nav-next {
        right: 5px;
    }
    .overlay-counter {
        font-size: 0.7rem;
        padding: 4px 12px;
    }

    .footer-content p {
        font-size: 0.7rem;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}