/* =====================================================
   НЕЙРОБЫЛИНЫ — базовые стили книги
   ===================================================== */

/* --- Шрифты (локально) --- */
@font-face {
    font-family: 'Ruslan Display';
    src: url('../fonts/RuslanDisplay-cyrillic.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Ruslan Display';
    src: url('../fonts/RuslanDisplay-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Old Standard TT';
    src: url('../fonts/OldStandardTT-cyrillic-ext.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Old Standard TT';
    src: url('../fonts/OldStandardTT-cyrillic.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Old Standard TT';
    src: url('../fonts/OldStandardTT-latin-ext.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
                   U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Old Standard TT';
    src: url('../fonts/OldStandardTT-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+FEFF, U+FFFD;
}

/* --- Переменные --- */
:root {
    --parchment: #f5ecd6;
    --parchment-dark: #e8dcc0;
    --ink: #2b1d0e;
    --ink-soft: #4a3a25;
    --gold: #b08d3f;
    --gold-deep: #7a5d1e;
    --wood: #3d2817;
    --wood-dark: #1f1409;
    --shadow: rgba(0, 0, 0, 0.5);

    --font-title: 'Ruslan Display', 'Georgia', serif;
    --font-text: 'Old Standard TT', 'Georgia', serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

.book-body {
    background:
        radial-gradient(ellipse at center, #4a2f1c 0%, #2a1810 60%, #140b05 100%);
    font-family: var(--font-text);
    color: var(--ink);
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Кнопка возврата на сайт --- */
.return-to-site {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(245, 236, 214, 0.9);
    color: var(--ink);
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid rgba(122, 93, 30, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.return-to-site:hover {
    background: var(--parchment);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.return-to-site svg { stroke: var(--gold-deep); }

/* --- Сцена книги --- */
.book-stage {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.book {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
}

/* --- Страница --- */
.page {
    background: var(--parchment);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(176, 141, 63, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(176, 141, 63, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    padding: 32px 28px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 40px rgba(122, 93, 30, 0.15);
}

.page__inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- Обложка --- */
.page--cover {
    background:
        radial-gradient(ellipse at 50% 30%, #6b4423 0%, #3d2817 60%, #1f1409 100%);
    color: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cover {
    text-align: center;
    max-width: 90%;
}

.cover__ornament-top,
.cover__ornament-bottom {
    color: var(--gold);
    font-size: 24px;
    letter-spacing: 8px;
    margin: 12px 0;
}

.cover__series {
    font-family: var(--font-title);
    font-size: 20px;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.cover__title {
    font-family: var(--font-title);
    font-size: 52px;
    margin: 16px 0;
    color: var(--parchment);
    line-height: 1.1;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.cover__subtitle {
    font-size: 16px;
    font-style: italic;
    color: rgba(245, 236, 214, 0.8);
    margin-bottom: 24px;
}

.cover__divider {
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 20px auto;
}

.cover__illustration {
    margin: 20px 0;
}

.cover__placeholder {
    font-size: 64px;
    color: var(--gold);
    opacity: 0.6;
}

.cover__authors {
    font-size: 13px;
    font-style: italic;
    color: rgba(245, 236, 214, 0.7);
    margin: 20px 0;
    line-height: 1.5;
}

.cover__disclaimer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(176, 141, 63, 0.3);
    font-size: 11px;
    line-height: 1.5;
    color: rgba(245, 236, 214, 0.75);
    text-align: left;
    max-height: 220px;
    overflow-y: auto;
}

.cover__disclaimer h3 {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--gold);
    margin: 0 0 8px;
    letter-spacing: 2px;
}

.cover__disclaimer p { margin: 0 0 8px; }

/* --- Оглавление --- */
.toc { padding: 8px 0; }

.toc__header {
    text-align: center;
    margin-bottom: 24px;
}

.toc__subtitle {
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-deep);
}

.toc__title {
    font-family: var(--font-title);
    font-size: 32px;
    color: var(--ink);
    margin: 8px 0;
}

.toc__ornament {
    color: var(--gold);
    letter-spacing: 6px;
    font-size: 14px;
}

.toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: skaz;
}

.toc__item { border-bottom: 1px dashed rgba(122, 93, 30, 0.3); }
.toc__item:last-child { border-bottom: none; }
.toc__item--greece { background: rgba(176, 141, 63, 0.04); }

.toc__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.2s;
    border-radius: 4px;
}

.toc__link:hover { background: rgba(176, 141, 63, 0.12); }

.toc__num {
    font-family: var(--font-title);
    font-size: 24px;
    color: var(--gold-deep);
    min-width: 32px;
    text-align: center;
}

.toc__text { display: flex; flex-direction: column; }

.toc__subtitle-line {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-style: italic;
}

.toc__title-line {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--ink);
    margin-top: 2px;
}

/* --- Страницы сказов --- */
.page--skaz .page__inner { padding: 0; }

.page__header {
    text-align: center;
    margin-bottom: 20px;
}

.page__subtitle {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-style: italic;
}

.page__title {
    font-family: var(--font-title);
    font-size: 26px;
    color: var(--ink);
    margin: 6px 0;
    line-height: 1.15;
}

.page__ornament {
    color: var(--gold);
    letter-spacing: 6px;
    font-size: 12px;
}

.page__content {
    flex: 1;
    column-count: 2;
    column-gap: 28px;
    column-rule: 1px solid rgba(122, 93, 30, 0.15);
    font-size: 15px;
    line-height: 1.65;
    text-align: justify;
    overflow-y: auto;
}

.page__content p { margin: 0 0 12px; text-indent: 24px; }
.page__content p:first-of-type { text-indent: 0; }
.page__content .lead { font-style: italic; color: var(--ink-soft); }
.page__content .lead::first-letter {
    font-family: var(--font-title);
    font-size: 3.5em;
    float: left;
    line-height: 0.85;
    margin: 4px 8px 0 0;
    color: var(--gold-deep);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
}

.page__footer {
    text-align: center;
    margin-top: 12px;
    font-family: var(--font-title);
    color: var(--gold-deep);
    font-size: 14px;
}

/* --- Навигация --- */
.book-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 20px;
    color: var(--parchment);
}

.book-nav__btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(176, 141, 63, 0.5);
    background: rgba(245, 236, 214, 0.08);
    color: var(--parchment);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-title);
    line-height: 1;
}

.book-nav__btn:hover:not(:disabled) {
    background: rgba(245, 236, 214, 0.2);
    border-color: var(--gold);
}

.book-nav__btn:disabled { opacity: 0.3; cursor: not-allowed; }

.book-nav__indicator {
    font-family: var(--font-title);
    letter-spacing: 2px;
    font-size: 14px;
    min-width: 160px;
    text-align: center;
    color: var(--parchment);
}

/* --- Загрузчик --- */
.book-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    color: var(--parchment);
    font-family: var(--font-title);
    letter-spacing: 2px;
    background: rgba(20, 11, 5, 0.8);
}

.book-loader__spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(176, 141, 63, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Мобильная адаптация --- */
@media (max-width: 768px) {
    .cover__title { font-size: 34px; }
    .toc__title { font-size: 22px; }
    .page__title { font-size: 20px; }
    .page { padding: 20px 16px; }
    .page__content {
        column-count: 1;
        font-size: 15px;
    }
    .cover__disclaimer { font-size: 10px; max-height: 180px; }
    .return-to-site span { display: none; }
    .return-to-site { padding: 8px; border-radius: 50%; }
    .book-nav__indicator { min-width: 100px; font-size: 12px; }
    .book-nav__btn { width: 38px; height: 38px; font-size: 20px; }
}

/* =====================================================
   Переключатель «Книга / Свиток»
   ===================================================== */
.mode-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    padding: 8px 16px;
    background: rgba(245, 236, 214, 0.9);
    color: var(--ink);
    border: 1px solid rgba(122, 93, 30, 0.3);
    border-radius: 24px;
    font-family: var(--font-title);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.mode-toggle:hover {
    background: var(--parchment);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* =====================================================
   Режим «Свиток»
   ===================================================== */
.book-body--scroll {
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background:
        radial-gradient(ellipse at top, #6b4423 0%, #3d2817 40%, #1f1409 100%) fixed;
    padding: 80px 20px 60px;
}

.book-stage--scroll {
    height: auto !important;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
    display: block;
}

.book-stage--scroll .book {
    filter: none;
    display: block;
}

.book-stage--scroll .page {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    margin: 0 auto 40px;
    padding: 40px 32px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative !important;
    overflow: visible !important;
    transform: none !important;
    min-height: auto !important;
}

.book-stage--scroll .page--cover {
    background:
        radial-gradient(ellipse at 50% 30%, #6b4423 0%, #3d2817 60%, #1f1409 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-stage--scroll .page__content {
    column-count: 1 !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}

.book-stage--scroll .page__inner {
    height: auto !important;
}

.book-stage--scroll .book-nav {
    display: none;
}

/* StPageFlip-специфичные правки */
.stf__parent { margin: 0 auto; }
.stf__item { overflow: hidden; }

/* Тонкая настройка StPageFlip: узкие полосы-разделители */
.stf__outerShadow,
.stf__innerShadow {
    pointer-events: none;
}

/* Плавный переход при клике на оглавление */
.toc__link { cursor: pointer; }

/* =====================================================
   ЭПИГРАФЫ
   ===================================================== */
.epigraph {
    margin: 0 0 24px;
    padding: 12px 20px;
    border-left: 3px solid var(--gold);
    background: rgba(176, 141, 63, 0.06);
    font-style: italic;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-soft);
    break-inside: avoid;
}

.epigraph p {
    margin: 0 0 6px;
    text-indent: 0 !important;
}

.epigraph p:last-child { margin-bottom: 0; }

.epigraph cite {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--gold-deep);
    font-style: normal;
    letter-spacing: 1px;
    margin-top: 4px;
}

.epigraph--final {
    border-left: none;
    border-top: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    background: transparent;
    text-align: center;
    font-family: var(--font-title);
    font-style: normal;
    letter-spacing: 2px;
    color: var(--gold-deep);
    padding: 14px 20px;
    margin: 20px 0;
    font-size: 14px;
}

/* =====================================================
   ОРНАМЕНТЫ-РАЗДЕЛИТЕЛИ
   ===================================================== */
.ornament {
    text-align: center;
    color: var(--gold);
    letter-spacing: 8px;
    font-size: 14px;
    margin: 20px 0;
    break-inside: avoid;
    opacity: 0.8;
}

/* =====================================================
   ПОДЗАГОЛОВКИ ВНУТРИ СКАЗА
   ===================================================== */
.section-title {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--gold-deep);
    text-align: center;
    letter-spacing: 2px;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(122, 93, 30, 0.25);
    break-inside: avoid;
}

/* =====================================================
   ИЛЛЮСТРАЦИИ
   ===================================================== */
.illustration {
    margin: 16px 0;
    text-align: center;
    break-inside: avoid;
}

.illustration img {
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(122, 93, 30, 0.3);
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.15);
}

.illustration--placeholder {
    padding: 30px 20px;
    background: rgba(176, 141, 63, 0.05);
    border: 1px dashed rgba(122, 93, 30, 0.3);
    border-radius: 4px;
}

.illustration__caption {
    font-style: italic;
    font-size: 11px;
    color: var(--gold-deep);
    letter-spacing: 1px;
}

/* =====================================================
   РАЗНОЕ
   ===================================================== */
.page__content em {
    font-style: italic;
    color: var(--ink-soft);
}

.page__content strong { color: var(--ink); }

.page__content h3 { break-after: avoid; }

/* =====================================================
   Картинка на обложке
   ===================================================== */
.cover__illustration {
    margin: 16px 0;
    text-align: center;
}

.cover__illustration img {
    max-width: 90%;
    max-height: 200px;
    height: auto;
    border: 2px solid var(--gold);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* =====================================================
   Иллюстрации в сказах — финальные штрихи
   ===================================================== */
.illustration img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid rgba(122, 93, 30, 0.4);
    border-radius: 3px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 0 0 4px var(--parchment);
    background: var(--parchment);
    padding: 4px;
}

.illustration__caption {
    margin-top: 6px;
    font-size: 10.5px;
}

/* В режиме свитка — чуть иначе */
.book-stage--scroll .illustration img {
    max-height: 500px;
}

/* =====================================================
   ВЕРХНИЕ ССЫЛКИ В КНИГЕ (На сайт + Нейробылины)
   ===================================================== */
.top-nav-links {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.top-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(245, 236, 214, 0.92);
    color: var(--ink);
    text-decoration: none;
    border-radius: 24px;
    font-size: 13px;
    font-family: var(--font-title);
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border: 1px solid rgba(122, 93, 30, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.top-link:hover {
    background: var(--parchment);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.top-link svg { stroke: var(--gold-deep); flex-shrink: 0; }

/* Старая кнопка .return-to-site — оставляем для совместимости */
.return-to-site {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(245, 236, 214, 0.9);
    color: var(--ink);
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid rgba(122, 93, 30, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   ИНДЕКС РАЗДЕЛА «НЕЙРОБЫЛИНЫ»
   ===================================================== */
.index-body {
    background:
        radial-gradient(ellipse at center, #4a2f1c 0%, #2a1810 60%, #140b05 100%);
    font-family: var(--font-text);
    color: var(--ink);
    min-height: 100vh;
    margin: 0;
    padding: 80px 20px 60px;
    overflow-x: hidden;
}

.index-stage {
    max-width: 1100px;
    margin: 0 auto;
}

.index-header {
    text-align: center;
    margin-bottom: 48px;
    color: var(--parchment);
}

.index-header__series {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.index-header__title {
    font-family: var(--font-title);
    font-size: 56px;
    color: var(--parchment);
    margin: 8px 0 16px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.index-header__ornament {
    color: var(--gold);
    font-size: 20px;
    letter-spacing: 8px;
    margin-bottom: 20px;
}

.index-header__intro {
    font-size: 15px;
    font-style: italic;
    line-height: 1.7;
    color: rgba(245, 236, 214, 0.85);
    max-width: 640px;
    margin: 0 auto;
}

/* --- Сетка книг --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.book-card {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px;
    background: var(--parchment);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(176, 141, 63, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    border: 1px solid rgba(122, 93, 30, 0.35);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ink);
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--gold), var(--gold-deep));
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: var(--gold);
}

.book-card__cover {
    flex-shrink: 0;
    width: 100px;
    height: 140px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--wood);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.3);
}

.book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card__placeholder {
    font-size: 48px;
    color: var(--gold);
    opacity: 0.6;
}

.book-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.book-card__subtitle {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-style: italic;
    margin-bottom: 4px;
}

.book-card__title {
    font-family: var(--font-title);
    font-size: 20px;
    color: var(--ink);
    margin: 0 0 8px;
    line-height: 1.15;
}

.book-card__description {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-soft);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card__meta {
    font-size: 11px;
    color: var(--gold-deep);
    font-style: italic;
    margin-top: auto;
    display: flex;
    gap: 6px;
}

/* --- Пустое состояние --- */
.index-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(245, 236, 214, 0.6);
    font-style: italic;
    font-size: 15px;
}

/* --- Футер индекса --- */
.index-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(176, 141, 63, 0.25);
    color: rgba(245, 236, 214, 0.55);
    font-size: 12px;
    font-style: italic;
    line-height: 1.6;
}

.index-footer__ornament {
    color: var(--gold);
    letter-spacing: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.index-footer p { margin: 4px 0; }

/* --- Адаптив --- */
@media (max-width: 768px) {
    .index-body { padding: 70px 14px 40px; }
    .index-header__title { font-size: 34px; }
    .index-header__intro { font-size: 13px; }
    .books-grid { grid-template-columns: 1fr; gap: 16px; }

    .top-nav-links {
        top: 10px;
        left: 10px;
        gap: 6px;
    }

    .top-link {
        padding: 6px 10px;
        font-size: 11px;
    }

    .top-link span { display: none; }
    .top-link svg { width: 18px; height: 18px; }

    .book-card {
        padding: 12px;
        gap: 12px;
    }

    .book-card__cover {
        width: 80px;
        height: 110px;
    }

    .book-card__title { font-size: 17px; }
    .book-card__description { font-size: 11.5px; -webkit-line-clamp: 2; }
}

/* =====================================================
   ИНДЕКС — расширенные секции
   ===================================================== */

.index-about,
.index-books,
.index-how,
.index-heroes,
.index-what {
    margin: 50px 0;
}

.index-about p {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(245, 236, 214, 0.85);
    margin: 0 0 14px;
    text-align: justify;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.index-section-title {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--parchment);
    text-align: center;
    letter-spacing: 2px;
    margin: 0 0 32px;
    position: relative;
    padding-bottom: 16px;
}

.index-section-title::after {
    content: "✦ ❧ ✦";
    display: block;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 8px;
}

/* --- Как читать --- */
.index-how__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.index-how__item {
    background: var(--parchment);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(176, 141, 63, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    border: 1px solid rgba(122, 93, 30, 0.35);
    border-radius: 6px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.index-how__icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.index-how__heading {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--gold-deep);
    margin: 0 0 10px;
    letter-spacing: 1px;
}

.index-how__item p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 0;
}

/* --- Герои --- */
.index-heroes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.index-hero {
    background: rgba(245, 236, 214, 0.06);
    border: 1px solid rgba(176, 141, 63, 0.3);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    padding: 16px 20px;
    transition: all 0.25s ease;
}

.index-hero:hover {
    background: rgba(245, 236, 214, 0.12);
    border-left-color: var(--gold-deep);
}

.index-hero__name {
    font-family: var(--font-title);
    font-size: 17px;
    color: var(--gold);
    margin: 0 0 8px;
    letter-spacing: 1px;
}

.index-hero__desc {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(245, 236, 214, 0.85);
    margin: 0;
    font-style: italic;
}

/* --- Что вас ждёт --- */
.index-what__list {
    list-style: none;
    padding: 0;
    max-width: 780px;
    margin: 0 auto;
}

.index-what__list li {
    position: relative;
    padding: 14px 0 14px 36px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(245, 236, 214, 0.9);
    border-bottom: 1px dashed rgba(176, 141, 63, 0.2);
}

.index-what__list li:last-child {
    border-bottom: none;
}

.index-what__list li::before {
    content: "❧";
    position: absolute;
    left: 8px;
    top: 14px;
    color: var(--gold);
    font-size: 16px;
}

/* --- Мелкий шрифт в футере --- */
.index-footer__small {
    font-size: 10.5px !important;
    color: rgba(245, 236, 214, 0.35) !important;
    margin-top: 16px !important;
}

/* --- Мобильная адаптация для новых секций --- */
@media (max-width: 768px) {
    .index-about,
    .index-books,
    .index-how,
    .index-heroes,
    .index-what {
        margin: 30px 0;
    }

    .index-section-title {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .index-about p {
        font-size: 13.5px;
    }

    .index-how__grid {
        grid-template-columns: 1fr;
    }

    .index-heroes__grid {
        grid-template-columns: 1fr;
    }

    .index-what__list li {
        font-size: 13px;
    }
}

/* =====================================================
   ЖЁСТКИЙ ФИКС ЧИТАЕМОСТИ НА ИНДЕКСЕ
   (чтобы текст не сливался с тёмным фоном)
   ===================================================== */

/* Заголовок "Что это такое" и текст под ним */
.index-about h2,
.index-about p {
    color: #f5ecd6 !important; /* Светлый цвет */
}

/* Заголовки секций: "Книги раздела", "Как читать", "Кто здесь живёт", "Что вас ждёт" */
.index-section-title {
    color: #f5ecd6 !important;
}

/* Описания героев */
.index-hero__desc {
    color: rgba(245, 236, 214, 0.85) !important;
}

/* Список "Что вас ждёт" */
.index-what__list li {
    color: rgba(245, 236, 214, 0.9) !important;
}

/* Вводный текст (на всякий случай) */
.index-header__intro {
    color: rgba(245, 236, 214, 0.85) !important;
}