.gg-container {
    --main-color: rgba(255,255,255,0.8);
    --secondary-color: #fff;
    --txt-color: #000;
    --img-bg-color: linear-gradient(rgba(166, 179, 210, 0.9), rgba(227, 231, 241, 0.7));
    --backdrop-color: rgba(0,0,0,0.8);
    --gap-length: calc(14px + 2vw);
    --row-height: calc(160px + 4vw);
    --column-width: calc(180px + 4vw);
}

.gg-container *[data-theme="dark"] {
    --main-color: #ddd;
    --secondary-color: #eee;
    --txt-color: #111;
    --img-bg-color: rgba(20,20,20,0.9);
    --backdrop-color: rgba(30,30,30,0.9)
}

.gg-box {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(var(--column-width),1fr));
    grid-auto-rows: var(--row-height);
    grid-gap: var(--gap-length);
    margin: 20px 0
}

.gg-box img, .gg-box video {
    object-fit: cover;
    cursor: pointer;
    width: 100%;
    height: 100%;
    background: var(--img-bg-color);
    transition: 0.5s;
    border-radius: calc(10px + 1.5vw);
    filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, 0.4));
    position: relative;
}

.gg-box img:hover, .gg-box video:hover {
    transform: scale(1.05) !important;
    transition: 0.5s;
    opacity: 0.8 !important;
}

.gg-box img.clicked, .gg-box video.clicked {
    transition: 0.5s !important;
}

.gg-box video:fullscreen {
    opacity: 1 !important;
    border-radius: 0;
    transition: 0.5s;
    object-fit: contain;
    background: var(--backdrop-color);
}

#gg-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: var(--backdrop-color);
    z-index: 999999;
    text-align: center;
    transition: 0.5s;
}

#gg-screen .gg-image {
    height: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center
}

#gg-screen .gg-image img {
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto
}

.gg-btn {
    width: 35px;
    height: 35px;
    background: var(--main-color);
    color: var(--txt-color);
    text-align: center;
    line-height: 35px;
    cursor: pointer;
    -moz-transition: all .5s ease;
    -o-transition: all .5s ease;
    -webkit-transition: all .5s ease;
    transition: all .5s ease;
    font-size: 20px;
    box-sizing: border-box;
    padding-left: 2px;
    position: fixed;
    bottom: 10px
}

.gg-btn:hover {
    background: var(--secondary-color);
    color: var(--accent);
}

.gg-close {
    top: 10px
}

.gg-close, .gg-next {
    right: 10px
}

.gg-prev {
    right: 50px
}

.gg-prev, .gg-next {
    bottom: 10px
}

@media(min-width:478px) {
    .gg-box img:nth-child(2n):not(:last-of-type) {
        grid-row-end: span 2
    }

    [data-layout="horizontal"] img:nth-child(2n):not(:last-of-type) {
        grid-column-end: span 2;
        grid-row-end: span 1
    }

    [data-layout="square"] img:nth-child(2n):not(:last-of-type) {
        grid-row-end: span 1;
        grid-column-end: span 1
    }
}

@media(max-width:625px) {
    .gg-box {
        grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
        grid-auto-rows: calc(calc(200px + 5vw) - 10vh);
        margin: 10px 0
    }
}

@media(max-width:480px) {
    .gg-box {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
}
