/* Reset CSS
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    background: linear-gradient(45deg, #190f2c, #200b30);
    padding: 15px;
}
*/
.grid-wrapper img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    display: inline-block;
}

/* Main CSS */
.grid-wrapper > div {
    display: flex;
    justify-content: center;
    align-items: center;
}
.grid-wrapper > div > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;

}

.grid-wrapper {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
}
.grid-wrapper .wide {
    grid-column: span 2;
}
.grid-wrapper .tall {
    grid-row: span 2;
}
.grid-wrapper .big {
    grid-column: span 2;
    grid-row: span 2;
}




/* fade in effect  + */
/* over effect */
.grid-wrapper img {
    opacity: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease-in,transform 0.3s ease-in-out;
}
.grid-wrapper > div:hover img {
    transform: scale(1.05);
}
.grid-wrapper > div {
    overflow: hidden; /* Prevents the scaled image from overlapping others awkwardly */
}
.grid-wrapper img.fade-in {
    opacity: 1;
}

/* popup */



.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95); /* Partenza con una leggera riduzione */
    transition: opacity 1.5s ease, visibility 0.5s ease, transform 0.5s ease;
}

.popup.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1); /* Ritorno alla dimensione normale */
}

.popup-content {
  position: relative;
  background: #fff;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  border-radius: 10px;
  overflow: auto;
}

.popup img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.popup-text h2 {
  margin: 10px 0;
  font-size: 2rem;
}

.popup-text p {
  margin: 10px 0;
  font-size: 1.2rem;
}

.popup-button {
  display: inline-block;
  padding: 10px 20px;
  background: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  margin-top: 10px;
}

.popup-button:hover {
  background: #0056b3;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #000;
  cursor: pointer;
}

.popup.visible {
  opacity: 1;
  visibility: visible;
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 2rem;
    padding: 15px;
    cursor: pointer;
    z-index: 1001;
    border-radius: 50%; /* Rende i pulsanti rotondi */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#popup-prev {
    left: -50px; /* Posiziona il pulsante a sinistra fuori dal contenitore */
}

#popup-next {
    right: -50px; /* Posiziona il pulsante a destra fuori dal contenitore */
}

.popup-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

