/* === FACT SECTION STYLES === */
/* Стили вынесены и унифицированы на основе переменных из base_color.css и base_font.css */

.fact-section {
    margin-top: 50px;
    display: flex;
    flex-direction: column; /* Элементы выстраиваются в колонку друг под другом */
    align-items: center;    /* Центрируем контейнеры по горизонтали */
    width: 100%;
    gap: 50px;              /* Отступ между блоками фактов */
}

.fact-container {
    display: flex;
    min-height: 671px;
    width: 1280px;
    max-width: 100%;
    align-items: stretch;
    gap: 30px;
}

/* Логика чередования: Теперь применяем к самому контейнеру внутри секции.
   Нечетные - стандартно, Четные - реверс (картинка справа) */
.fact-container:nth-of-type(even) {
    flex-direction: row-reverse;
}

/* === Изображение === */
.fact-image {
    aspect-ratio: 0.96;
    width: 50%; /* Балансируем ширину */
    min-width: 240px;
    flex-grow: 1;
    border-radius: 12px;
    object-fit: cover;
}

/* === Карточка с текстом === */
.fact-card {
    border-radius: 12px;
    /* Цвет рамки оригинальный */
    border: 1px solid #e6e9eb;
    background-color: var(--color-white);
    display: flex;
    min-width: 240px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 50%; /* Балансируем ширину */
    flex-grow: 1;
    padding: 41px 31px;
}

.fact-content {
    padding-right: 28px;
}

/* === Типографика с использованием переменных === */
.fact-title {
    font-size: 40px;
    color: var(--FOSS-Blue-text);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
}

.fact-text {
    z-index: 10;
    margin-top: 20px;
    font-size: 16px;
    color: var(--FOSS-Blue-text);

}

.fact-heading {
    min-height: auto;
    font-size: 32px;
    color: var(--text-dark-blue);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 40px;
}

.fact-description {
    color: var(--text-dark-blue);
    font-size: 16px;
    font-weight: 400;
    line-height: 19px;
}

/* === RESPONSIVE DESIGN (Адаптивность) === */

@media (max-width: 991px) {
    .fact-section {
        margin-top: 40px;
        gap: 40px; /* Уменьшенный отступ между блоками на мобильных */
    }

    .fact-container {
        flex-direction: column; /* Картинка сверху, текст снизу */
        min-height: auto;
    }

    /* Важно: на мобильных отменяем реверс для четных контейнеров,
       чтобы всегда сохранялся порядок: Картинка -> Текст */
    .fact-container:nth-of-type(even) {
        flex-direction: column;
    }

    .fact-image {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        max-height: 400px; /* Ограничение высоты картинки на мобильном */
        object-fit: cover;
    }

    .fact-card {
        width: 100%;
        padding: 30px 20px;
    }

    .fact-content {
        padding-right: 0;
    }

    .fact-heading {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .fact-text {
        margin: 0;
    }
}