.cases {
    padding: 0 24px;
    font-family: "Manrope", sans-serif;
}

.cases,
.cases * {
    box-sizing: border-box;
}

.cases__container {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
}

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

.cases__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 120px 0 64px;
}

.cases__heading {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: #070c12;
    font-size: 40px;
    font-weight: 600;
    line-height: 48px;
}

.cases__all {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    color: #09204b;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
}

.cases__all-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    background: #09204b;
}

.cases__all-icon img {
    display: block;
    width: 20px;
    height: 20px;
}

.cases__all:hover {
    color: #09204b;
    text-decoration: none;
}

.cases__all:hover > span:first-child {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cases__all:focus-visible {
    outline: 2px solid #09204b;
    outline-offset: 6px;
    border-radius: 4px;
}

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

.cases__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cases__card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 32px;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px -8px rgb(15 58 140 / 16%);
}

.cases__title {
    margin: 0;
    color: #242f3a;
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
}

.cases__preview,
.cases__text {
    color: #242f3a;
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    overflow-wrap: anywhere;
}

.cases__preview p,
.cases__text p {
    margin: 0 0 12px;
}

.cases__preview > :first-child,
.cases__text > :first-child {
    margin-top: 0;
}

.cases__preview > :last-child,
.cases__text > :last-child {
    margin-bottom: 0;
}

.cases__preview strong,
.cases__preview b,
.cases__text strong,
.cases__text b {
    font-weight: 600;
}

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

.cases__photo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 2px;
    margin-top: auto;
    overflow: hidden;
    border-radius: 8px;
}

.cases__photo img {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
}

.cases__photo img:only-child {
    grid-column: 1 / -1;
}

/* Адаптив */

@media (max-width: 1100px) {
    .cases__card {
        padding: 24px;
    }

    .cases__title {
        font-size: 22px;
        line-height: 30px;
    }
}

@media (max-width: 800px) {
    .cases {
        padding: 0 16px;
    }

    .cases__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        padding: 64px 0 32px;
    }

    .cases__heading {
        font-size: 28px;
        line-height: 36px;
    }

    .cases__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cases__card {
        padding: 20px;
    }

    .cases__title {
        font-size: 20px;
        line-height: 28px;
    }

    .cases__preview,
    .cases__text {
        font-size: 15px;
        line-height: 26px;
    }
}

/* Клинический случай на мобильной главной */
@media (max-width: 600px) {
    .cases {
        padding: 64px 12px 0;
    }

    .cases__container {
        display: grid;
        gap: 32px;
    }

    .cases__header {
        display: contents;
    }

    .cases__heading {
        max-width: 250px;
        justify-self: center;
        font-size: clamp(21px, 6.4vw, 24px);
        line-height: 1.2;
        text-align: center;
        text-wrap: balance;
    }

    .cases__grid {
        grid-row: 2;
    }

    .cases__card {
        gap: 16px;
        padding: 20px;
    }

    .cases__card:not(:first-child) {
        display: none;
    }

    .cases__title {
        font-size: 20px;
        line-height: 24px;
    }

    .cases__preview,
    .cases__text {
        font-size: 14px;
        line-height: 20px;
    }

    .cases__photo {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .cases__photo img:not(:only-child) {
        aspect-ratio: 311 / 220;
        object-fit: cover;
    }

    .cases__all {
        grid-row: 3;
        justify-self: center;
        gap: 8px;
        min-height: 44px;
        font-size: 14px;
    }
}
