.ballad-reading-page {
    --ballad-paper: #fffdfa;
    --ballad-paper-warm: #f6f0e5;
    --ballad-ink: #210a00;
    --ballad-gold: #dbbd59;
    --ballad-gold-light: #f2d87d;
    --ballad-muted: #74665e;
    --ballad-rule: rgba(185, 147, 47, 0.28);
    color: var(--ballad-ink);
    font-family: Montserrat, Arial, sans-serif;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

.ballad-page-main {
    overflow: visible;
}

.ballad-reading-page *,
.ballad-reading-page *::before,
.ballad-reading-page *::after {
    box-sizing: border-box;
}

.ballad-reading-page .container {
    box-sizing: content-box;
}

.ballad-breadcrumbs {
    margin-top: 4px;
}

.ballad-breadcrumbs__list {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #786f69;
    font-size: 13px;
    line-height: 1.45;
    list-style: none;
}

.ballad-breadcrumbs__list li {
    min-width: 0;
}

.ballad-breadcrumbs__list li:not(:last-child)::after {
    content: "›";
    margin-left: 10px;
    color: #a09288;
    font-size: 20px;
    line-height: 0;
    vertical-align: -2px;
}

.ballad-breadcrumbs__list a {
    color: inherit;
    text-decoration: none;
    transition: color 160ms ease;
}

.ballad-breadcrumbs__list a:hover {
    color: #8a681b;
}

.ballad-breadcrumbs__current {
    overflow: hidden;
    color: #4d4540;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ballad-layout {
    display: grid;
    grid-template-columns: 346px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin-top: 30px;
    margin-bottom: 90px;
}

.ballad-layout > .aside.ballads {
    width: 100%;
    margin-right: 0;
}

.ballad-main {
    min-width: 0;
}

.ballad-context-nav {
    display: none;
}

.ballad-chapter-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ballad-chapter-nav__link {
    position: relative;
    display: grid;
    gap: 3px;
    min-height: 68px;
    padding: 12px 17px;
    color: var(--ballad-ink);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--ballad-rule);
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(33, 10, 0, 0.045);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ballad-chapter-nav__link--next {
    text-align: right;
}

.ballad-chapter-nav__link:hover {
    border-color: rgba(185, 147, 47, 0.62);
    box-shadow: 0 10px 28px rgba(33, 10, 0, 0.08);
    transform: translateY(-2px);
}

.ballad-chapter-nav__direction {
    color: #8a681b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ballad-chapter-nav__title {
    overflow: hidden;
    font-family: Philosopher;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.ballad-hero {
    position: relative;
    isolation: isolate;
    min-height: 260px;
    padding: 42px 46px 38px;
    overflow: hidden;
    color: var(--ballad-ink);
    background: #f4f4f4;
    border: 1px solid rgba(33, 10, 0, 0.1);
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(33, 10, 0, 0.09);
    margin-top: 20px;
}

.ballad-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: linear-gradient(180deg, #f2d87d, #a77c17);
}

.ballad-hero::after {
    content: attr(data-chapter-number);
    position: absolute;
    z-index: -1;
    right: 18px;
    bottom: -54px;
    color: rgba(33, 10, 0, 0.055);
    font-family: Philosopher;
    font-size: clamp(150px, 18vw, 230px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.08em;
    pointer-events: none;
}

.ballad-hero__kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: #8a681b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.ballad-hero__kicker::before {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
}

.ballad-page__title {
    max-width: 690px;
    margin: 0;
    color: var(--ballad-ink);
    font-family: Philosopher;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-wrap: balance;
}

.ballad-hero__note {
    max-width: 540px;
    margin: 22px 0 0;
    color: #695f59;
    font-size: 13px;
    line-height: 1.55;
}

.ballad-audio {
    margin-top: 22px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--ballad-rule);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(33, 10, 0, 0.06);
}

.ballad-audio__heading,
.ballad-gallery__heading,
.ballad-poem__heading,
.ballad-all-parts__heading {
    margin: 0;
    color: var(--ballad-ink);
    font-family: Philosopher;
    font-weight: 700;
}

.ballad-audio__heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    font-size: 18px;
}

.ballad-audio__heading::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--ballad-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(219, 189, 89, 0.16);
}

.ballad-audio .audiogallery {
    width: 100% !important;
    min-height: 164px;
    margin: 0 !important;
    overflow: visible !important;
    background-color: #f4f4f4 !important;
    border-radius: 12px;
}

.ballad-audio .ap-wrapper {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ballad-audio .audioplayer,
.ballad-audio .audioplayer-inner {
    width: 100% !important;
    max-width: none !important;
}

.ballad-audio .audioplayer,
.ballad-audio .meta-artist,
.ballad-audio .the-name,
.ballad-audio .the-artist,
.ballad-audio .extra-html {
    font-family: Montserrat, Arial, sans-serif !important;
}

.ballad-audio .audioplayer {
    min-height: 164px;
    margin: 0 !important;
    border-radius: 12px;
}

.ballad-audio .audioplayer-inner,
.ballad-audio .audioplayer .ap-controls {
    min-width: 0 !important;
}

.ballad-audio .audioplayer .ap-controls {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
}

.ballad-audio .audioplayer .scrubbar,
.ballad-audio .audioplayer .con-controls {
    width: 100% !important;
    max-width: none !important;
}

.ballad-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
}

.ballad-reading-page a.ballad-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: 260px;
    min-height: 54px;
    margin: 0;
    padding: 12px 22px;
    color: var(--ballad-ink);
    background: linear-gradient(100deg, #f4e4a7 0%, var(--ballad-gold) 100%);
    border: 1px solid rgba(167, 124, 23, 0.38);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(185, 147, 47, 0.17);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.015em;
    text-decoration: none;
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.ballad-reading-page a.ballad-download::before {
    content: "↓";
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.ballad-reading-page a.ballad-download:hover {
    box-shadow: 0 13px 30px rgba(185, 147, 47, 0.26);
    transform: translateY(-2px);
}

.ballad-reading-page .ballad-engagement.book__buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
    min-height: 54px;
    margin: 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(33, 10, 0, 0.1);
    border-radius: 12px;
}

.ballad-reading-page .ballad-engagement.book__buttons > * {
    margin: 0;
    padding: 0;
}

.ballad-reading-page .ballad-view {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4d4540;
    font-size: 13px;
}

.ballad-view__label {
    color: #81766f;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ballad-reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
    gap: 34px;
    align-items: start;
    margin-top: 38px;
}

.ballad-reading-layout--text-only {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.ballad-poem {
    position: relative;
    min-width: 0;
    padding: 42px 48px 54px 58px;
    background:
        linear-gradient(90deg, rgba(219, 189, 89, 0.055), transparent 18%),
        rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(33, 10, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 18px 46px rgba(33, 10, 0, 0.065);
}

.ballad-poem::before {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 40px;
    left: 26px;
    width: 2px;
    background: linear-gradient(180deg, var(--ballad-gold), rgba(219, 189, 89, 0.12));
}

.ballad-poem__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ballad-rule);
}

.ballad-poem__heading {
    font-size: 25px;
    line-height: 1.15;
}

.ballad-poem__part {
    color: #8a681b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ballad-reading-page .ballad-poem__text {
    max-width: 34em;
    color: #2d1911;
    font-family: inherit;
    font-size: 20px;
    font-weight: 400;
    line-height: 30px;
    letter-spacing: 0.03em;
}

.ballad-reading-page .ballad-poem__text strong {
    font-weight: inherit;
}

.ballad-reading-page .ballad-poem__text p {
    margin: 0 0 1.45em;
    padding: 0;
}

.ballad-reading-page .ballad-poem__text p:last-child {
    margin-bottom: 0;
}

.ballad-gallery {
    position: sticky;
    top: 22px;
    min-width: 0;
    padding: 20px 18px 42px;
    color: var(--ballad-ink);
    background: #f4f4f4;
    border: 1px solid rgba(33, 10, 0, 0.1);
    border-radius: 20px;
    box-shadow: 0 16px 38px rgba(33, 10, 0, 0.09);
}

.ballad-gallery__heading {
    margin-bottom: 14px;
    color: var(--ballad-ink);
    font-size: 19px;
    text-align: center;
}

.ballad-gallery__note {
    margin: -5px 0 14px;
    color: var(--ballad-muted);
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: 0.07em;
    text-align: center;
    text-transform: uppercase;
}

.ballad-gallery__slider {
    margin: 0;
}

.ballad-gallery__slider:not(.slick-initialized) > li:not(:first-child) {
    display: none;
}

.ballad-gallery__slider:not(.slick-initialized) > li:first-child,
.ballad-gallery .slick-slide > a {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.ballad-gallery .slick-list,
.ballad-gallery .slick-track,
.ballad-gallery .slick-slide {
    min-width: 0;
}

.ballad-gallery .slick-slide img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 640px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(33, 10, 0, 0.14);
}

.ballad-gallery .slick-prev,
.ballad-gallery .slick-next {
    top: 50%;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 253, 249, 0.92) !important;
    background-image: none !important;
    border: 1px solid rgba(219, 189, 89, 0.46);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.ballad-gallery .slick-prev {
    left: -6px;
    transform: translateY(-50%);
}

.ballad-gallery .slick-next {
    right: -6px;
    transform: translateY(-50%);
}

.ballad-gallery .slick-prev img,
.ballad-gallery .slick-next img {
    width: 15px;
    margin: auto;
}

.ballad-gallery .slick-dots {
    bottom: -30px;
}

.ballad-gallery .slick-dots li button::before {
    color: rgba(33, 10, 0, 0.34);
}

.ballad-gallery .slick-dots li.slick-active button::before {
    color: #8a681b;
}

.ballad-all-parts {
    display: none;
}

.ballad-reading-page .quote__totop2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    color: var(--ballad-ink);
    background: rgba(255, 253, 250, 0.94);
    border: 1px solid var(--ballad-rule);
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(33, 10, 0, 0.12);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.ballad-reading-page .quote__totop2.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ballad-reading-page a:focus-visible,
.ballad-reading-page button:focus-visible {
    outline: 2px solid #b78a1b;
    outline-offset: 3px;
}

@media (min-width: 1001px) {
    .ballad-layout > .aside.ballads {
        position: sticky;
        top: 22px;
        max-height: calc(100vh - 44px);
        overflow-y: auto;
        scrollbar-color: rgba(219, 189, 89, 0.5) transparent;
        scrollbar-width: thin;
    }
}

@media (max-width: 1180px) {
    .ballad-layout {
        grid-template-columns: 310px minmax(0, 1fr);
        gap: 28px;
    }

    .ballad-reading-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
        gap: 24px;
    }

    .ballad-poem {
        padding-right: 34px;
    }

    .ballad-reading-page .ballad-poem__text {
        font-size: 20px;
    }
}

@media (max-width: 1000px) {
    .ballad-breadcrumbs {
        display: none;
    }

    .ballad-layout {
        display: block;
        margin-top: 0;
        margin-bottom: 65px;
    }

    .ballad-main {
        margin-top: 22px;
    }

    .ballad-context-nav.video.video_ballads {
        display: block;
        margin: 0 0 24px;
    }

    .ballad-context-nav .video__left {
        width: 100%;
    }

    .ballad-context-nav .buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        margin: 0;
    }

    .ballad-context-nav .buttons .button {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 50px;
        margin: 0;
        padding: 7px 5px;
        color: var(--ballad-ink);
        background: transparent;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
    }

    .ballad-context-nav .buttons .button.is-current {
        border-bottom-color: var(--ballad-gold);
        font-weight: 700;
    }

    .ballad-chapter-nav {
        margin-bottom: 14px;
    }

    .ballad-hero {
        min-height: 225px;
        padding: 34px 30px;
        border-radius: 20px;
    }

    .ballad-page__title {
        max-width: 620px;
        font-size: 32px;
    }

    .ballad-audio {
        margin-top: 18px;
    }

    .ballad-reading-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
        margin-top: 28px;
    }

    .ballad-poem {
        order: 1;
        width: 100%;
    }

    .ballad-gallery {
        position: relative;
        top: auto;
        order: 2;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .ballad-gallery .slick-slide img {
        max-height: 520px;
    }

    .ballad-all-parts {
        display: block !important;
        margin-top: 28px;
        padding: 26px;
        background: var(--ballad-paper-warm);
        border: 1px solid var(--ballad-rule);
        border-radius: 18px;
    }

    .ballad-all-parts__heading {
        margin-bottom: 18px;
        font-size: 24px;
    }

    .ballad-all-parts__list {
        display: grid;
        gap: 7px;
        margin: 0;
        padding: 0;
        list-style: none;
        counter-reset: ballad-part;
    }

    .ballad-all-parts__list li {
        counter-increment: ballad-part;
    }

    .ballad-all-parts__list a {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        min-height: 44px;
        padding: 8px 10px;
        color: var(--ballad-ink);
        background: rgba(255, 255, 255, 0.6);
        border: 1px solid transparent;
        border-radius: 9px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.35;
        text-decoration: none;
    }

    .ballad-all-parts__list a::before {
        content: counter(ballad-part, decimal-leading-zero);
        color: #9a7623;
        font-family: Philosopher;
        font-size: 15px;
    }

    .ballad-all-parts__list a:hover,
    .ballad-all-parts__list a[aria-current="page"] {
        background: #fffdf9;
        border-color: rgba(185, 147, 47, 0.42);
    }
}

@media (max-width: 991px) {
    .ballad-chapter-nav {
        display: grid;
    }
}

@media (max-width: 620px) {
    .ballad-reading-page .ballad-layout.container {
        width: auto;
        max-width: none;
        padding-right: 20px;
        padding-left: 20px;
    }

    .ballad-main {
        margin-top: 16px;
    }

    .ballad-chapter-nav {
        gap: 7px;
    }

    .ballad-chapter-nav__link {
        min-height: 72px;
        padding: 10px 11px;
        border-radius: 11px;
    }

    .ballad-chapter-nav__direction {
        font-size: 8px;
    }

    .ballad-chapter-nav__title {
        display: -webkit-box;
        overflow: hidden;
        font-size: 13px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .ballad-hero {
        min-height: 218px;
        padding: 30px 22px 28px;
    }

    .ballad-hero::after {
        right: 8px;
        bottom: -30px;
        font-size: 132px;
    }

    .ballad-hero__kicker {
        margin-bottom: 14px;
        font-size: 9px;
        letter-spacing: 0.11em;
    }

    .ballad-hero__kicker::before {
        width: 22px;
    }

    .ballad-page__title {
        max-width: 320px;
        font-size: 26px;
        line-height: 1.1;
    }

    .ballad-hero__note {
        max-width: 280px;
        margin-top: 16px;
        font-size: 11px;
    }

    .ballad-audio {
        padding: 13px;
        border-radius: 14px;
    }

    .ballad-audio__heading {
        font-size: 16px;
    }

    .ballad-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .ballad-reading-page a.ballad-download {
        width: 100%;
        min-width: 0;
    }

    .ballad-reading-page .ballad-engagement.book__buttons {
        justify-content: space-between;
        width: 100%;
    }

    .ballad-reading-layout {
        margin-top: 22px;
    }

    .ballad-poem {
        padding: 30px 20px 38px 36px;
        border-radius: 16px;
    }

    .ballad-poem::before {
        top: 26px;
        bottom: 30px;
        left: 18px;
    }

    .ballad-poem__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 24px;
    }

    .ballad-poem__heading {
        font-size: 22px;
    }

    .ballad-reading-page .ballad-poem__text {
        font-size: 20px;
        line-height: 30px;
        letter-spacing: 0.03em;
    }

    .ballad-reading-page .ballad-poem__text p {
        margin-bottom: 1.35em;
    }

    .ballad-gallery {
        padding: 18px 14px 40px;
        border-radius: 16px;
    }

    .ballad-gallery .slick-slide img {
        max-height: 440px;
    }

    .ballad-gallery .slick-prev {
        left: 0;
    }

    .ballad-gallery .slick-next {
        right: 0;
    }

    .ballad-all-parts {
        padding: 22px 16px;
    }

    .ballad-view__label {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ballad-reading-page *,
    .ballad-reading-page *::before,
    .ballad-reading-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
