/* Stili per la lightbox */
.slide {
  cursor: pointer;
}

.custom-lightbox {
    /* Proprietà fondamentali per il posizionamento */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);

    /* Proprietà per la visualizzazione e transizione */
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Stato attivo per la transizione di apertura */
.custom-lightbox.is-open {
    opacity: 1;
}

.lightbox-header,
.lightbox-footer {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
    min-height: 4rem;
}

.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    justify-content: center;
}

.lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    justify-content: space-evenly;
}

.lightbox-title {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.lightbox-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    right: 2rem;
    z-index: 1002;
    transition: color 0.3s;
    width: 3rem;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-body {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    height: calc(100% - 8rem);
}

.lightbox-body img {
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 4rem);
  object-fit: contain;
  opacity: 0;
  /*transform: scale(0.25);*/
  transition: opacity 1s ease-in-out;
  border-radius: 1.5rem;
}

/* Stato attivo per la transizione dell'immagine */
.lightbox-body img.is-loaded {
    opacity: 1;
    /*transform: scale(1);*/
}

/* Stili per i pulsanti di navigazione e il contatore */
.lightbox-prev-btn,
.lightbox-next-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
    width: 3rem;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-prev-btn:hover,
.lightbox-next-btn:hover {
    color: #ccc;
}

.lightbox-counter {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 500;
    text-align: center;
    min-width: 4rem;
}

@media (max-width: 768px) {
    .lightbox-prev-btn,
    .lightbox-next-btn {
        font-size: 1.5rem;
    }

    .lightbox-counter {
        font-size: 1rem;
    }
}