/* --- КОНТЕЙНЕР --- */
.biographies-background {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: #F9FED8;
    padding-bottom: 150px;
}

.biographies-title {
    margin: 80px 0;
    font-family: 'Novelist', serif;
    font-size: clamp(64px, 10vw, 128px);
    color: #5A062A;
    text-transform: uppercase;
}

/* --- ТАЙМЛАЙН: ПЕРИОДЫ --- */
.biographies-period {
    display: flex;
    width: 90%;
    max-width: 1400px;
    position: relative;
    /* Убираем margin-left: 50%, используем естественный поток */
}

/* ОБЩАЯ ВЕРТИКАЛЬНАЯ ЛИНИЯ */
/* Рисуем её через псевдоэлемент родителя, чтобы она была непрерывной */
.biographies-period::before {
    content: "";
    position: absolute;
    left: 37px; /* Твоя координата */
    top: 0;
    bottom: 0;
    width: 10px;
    background-color: #8D0B19;
    z-index: 1;
}

/* ПЕРПЕНДИКУЛЯР (Горизонтальная черточка) */
.timeline-line {
    position: absolute;
    left: 10px; /* Стыкуется с вертикалью */
    top: 86px;  /* Твоя высота */
    width: 60px;
    height: 10px;
    background-color: #8D0B19;
    z-index: 2;
}

/* СТРЕЛКА В КОНЦЕ (только для последнего блока) */
.biographies-period:last-child::after {
    content: "";
    position: absolute;
    left: 17px; /* Центрируем под линией 10px */
    bottom: -60px;
    width: 51px;
    height: 59px;
    background: url(/dist/4c2969d0eaf803e8f910.png) no-repeat center / contain;
    z-index: 3;
}

/* --- КОНТЕНТНАЯ ОБЛАСТЬ --- */
.biographies-title-portraits-field {
    margin-left: 100px; /* Отступ от линии таймлайна */
    display: flex;
    flex-direction: column;
    width: 100%;
}

.biographies-periods-title {
    font-family: "Playfair Display", serif;
    font-size: 48px;
    color: #8D0B19;
    text-transform: uppercase;
    margin-top: 68px;
    line-height: 1;
}

/* СОВРЕМЕННАЯ СЕТКА ПОРТРЕТОВ */
.biographies-portraits-field {
    display: grid;
    /* Создаем колонки по 236px (как в твоем макете) */
    grid-template-columns: repeat(auto-fill, 236px);
    column-gap: 80px; /* Расстояние между колонками */
    row-gap: 50px;    /* Расстояние между рядами */
    margin-top: 50px;
    width: 100%;
}

/* КАРТОЧКА ГЕРОЯ */
.biographies-portrait-name-field,
.biographies-portrait-name-field-first {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.2s ease;
}

.biographies-portrait-name-field:hover {
    transform: translateY(-5px);
}

.biographies-portrait {
    width: 223px;
    height: 280px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.biographies-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biographies-name {
    margin-top: 15px;
    font-family: 'Gabriola', serif;
    font-size: 32px;
    color: #000;
    text-align: center;
    line-height: 30px;
}

.link {
    position: absolute;
    inset: 0;
    z-index: 10;
}

@media (max-width: 991.98px) {
    .biographies-period::before,
    .timeline-line,
    .biographies-period:last-child::after {
        display: none !important;
    }

    .biographies-title-portraits-field {
        margin-left: 0;
        align-items: center;
    }

    .biographies-periods-title {
        font-size: 28px;
        text-align: center;
        margin-top: 20px;
    }

    .biographies-portraits-field {
        grid-template-columns: repeat(auto-fill, 160px); /* По 2 в ряд на малых экранах */
        justify-content: center;
        column-gap: 20px;
    }

    .biographies-portrait {
        width: 160px;
        height: 200px;
    }

    .biographies-name {
        font-size: 20px;
    }
}
