.kvh-gallery,
.kvh-gallery * {
    box-sizing: border-box;
}

.kvh-gallery {
    width: 100%;
    padding: 32px 0 12px;
}

/* Заголовок */

.kvh-gallery__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.kvh-gallery .kvh-gallery__title {
    margin: 0;
    color: #1f5875;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Стрелки переключения */

.kvh-gallery__controls {
    display: flex;
    gap: 10px;
}

.kvh-gallery__controls[hidden] {
    display: none;
}

.kvh-gallery__controls button {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    padding: 0;
    border: 1px solid #b9cdd7;
    border-radius: 11px;
    background: #fff;
    color: #1f5875;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.kvh-gallery__controls button:hover {
    background: #1f5875;
    color: #fff;
}

.kvh-gallery__controls button svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.kvh-gallery__controls .slick-disabled {
    opacity: .4;
    cursor: default;
}

.kvh-gallery__controls .slick-hidden {
    display: none;
}

/* Слайдер */

.kvh-gallery__slider .slick-list {
    margin: -4px -10px -12px;
}

.kvh-gallery__slider .slick-track {
    display: flex;
    align-items: stretch;
}

.kvh-gallery__slider .slick-track::before,
.kvh-gallery__slider .slick-track::after {
    display: none;
}

.kvh-gallery__slider.slick-initialized .kvh-gallery__slide {
    display: flex;
    float: none;
    height: auto;
    padding: 4px 10px 12px;
}

/* Карточки */

.kvh-gallery__slide {
    min-width: 0;
}

.kvh-gallery .kvh-gallery__card {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1px solid #dce5e9;
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 6px 20px #1f587507;
    transition: transform .25s,
                box-shadow .25s,
                border-color .25s;
}

.kvh-gallery .kvh-gallery__card:hover {
    transform: translateY(-4px);
    border-color: #82a9bb;
    box-shadow: 0 12px 26px #1f58751a;
}

/* Фотографии */

.kvh-gallery__photo {
    position: relative;
    height: 164px;
    overflow: hidden;
    background: #1f5875;
}

.kvh-gallery__photo::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1f5875;
}

.kvh-gallery__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s;
}

.kvh-gallery__card:hover .kvh-gallery__photo img {
    transform: scale(1.045);
}

/* Текст карточки */

.kvh-gallery__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 24px 24px;
}

.kvh-gallery .kvh-gallery__headline {
    margin: 0 0 9px;
    color: #1f5875;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.25px;
    overflow-wrap: anywhere;
}

.kvh-gallery .kvh-gallery__description {
    margin: 0;
    color: #657984;
    font-size: 14px;
    line-height: 1.55;
}

.kvh-gallery button:focus-visible,
.kvh-gallery a:focus-visible {
    outline: 2px solid #1f5875;
    outline-offset: 2px;
}

/* Резервная вёрстка при отсутствии Slick */

.kvh-gallery__slider:not(.slick-initialized) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.kvh-gallery__slider:not(.slick-initialized) .kvh-gallery__slide {
    display: flex;
}

/* Планшеты */

@media (max-width: 1023.98px) {
    .kvh-gallery__slider:not(.slick-initialized) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Смартфоны */

@media (max-width: 766.98px) {
    .kvh-gallery {
        padding: 26px 0 12px;
    }

    .kvh-gallery .kvh-gallery__title {
        font-size: 30px;
    }

    .kvh-gallery__head {
        gap: 12px;
        margin-bottom: 20px;
    }

    .kvh-gallery__controls button {
        width: 38px;
        height: 38px;
    }

    .kvh-gallery__photo {
        height: 180px;
    }

    .kvh-gallery__body {
        padding: 18px;
    }

    .kvh-gallery .kvh-gallery__headline {
        font-size: 17px;
    }

    .kvh-gallery__slider:not(.slick-initialized) {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kvh-gallery *,
    .kvh-gallery *::before,
    .kvh-gallery *::after {
        transition: none !important;
    }

    .kvh-gallery__card:hover,
    .kvh-gallery__card:hover img {
        transform: none !important;
    }
}
