/* --- ГЛОБАЛЬНЫЙ КОНТЕЙНЕР --- */
.background {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: #F9FED8;
    padding-bottom: 100px;
    overflow-x: hidden;
}

/* --- ШАПКА: ПОРТРЕТ И ТИТУЛ --- */
.biography-portrait-field {
    position: relative;
    width: 100%;
    max-width: 1280px;
    height: auto;
}

.biography-portrait {
    position: relative;
    width: 100%;
    height: 837px;
    margin: 0 auto;
}

.biography-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biography-portrait-title {
    position: absolute;
    left: 100px;
    top: 200px;
    width: 60%;
    z-index: 5;
    color: #F9FED8;
    text-shadow: 10px 10px 5px #0F0F0C;
    font-family: 'Novelist', serif;
    font-size: 128px;
    text-transform: uppercase;
    line-height: 1;
}

.biography-portrait-torn-edge {
    position: absolute;
    inset: auto 0 0 0; /* Растягиваем по низу */
    height: 76px;
    background: url("../img/page_elements/torn_edges/torn_edge3-2.png") repeat-x bottom / contain;
    z-index: 6;
}

/* --- ЗАГОЛОВОК С ИМЕНЕМ И ГОДАМИ --- */
.biography-name-years-of-life-field,
.videobiography-name-years-of-life-field {
    width: 100%;
    max-width: 1280px;
    min-height: 315px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.biography-name-years-of-life-field { align-items: flex-end; }
.videobiography-name-years-of-life-field { align-items: flex-start; }

.biography-name-years-of-life,
.videobiography-name-years-of-life {
    font-family: 'Novelist', serif;
    font-size: 64px;
    color: #5A062A;
    text-transform: uppercase;
    line-height: 1.1;
    text-align: inherit; /* Берет выравнивание от родителя */
}

/* --- ОСНОВНОЙ ТЕКСТ И ВИДЕО --- */
.videobiography-video-text-field {
    width: 100%;
    max-width: 1280px;
    padding: 0 40px;
    box-sizing: border-box;
}

.biography-video {
    float: left; /* Оставляем обтекание для десктопа */
    width: 720px;
    height: 405px;
    margin: 0 30px 20px 0;
    border-radius: 15px;
    background-color: black;
}

.biography-text {
    font-family: 'Gabriola', serif;
    font-size: 40px;
    line-height: 1.1;
    color: #5A062A;
    text-align: justify;
}

.biography-text p {
    text-indent: 40px;
    margin-bottom: 20px;
}

/* --- СВЯЗАННЫЕ СТАТЬИ --- */
.biography-under-text-field {
    width: 100%;
    max-width: 1280px;
    height: 315px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.related-articles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-articles-title {
    font-family: 'Novelist', serif;
    font-size: 32px;
    color: #8D0B19;
    text-transform: uppercase;
    -webkit-text-stroke: 1px #8D0B19;
}

.related-articles-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 30px;
    border: 3px solid #8D0B19;
    border-radius: 45px;
    color: #8D0B19;
    font-family: 'Gabriola', serif;
    font-size: 32px;
    text-decoration: none;
    transition: 0.3s;
}

.related-articles-link:hover {
    background: #8D0B19;
    color: #F9FED8;
}

/* ==========================================================================
   ПОЛНАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
    /* 1. Глобальный сброс фона */
    .background {
        padding-bottom: 60px;
    }

    /* 2. Портрет: Фикс обрезки лица */
    .biography-portrait {
        width: 100% !important;
        height: 350px !important; /* УМЕНЬШИЛИ высоту, чтобы уменьшить ЗУМ */
        margin: 0 !important;
        transform: none !important;
        overflow: hidden;
    }

    .biography-portrait img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
    }

    .biography-portrait-title {
        display: none !important;
    }

    .biography-portrait-torn-edge {
        height: 40px !important;
    }

    /* 3. Имя и Годы жизни */
    .biography-name-years-of-life-field,
    .videobiography-name-years-of-life-field {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 30px 0 !important;
        padding: 0 20px !important;
        transform: none !important;
        align-items: center !important; /* Всегда по центру */
    }

    .biography-name-years-of-life,
    .videobiography-name-years-of-life {
        width: 100% !important;
        font-size: 32px !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }

    /* 4. Видео и Текст */
    .videobiography-video-text-field {
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        padding: 0 20px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .biography-video {
        float: none !important; /* Отменяем обтекание текстом */
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9; /* Сохраняем пропорции видео */
        margin: 0 0 25px 0 !important;
    }

    .biography-text {
        width: 100% !important;
        font-size: 24px !important; /* Gabriola должна быть читабельной */
        line-height: 1.2 !important;
        text-align: left !important;
    }

    p {
        text-indent: 20px !important; /* Уменьшили отступ абзаца */
    }

    /* 5. Связанные статьи */
    .biography-under-text-field {
        width: 100% !important;
        height: auto !important;
        margin: 40px 0 !important;
        padding: 0 20px !important;
        transform: none !important;
        justify-content: center !important;
    }

    .related-articles {
        width: 100% !important;
        align-items: center !important;
        height: auto !important;
    }

    .related-articles-title {
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 15px;
    }

    .related-articles-link {
        width: auto !important;
        min-width: 280px;
        font-size: 24px !important;
        padding: 10px 20px;
    }
}