/* ==========================================================
   SOLO-GYM
   Gallery
========================================================== */

.sg-gallery {
    width: 100%;
    padding: 110px 0 130px;
    background: #0d0d0d;
    color: #fff;
}

.sg-gallery .sg-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}


/* ==========================================================
   HEADER
========================================================== */

.sg-gallery__header {
    max-width: 760px;
    margin: 0 auto 80px;
    text-align: center;
}

.sg-gallery__eyebrow {
    display: inline-block;
    margin-bottom: 18px;

    color: #eab308;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.sg-gallery__title {
    margin: 0;

    color: #fff;

    font-size: clamp(44px, 6vw, 76px);
    line-height: .98;
    font-weight: 800;
    letter-spacing: -.045em;
}

.sg-gallery__intro {
    max-width: 620px;
    margin: 25px auto 0;

    color: #999;

    font-size: 18px;
    line-height: 1.6;
}


/* ==========================================================
   SECTION HEADINGS
========================================================== */

.sg-gallery__photos,
.sg-gallery__videos {
    margin-top: 80px;
}

.sg-gallery__section-heading {
    display: flex;
    align-items: center;
    gap: 22px;

    margin-bottom: 28px;
}

.sg-gallery__section-heading::after {
    content: "";

    flex: 1;

    height: 1px;

    background: rgba(255, 255, 255, .14);
}

.sg-gallery__section-title {
    flex: 0 0 auto;

    margin: 0;

    color: #eab308;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}


/* ==========================================================
   PHOTO GRID
========================================================== */

.sg-gallery__grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}


/*
 * All photographs have the same visual frame.
 */

.sg-gallery__item {
    position: relative;

    min-width: 0;
    aspect-ratio: 4 / 3;

    margin: 0;

    overflow: hidden;

    background: #161616;

    cursor: zoom-in;
}


/*
 * Hidden photographs remain in the DOM.
 * They are therefore still available to gallery.js.
 */

.sg-gallery__item--hidden {
    display: none;
}


.sg-gallery__item img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .5s cubic-bezier(.2, .7, .2, 1),
        opacity .3s ease;
}


.sg-gallery__item:hover img,
.sg-gallery__item:focus img {
    transform: scale(1.035);
}


/*
 * Keyboard focus.
 */

.sg-gallery__item:focus-visible {
    outline: 2px solid #eab308;
    outline-offset: 3px;
}


/* ==========================================================
   "+ X DALŠÍCH"
========================================================== */

.sg-gallery__item--more {
    cursor: pointer;
}


.sg-gallery__more {
    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, .72),
            rgba(0, 0, 0, .58)
        );

    backdrop-filter: blur(2px);

    transition:
        background .3s ease,
        backdrop-filter .3s ease;
}

.sg-gallery__more:hover {
    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, .84),
            rgba(0, 0, 0, .68)
        );

    backdrop-filter: blur(4px);
}

.sg-gallery__more-count {
    display: block;

    margin-bottom: 6px;

    color: #fff;

    font-size: clamp(34px, 4vw, 52px);
    font-weight: 800;
    line-height: 1;

    letter-spacing: -.04em;
}


.sg-gallery__more-label {
    display: block;

    margin-top: 8px;

    color: #eab308;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
}


/* ==========================================================
   TOTAL COUNT
========================================================== */

.sg-gallery__count {
    margin-top: 16px;

    color: #666;

    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-align: center;
}


/* ==========================================================
   VIDEOS
========================================================== */

.sg-gallery__video-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 360px));

    justify-content: center;

    gap: 28px;
}


.sg-gallery__video {
    min-width: 0;
}


.sg-gallery__video-frame {
    position: relative;

    width: 100%;

    /*
     * Vertical YouTube Shorts.
     */

    aspect-ratio: 478 / 850;

    overflow: hidden;

    background: #111;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .42);
}


.sg-gallery__video-frame iframe {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;
}


/* ==========================================================
   LIGHTBOX
========================================================== */

.sg-gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px 80px;

    background: rgba(0, 0, 0, .94);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}


.sg-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}


.sg-gallery-lightbox__image {
    display: block;

    max-width: min(90vw, 1500px);
    max-height: 88vh;

    width: auto;
    height: auto;

    object-fit: contain;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, .65);

    user-select: none;
}


/* ==========================================================
   LIGHTBOX BUTTONS
========================================================== */

.sg-gallery-lightbox__button {
    position: absolute;

    z-index: 2;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;

    background: rgba(15, 15, 15, .72);

    color: #fff;

    font: inherit;
    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}


.sg-gallery-lightbox__button:hover {
    border-color: #eab308;

    background: #eab308;

    color: #111;
}


.sg-gallery-lightbox__close {
    top: 24px;
    right: 24px;
}


.sg-gallery-lightbox__prev {
    left: 24px;
}


.sg-gallery-lightbox__next {
    right: 24px;
}


.sg-gallery-lightbox__counter {
    position: absolute;

    left: 50%;
    bottom: 22px;

    transform: translateX(-50%);

    color: rgba(255, 255, 255, .65);

    font-size: 12px;
    letter-spacing: .12em;
}


body.sg-gallery-lightbox-open {
    overflow: hidden;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 900px) {

    .sg-gallery {
        padding: 80px 0 100px;
    }

    .sg-gallery .sg-container {
        width: min(100% - 32px, 700px);
    }

    .sg-gallery__header {
        margin-bottom: 60px;
    }

    .sg-gallery__intro {
        font-size: 16px;
    }

    .sg-gallery__photos,
    .sg-gallery__videos {
        margin-top: 60px;
    }

    .sg-gallery__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .sg-gallery__item {
        aspect-ratio: 4 / 3;
    }

    .sg-gallery__video-grid {
        grid-template-columns:
            repeat(2, minmax(0, 330px));

        gap: 20px;
    }

    .sg-gallery-lightbox {
        padding: 20px 55px;
    }

}

/* ==========================================================
   GALLERY – MORE OVERLAY
   ========================================================== */

.sg-gallery__item.sg-gallery__item--more {
    position: relative;
    overflow: hidden;
}


.sg-gallery__item.sg-gallery__item--more .sg-gallery__more {
    position: absolute !important;
    inset: 0 !important;

    z-index: 10 !important;

    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100% !important;
    height: 100% !important;

    margin: 0;
    padding: 20px;

    border: 0;

    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, .76),
            rgba(0, 0, 0, .58)
        ) !important;

    color: #fff;

    cursor: pointer;

    opacity: 1 !important;
    visibility: visible !important;

    box-sizing: border-box;

    transition:
        background .3s ease,
        backdrop-filter .3s ease;
}


.sg-gallery__item.sg-gallery__item--more
.sg-gallery__more:hover {

    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, .88),
            rgba(0, 0, 0, .68)
        ) !important;

    backdrop-filter: blur(4px);
}


.sg-gallery__item.sg-gallery__item--more
.sg-gallery__more-count {

    display: block;

    margin: 0 0 8px;

    color: #fff;

    font-size: clamp(36px, 4vw, 54px);
    font-weight: 800;
    line-height: 1;

    letter-spacing: -.04em;
}


.sg-gallery__item.sg-gallery__item--more
.sg-gallery__more-label {

    display: block;

    margin: 0;

    color: #eab308;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: .18em;
    text-transform: uppercase;
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 600px) {

    .sg-gallery {
        padding: 65px 0 80px;
    }

    .sg-gallery .sg-container {
        width: calc(100% - 24px);
    }

    .sg-gallery__header {
        margin-bottom: 50px;
    }

    .sg-gallery__eyebrow {
        margin-bottom: 14px;
    }

    .sg-gallery__title {
        font-size: 43px;
    }

    .sg-gallery__intro {
        margin-top: 20px;

        font-size: 15px;
        line-height: 1.55;
    }


    .sg-gallery__photos,
    .sg-gallery__videos {
        margin-top: 50px;
    }


    .sg-gallery__section-heading {
        gap: 14px;

        margin-bottom: 18px;
    }


    .sg-gallery__section-title {
        font-size: 11px;
    }


    .sg-gallery__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 5px;
    }


    .sg-gallery__item {
        aspect-ratio: 4 / 3;
    }


    .sg-gallery__more-count {
        font-size: 34px;
    }


    .sg-gallery__more-label {
        font-size: 9px;
    }


    .sg-gallery__count {
        margin-top: 12px;

        font-size: 10px;
    }


    /*
     * Videos one below another.
     */

    .sg-gallery__video-grid {
        grid-template-columns:
            minmax(0, 330px);

        gap: 20px;
    }


    .sg-gallery-lightbox {
        padding: 15px 10px;
    }


    .sg-gallery-lightbox__image {
        max-width: 94vw;
        max-height: 82vh;
    }


    .sg-gallery-lightbox__button {
        width: 42px;
        height: 42px;

        font-size: 21px;
    }


    .sg-gallery-lightbox__close {
        top: 12px;
        right: 12px;
    }


    .sg-gallery-lightbox__prev {
        left: 8px;
    }


    .sg-gallery-lightbox__next {
        right: 8px;
    }


    .sg-gallery-lightbox__counter {
        bottom: 16px;

        font-size: 10px;
    }


    .sg-gallery__item.sg-gallery__item--more
    .sg-gallery__more-count {

        font-size: 32px;
    }

    .sg-gallery__item.sg-gallery__item--more
    .sg-gallery__more-label {

        font-size: 9px;
        letter-spacing: .14em;
    }
}