/*==================================================
    GALLERY.CSS
    Mikster Kast Gallery v2.0.1
    
    made by Miguel Castro
==================================================*/


/*==================================================
    GALLERY VARIABLES
==================================================*/

:root{

    --gallery-thumb-size:240px;

    --gallery-thumb-tablet:190px;

    --gallery-thumb-mobile:260px;

    --gallery-gap:40px;

    --gallery-radius:8px;

    --gallery-border:3px;

    --gallery-padding:10px;

}


/*==================================================
    1. GALERIA
==================================================*/

#galleryGrid{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            var(--gallery-thumb-size)
        );

    justify-content:center;

    gap:var(--gallery-gap);

    margin:30px auto 40px auto;

    width:100%;

}


/*==================================================
    2. CARD
==================================================*/

.galleryCard{

    display:flex;

    flex-direction:column;

    align-items:center;

    cursor:pointer;

    user-select:none;

    transition:
        transform .25s ease,
        filter .25s ease;

}

.galleryCard:hover{

    transform:translateY(-6px);

    filter:brightness(1.05);

}


/*==================================================
    3. IMAGEM
==================================================*/

.galleryCard img{

    width:var(--gallery-thumb-size);

    height:var(--gallery-thumb-size);

    object-fit:contain;

    object-position:center;

    pointer-events:none;

    display:block;

    background:var(--container);

    border:
        var(--gallery-border)
        solid
        var(--outline);

    border-radius:var(--gallery-radius);

    padding:var(--gallery-padding);

    box-sizing:border-box;

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;

}

.galleryCard:hover img{

    transform:scale(1.02);

    border-color:var(--text);

    box-shadow:
        0 0 18px rgba(0,0,0,.25);

}


/*==================================================
    4. TEXTO
==================================================*/

.cardInfo{

    width:var(--gallery-thumb-size);

    margin-top:15px;

    text-align:center;

    overflow-wrap:anywhere;

}

.cardInfo h3{

    color:var(--text);

    font-size:1.15rem;

    margin-bottom:8px;

}

.cardInfo p{

    color:var(--text);

    opacity:.8;

    font-size:.92rem;

    line-height:1.4em;

}


/*==================================================
    5. VIEWER
==================================================*/

#viewer{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.88);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:9999;

    opacity:1;

    transition:opacity .2s ease;

}

#viewer.hidden{

    display:none;

}


/*==================================================
    6. PAINEL
==================================================*/

.viewerContent{

    position:relative;

    display:flex;

    flex-direction:column;

    align-items:center;

    background:var(--container);

    border:4px solid var(--outline);

    border-radius:10px;

    padding:30px;

    max-width:90vw;

    max-height:90vh;

    overflow:auto;

}


/*==================================================
    7. IMAGEM GRANDE
==================================================*/

#viewerImage{

    max-width:80vw;

    max-height:70vh;

    object-fit:contain;

}


/*==================================================
    8. INFORMAÇÕES
==================================================*/

.viewerInfo{

    width:100%;

    text-align:center;

    margin-top:25px;

}

.viewerInfo h2{

    color:var(--text);

    font-size:2rem;

    margin-bottom:15px;

}

.viewerInfo p{

    color:var(--text);

    opacity:.9;

    margin:8px 0;

}


/*==================================================
    9. FECHAR
==================================================*/

#closeViewer{

    position:absolute;

    top:15px;

    right:20px;

    color:var(--text);

    font-size:42px;

    cursor:pointer;

    transition:.2s;

    background:none;

    border:none;

    padding:0;

    font-family:inherit;
}

#closeViewer:hover{

    transform:scale(1.15);

}


/*==================================================
    10. BOTÕES (FUTURO)
==================================================*/

.viewerButton{

    position:absolute;

    top:50%;

    transform:translateY(-50%);

    width:55px;

    height:55px;

    border:none;

    border-radius:50%;

    background:var(--container);

    color:var(--text);

    border:2px solid var(--outline);

    cursor:pointer;

    transition:.2s;

}

.viewerButton:hover{

    transform:
        translateY(-50%)
        scale(1.08);

}

.viewerPrev{

    left:20px;

}

.viewerNext{

    right:20px;

}


/*==================================================
    11. ANIMAÇÕES
==================================================*/

.galleryCard{

    animation:fadeUp .35s ease;

}

@keyframes fadeUp{

    from{

        opacity:0;

        transform:translateY(15px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}


/*==================================================
    12. RESPONSIVO
==================================================*/

@media(max-width:900px){

    :root{

        --gallery-thumb-size:
            var(--gallery-thumb-tablet);

    }

}

@media(max-width:600px){

    #galleryGrid{

        grid-template-columns:1fr;

    }

    :root{

        --gallery-thumb-size:
            var(--gallery-thumb-mobile);

    }

}