/* Variabili CSS */
:root {
    --primary-color: #FF8C00;
    --primary-dark: #E67E00;
    --primary-light: #FFA033;
    --dark-bg: #121212;
    --dark-bg-lighter: #1e1e1e;
    --light-text: #ffffff;
    --accent-color: #f8f8f8;
    --section-padding: 60px 20px;
    --gradient-bg: linear-gradient(135deg, rgba(255, 140, 0, 0.8), rgba(230, 126, 0, 0.9));
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --neon-glow: 0 0 10px rgba(255, 140, 0, 0.6), 0 0 20px rgba(255, 140, 0, 0.4);
    --glassmorphism: rgba(30, 30, 30, 0.7);
}

/* Reset e stili di base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: var(--dark-bg);
    background-image: 
    radial-gradient(circle at 20% 30%, rgba(255, 140, 0, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(255, 140, 0, 0.1) 0%, transparent 40%);
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--dark-bg));
    pointer-events: none;
    z-index: -1;
}

/* Main content */
main {
    padding-top: 100px;
    min-height: calc(100vh - 100px);
}

/* Gallery section */
.gallery-section {
    padding: var(--section-padding);
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
    color: var(--light-text);
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    box-shadow: var(--neon-glow);
}

.event-info {
    background-color: var(--glassmorphism);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.event-date {
    display: inline-block;
    background: var(--gradient-bg);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
    padding: 20px;
}
#gallery a img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
    display: block;
}
#gallery a:hover img {
    transform: scale(1.05);
}

.full-image{
    margin-top: 5rem;
}

@media (max-width: 480px) {
    #gallery {
    grid-template-columns: 1fr;
    }
    #gallery a img {
    height: auto;
    max-width: 100%;
    margin-bottom: 10px;
    }
}

/* Back button */
.back-button {
    display: inline-block;
    margin-bottom: 30px;
    padding: 15px 40px;
    background: var(--gradient-bg);
    color: var(--light-text);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.3);
    z-index: 1;
}

.back-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
    z-index: -1;
}

.back-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 140, 0, 0.4);
    letter-spacing: 1.5px;
}

.back-button:hover::before {
    left: 100%;
}

.back-button:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.35);
}


    /* Improve touch targets for mobile */
    .back-button {
    padding: 10px;
    }
    
    /* Prevent scrolling when menu is open */
    body.menu-open {
    overflow: hidden;
    }



    
    .section-title {
    font-size: 26px;
    }


@media (max-width: 480px) {
    .section-title {
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 30px;
    }
    
    .photo-grid {
    grid-template-columns: 1fr;
    }

}

/* iPhone 5/SE (smallest iPhones) */
@media (max-width: 320px) {
    .section-title {
    font-size: 20px;
    }

    .back-button {
    font-size: 13px;
    padding: 10px 20px;
    }
}

@media (max-width: 600px) {
    #custom-lightbox {
    align-items: flex-start;
    justify-content: flex-start;
    }
    #custom-lightbox img {
    margin-top: 14vh;
    max-width: 96vw;
    max-height: 70vh;
    border-radius: 16px;
    box-shadow: 0 8px 40px #000b;
    transition: opacity 0.4s, transform 0.4s, margin-top 0.3s;
    object-fit: contain;
    background: #181818;
    display: block;
    }
    #custom-lightbox.horizontal img {
    margin-top: 34vh;
    max-height: 54vw;
    }
    #custom-lightbox button#lightbox-prev,
    #custom-lightbox button#lightbox-next {
    top: 3%;
    width: 32px;
    height: 32px;
    }
    #custom-lightbox button#lightbox-close {
    top: 2px;
    right: 2px;
    font-size: 2rem;
    }
    #custom-lightbox #lightbox-controls {
    top: 40px;
    padding: 4px 4vw 0 0;
    }
}

#custom-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18,18,18,0.97);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#custom-lightbox #lightbox-controls {
    top: 32px;
    right: 0;
    position: fixed !important;
    left: auto;
    z-index: 10001;
    padding: 0 12px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
#custom-lightbox #lightbox-controls button {
    background: none;
    border: none;
    color: #fff;
    font-size: 2.1rem;
    cursor: pointer;
    filter: drop-shadow(0 0 8px #000);
    transition: color 0.2s;
    vertical-align: middle;
    align-self: center;
    padding: 0 8px;
    margin: 0;
    line-height: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#custom-lightbox #lightbox-controls button:hover {
    color: #FF8C00;
}
@media (max-width: 600px) {
    #custom-lightbox #lightbox-controls {
    top: 40px;
    padding: 0 4vw 0 0;
    }
}
#custom-lightbox #lightbox-controls button#lightbox-download {
    margin-top: 0px;
}
#custom-lightbox #lightbox-controls button#lightbox-close {
    right: 1000px;
    top: 42px;
}

body.preloader-active {
    overflow: hidden !important;
}
#preloader svg {
    display: block;
}
#preloader img {
    display: block;
    margin: 0 auto;
}
#preloader circle {
    filter: drop-shadow(0 0 6px #FF8C00aa);
    transition: stroke-dashoffset 0.3s linear;
}

@keyframes pulse-scale {
    0% { transform: scale(1); }
    50% { transform: scale(1.10); }
    100% { transform: scale(1); }
}
#preloader .preloader-logo {
    animation: pulse-scale 1.3s infinite cubic-bezier(.4,0,.6,1);
    will-change: transform;
}

@keyframes spin {
    0% { stroke-dashoffset: 31.4; }
    100% { stroke-dashoffset: 0; }
}

#lightbox-download {
    transition: all 0.3s ease;
}

#lightbox-download:hover {
    transform: scale(1.1);
}

#lightbox-download:active {
    transform: scale(0.95);
}