.custom-gallery-container {
    display: flex;
    width: 100%;
    font-family: Arial, sans-serif;
}

.custom-gallery-sidebar {
    width: 30%;
    padding: 20px;
    background-color: #000000;
    overflow-y: auto;
}

.custom-gallery-content {
    width: 70%;
    overflow-y: auto;
    padding: 20px;
}

.group-item {
    margin-bottom: 0px;
}

.group-name {
    color: #fffbee !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin-bottom: 0 !important;
    text-transform: uppercase;
}

.project-item {
    padding: 0px;
    cursor: pointer;
    margin-bottom: 0px;
    border-radius: 4px;
}



.project-item.active {
    background-color: #000000;
    color: white;
}

.project-name {
    color: #fffbee;
    margin: 0;
    margin-bottom: 0 !important;
    text-transform: capitalize;
}

.media-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px 20px;
}

.media-container{
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px 2% ;
}

.media-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 9 / 16;
    flex: 0 1 32%;
}


.media-item img, .media-item video {
   width: 100%;
    height: auto !important;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 9 / 16;
    transition: transform 0.3s ease;
}

.media-item:hover img, .media-item:hover video {
    transform: scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 40px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.load-more-container {
    text-align: center;
    margin: 20px 0;
}

.load-more-btn {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.load-more-btn:hover {
    background-color: #005a87;
}

/* Lightbox Styles */
.custom-gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lightbox-content {
    position: relative;
    width: 80%;
    aspect-ratio: 200 / 367;
    height: 80%;
    margin: 5% auto;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0;
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 10;
}

.lightbox-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media-container img, 
.lightbox-media-container video {
    max-height: 100%;
    width: 100%;
    height: 100% !important;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.lightbox-prev, .lightbox-next {
    font-size: 50px;
    color: white;
    cursor: pointer;
    padding: 0 20px;
    pointer-events: auto;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: #0073aa;
}

.lightbox-media-container iframe{
    width: 100%;
    height: 100%;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    object-position: center;
}

.custom-gallery-button-panel{
    display: none;
}

.custom-gallery-sidebar-btn-close{
    display: none;
}

.group-signal{
    display: none;
}

@media (max-width: 769px){
    .custom-gallery-button-panel{
        display: flex;
        flex-wrap: nowrap;
        align-content: center;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 10px 10px 20px 10px;
    }

    .custom-gallery-button-panel-btn{
        display: block;;
        color: #fffbee;
        font-size: 18px;
        padding: 5px 10px;
        border: 4px solid #fffbee;
        line-height: 1;
        display: block;
        position: relative;
    }

    .custom-gallery-sidebar{
        position: fixed;
        top: 0;
        left: 0;
        z-index: 99;
        width: 100%;
        height: 100dvh;
        padding: 0;
        transform: translateX(-400%);
        -webkit-transition: all 500ms ease-out;
        -moz-transition: all 500ms ease-out;
        -ms-transition: all 500ms ease-out;
        -o-transition: all 500ms ease-out;
        transition: all 500ms ease-out;
    }

        .custom-gallery-sidebar-activo{
            transform: translateX(0%);
        }

    .custom-gallery-content{
        width: 100%;
        padding: 0;
    }

    .custom-gallery-sidebar-btn-close{
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        color: #fffbee;
        font-size: 30px;
        line-height: 1;
        font-weight: 300;
        z-index: 2;
    }
/*     .projects-list{
        height: 0;
        opacity: 0;
        visibility: hidden;
        -webkit-transition: all 500ms ease-out;
        -moz-transition: all 500ms ease-out;
        -ms-transition: all 500ms ease-out;
        -o-transition: all 500ms ease-out;
        transition: all 500ms ease-out;

    }*/
    .projects-list-active{
        
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-content: flex-start;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 15px;
    }
 


    .projects-list {
        height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
    }

    /* Animación de APERTURA (height primero, luego opacity/visibility) */
    .projects-list.projects-list-active {
        animation: openAnimation 500ms ease-out forwards;
    }

    @keyframes openAnimation {
        0% {
            height: 0;
            opacity: 0;
            visibility: hidden;
            padding-left: 0px;
        }
        50% {
            height: 100px; /* Altura intermedia (ajústala) */
            opacity: 0;
            visibility: hidden;
            padding-left: 60px;
        }
        100% {
            height: auto; /* Altura final (puede ser "auto" o un valor fijo) */
            opacity: 1;
            visibility: visible;
            padding-left: 60px;
        }
    }

    /* Animación de CIERRE (opacity/visibility primero, luego height) */
    .projects-list:not(.projects-list-active) {
        animation: closeAnimation 500ms ease-out forwards;
    }

    @keyframes closeAnimation {
        0% {
            height: auto;
            opacity: 1;
            visibility: visible;
            padding-left: 60px;
        }
        50% {
            height: 100px; /* Misma altura que en apertura */
            opacity: 0;
            visibility: hidden;
            padding-left: 0px;
        }
        100% {
            height: 0;
            opacity: 0;
            visibility: hidden;
            padding-left: 0px;
        }
    }


    .custom-gallery-sidebar-cont{
        position: absolute;
        z-index: 1;
        width: 100%;
        top: 90px;
    }
    .group-name{
        padding: 20px;
        width: 98%;
        text-align: left;
        margin: 0 auto;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: center;
        justify-content: space-between;
        align-items: center;
    }

    .group-name-title{
        max-width: 90%;
        text-align: left;
        width: 100%;
    }

    .group-name-underline{
        content: '';
        width: 100%;
        height: 1px;
        background-color: #fffbee;
        position: relative;
        bottom: -20px;
        left: 0;
        transform: scale(100%);
        -webkit-transition: all 500ms ease-out;
        -moz-transition: all 500ms ease-out;
        -ms-transition: all 500ms ease-out;
        -o-transition: all 500ms ease-out;
        transition: all 500ms ease-out;
    }

    .group-name-underline-active {
        transform: scale(0);
    }

    .group-signal{
        display: block;
        font-size: 20px;
        line-height: 1;
    }
}