/* =========================================
   1. ДИЗАЙН-СИСТЕМА (Slate Blue & Gold)
   ========================================= */
:root {
    /* ФОН: Теплый алебастр */
    --paper: #F7F5F0; 
    
    /* ТЕКСТ: Грифельный Синий */
    --ink: #3d5369;   
    
    /* АКЦЕНТ: Античное Золото */
    --gold: #C0A062;
    
    /* ВТОРИЧНЫЙ: Светлый серо-синий */
    --slate-light: #6B7F91;
    
    /* ТЕМНЫЙ ФОН: Глубокая ночь */
    --dark-bg: #15202B; 

    /* Настройки для dFlip (PDF плеер) */
    --dflip-color: var(--gold) !important; 
    --dflip-bg-color: var(--dark-bg) !important;

    --nav-height: 60px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}

a { text-decoration: none; color: var(--ink); transition: 0.3s; border-bottom: 1px solid transparent; }
a:hover { color: var(--gold); border-color: var(--gold); }

/* ОБЩИЕ ЗАГОЛОВКИ */
.section-title-wrapper {
    text-align: center;
    margin-bottom: 60px;
    margin-top: 20px;
}
.section-main-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--ink);
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.section-subtitle {
    font-size: 0.9rem;
    color: var(--slate-light);
    font-style: italic;
}


/* =========================================
   2. ОБЛОЖКА (HERO) И ЯЗЫКИ
   ========================================= */
.hero-section {
    height: 100vh;
    background-color: #3d5369; 
    background: linear-gradient(rgba(61, 83, 105, 0.6), rgba(61, 83, 105, 0.8)), 
                url('https://github.com/irkrssss/avierino-story/blob/main/sea.png?raw=true') center/cover fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    filter: none; 
}

.hero-title {
    font-size: 5rem;
    color: var(--paper);
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--gold);
    font-style: italic;
    letter-spacing: 1px;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: bounce 2s infinite;
}

@keyframes bounce { 
    0%, 100% { transform: translateY(0); } 
    50% { transform: translateY(10px); } 
}

/* ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ */
.hero-lang-switcher {
    position: absolute;
    top: 40px;
    right: 50px;
    z-index: 20;
    display: flex;
    gap: 15px;
}

.hero-lang-btn {
    background: none;
    border: none;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-lang-btn:hover { color: #fff; transform: translateY(-2px); }
.hero-lang-btn.active { color: var(--gold); opacity: 1; pointer-events: none; border-bottom: 1px solid var(--gold); }
.hero-sep { color: rgba(255, 255, 255, 0.3); }


/* =========================================
   3. НАВИГАЦИЯ
   ========================================= */
.sticky-nav {
    position: sticky; top: 0;
    background: rgba(247, 245, 240, 0.98);
    height: var(--nav-height); padding: 0 40px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(61, 83, 105, 0.1);
    z-index: 1000;
}
.nav-logo { font-family: 'Playfair Display'; font-weight: bold; font-size: 1.2rem; color: var(--ink); text-transform: uppercase; letter-spacing: 2px; }
.nav-links a { color: var(--ink); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-left: 25px; border: none; }


/* =========================================
   4. СТАТИЧНАЯ КНИГА (ОТ АВТОРОВ) — ТИПОГРАФСКАЯ ВЕРСТКА
   ========================================= */
.book-spread-section {
    padding: 60px 20px;
    background: var(--paper);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.book-spread {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1100px; /* Чуть компактнее по ширине */
    aspect-ratio: 3 / 2; /* Строгая пропорция книги */
    box-shadow: 0 20px 60px rgba(61, 83, 105, 0.15);
    position: relative;
    z-index: 2;
}

.book-page {
    flex: 1;
    width: 50%;
    background-color: #F9F7F1;
    padding: 4% 5%; /* Поля чуть меньше, чтобы влез текст */
    position: relative;
    border: 1px solid #D8D4C5;
    overflow: hidden; /* Обрезаем всё, что вылезает (на всякий случай) */
}

.page-left { 
    border-right: 1px solid #C8C4B5; 
    background: linear-gradient(to right, #F9F7F1 95%, #EFE8D5 100%); 
    display: flex; align-items: center; justify-content: center;
}
.page-right { 
    border-left: none; 
    background: linear-gradient(to left, #F9F7F1 95%, #EFE8D5 100%); 
}

/* Рамка внутри страницы */
.book-page::before { 
    content: ""; position: absolute; 
    top: 15px; left: 15px; right: 15px; bottom: 15px; 
    border: 3px double var(--ink); 
    pointer-events: none; opacity: 0.6; 
}
/* Уголки */
.corner { position: absolute; width: 12px; height: 12px; background: var(--ink); z-index: 2; }
.list-tl { top: 15px; left: 15px; } .list-tr { top: 15px; right: 15px; }
.list-bl { bottom: 15px; left: 15px; } .list-br { bottom: 15px; right: 15px; }

/* Гравюра (левая страница) */
.engraving-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.engraving-img {
    max-width: 90%; max-height: 80%; width: auto; height: auto; 
    object-fit: contain;
    filter: sepia(30%) contrast(0.9); 
    border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.img-caption {
    margin-top: 15px;
    font-family: 'Playfair Display', serif; font-style: italic; 
    font-size: clamp(0.7rem, 1.2vw, 0.85rem); 
    color: var(--slate-light); text-align: center;
}

/* Правая страница (Текстовый блок) - КОМПАКТНАЯ ВЕРСИЯ */
.page-content {
    height: 100%;
    display: flex; 
    flex-direction: column; 
    /* justify-content: space-between; <--- Убрали, чтобы не растягивало, если текста мало */
    padding: 10px 0; /* Небольшой отступ сверху/снизу внутри страницы */
}

/* ЗАГОЛОВКИ */
.chapter-label { 
    display: block; 
    color: var(--gold); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 0.65rem; 
    font-weight: bold; 
    margin-bottom: 5px;
}

.page-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 2vw, 1.7rem);
    color: var(--ink);
    margin: 0 0 10px 0; /* Уменьшили отступ снизу */
    line-height: 1;
    font-weight: 700;
}

/* ТИПОГРАФИКА ТЕКСТА */
.author-text-body {
    flex-grow: 1; 
}

.author-text-body p {
    font-family: 'Lato', sans-serif;
    /* Шрифт чуть меньше: от 11px до 13.5px */
    font-size: clamp(0.7rem, 0.9vw, 0.85rem); 
    line-height: 1.45; /* Чуть плотнее строки */
    margin-bottom: 6px; /* Минимальный отступ между абзацами */
    text-align: justify;
    hyphens: auto;
    color: rgba(61, 83, 105, 0.95);
}

.author-text-body p:last-child { margin-bottom: 0; }

/* Жирный текст внутри абзаца (вместо подзаголовка) */
.text-highlight {
    font-weight: 700;
    color: var(--ink);
}

/* Буквица (Drop Cap) */
.drop-cap { 
    float: left; 
    font-size: 3.2em; /* Чуть меньше */
    line-height: 0.8; 
    font-family: 'Playfair Display'; 
    color: var(--ink); 
    padding: 4px 6px 0 0; 
    font-weight: 400;
}

/* Разделитель и Благодарности */
.ornament-divider { 
    text-align: center; color: var(--gold); 
    font-size: 0.7rem; margin: 8px 0; opacity: 0.6; /* Уменьшили отступы */
}

.acknowledgments-box { 
    text-align: center; 
    padding-top: 5px;
    border-top: 1px dashed rgba(61, 83, 105, 0.15);
}

.ack-item .ack-label { 
    display: block; color: var(--ink); 
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; 
    font-weight: bold; opacity: 0.7; margin-bottom: 2px;
}
.ack-item .ack-text { 
    font-family: 'Playfair Display', serif; 
    font-size: clamp(0.7rem, 1vw, 0.85rem); 
    font-style: italic; color: var(--ink); 
    margin: 0; line-height: 1.3;
}
/* =========================================
   5. КАРТА (ВЕКТОРНАЯ ИСТОРИЯ)
   ========================================= */
.map-wrapper {
    display: flex;
    position: relative;
    background: var(--dark-bg);
}

.map-sticky {
    width: 60%;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: #0b1116;
}

.map-container {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

.map-svg-vector {
    width: 100%; height: 100%;
    max-height: 95vh;
    background: #0b1116;
}

.map-base-layer path {
    fill: #1e2a36; stroke: #3d5369; stroke-width: 0.5px;
}

.route-path {
    fill: none; stroke: var(--gold); stroke-width: 1.5px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px rgba(192, 160, 98, 0.7));
    opacity: 0.8;
}
.main-route { stroke-width: 2.5px; opacity: 1; }
.secondary-route { stroke-width: 1px; opacity: 0.6; }

.city-dot {
    fill: var(--paper); stroke: var(--gold); stroke-width: 1px;
    transition: 0.3s; opacity: 0;
}
.city-dot.origin { 
    fill: var(--gold); 
    opacity: 1 !important; 
}
.city-label.origin-label {
    opacity: 1 !important;
}
.city-dot.hub { fill: var(--gold); stroke-width: 2px; r: 6px; }

.city-label {
    font-family: 'Lato', sans-serif; font-size: 10px; fill: var(--paper);
    opacity: 0; pointer-events: none; text-shadow: 0 1px 2px #000; font-weight: bold;
}

.map-content {
    width: 40%;
    background: rgba(247, 245, 240, 0.96);
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    z-index: 20;
    position: relative;
}

.step {
    min-height: 90vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 40px;
}

.step-card {
    background: #fff; padding: 30px; border-radius: 8px;
    box-shadow: 0 10px 30px rgba(61, 83, 105, 0.1);
    border-left: 4px solid var(--gold);
}
.step-card h3 { font-size: 1.5rem; margin-bottom: 15px; }


/* =========================================
   6. ПЕРСОНАЛИИ (РЕЕСТР + ПОИСК)
   ========================================= */
.registry-section {
    padding: 40px 20px 80px 20px;
    background: #fff;
    position: relative;
    z-index: 5;
}

/* ⚡ СПЕЦИАЛЬНЫЙ ОТСТУП ДЛЯ ЭТОГО ЗАГОЛОВКА */
/* Уменьшаем расстояние до поиска (было 60px, стало 15px) */
.registry-section .section-title-wrapper {
    margin-bottom: 15px; 
}

/* Верхняя часть: Поиск */
.registry-controls {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 30px; 
    text-align: center;
}

.search-input {
    padding: 18px 30px;
    width: 100%; max-width: 600px;
    border: 2px solid rgba(107, 127, 145, 0.3);
    background: #fff; font-family: 'Lato', sans-serif; font-size: 1.1rem;
    border-radius: 50px; outline: none; transition: 0.3s;
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 15px rgba(192, 160, 98, 0.25); }

/* Список людей */
.registry-container { max-width: 800px; margin: 0 auto; }

.registry-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; padding: 20px 30px;
    margin-bottom: 15px; border-radius: 8px;
    border: 1px solid rgba(61, 83, 105, 0.1);
    transition: all 0.3s ease; cursor: pointer;
    position: relative; overflow: hidden;
}
.registry-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(61, 83, 105, 0.1);
    border-color: var(--gold);
}
.registry-row::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: var(--gold); opacity: 0; transition: 0.3s;
}
.registry-row:hover::before { opacity: 1; }

.reg-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--ink); font-weight: 700; }
.reg-dates {
    font-family: 'Lato', sans-serif; font-size: 0.9rem; color: var(--slate-light);
    background: rgba(61, 83, 105, 0.05); padding: 5px 12px; border-radius: 20px;
}

/* НИЖНЯЯ ПАНЕЛЬ (НОВАЯ РАСКЛАДКА) */
.registry-footer-controls {
    max-width: 800px; margin: 30px auto 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Селектор слева */
    min-height: 40px;
}

/* Селектор количества */
.rows-selector {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; color: var(--slate-light);
    z-index: 2;
}
.items-select {
    padding: 6px 12px;
    border: 1px solid var(--slate-light); border-radius: 4px;
    background: #fff; color: var(--ink);
    font-family: 'Lato', sans-serif; cursor: pointer; outline: none;
}
.items-select:focus { border-color: var(--gold); }

/* Кнопки страниц (Строго по центру) */
.pagination-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex; justify-content: center; gap: 10px;
    width: max-content;
    z-index: 1;
}

.page-btn {
    background: #fff; border: 1px solid var(--slate-light); color: var(--ink);
    padding: 8px 16px; cursor: pointer; border-radius: 4px; font-family: 'Lato'; transition: 0.2s;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.3; cursor: default; border-color: #ddd; }

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 700px) {
    .registry-footer-controls {
        flex-direction: column;
        gap: 20px;
        justify-content: center;
    }
    .pagination-wrapper {
        position: static;
        transform: none;
    }
}

/* Карточка человека в списке */
.registry-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; padding: 20px 30px;
    margin-bottom: 15px; border-radius: 8px;
    border: 1px solid rgba(61, 83, 105, 0.1);
    transition: all 0.3s ease; cursor: pointer;
    position: relative; overflow: hidden;
}

.registry-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(61, 83, 105, 0.1);
    border-color: var(--gold);
}

.registry-row::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: var(--gold); opacity: 0; transition: 0.3s;
}
.registry-row:hover::before { opacity: 1; }

.reg-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--ink); font-weight: 700; }
.reg-dates {
    font-family: 'Lato', sans-serif; font-size: 0.9rem; color: var(--slate-light);
    background: rgba(61, 83, 105, 0.05); padding: 5px 12px; border-radius: 20px;
}

/* Пагинация */
.pagination-wrapper { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.page-btn {
    background: #fff; border: 1px solid var(--slate-light); color: var(--ink);
    padding: 8px 16px; cursor: pointer; border-radius: 4px; font-family: 'Lato'; transition: 0.2s;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.3; cursor: default; border-color: #ddd; }


/* =========================================
   7. PDF КНИГА (ИСТОРИЧЕСКИЙ КОНТЕКСТ)
   ========================================= */
.history-book-section {
    /* ⚡ Было padding-top: 80px. Ставим 40px, чтобы подтянуть к верху */
    padding: 40px 20px 100px 20px;
    background: var(--paper);
    text-align: center;
    position: relative; 
    z-index: 6;
    box-shadow: 0 -20px 40px rgba(0,0,0,0.05);
}

/* ⚡ Специально для этой секции уменьшаем отступ под заголовком */
.history-book-section .section-title-wrapper {
    margin-bottom: 20px; /* Было 60px */
    margin-top: 0;
}

.flipbook-container {
    width: 100%;
    max-width: 900px; /* ⚡ Сделали уже (было 1200px) */
    height: 80vh; 
    min-height: 600px;
    margin: 0 auto;   /* Центрируем и убираем лишние отступы сверху */
    box-shadow: 0 20px 50px rgba(61, 83, 105, 0.2);
    z-index: 1;
}

/* =========================================
   8. ПОДДЕРЖКА
   ========================================= */
.support-section-clean {
    background-color: #FAFAFA; padding: 60px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.support-wrapper { max-width: 800px; margin: 0 auto; text-align: center; }
.support-section-clean h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--ink); margin-bottom: 20px; }
.support-text p { font-size: 0.9rem; line-height: 1.6; color: var(--ink); max-width: 600px; margin: 0 auto 15px auto; opacity: 0.9; }
.support-buttons-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 30px;}
.btn-clean-dark {
    background-color: var(--ink); color: #fff; padding: 12px 25px; border-radius: 4px; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; min-width: 200px;
    box-shadow: 0 10px 20px rgba(61, 83, 105, 0.2); transition: transform 0.2s, box-shadow 0.2s;
}
.btn-clean-dark:hover { background-color: var(--dark-bg); color: #fff; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }


/* =========================================
   9. ПОДВАЛ
   ========================================= */
.site-footer-clean {
    background-color: var(--dark-bg); color: rgba(255,255,255,0.7);
    padding: 80px 40px 30px 40px; font-size: 0.95rem;
}
.footer-grid {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
    padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h3 { color: #fff; font-family: 'Lato', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 25px; opacity: 0.9; }
.footer-col p { color: rgba(255,255,255,0.7); margin-bottom: 15px; line-height: 1.6; }

/* ⚡ ОБНОВЛЕННЫЙ СТИЛЬ ДЛЯ ГОРОДА */
.location-tag { 
    margin-top: 30px; 
    color: rgba(255,255,255,0.4); /* Тусклый цвет */
    font-size: 0.85rem; 
}

.btn-gold-action {
    display: inline-block; margin-top: 15px; background-color: rgba(255,255,255,0.1); color: #fff; padding: 12px 25px; border-radius: 4px; font-weight: bold; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.2); transition: 0.3s;
}
.btn-gold-action:hover { background-color: var(--gold); border-color: var(--gold); color: var(--dark-bg); }
.footer-bottom { text-align: center; padding-top: 30px; font-size: 0.8rem; opacity: 0.4; }


/* =========================================
   10. МОДАЛЬНОЕ ОКНО
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(21, 32, 43, 0.9); z-index: 2000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-overlay.active { display: flex; animation: fadeIn 0.3s; }
.modal-card {
    background: var(--paper); width: 90%; max-width: 900px;
    max-height: 90vh; overflow-y: auto; position: relative; padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); border: 1px solid var(--gold);
}
.close-modal {
    position: absolute; top: 15px; right: 20px;
    font-size: 2rem; background: none; border: none; cursor: pointer; color: var(--ink); z-index: 10;
}
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

.person-layout-grid { display: grid; grid-template-columns: 250px 1fr; gap: 40px; }
.person-left-col { display: flex; flex-direction: column; gap: 20px; }
.person-img { width: 100%; border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.relatives-box {
    background: rgba(61, 83, 105, 0.05); padding: 15px; border-radius: 4px; font-size: 0.9rem; border-left: 2px solid var(--gold);
}
.relatives-line { margin-bottom: 8px; line-height: 1.4; }
.relative-link {
    color: var(--gold); font-weight: 700; cursor: pointer;
    border-bottom: 1px solid rgba(192, 160, 98, 0.3); transition: 0.2s;
}
.relative-link:hover { color: var(--ink); border-bottom-color: var(--ink); background-color: rgba(192, 160, 98, 0.1); }

.person-full-name {
    font-family: 'Playfair Display', serif; font-size: 2.2rem; line-height: 1.1;
    color: var(--ink); margin-top: 0; margin-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 15px;
}
.life-dates { margin-bottom: 30px; font-size: 1rem; color: var(--ink); line-height: 1.6; }
.date-row { display: flex; align-items: center; gap: 10px; }
.date-icon { font-size: 1.2rem; color: var(--gold); width: 20px; text-align: center; }
.person-bio { font-size: 1rem; line-height: 1.7; text-align: justify; margin-bottom: 30px; }
.sources-box { margin-top: 40px; padding-top: 20px; border-top: 1px dashed rgba(0,0,0,0.2); font-size: 0.85rem; opacity: 0.7; }


/* =========================================
   11. МОБИЛЬНАЯ ВЕРСИЯ (ADAPTIVE) - ВСЕГДА ВНИЗУ
   ========================================= */
@media (max-width: 900px) {
    /* Карта */
    .map-wrapper { flex-direction: column; }
    .map-sticky { width: 100%; height: 50vh; position: relative; top: unset; }
    .map-svg-vector { max-height: none; }
    .map-content { width: 100%; }
    .step { min-height: 50vh; padding: 20px; }
    
    /* Реестр: из строки в колонку */
    .registry-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    
    /* HTML Книга */
    .book-spread { flex-direction: column; box-shadow: none; margin-top: 0; }
    .book-page { width: 100%; max-width: 100%; flex: auto; min-height: auto; border: none; border-bottom: 10px solid #eee; }
    .page-left, .page-right { background: var(--paper); }
    .author-text-body p { text-align: left; text-indent: 20px; }
    
    /* PDF Книга */
    .flipbook-container { height: 60vh; min-height: 400px; }
    .section-subtitle { display: none; }

    /* Модалка на телефоне */
    .person-layout-grid { grid-template-columns: 1fr; gap: 20px; }
    .person-full-name { font-size: 1.8rem; }
    .modal-card { padding: 20px; width: 95%; }

    /* Футер */
    .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .support-buttons-row { flex-direction: column; align-items: center; }
    .btn-clean-dark { width: 100%; min-width: unset; }
    .site-footer-clean { padding: 60px 20px 30px 20px; }
    
    .hero-lang-switcher { top: 20px; right: 20px; gap: 10px; }
}
/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ДЛЯ КНИГИ "ОТ АВТОРОВ"
   ========================================= */
@media (max-width: 900px) {
    
    .book-spread-section {
        min-height: auto; /* Убираем обязательную высоту */
        padding: 40px 15px;
    }

    .book-spread {
        flex-direction: column; /* Страницы в столбик */
        aspect-ratio: auto;     /* Отключаем пропорцию 3:2 */
        width: 100%;
        box-shadow: none;       /* Убираем тень "парящей книги" */
    }

    .book-page {
        width: 100%;            /* Страница на всю ширину экрана */
        min-height: auto;
        border: none;
        /* Добавляем серый разделитель между страницами */
        border-bottom: 8px solid #E0E0E0; 
        padding: 40px 20px;
    }

    /* Убираем градиент переплета, делаем ровный фон */
    .page-left, .page-right {
        background: #F9F7F1; 
    }

    /* Адаптация рамки */
    .book-page::before {
        top: 10px; left: 10px; right: 10px; bottom: 10px;
    }
    
    /* Скрываем уголки на телефоне, чтобы не мешали */
    .corner { display: none; }

    /* Картинка (Гравюра) */
    .engraving-img {
        max-height: 250px; /* Ограничиваем высоту, чтобы не занимала весь экран */
        margin-bottom: 20px;
    }

    /* Текст */
    .page-content {
        display: block; /* Убираем сложный флекс */
    }

    .author-text-body p {
        /* На узком экране Justify делает дыры в тексте, лучше по левому краю */
        text-align: left; 
        text-indent: 20px;
        font-size: 1rem; /* Читаемый размер для телефона */
    }

    .drop-cap {
        font-size: 3.5rem; /* Чуть меньше буквица */
    }
    
    /* Заголовок покрупнее, чтобы удобно читать */
    .page-content h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}
