/*
 * Case Related Cases
 * Figma: desktop 747:10167, tablet 776:11808, mobile 851:11428
 * Breakpoints: mobile ≤767, tablet 768–1199, large ≥1200
 */

.case-related-cases {
    --crc-pad-y: 80px;
    --crc-pad-x: 16px;
    --crc-stack-gap: 40px;
    --crc-heading-size: 32px;
    --crc-heading-align: center;
    --crc-card-image-h: 220px;
    --crc-body-pad: 24px;
    --crc-body-gap: 32px;
    --crc-title-size: 20px;
    --crc-desc-size: 16px;
    --crc-grid-gap: 24px;
    --crc-media-overlay: rgba(0, 0, 0, 0.35);

    background: var(--white);
    color: var(--black);
    padding: var(--crc-pad-y) var(--crc-pad-x);
}

.case-related-cases__inner {
    max-width: var(--akdev-section-max, 1440px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--crc-stack-gap);
}

.case-related-cases__heading {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: var(--crc-heading-size);
    line-height: 1.193;
    color: var(--black);
    text-align: var(--crc-heading-align);
}

.case-related-cases__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--crc-grid-gap);
    align-items: stretch;
}

.case-related-cases__card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--light-gray);
    overflow: hidden;
    min-width: 0;
}

.case-related-cases__media {
    position: relative;
    width: 100%;
    height: var(--crc-card-image-h);
    flex-shrink: 0;
    overflow: hidden;
    background: #e5e5e5;
}

.case-related-cases__cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-related-cases__media-overlay {
    position: absolute;
    inset: 0;
    background: var(--crc-media-overlay);
    pointer-events: none;
}

.case-related-cases__logo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
}

.case-related-cases__logo-img {
    display: block;
    max-width: min(240px, 85%);
    max-height: min(56px, 28%);
    width: auto;
    height: auto;
    object-fit: contain;
}

.case-related-cases__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--crc-body-gap);
    padding: var(--crc-body-pad);
    min-height: 0;
}

.case-related-cases__text-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case-related-cases__title {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: var(--crc-title-size);
    line-height: 1.25;
    color: var(--black);
}

.case-related-cases__description {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: var(--crc-desc-size);
    line-height: 1.3;
    color: var(--dark);
}

.case-related-cases__tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-related-cases__tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--light-gray);
    background: var(--white);
}

.case-related-cases__tag-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.case-related-cases__tag--solution .case-related-cases__tag-text {
    color: var(--black);
}

.case-related-cases__tag--industry .case-related-cases__tag-text {
    color: var(--lazure-green);
}

.case-related-cases__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: auto;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.3;
    color: var(--black);
    text-decoration: none;
    transition: color 0.2s ease;
}

.case-related-cases__link:hover {
    color: var(--dark);
}

.case-related-cases__link-icon {
    display: flex;
    color: var(--lazure-green);
    flex-shrink: 0;
}

.case-related-cases__link-icon svg {
    display: block;
}

.case-related-cases__empty {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    color: var(--dark);
}

/* Tablet 768–1199: 2 колонки */
@media (min-width: 768px) {
    .case-related-cases {
        --crc-heading-size: 40px;
        --crc-heading-align: left;
        --crc-card-image-h: 240px;
    }

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

/* Large ≥1200: 3 колонки, отступы как в макете */
@media (min-width: 1200px) {
    .case-related-cases {
        --crc-pad-x: 120px;
        --crc-stack-gap: 60px;
        --crc-heading-size: 56px;
        --crc-card-image-h: 250px;
    }

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