/* Applicazione box-sizing a tutti gli elementi */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-image: url("../imgs/stars 1.gif");
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Cambiato da center a flex-start */
    height: 100vh;
    margin: 0;
    overflow-x: hidden; /* Evita che l'overflow orizzontale causi problemi */
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px;
    max-width: 100%; /* Limita la larghezza per evitare overflow */
    max-height: 100vh; /* Limita l'altezza totale della galleria */
    overflow-y: auto; /* Permette lo scorrimento verticale se necessario */
    overflow-x: hidden; /* Evita lo scorrimento orizzontale */
}

.thumbnail {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /*max-width: 100px;*/
    /*max-height: 100px;*/
}

.thumbnail img {
    width: 100%;
    height: auto;
    max-width: 100%; 
    max-height: 100%; 
    border-radius: 10px;
    transition: transform 0.2s;
}

.thumbnail img:hover {
    transform: scale(1.1);
}

/* Stili per il modale */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
