/**
 * Блок «Как работает Магистраль».
 * BEM: how-it-works.
 * Desktop 1300×609 · Tablet 628×1072 · Phone 355×2084.
 * Только var(--site-*), rem.
 */

.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 2.5rem; /* 40px */
    width: 100%;
    max-width: 81.25rem; /* 1300px */
    margin: 0 auto;
    padding: 0 0 var(--site-section-gap);
    box-sizing: border-box;
}

.how-it-works__intro {
    display: flex;
    flex-direction: column;
    gap: 1.875rem; /* 30px */
    width: 100%;
}

.how-it-works__title {
    margin: 0;
    max-width: 46.75rem; /* 748px */
    font-size: 2.5rem; /* 40px */
    font-weight: 800;
    line-height: 1.15;
    color: var(--site-text);
}

.how-it-works__text {
    margin: 0;
    max-width: 63.5625rem; /* 1017px */
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    line-height: 1.4;
    color: var(--site-text-body);
}

.how-it-works__cards {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1.25rem; /* 20px */
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.how-it-works__card {
    display: flex;
    flex-direction: column;
    gap: 0.9375rem; /* 15px */
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 1.25rem; /* 20px */
    background-color: var(--site-surface);
    border-radius: 1.25rem; /* 20px */
    box-shadow: inset 0 0 0 1px var(--site-card-ring);
}

.how-it-works__card-body {
    display: flex;
    flex-direction: column;
    gap: 0.9375rem;
    width: 100%;
}

.how-it-works__card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem; /* 10px */
    width: 100%;
}

.how-it-works__number {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.875rem; /* 30px */
    height: 1.875rem;
    border-radius: 0.625rem; /* 10px */
    background-color: var(--site-step-bg);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    color: var(--site-accent);
}

.how-it-works__card-title {
    flex: 1 1 0;
    margin: 0;
    min-width: 0;
    font-size: 1.25rem; /* 20px */
    font-weight: 800;
    line-height: 1.15;
    color: var(--site-text);
}

.how-it-works__card-text {
    margin: 0;
    font-size: 0.75rem; /* 12px */
    font-weight: 600;
    line-height: 1.35;
    color: var(--site-text);
}

.how-it-works__card-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--site-image-ring);
    border-radius: 0.5rem; /* 8px */
    box-sizing: border-box;
}

/* Tablet ≈ 628×1072: 2×2 */
@media (max-width: 63.9375rem) {
    .how-it-works {
        gap: 2rem;
    }

    .how-it-works__title {
        max-width: none;
        font-size: 2rem;
    }

    .how-it-works__text {
        max-width: none;
        font-size: 1rem;
    }

    .how-it-works__cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* Phone ≈ 355×2084: колонка */
@media (max-width: 47.9375rem) {
    .how-it-works {
        gap: 1.5rem;
    }

    .how-it-works__intro {
        gap: 1rem;
    }

    .how-it-works__title {
        font-size: 1.625rem;
        line-height: 1.2;
    }

    .how-it-works__text {
        font-size: 0.9375rem;
        font-weight: 600;
        line-height: 1.4;
    }

    .how-it-works__cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .how-it-works__card {
        flex: none;
        width: 100%;
    }

    .how-it-works__card-title {
        font-size: 1.125rem;
    }
}
