/*
==================================================
INDICE
==================================================
1. Reset & base
2. Body
3. Layout wrapper
4. Header
5. Loghi
6. Gallery
7. Footer
8. Responsive
   8.1 Widescreen
   8.2 Laptop
   8.3 Tablet orizzontale
   8.4 Tablet verticale
   8.5 Smartphone
==================================================
*/

/*
==================================================
1. Reset & base
==================================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/*
==================================================
2. Body
==================================================
*/
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0e0e0e;
    color: #ffffff;
}

.intro {
    padding: 20px 30px 10px;
    max-width: 80%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin: auto;
    gap: 18px;
}

.intro h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.intro p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.8;
    text-align: center;
    color: white;
}


/*
==================================================
3. Layout wrapper
==================================================
*/
.site-wrapper {
    max-width: 1600px;
    margin: 0 auto;
}

/*
==================================================
4. Header
==================================================
*/
.site-header {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

/*
==================================================
5. Loghi
==================================================
*/
.logo-wrapper {
    display: flex;
    gap: 40px;
    align-items: center;
}

.logo-wrapper img {
    height: 210px;
    width: 500px;
    object-fit: cover;
}

/*
==================================================
6. Gallery
==================================================
*/
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 70px 40px 40px 40px;
}

.gallery img {
    width: 100%;
    height: 480px !important;
    object-fit: cover;
    display: block;
    border-radius: 0px;
    object-position: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    cursor: zoom-out;
}

.gallery img {
    position: relative;
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

p.caption {
    color: black;
    text-align: center;
    margin: 0px;
    font-size: 13px !important;
    font-family: system-ui;
}

.gallery-item {
    background: white;
    padding: 30px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.caption {
    font-size: 14px;
    color: #111;
    opacity: 0.8;
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

.gallery-item::after {
    content: "Apri";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

@media (hover: none) {
    .gallery-item::after {
        display: none;
    }
}


/*
==================================================
7. Footer
==================================================
*/
.site-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    opacity: 0.7;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

h4.title-footer {
    margin-bottom: 10px;
}

a {
   color: white;
}

a.backtotop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    color: black;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
}

/*
==================================================
8. Responsive
==================================================
*/

/*
--------------------------------------------------
8.1 Widescreen (≥ 1600px)
--------------------------------------------------
*/
@media (min-width: 1600px) {
    .site-wrapper {
        max-width: 1800px;
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
        padding: 70px 40px 40px 40px;
    }
}

/*
--------------------------------------------------
8.2 Laptop (≤ 1440px)
--------------------------------------------------
*/
@media (max-width: 1540px) {
    .logo-wrapper img {
        width: 280px;
        height: 110px;
    }
   .gallery img {
       width: 100%;
       height: 380px !important;
       object-fit: cover;
       display: block;
       border-radius: 0px;
       object-position: center;
   }
    .gallery {
     grid-template-columns: repeat(3, 1fr);
     gap: 30px;
     padding: 70px 40px 40px 40px;
 }
}

/*
--------------------------------------------------
8.3 Tablet orizzontale (≤ 1024px)
--------------------------------------------------
*/
@media (max-width: 1024px) {
    .logo-wrapper {
        gap: 30px;
    }

    .logo-wrapper img {
        width: 240px;
        height: 95px;
    }

    .gallery {
        gap: 16px;
        padding: 50px 40px 40px 40px;
    }
}

/*
--------------------------------------------------
8.4 Tablet verticale (≤ 768px)
--------------------------------------------------
*/
@media (max-width: 768px) {
    .site-header {
        padding: 30px 15px;
    }

    .logo-wrapper img {
        width: 250px !important;
        height: 110px !important;
        object-fit: cover;
        object-position: center;
    }

    .logo-wrapper img {
        width: 220px;
        height: auto;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        padding: 30px;
    }

   .intro {
       padding: 20px 30px 10px;
       max-width: 100%;
   }

   .gallery {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
   
   .gallery-item::after {
      display: none !important;
   }
   
   .gallery-item {
       padding: 30px 20px 25px;
   }
   
   .gallery img {
       width: 100%;
       height: 380px !important;
   }
}
