/* Фотогалерея обучения. Только #education-gallery. */
#education-gallery {
    scroll-margin-top: 112px;
}

.edu-gal,
.edu-gal *,
.edu-gal *::before,
.edu-gal *::after {
    box-sizing: border-box;
}

.edu-gal {
    margin: 0;
    padding: 52px 0 56px;
    background: #ffffff;
    color: #292929;
    font-family: inherit;
}

.edu-gal__inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.edu-gal__eyebrow {
    margin: 0;
    color: #856438;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.edu-gal__title {
    margin: 12px 0 0;
    max-width: 16em;
    color: #292929;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.12;
    text-wrap: balance;
}

.edu-gal__lead {
    margin: 14px 0 0;
    max-width: 46rem;
    color: #666666;
    font-size: 16px;
    line-height: 1.6;
}

.edu-gal__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.edu-gal__item {
    min-width: 0;
}

.edu-gal__shot {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f1ea;
    color: #ffffff;
    cursor: pointer;
}

.edu-gal__shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 180ms ease;
}

.edu-gal__shade,
.edu-gal__zoom {
    position: absolute;
    pointer-events: none;
}

.edu-gal__shade {
    inset: 0;
    background: rgba(41, 41, 41, 0.28);
    opacity: 0;
    transition: opacity 180ms ease;
}

.edu-gal__zoom {
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 180ms ease;
}

.edu-gal__zoom svg {
    width: 22px;
    height: 22px;
}

.edu-gal__shot:hover img,
.edu-gal__shot:focus-visible img {
    transform: scale(1.03);
}

.edu-gal__shot:hover .edu-gal__shade,
.edu-gal__shot:focus-visible .edu-gal__shade,
.edu-gal__shot:hover .edu-gal__zoom,
.edu-gal__shot:focus-visible .edu-gal__zoom {
    opacity: 1;
}

.edu-gal__shot:focus-visible,
.edu-gal__more:focus-visible,
.edu-gal__close:focus-visible,
.edu-gal__nav:focus-visible,
.edu-gal__thumb:focus-visible {
    outline: 2px solid #292929;
    outline-offset: 3px;
}

.edu-gal__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 20px;
    padding: 0 22px;
    border: 1px solid #856438;
    border-radius: 12px;
    background: transparent;
    color: #856438;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.edu-gal__more:hover {
    background: #f5f1ea;
    color: #6d502c;
}

.edu-gal__dialog[hidden] {
    display: none;
}

.edu-gal__dialog {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 16px 20px;
    background: #292929;
    color: #ffffff;
}

.edu-gal__close,
.edu-gal__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.edu-gal__close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.edu-gal__close svg,
.edu-gal__nav svg {
    width: 22px;
    height: 22px;
}

.edu-gal__close:focus-visible,
.edu-gal__nav:focus-visible,
.edu-gal__thumb:focus-visible {
    outline-color: #ffffff;
}

.edu-gal__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(960px, 100%);
    min-height: 0;
    max-height: calc(100vh - 230px);
    touch-action: pan-y;
}

.edu-gal__view {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 230px);
    object-fit: contain;
}

.edu-gal__caption {
    max-width: 40rem;
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.45;
    text-align: center;
}

.edu-gal__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.edu-gal__count {
    min-width: 5.5em;
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
}

.edu-gal__thumbs {
    display: none;
}

.edu-gal__thumb {
    width: 64px;
    height: 84px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    opacity: 0.72;
}

.edu-gal__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edu-gal__thumb.is-current {
    border-color: #ffffff;
    opacity: 1;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .edu-gal {
        padding: 72px 0 80px;
    }

    .edu-gal__inner {
        width: min(1180px, calc(100% - 48px));
    }

    .edu-gal__title {
        font-size: 36px;
    }

    .edu-gal__lead {
        font-size: 17px;
    }

    .edu-gal__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        margin-top: 36px;
    }

    .edu-gal__more {
        min-height: 56px;
    }

    .edu-gal__dialog {
        padding: 72px 32px 28px;
    }

    .edu-gal__stage,
    .edu-gal__view {
        max-height: calc(100vh - 250px);
    }
}

@media (min-width: 1100px) {
    .edu-gal__thumbs {
        display: flex;
        justify-content: center;
        gap: 8px;
    }

    .edu-gal__stage,
    .edu-gal__view {
        max-height: calc(100vh - 340px);
    }
}

@media (min-width: 1200px) {
    .edu-gal {
        padding: 88px 0 96px;
    }

    .edu-gal__title {
        font-size: 44px;
    }

    .edu-gal__lead {
        font-size: 18px;
    }

    .edu-gal__grid {
        gap: 16px;
        margin-top: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .edu-gal__shot img,
    .edu-gal__shade,
    .edu-gal__zoom {
        transition: none;
    }

    .edu-gal__shot:hover img,
    .edu-gal__shot:focus-visible img {
        transform: none;
    }
}
