.gallery-section {
    position: relative;
    padding-block:
        var(--gallery-padding-top)
        var(--gallery-padding-bottom);
    color: var(--gallery-text);
    background: var(--gallery-bg);
    overflow: hidden;
}

.gallery-section__container {
    margin-inline: auto;
}

.gallery-section__container--narrow {
    width: min(calc(100% - 48px), 960px);
}

.gallery-section__container--normal {
    width: min(calc(100% - 48px), 1240px);
}

.gallery-section__container--wide {
    width: min(calc(100% - 48px), 1600px);
}

.gallery-section__container--full {
    width: 100%;
}

.gallery-section__heading {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(260px, .8fr);
    gap: 60px;
    align-items: end;
    margin-bottom: clamp(40px, 7vw, 88px);
}

.gallery-section__heading > div > span {
    display: block;
    margin-bottom: 17px;
    color: var(--gallery-accent);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.gallery-section__heading h2 {
    max-width: 920px;
    margin: 0;
    font-size: clamp(28px, 6.5vw, 34px);
    font-weight: 520;
    letter-spacing: -.07em;
    line-height: .9;
}

.gallery-section__heading p {
    max-width: 520px;
    margin: 0 0 5px auto;
    color: color-mix(
        in srgb,
        var(--gallery-text) 65%,
        transparent
    );
    font-size: 14px;
    line-height: 1.75;
}

.gallery-section__grid {
    display: grid;
    gap: var(--gallery-gap);
}

.gallery-card {
    position: relative;
    min-width: 0;
    margin: 0;
}

.gallery-card__button {
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    color: #fff;
    background: #dad8d2;
    border: 0;
    border-radius: var(--gallery-radius);
    cursor: pointer;
}

.gallery-card__button picture {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-card__button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 700ms cubic-bezier(.2, .72, .2, 1),
        filter 400ms ease;
}

.gallery-card__button:hover img {
    transform: scale(1.025);
}

.gallery-card__open {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #191917;
    background: rgb(255 255 255 / 92%);
    border-radius: 50%;
    opacity: 0;
    transform: scale(.85);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.gallery-card__open svg {
    width: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.gallery-card__button:hover
.gallery-card__open {
    opacity: 1;
    transform: scale(1);
}

.gallery-card figcaption {
    display: grid;
    gap: 5px;
    padding-top: 13px;
}

.gallery-card figcaption strong {
    font-size: 12px;
    font-weight: 650;
}

.gallery-card figcaption span {
    color: color-mix(
        in srgb,
        var(--gallery-text) 57%,
        transparent
    );
    font-size: 11px;
    line-height: 1.55;
}

/*
|--------------------------------------------------------------------------
| Dengeli grid
|--------------------------------------------------------------------------
*/

.gallery-section--grid .gallery-section__grid {
    grid-template-columns:
        repeat(
            var(--gallery-desktop-columns),
            minmax(0, 1fr)
        );
}

.gallery-section--grid .gallery-card__button {
    height: var(--gallery-height);
}

/*
|--------------------------------------------------------------------------
| Editoryal mozaik
|--------------------------------------------------------------------------
*/

.gallery-section--mosaic .gallery-section__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
}

.gallery-section--mosaic .gallery-card {
    grid-column: span 4;
}

.gallery-section--mosaic .gallery-card__button {
    height: calc(var(--gallery-height) * .78);
}

.gallery-section--mosaic .gallery-card:nth-child(7n + 1) {
    grid-column: span 8;
    grid-row: span 2;
}

.gallery-section--mosaic
.gallery-card:nth-child(7n + 1)
.gallery-card__button {
    height: calc(
        (var(--gallery-height) * .78 * 2)
        + var(--gallery-gap)
    );
}

.gallery-section--mosaic .gallery-card:nth-child(7n + 4),
.gallery-section--mosaic .gallery-card:nth-child(7n + 5) {
    grid-column: span 6;
}

.gallery-section--mosaic
.gallery-card:nth-child(7n + 4)
.gallery-card__button,
.gallery-section--mosaic
.gallery-card:nth-child(7n + 5)
.gallery-card__button {
    height: var(--gallery-height);
}

/*
|--------------------------------------------------------------------------
| Yatay akış
|--------------------------------------------------------------------------
*/

.gallery-section--horizontal .gallery-section__grid {
    grid-template-columns: 1fr;
}

.gallery-section--horizontal .gallery-card__button {
    height: clamp(
        360px,
        52vw,
        calc(var(--gallery-height) * 1.25)
    );
}

.gallery-section--horizontal .gallery-card:nth-child(even) {
    width: min(82%, 1250px);
    margin-left: auto;
}

.gallery-section--horizontal .gallery-card:nth-child(odd) {
    width: min(90%, 1400px);
}

/*
|--------------------------------------------------------------------------
| Film şeridi
|--------------------------------------------------------------------------
*/

.gallery-section--filmstrip
.gallery-section__container {
    width: 100%;
}

.gallery-section--filmstrip
.gallery-section__heading {
    width: min(calc(100% - 48px), 1600px);
    margin-inline: auto;
}

.gallery-section--filmstrip .gallery-section__grid {
    display: flex;
    gap: var(--gallery-gap);
    padding-inline: max(
        24px,
        calc((100vw - 1600px) / 2)
    );
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-section--filmstrip
.gallery-section__grid::-webkit-scrollbar {
    display: none;
}

.gallery-section--filmstrip .gallery-card {
    width: min(72vw, 720px);
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.gallery-section--filmstrip .gallery-card:nth-child(even) {
    width: min(52vw, 510px);
}

.gallery-section--filmstrip .gallery-card__button {
    height: var(--gallery-height);
}

/*
|--------------------------------------------------------------------------
| Lightbox
|--------------------------------------------------------------------------
*/

html.has-gallery-lightbox,
body.has-gallery-lightbox {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 90px;
    align-items: center;
    color: #fff;
    visibility: hidden;
    opacity: 0;
    transition:
        opacity 260ms ease,
        visibility 260ms ease;
}

.gallery-lightbox.is-open {
    visibility: visible;
    opacity: 1;
}

.gallery-lightbox__backdrop {
    appearance: none;
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgb(10 10 9 / 96%);
    border: 0;
    cursor: zoom-out;
}

.gallery-lightbox__top {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 24px 28px;
    pointer-events: none;
}

.gallery-lightbox__top > span {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .12em;
}

.gallery-lightbox__close {
    appearance: none;
    position: relative;
    width: 42px;
    height: 42px;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    pointer-events: auto;
}

.gallery-lightbox__close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 1px;
    background: currentColor;
}

.gallery-lightbox__close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.gallery-lightbox__close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.gallery-lightbox__stage {
    position: relative;
    grid-column: 2;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100vh;
    padding: 80px 20px 100px;
}

.gallery-lightbox__stage > img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    opacity: 0;
    transform: scale(.985);
    transition:
        opacity 240ms ease,
        transform 400ms cubic-bezier(.2, .72, .2, 1);
}

.gallery-lightbox.is-loaded
.gallery-lightbox__stage > img {
    opacity: 1;
    transform: scale(1);
}

.gallery-lightbox__caption {
    position: absolute;
    bottom: 28px;
    left: 50%;
    width: min(calc(100% - 40px), 720px);
    text-align: center;
    transform: translateX(-50%);
}

.gallery-lightbox__caption strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 650;
}

.gallery-lightbox__caption p {
    margin: 0;
    color: rgb(255 255 255 / 58%);
    font-size: 11px;
    line-height: 1.55;
}

.gallery-lightbox__caption strong:empty,
.gallery-lightbox__caption p:empty {
    display: none;
}

.gallery-lightbox__navigation {
    appearance: none;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: auto;
    color: #fff;
    background: transparent;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 50%;
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease;
}

.gallery-lightbox__navigation:hover {
    color: #111;
    background: #fff;
}

.gallery-lightbox__navigation svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.gallery-lightbox__navigation--previous {
    grid-column: 1;
}

.gallery-lightbox__navigation--next {
    grid-column: 3;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 980px) {
    .gallery-section__heading {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .gallery-section__heading p {
        margin-left: 0;
    }

    .gallery-section--grid .gallery-section__grid {
        grid-template-columns:
            repeat(
                var(--gallery-tablet-columns),
                minmax(0, 1fr)
            );
    }

    .gallery-section--mosaic .gallery-card,
    .gallery-section--mosaic .gallery-card:nth-child(n) {
        grid-column: span 6;
        grid-row: auto;
    }

    .gallery-section--mosaic
    .gallery-card:nth-child(n)
    .gallery-card__button {
        height: var(--gallery-height);
    }

    .gallery-lightbox {
        grid-template-columns: 64px minmax(0, 1fr) 64px;
    }

    .gallery-lightbox__navigation {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 650px) {
    .gallery-section__container--narrow,
    .gallery-section__container--normal,
    .gallery-section__container--wide {
        width: calc(100% - 28px);
    }

    .gallery-section__heading h2 {
        font-size: clamp(26px, 15vw, 32px);
    }

    .gallery-section--grid .gallery-section__grid {
        grid-template-columns:
            repeat(
                var(--gallery-mobile-columns),
                minmax(0, 1fr)
            );
    }

    .gallery-section--grid .gallery-card__button {
        height: min(var(--gallery-height), 120vw);
    }

    .gallery-section--mosaic .gallery-section__grid {
        grid-template-columns: 1fr;
    }

    .gallery-section--mosaic .gallery-card,
    .gallery-section--mosaic .gallery-card:nth-child(n) {
        grid-column: auto;
    }

    .gallery-section--mosaic
    .gallery-card:nth-child(n)
    .gallery-card__button {
        height: min(var(--gallery-height), 118vw);
    }

    .gallery-section--horizontal .gallery-card:nth-child(n) {
        width: 100%;
    }

    .gallery-section--horizontal .gallery-card__button {
        height: 112vw;
        max-height: 560px;
    }

    .gallery-section--filmstrip
    .gallery-section__heading {
        width: calc(100% - 28px);
    }

    .gallery-section--filmstrip
    .gallery-section__grid {
        padding-inline: 14px;
    }

    .gallery-section--filmstrip .gallery-card,
    .gallery-section--filmstrip
    .gallery-card:nth-child(even) {
        width: 84vw;
    }

    .gallery-section--filmstrip .gallery-card__button {
        height: 112vw;
        max-height: 560px;
    }

    .gallery-card__open {
        top: 12px;
        right: 12px;
        opacity: 1;
        transform: scale(1);
    }

    .gallery-lightbox {
        display: block;
    }

    .gallery-lightbox__stage {
        height: 100dvh;
        padding: 75px 14px 110px;
    }

    .gallery-lightbox__stage > img {
        max-height: calc(100dvh - 205px);
    }

    .gallery-lightbox__navigation {
        position: absolute;
        z-index: 4;
        bottom: 30px;
    }

    .gallery-lightbox__navigation--previous {
        left: 20px;
    }

    .gallery-lightbox__navigation--next {
        right: 20px;
    }

    .gallery-lightbox__caption {
        bottom: 36px;
        width: calc(100% - 150px);
    }

    .gallery-lightbox__top {
        padding: 15px 16px;
    }
}