@import '../css/resources/variables.css';
@import '../css/resources/style_reset.css';
@import '../css/resources/components.css';

/* --------------
Helpers
-------------- */
div img {
    width: 100%;
}

button {
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.body--block-scroll {
    overflow: hidden;
}

.modal-lightbox--show {
    opacity: 1;
    pointer-events: unset;
    transition: opacity .5s;
}
/* -------------- */

/* --------------
Main Section
-------------- */
main {
    position: relative;
    transition: background-color 0.5s ease-in-out;
}
/* -------------- */

/* --------------
switch Section
-------------- */
.switch-container {
    position: fixed;
    top: 30px;
    right: 5%;
    display: grid;
    gap: 12px;
    z-index: 5;
}

.switch {
    position: relative;
    display: flex;
    width: 210px;
    height: 50px;
    padding: 5px;
    border-radius: 15px;
    background-color: var(--gris-amara);
}

.switch button {
    width: 100px;
    position: relative;
    z-index: 1;
    transition: color 0.5s var(--anim-movement);
}

.switch__selector {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 100px;
    height: 40px;
    border-radius: 10px;
    transition: transform 0.5s var(--anim-movement);
}
/* -------------- */

/* --------------
Galeria Section
-------------- */
.gallery__container {
    width: 90%;
    min-height: 150vh;
    margin: 0 auto;
    columns: 3 333.33px;
    column-gap: 1em;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    position: relative;
}

.gallery__container--loading {
    opacity: 0;
}

.gallery__container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: transparent;
    z-index: -1;
}

.gallery__item {
    position: relative;
    margin-bottom: 1em;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.gallery__item:nth-child(1) { animation-delay: 0.1s; }
.gallery__item:nth-child(2) { animation-delay: 0.2s; }
.gallery__item:nth-child(3) { animation-delay: 0.3s; }
.gallery__item:nth-child(4) { animation-delay: 0.4s; }
.gallery__item:nth-child(5) { animation-delay: 0.5s; }
.gallery__item:nth-child(6) { animation-delay: 0.6s; }
.gallery__item:nth-child(7) { animation-delay: 0.7s; }
.gallery__item:nth-child(8) { animation-delay: 0.8s; }
.gallery__item:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item__poster {
    display: block;
    transition: transform .4s var(--anim-movement);
}

.gallery-item__title-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.49) 100%);
}

.gallery-item__title-container {
    padding: 1.3em;
}

.gallery-item__title {
    line-height: 2.2rem;
}
/* -------------- */

/* --------------
Lightbox Section
-------------- */
.gallery-lightbox__container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 6;
}

.modal-lightbox--show {
    opacity: 1;
    pointer-events: unset;
    transition: opacity .5s;
}

.glide {
    width: 85%;
    max-width: 1920px;
    margin: 0 auto;
}

.glide__slide {
    position: relative;
}

.glide__img {
    border-radius: 1.57rem;
}

.glide__arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    transform: translateY(-50%);
}

.glide__arrow {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--gris-amara);
}

.glide__arrow img {
    width: 34%;
}

.glide__arrow--left img {
    margin-right: 7%;
    transform: rotateZ(180deg);
}

.glide__arrow--right img {
    margin-left: 7%;
}

.lightbox__header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
}

.lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5%;
    max-width: 40px;
    min-width: 20px;
}

.lightbox__close img {
    display: block;
}
/* -------------- */

/* ---------------------
Media Queries
---------------------- */
@media screen and (max-width: 1024px) {
    .gallery__container {
        columns: 2 250px;
    }
}

@media screen and (max-width: 700px) {
    /* --------------
    switch Section
    -------------- */
    .switch-container {
        top: 65px;
        right: 3%;
    }
    /* -------------- */

.gallery__container {
        columns: 1 300px;
        width: 95%;
    }

    .gallery__item:nth-child(n) { 
        animation-delay: calc(0.1s * var(--item-index, 1)); 
    }

    .glide {
        width: 90%;
        height: 90vh;
        max-width: 1920px;
        margin: 0 auto;
    }

    .glide__track,
    .glide__slides,
    .glide__slide {
        height: 100%;
    }

    .glide__img {
        height: 100%;
        object-fit: cover;
    }

    .glide__arrow {
        width: 45px;
        height: 45px;
    }
}
/* ------------------- */

/* ---------------------
Interactuables
---------------------- */
.gallery__item:hover img {
    transform: scale(1.15);
}

.gallery__item:hover {
    outline: 2px solid var(--blaco-amara);
}
/* ------------------- */