@font-face {
    font-family: "Frank Ruhl Libre";
    src: url("fonts/frank-ruhl-libre.57720a889009.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
    unicode-range: U+0590-05FF, U+FB1D-FB4F, U+200C-2010, U+20AA;
}
:root {
    --paper: #FAF8F3;
    --surface: #FFFFFF;
    --ink: #22201D;
    --ink-soft: #5F594F;
    --accent: #7C2E3B;
    --accent-strong: #5E2029;
    --rule: #DED8CC;
    --measure: 44rem;
    --sidebar: 15rem;
    --media: 52rem;
}

[data-theme="dark"] {
    color-scheme: dark;
    --paper: #191817;
    --surface: #201F1D;
    --ink: #E8E3DA;
    --ink-soft: #9A9287;
    --accent: #C77F8C;
    --accent-strong: #E0A3AD;
    --rule: #35332F;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "PT Serif", Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Верхняя полоса ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Cormorant", serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.brand-logo {
    height: 2rem;
    width: auto;
    display: block;
}
.search {
    flex: 1;
    max-width: 26rem;
    display: flex;
    gap: 0.5rem;
}
.search input {
    flex: 1;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.45rem 0.7rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 2px;
}
.search input::placeholder { color: var(--ink-soft); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.theme-toggle {
    margin-left: auto;
    background: none;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--ink-soft);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}
.theme-toggle:hover { color: var(--accent-strong); border-color: var(--accent); }

/* ── Каркас: колонка + контент ── */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 3rem;
    max-width: 68rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}
@media (min-width: 1100px) {
    .layout {
        max-width: 80rem;
        gap: 4rem;
        grid-template-columns: 19rem minmax(0, 1fr);
    }
}
.sidebar { position: sticky; top: 5rem; align-self: start; }
.sidebar .eyebrow { margin-bottom: 1rem; }
.genre-list { list-style: none; margin: 0; padding: 0; font-size: 0.98rem; }
.genre-list li { margin-bottom: 0.55rem; }
.genre-list a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}
.genre-list a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.genre-list a.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

.content { min-width: 0; }

/* ── Типографика ── */
.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.75rem;
}
h1.work-title {
    font-family: "Cormorant", serif;
    font-weight: 600;
    font-size: 2.4rem;
    line-height: 1.1;
    margin: 0 0 0.4rem;
}
.meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 2rem; }
.meta a { color: var(--ink-soft); }

/* ── Каталог ── */
.work-list { list-style: none; padding: 0; margin: 0; }
.work-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.work-list a { color: var(--ink); text-decoration: none; font-size: 1.25rem; }
.work-list a:hover { color: var(--accent-strong); }
.work-list .type { color: var(--ink-soft); font-size: 0.9rem; }

/* ── Произведение ── */
.work-body { max-width: var(--measure); }
.work-body p { margin: 0 0 1.2rem; }

/* Выравнивание по обоим краям — только для сплошного текста */
.work-body.justified p {
    text-align: justify;
    text-wrap: pretty;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 8 4 3;
}

.divider { text-align: center; color: var(--accent); margin: 3rem 0; }

.attachment { margin: 1.5rem 0; }
.attachment img { max-width: 100%; border-radius: 2px; }
.attachment audio { width: 100%; max-width: var(--measure); }
.attachment .caption { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.4rem; }


.btn {
    font-family: inherit;
    font-size: 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 2px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
}
.btn:hover { background: var(--accent-strong); }
[data-theme="dark"] .btn { color: #191817; }

/* ── Служебное ── */
.flash { color: var(--accent-strong); font-style: italic; margin: 1rem 0; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--ink-soft); text-decoration: none; }
.back-link:hover { color: var(--accent-strong); }
.honeypot { position: absolute; left: -5000px; }

.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    padding: 1.5rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-align: center;
}

a:focus-visible, .btn:focus-visible, .theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 800px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 1.5rem;
    }

    .sidebar {
        display: none;
    }

    .content {
        order: 1;
    }

    .genre-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem 1rem;
    }

    .genre-list li {
        margin: 0;
    }

    .brand {
        font-size: 1.25rem;
    }

    body {
        font-size: 1.05rem;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        padding: 0.75rem 1rem;
    }

    .brand {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-toggle {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .search {
        order: 3;
        flex: 1 0 100%;
        max-width: none;
    }
}
    /* Сворачивающийся блок жанров */
.genre-box { margin-top: 1.75rem; }
.genre-box summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.genre-box summary::-webkit-details-marker { display: none; }
.genre-box summary::before { content: "▸"; font-size: 0.7rem; transition: transform .15s; }
.genre-box[open] summary::before { transform: rotate(90deg); }
.genre-box summary:hover { color: var(--accent-strong); }
.genre-box .genre-list { margin-top: 0.9rem; }

/* Видео */
.attachment video { width: 100%; max-width: var(--media); border-radius: 2px;  }
.main-video { margin: 0 0 2rem; }
.video-embed { position: relative; max-width: var(--media); aspect-ratio: 16 / 9; }
.video-embed iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0; border-radius: 2px;
}

/* Пометки для админа */
.admin-note {
    border: 1px dashed var(--accent);
    color: var(--accent-strong);
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}
.badge-draft {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 2px;
    padding: 0.05rem 0.35rem;
    margin-left: 0.5rem;
}
/* ── Строка под текстом: лайк + жанры ── */
.work-footer {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 2.25rem 0 0;
}
.work-genres { font-size: 0.85rem; color: var(--ink-soft); }
.work-genres a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.work-genres a:hover { border-bottom-color: var(--accent); color: var(--ink); }

/* ── Лайк ── */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color .15s;
}
.like-btn .heart {
    font-size: 1.5rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.2px var(--ink-soft);
    transition: color .2s, -webkit-text-stroke-color .2s, transform .2s;
}
.like-btn:hover .heart { -webkit-text-stroke-color: var(--accent); transform: scale(1.08); }
.like-btn.liked .heart {
    color: var(--accent);
    -webkit-text-stroke-color: var(--accent);
    animation: pop .3s ease-out;
}
.like-btn.liked { color: var(--accent); }
.like-btn:disabled { opacity: .5; cursor: default; }
.like-count:empty { display: none; }

.like-btn.small .heart { font-size: 1.15rem; -webkit-text-stroke-width: 1px; }
.like-btn.small { font-size: 0.8rem; }

@keyframes pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .like-btn.liked .heart { animation: none; }
    .like-btn .heart { transition: none; }
}

/* ── Комментарии ── */
.comments { margin-top: 1rem; }
.comment {
    border: none;
    border-top: 1px solid var(--rule);
    padding: 1.35rem 0;
    margin: 0;
}
.comment:first-child { border-top: none; }
.comment-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.comment .who {
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink);
}
.comment .when { color: var(--ink-soft); font-size: 0.78rem; }
.comment-body { margin: 0; }
.comment-body p { margin: 0 0 0.6rem; }
.comment-body p:last-child { margin-bottom: 0; }
.comment .like-btn { margin-top: 0.5rem; }
/* ── Форма комментария ── */
.comment-form { max-width: var(--measure); margin-top: 2rem; }
.comment-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
}
.comment-form input[type=text],
.comment-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 2px;
    margin-bottom: 1rem;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
/* ── Кнопка «добавить комментарий» ── */
.comment-box { margin: 0 0 1rem; }
.comment-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    color: var(--ink-soft);
    padding: 0.4rem 0;
    transition: color .15s;
}
.comment-toggle::-webkit-details-marker { display: none; }
.comment-toggle:hover { color: var(--accent-strong); }
.comment-toggle .plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-size: 1rem;
    line-height: 1;
    transition: transform .2s, border-color .15s;
}
.comment-toggle:hover .plus { border-color: var(--accent); }
.comment-box[open] .comment-toggle .plus { transform: rotate(45deg); }
.comment-box[open] .comment-toggle { color: var(--accent-strong); }
.comment-form textarea {
    min-height: 3.2rem;
    max-height: 22rem;
    resize: vertical;
    overflow-y: hidden;
    line-height: 1.5;
}
/* ── Полоса прогресса чтения ── */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    z-index: 20;
    pointer-events: none;
}
.read-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width .08s linear;
}

/* ── Кнопка «наверх» ── */
.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity .2s, transform .2s, color .15s, border-color .15s;
    z-index: 15;
}
.to-top.show { opacity: 1; transform: translateY(0); }
.to-top:hover { color: var(--accent-strong); border-color: var(--accent); }

/* ── Плашка «продолжить чтение» ── */
.resume-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.55rem 0.75rem;
    margin-bottom: 1.25rem;
    animation: fade-in .25s ease-out;
}
.resume-bar[hidden] { display: none; }
.resume-bar button {
    font: inherit;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    padding: 0;
}
.resume-bar button:hover { color: var(--accent-strong); }
#resumeDismiss { margin-left: auto; font-size: 1.1rem; line-height: 1; color: var(--ink-soft); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 800px) {
    .to-top { right: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .read-progress span, .to-top, .resume-bar { transition: none; animation: none; }
}
/* ── Сборники в разделе ── */
.collections-strip { margin-bottom: 2.5rem; }
.collection-cards { list-style: none; margin: 0; padding: 0; }
.collection-cards li { border-bottom: 1px solid var(--rule); }
.collection-cards a {
    display: block;
    padding: 0.7rem 0;
    color: var(--ink);
    text-decoration: none;
    font-size: 1.15rem;
    transition: color .15s;
}
.collection-cards a:hover { color: var(--accent-strong); }

/* ── Список произведений в сборнике ── */
.collection-list { padding-left: 1.5rem; }
.collection-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.collection-list a { color: var(--ink); text-decoration: none; font-size: 1.2rem; }
.collection-list a:hover { color: var(--accent-strong); }

/* ── Навигация по сборнику на странице произведения ── */
.collection-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    padding: 0.6rem 0;
    margin: 0.5rem 0 1.5rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.collection-nav a { color: var(--ink-soft); text-decoration: none; }
.collection-nav a:hover { color: var(--accent-strong); }
.collection-nav .col-title { flex: 1; text-align: center; }
/* Значок описания в списке */
.desc-pop { display: inline; }
.desc-pop summary {
    display: inline;
    list-style: none;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 0.9rem;
    margin-left: 0.35rem;
}
.desc-pop summary::-webkit-details-marker { display: none; }
.desc-pop summary:hover { color: var(--accent-strong); }
.desc-pop[open] p {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    font-size: 0.92rem;
    color: var(--ink-soft);
    max-width: var(--measure);
}

/* Блок описания на странице произведения */
.work-desc {
    max-width: var(--measure);
    margin: 0 0 1.5rem;
}
.work-desc summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.work-desc summary::-webkit-details-marker { display: none; }
.work-desc summary::before { content: "ⓘ "; }
.work-desc[open] summary { margin-bottom: 0.5rem; }
.work-desc p {
    margin: 0;
    font-style: italic;
    color: var(--ink-soft);
}
/* ── Колонка в режиме сборника ── */
.collection-name {
    font-family: "Cormorant", serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--ink);
}
.toc {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0;
    font-size: 0.92rem;
}
.toc li {
    counter-increment: toc;
    margin-bottom: 0.5rem;
    padding-left: 1.6rem;
    position: relative;
    line-height: 1.35;
}
.toc li::before {
    content: counter(toc) ".";
    position: absolute;
    left: 0;
    color: var(--ink-soft);
    font-size: 0.82rem;
}
.toc a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.toc a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.toc li.current { color: var(--accent-strong); font-weight: 700; }
.toc li.current::before { color: var(--accent); }

.sidebar-sep {
    height: 1px;
    background: var(--rule);
    margin: 1.75rem 0;
}
/* ── Главная ── */
.hero { text-align: center; margin: 1rem 0 3rem; }
.hero-logo { max-width: 260px; width: 60%; height: auto; }
.hero-tagline {
    font-family: "Cormorant", serif;
    font-size: 1.4rem;
    color: var(--ink-soft);
    margin: 0.5rem 0 0;
}

/* ── Свёрнутые полосы раздела: Новое, Сборники, Ассорти ── */
.strip {
    border-bottom: 1px solid var(--rule);
    padding: 0.4rem 0;
}
.strip summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.4rem 0;
}
.strip summary::-webkit-details-marker { display: none; }
.strip summary::before {
    content: "▸";
    font-size: 0.7rem;
    transition: transform .15s;
    color: var(--accent);
}
.strip[open] summary::before { transform: rotate(90deg); }
.strip summary:hover { color: var(--accent-strong); }
.strip .hint { text-transform: none; letter-spacing: 0; color: var(--ink-soft); font-size: 0.9em; }
.strip .mini-list,
.strip .collection-cards { margin: 0.5rem 0 1rem; }

.mini-list { list-style: none; padding: 0; }
.mini-list li { padding: 0.35rem 0; }
.mini-list a { color: var(--ink); text-decoration: none; }
.mini-list a:hover { color: var(--accent-strong); }

/* отступ перед основным списком раздела */
.work-list { margin-top: 1.5rem; }
/* ── Плеер ── */
.player {
    position: sticky;
    top: 5rem;
    z-index: 5;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}
.player-col {
    align-self: start;
}
.player-bar { display: flex; align-items: center; gap: 0.75rem; }
.player-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: var(--ink-soft); padding: 0.2rem;
    transition: color .15s;
}
.player-btn:hover { color: var(--accent-strong); }
.player-play { font-size: 1.4rem; color: var(--accent); }
.player-now { flex: 1; min-width: 0; }
.player-title {
    display: block; font-size: 0.9rem; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}
.player-seek {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--rule);
    border-radius: 3px;
    outline: none;
    margin: 0.3rem 0;
}
/* дорожка — Firefox */
.player-seek::-moz-range-track {
    height: 6px;
    background: var(--rule);
    border-radius: 3px;
}
/* бегунок — Chrome/Safari */
.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--paper);
    cursor: pointer;
}
/* бегунок — Firefox */
.player-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--paper);
    cursor: pointer;
}
.player-time { font-size: 0.8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.player-list { list-style: none; counter-reset: pl; margin: 0; padding: 0; }
.player-list li {
    counter-increment: pl;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0; border-bottom: 1px solid var(--rule);
}
.player-list li::before {
    content: counter(pl); color: var(--ink-soft); font-size: 0.8rem;
    width: 1.5rem; text-align: right; flex-shrink: 0;
}
.pl-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    padding: 0;
    color: var(--ink);
}
.pl-icon { color: var(--accent); font-size: 0.9rem; flex-shrink: 0; }
.pl-row:hover .pl-title { color: var(--accent-strong); }
.pl-row:hover .pl-icon { color: var(--accent-strong); }
.pl-title {
    color: var(--ink);
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.3;
}
.pl-text { font-size: 0.85rem; color: var(--ink-soft); text-decoration: none; flex-shrink: 0; }
.pl-text:hover { color: var(--accent-strong); }
.player-list li.playing { color: var(--accent-strong); }
.player-list li.playing .pl-title { color: var(--accent-strong); font-weight: 700; }
.player-list li.pl-noaudio { opacity: 0.6; }
.player-list li.pl-noaudio::before { color: var(--rule); }
/* ── Страница плеера: две колонки ── */
.player-page {
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
.player-col { padding-top: 1rem; }
.player-text { padding-top: 1rem; }

.player-heading { font-size: 1.8rem; margin-bottom: 1.5rem; }
.player-text { position: static; }
.pt-title {
    font-family: "Cormorant", serif;
    font-weight: 600;
    font-size: 1.8rem;
    margin: 0 0 1rem;
}
.pt-full {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    text-decoration: none;
}
.pt-full:hover { color: var(--accent-strong); }
.player-text-hint { font-style: italic; }

.pl-text {
    background: none; border: none; cursor: pointer;
    font: inherit; font-size: 0.85rem;
    color: var(--ink-soft); text-decoration: none;
    flex-shrink: 0; padding: 0;
}
.pl-text:hover { color: var(--accent-strong); }

@media (max-width: 800px) {
    .player-page {
        display: block;
        padding: 1.5rem 1rem 0;
    }
    .player-col, .player-text { padding-top: 0.5rem; }
    .player-text { margin-top: 1.5rem; }
}
/* ── Компактный аудиоплеер на странице произведения ── */
.audio-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--measure);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.5rem 0.85rem;
}
.ap-play {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.ap-play:hover { color: var(--accent-strong); }
.ap-seek {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    background: var(--rule);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.ap-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px; height: 15px;
    margin-top: 0;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--paper);
    cursor: pointer;
}
.ap-seek::-moz-range-thumb {
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--paper);
    cursor: pointer;
}
.ap-time {
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: right;
}

/* ── Лента обновлений ── */
/* ── Лента обновлений ── */
.updates { list-style: none; margin: 0; padding: 0; }
.updates li { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.upd-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
}
.upd-date {
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    min-width: 7rem;
    flex-shrink: 0;
}
.updates a { color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.updates a:hover { color: var(--accent-strong); }
.upd-what {
    color: var(--ink-soft);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    padding-left: 7.6rem;
}
/* ── Разметка внутри текста произведения ── */
/* чтобы якорь не уезжал под липкую панель сайта */

.work-body h2, .work-body h3, .work-body h4 {
    font-family: "Cormorant", serif;
    font-weight: 700;
    color: var(--ink);
    margin: 3rem 0 1.25rem;
    text-align: center;
    scroll-margin-top: 5rem;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
}
.work-body h2 { font-size: 2.1rem; }
.work-body h3 { font-size: 1.7rem; }
.work-body h4 { font-size: 1.35rem; }
.work-body em { font-style: italic; }
.work-body hr {
    border: none;
    margin: 2.5rem 0;
    text-align: center;
    overflow: visible;
    height: 0;
}
.work-body hr::before {
    content: "* * *";
    color: var(--ink-soft);
    letter-spacing: 0.4em;
    font-size: 1.05rem;
    line-height: 1;
}
.work-body blockquote {
    margin: 1.5rem 0;
    padding-left: 1.2rem;
    border-left: 2px solid var(--rule);
    color: var(--ink-soft);
    font-style: italic;
}

/* ── Сноски-примечания ── */
.work-body sup[id^="fnref"] a {
    display: inline-block;
    min-width: 1.15em;
    height: 1.15em;
    line-height: 1.15em;
    text-align: center;
    font-size: 0.7em;
    color: var(--paper);
    background: var(--accent);
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    vertical-align: super;
    transition: background .15s;
}
.work-body sup[id^="fnref"] a:hover { background: var(--accent-strong); }
.work-body sup[id^="fnref"].open a { background: var(--ink); }

.fn-pop {
    display: block;
    margin: 0.6rem 0;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink-soft);
    text-align: left;
    animation: fade-in .2s ease-out;
}
.fn-pop[hidden] { display: none; }
.fn-pop p { margin: 0; }

/* список сносок внизу — скрываем, они теперь раскрываются в тексте */
.work-body .footnote { display: none; }

/* ── Оглавление глав внутри произведения ── */
.chapters-toc { counter-reset: none; }
.chapters-toc li { padding-left: 0; margin-bottom: 0.45rem; }
.chapters-toc li::before { content: none; }
.chapters-toc li.lvl-3 { padding-left: 0.8rem; font-size: 0.88rem; }
.chapters-toc li.lvl-4 { padding-left: 1.6rem; font-size: 0.85rem; }
.chapters-toc a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    line-height: 1.35;
}
.chapters-toc a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.chapters-toc a.current { color: var(--accent-strong); font-weight: 700; }


@media (min-width: 801px) {
    .sidebar {
        position: sticky;
        top: 5rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
}
/* ── Плавающая кнопка оглавления (мобильное) ── */
.toc-fab {
    display: none;               /* по умолчанию скрыта; показываем только на узких */
    position: fixed;
    right: 1rem;
    bottom: 4.5rem;              /* выше кнопки «наверх», чтобы не налезали */
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 16;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .toc-fab { color: #191817; }

.toc-sheet {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: flex-end;
}
.toc-sheet-inner {
    background: var(--paper);
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 12px 12px 0 0;
    animation: sheet-up .2s ease-out;
}
.toc-sheet .chapters-toc { font-size: 1.05rem; }
.toc-sheet .chapters-toc li { margin-bottom: 0.75rem; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 800px) {
    .toc-fab { display: block; }   /* кнопка появляется только на телефоне */
}
@media (prefers-reduced-motion: reduce) {
    .toc-sheet-inner { animation: none; }
}
.toc-sheet[hidden] { display: none; }
.toc-sheet .chapters-toc { text-align: center; }
.toc-sheet .chapters-toc li { padding-left: 0; }
.toc-sheet .chapters-toc li.lvl-3,
.toc-sheet .chapters-toc li.lvl-4 { padding-left: 0; }

.pt-collapse {
    display: none;
}
@media (max-width: 800px) {
    .pt-collapse {
        display: inline-block;
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        background: var(--accent);
        color: var(--paper);
        border: none;
        border-radius: 999px;
        padding: 0.55rem 1.3rem;
        font-size: 0.85rem;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    }
    [data-theme="dark"] .pt-collapse { color: #191817; }
}
.genre-tag {
    display: inline;
    white-space: nowrap;
}
.genre-info {
    display: inline;
}
.genre-info summary {
    display: inline;
    cursor: pointer;
    color: var(--accent);
    font-size: 0.85em;
    margin-left: 0.15em;
    list-style: none;
    user-select: none;
}
.genre-info summary::-webkit-details-marker { display: none; }
.genre-info summary:hover { color: var(--accent-strong); }
.genre-desc {
    display: block;
    margin: 0.5rem 0;
    padding: 0.6rem 0.9rem;
    background: var(--surface);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ink-soft);
    white-space: normal;
}
.genres-label {
    color: var(--ink-soft);
    margin-right: 0.3rem;
}
/* ── Дерево сборников в колонке ── */
.section-tree .tree-node > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.section-tree .tree-node > summary::-webkit-details-marker { display: none; }
.section-tree .tree-node > summary::before {
    content: "▸";
    font-size: 0.7rem;
    color: var(--accent);
    transition: transform .15s;
    flex-shrink: 0;
}
.section-tree .tree-node[open] > summary::before { transform: rotate(90deg); }
.tree-children {
    list-style: none;
    padding-left: 1rem;
    margin: 0.3rem 0;
}
.tree-children li { margin: 0.25rem 0; }

/* Подсборники на странице сборника */
.subcollections { margin-bottom: 2rem; }
.subcollections .collection-cards a { font-weight: 600; }
.subcollections .collection-cards a::before { content: "📁 "; opacity: 0.6; }
/* пункты без треугольника — тот же отступ, чтобы названия шли столбцом */
.section-tree li > a { padding-left: 1rem; }
@media (min-width: 801px) {
}
/* ── Ссылки внутри текста произведения ── */
.work-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition: color .15s, border-color .15s;
}
.work-body a:hover {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
}
/* ── Обложка произведения ── */
.work-cover {
    margin: 0 0 2rem;
    text-align: center;
}
.work-cover img {
    width: 50%;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 3px;
}
.work-cover figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-style: italic;
}

@media (max-width: 800px) {
    .work-cover img {
        width: 100%;
        max-height: 50vh;
    }
}
.rights-page h3 {
    font-family: "Cormorant", serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    text-align: left;
    color: var(--ink);
}
.rights-page p { margin: 0 0 0.9rem; }
.site-footer a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.site-footer a:hover {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
}

/* ── Поиск: галочка и кнопка ── */
.search-scope {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
}
.search-scope:hover { color: var(--ink); }
.search-scope input {
    margin: 0;
    accent-color: var(--accent);
}
[data-theme="dark"] .search-scope input {
    accent-color: #5a3740;

}

.search-btn {
    align-self: center;
    background: none;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.search-btn:hover { color: var(--accent-strong); border-color: var(--accent); }
/* ── Мобильное меню (выдвижная панель слева) ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.4rem;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink-soft);
    border-radius: 1px;
    transition: background .15s;
}
.nav-toggle:hover span { background: var(--accent); }

.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
}
.nav-drawer[hidden] { display: none; }
.nav-drawer-inner {
    position: relative;
    background: var(--paper);
    width: 80%;
    max-width: 20rem;
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem 1.25rem 3rem;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.nav-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.nav-close:hover { color: var(--accent-strong); }
.nav-drawer-inner .eyebrow { margin-top: 0; }

@media (max-width: 800px) {
    .nav-toggle { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
    .nav-drawer-inner { animation: none; }
}
.work-body:not(.justified) h2,
.work-body:not(.justified) h3,
.work-body:not(.justified) h4 {
    text-align: left;
}
.work-body:not(.justified) hr { text-align: left; }
@media (max-width: 800px) {
    .search input[type="search"] {
        min-width: 0;
        width: 7rem;
        flex: 0 0 auto;
    }
    .search-scope {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .search-btn {
        padding: 0.15rem 0.4rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
}
/* Телефон лёжа: шапка прячется при чтении вниз, возвращается при движении вверх */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar {
        transition: transform .25s ease;
    }
    .topbar.hidden-up {
        transform: translateY(-100%);
    }
}
/* Выдвижное меню: пункты одним столбцом */
.nav-drawer-inner .genre-list,
.nav-drawer-inner .section-tree,
.nav-drawer-inner .tree-children {
    display: block;
}
.nav-drawer-inner .genre-list li,
.nav-drawer-inner .section-tree > li,
.nav-drawer-inner .tree-children li {
    display: block;
    margin-bottom: 0.6rem;
}
.nav-drawer-inner a {
    display: inline-block;
    padding: 0.15rem 0;
}
/* Строка разделов под шапкой — только на телефоне */
.quicknav { display: none; }

@media (max-width: 800px) {
    .quicknav {
        display: flex;
        align-items: center;
        gap: 0.15rem;
        padding: 0.4rem 1rem;
        border-bottom: 1px solid var(--rule);
        background: var(--paper);
        font-size: 0.9rem;
    }
    .quicknav a {
        flex: 1;
        text-align: center;
        padding: 0.35rem 0.2rem;
        color: var(--ink-soft);
        text-decoration: none;
        border-radius: 3px;
    }
    .quicknav a.active {
        color: var(--accent-strong);
        background: var(--surface);
    }
    .quicknav-more {
        flex: 0 0 auto;
        padding: 0.35rem 0.7rem;
        background: none;
        border: 1px solid var(--rule);
        border-radius: 3px;
        color: var(--ink-soft);
        font-family: inherit;
        font-size: 0.85rem;
        cursor: pointer;
    }
    .quicknav-more:hover { color: var(--accent-strong); }
    .quicknav-back {
        flex: 0 0 auto;
        padding: 0.35rem 0.6rem;
        background: none;
        border: 1px solid var(--rule);
        border-radius: 3px;
        color: var(--ink-soft);
        font-family: inherit;
        font-size: 1rem;
        line-height: 1;
        cursor: pointer;
    }
    .quicknav-back:hover { color: var(--accent-strong); }

}
/* Тонкая линия между колонкой и текстом */
@media (min-width: 801px) {
    .sidebar {
        border-right: 1px solid var(--rule);
        padding-right: 1.5rem;
    }
}
/* Главная: картинка слева, текст справа */
.hero {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
    text-align: left;
}
.hero-logo {
    flex: 0 0 auto;
    width: 13rem;
    max-width: 40%;
}
.hero-text p {
    margin: 0;
    font-family: "Cormorant", serif;
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--ink);
}

@media (max-width: 800px) {
    .hero {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }
    .hero-logo { width: 9rem; max-width: 60%; }
    .hero-text p { font-size: 1rem; text-align: left; }
}
.hero-sign {
    margin: 1rem 0 0;
    font-family: "Cormorant", serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--ink-soft);
    text-align: right;
}

/* Главная без текста — картинка по центру */
.hero.hero-center {
    justify-content: center;
}
.hero.hero-center .hero-logo {
    width: 18rem;
    max-width: 70%;
}
/* Витрины на главной */
.showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 2.5rem;
    margin-top: 2.5rem;
}
.sc-col .eyebrow { margin-bottom: 0.75rem; }
.sc-col .mini-list { margin: 0; }
.sc-col .mini-list li { margin-bottom: 0.6rem; }

@media (max-width: 800px) {
    .showcase { gap: 1.75rem; margin-top: 2rem; }
}
/* Рубрика «От автора» на главной */
.notice {
    margin: 2.5rem 0 0;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
}
.notice .eyebrow { margin: 0 0 0.6rem; }
.notice-text p {
    margin: 0 0 0.75rem;
    line-height: 1.7;
}
.notice-text p:last-child { margin-bottom: 0; }
/* Плеер витрины песен */
.sc-songs li { display: flex; align-items: center; gap: 0.5rem; }
.sc-play {
    flex: 0 0 auto;
    width: 1.6rem; height: 1.6rem;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: none;
    color: var(--accent);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sc-play:hover { border-color: var(--accent); }
.sc-songs li.playing .sc-play {
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
}
.sc-songs li.playing a { color: var(--accent-strong); }
.lang-switch {
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-decoration: none;
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }
.other-langs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0.5rem 0 0;
}
/* Ивритский текст на главной — от правого края */
html[dir="rtl"] .hero-text p:not(.hero-sign) {
    text-align: right;
}

/* На иврите подпись уходит к левому краю */
html[dir="rtl"] .hero-sign {
    text-align: left;
}
/* Ивритский текст — свой шрифт и размер побольше */
html[dir="rtl"] body {
    font-family: "Frank Ruhl Libre", "David Libre", Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.75;
}
/* Ивритские заголовки — свой шрифт и размер */
html[dir="rtl"] h1.work-title {
    font-family: "Frank Ruhl Libre", Georgia, serif;
    font-size: 2.6rem;
    line-height: 1.25;
}
html[dir="rtl"] .eyebrow {
    font-size: 1rem;
    letter-spacing: 0.06em;
}
/* Заголовки внутри ивритского текста — от правого края */
html[dir="rtl"] .work-body h2,
html[dir="rtl"] .work-body h3 {
    text-align: right;
}
.mail-link a {
    font-weight: 600;
}
/* Поделиться */
.share {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 2rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
}
.share-label {
    color: var(--ink-soft);
}
.share-btn {
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.25rem 0.7rem;
    background: none;
    font: inherit;
    cursor: pointer;
}
.share-btn:hover {
    border-color: var(--accent);
}
.share-done {
    color: var(--ink-soft);
    font-size: 0.85rem;
}
/* На иврите кнопка темы уходит в левый угол */
html[dir="rtl"] .theme-toggle {
    margin-right: auto;
    margin-left: 0;
}
/* Просмотр картинки во весь экран */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 2px;
}

/* Указатель на картинках, которые можно открыть */
.work-cover img,
.attachment img,
.work-body img {
    cursor: zoom-in;
}