/* ======================================================================
   KNIGA — страница книги (book detail)
   Сделано по Figma: wBw581gyxdKAUkcxecf5NE
     Web:    node 1661:2  (1400×2670, контент 1160 по центру)
     Mobile: node 1423:219 (320×3242)
   ====================================================================== */

/* ---- Локальные шрифты ---- */
@font-face {
    font-family: 'Comic Relief';
    src: url("../fonts/ComicRelief-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'BookSerif';
    src: url("../fonts/SansSerifCollection.ttf") format("truetype");
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: local('Arial'), url("../fonts/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url("../fonts/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url("../fonts/Montserrat-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("../fonts/Montserrat-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url("../fonts/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---- base.html: на странице книги шапка/футер из base скрыты ---- */
.landing-page--book {
    background-color: #FCFCF0;
}
.landing-page--book > .site-header,
.landing-page--book > .site-footer {
    display: none;
}
.landing-page--book > .site-main {
    padding: 0;
}

/* ---- Корень страницы книги ---- */
.kniga-page {
    --ink: #341400;
    --line: #95aabe;
    --bg: #fcfcf0;
    --footer-bg: #e9f1e2;

    position: relative;
    background-color: var(--bg);
    color: var(--ink);
    font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.kniga-page::before,
.kniga-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
    background-repeat: no-repeat;
}

/* Картинка №1: право + верх */
.kniga-page::before {
    top: 0;
    right: 0;
    width: 584px;
    height: 416px;
    background-image: url("../images/bg-top-right.jpg");
    background-size: contain;
    background-position: right top;
}

/* Картинка №2: лево + низ (центр-лево) */
.kniga-page::after {
    bottom: 0;
    left: 0;
    width: 1400px;
    height: 1464px;
    background-image: url("../images/bg-bottom-left.jpg");
    background-size: cover;
    background-position: left center;
}

.kniga-page > * {
    position: relative;
    z-index: 1;
}

.kniga-page * {
    box-sizing: border-box;
}
.kniga-page button { cursor: pointer; }
.kniga-page a { color: inherit; text-decoration: none; }
.kniga-page img { display: block; max-width: 100%; }
.kniga-page h1,
.kniga-page h2,
.kniga-page h3,
.kniga-page p,
.kniga-page ol,
.kniga-page ul {
    margin: 0;
}

.kniga-shell {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header (nav) ---- */
.kniga-header {
    width: 100%;
    background-color: transparent;
}

.kniga-header__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 56px;
    padding: 8px 16px;
    max-width: 610px;
    margin: 0 auto;
    border-bottom: 1px solid var(--line);
    min-height: 68px;
}

.kniga-header__brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 180ms ease;
}
.kniga-header__brand:hover { opacity: 0.8; }

.kniga-header__logo {
    width: 70px;
    height: 58.55px;
    object-fit: contain;
}

.kniga-header__nav {
    display: flex;
    align-items: center;
    gap: 56px;
    flex-wrap: wrap;
}

.kniga-header__link {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.4;
    color: var(--ink);
    transition: opacity 180ms ease;
}
.kniga-header__link:hover { opacity: 0.72; }

/* ---- Hero ---- */
.kniga-hero {
    position: relative;
    padding: 36px 0 30px;
    background-color: transparent;
}

.kniga-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    gap: 36px;
    align-items: flex-start;
}

.kniga-hero__media {
    flex: 0 0 590px;
    max-width: 590px;
    position: relative;
    background-color: var(--bg);
}

.kniga-hero__cover {
    width: 100%;
    height: auto;
    aspect-ratio: 590 / 298;
    object-fit: cover;
    display: block;
    border-radius: 0;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: pan-y;
    background-color: var(--bg);
}

.kniga-hero__thumbs-row {
    margin-top: 0;
}

.kniga-hero__thumbs {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}
.kniga-hero__thumbs::-webkit-scrollbar { display: none; }
.kniga-hero__thumbs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.kniga-hero__thumb-btn {
    flex: 0 0 31.05%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    line-height: 0;
    scroll-snap-align: start;
    transition: opacity 180ms ease, filter 180ms ease;
    opacity: 1;
    filter: brightness(0.92);
}
.kniga-hero__thumb-btn:hover { filter: brightness(1); }
.kniga-hero__thumb-btn.is-active {
    filter: brightness(1);
    opacity: 1;
}

.kniga-hero__thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 590 / 298;
    object-fit: cover;
    border-radius: 0;
}

.kniga-hero__content {
    flex: 1;
    min-width: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kniga-hero__title {
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 48px;
    line-height: 1.4;
    color: var(--ink);
    margin: 0;
}

.kniga-hero__copy {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.4;
    color: var(--ink);
    max-width: 560px;
    margin: 0;
}
.kniga-hero__copy p { margin: 0; }
.kniga-hero__copy p + p { margin-top: 16px; }

.kniga-hero__cta-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    flex-wrap: wrap;
}

.kniga-hero__price {
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 25px;
    line-height: 1.4;
    color: var(--ink);
    margin: 0;
    white-space: nowrap;
}

/* Заголовок книги — Sans Serif Collection */
.kniga-hero__title {
    font-family: "BookSerif", Georgia, serif;
}

.kniga-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 8px 20px;
    background-color: transparent;
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    color: #341400;
    min-height: 35px;
    white-space: nowrap;
    transition: opacity 180ms ease, background-color 180ms ease;
    cursor: pointer;
}
.kniga-btn:hover,
.kniga-btn:focus-visible {
    background-color: rgba(97, 120, 138, 0.09);
}

/* ---- FAQ ---- */
.kniga-faq {
    background-color: transparent;
    padding: 60px 0 100px;
}

.kniga-section-title {
    font-family: "Comic Relief", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 35px;
    line-height: 1;
    color: var(--ink);
    margin: 0 0 40px;
}

.kniga-faq__list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-top: none;
    padding-top: 24px;
}

.kniga-faq__item {
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
}
.kniga-faq__item:last-child {
    border-bottom: 0;
}

.kniga-faq__head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: transparent;
    border: 0;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.kniga-faq__q {
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 23px;
    line-height: 1.4;
    color: var(--ink);
    flex: 1;
}

.kniga-faq__icon {
    flex-shrink: 0;
    font-family: "Inter", "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 25px;
    line-height: 1;
    color: var(--ink);
    width: auto;
    text-align: center;
    user-select: none;
    transition: none;
    transform: none !important;
}

.kniga-faq__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 380ms ease;
}
.kniga-faq__body > div {
    overflow: hidden;
    min-height: 0;
}

.kniga-faq__item.is-open .kniga-faq__body {
    grid-template-rows: 1fr;
}

.kniga-faq__answer {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
    padding: 14px 24px 0;
    margin: 0;
}
.kniga-faq__answer p { margin: 0; }
.kniga-faq__answer p + p { margin-top: 8px; }
.kniga-faq__answer ol,
.kniga-faq__answer ul { margin: 0; padding-left: 28px; list-style-position: outside; }
.kniga-faq__answer ol { list-style-type: decimal; }
.kniga-faq__answer ul { list-style-type: disc; }
.kniga-faq__answer ol li { list-style-type: decimal; }
.kniga-faq__answer ul li { list-style-type: disc; }
.kniga-faq__answer li + li { margin-top: 4px; }
.kniga-faq__answer li { display: list-item; }

/* ---- Reviews ---- */
.kniga-reviews {
    background-color: transparent;
    padding: 60px 0 100px;
}

.kniga-reviews__list {
    border-top: 0;
}

.kniga-review {
    display: grid;
    grid-template-columns: 177px 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 16px 24px;
    padding: 40px 8px 40px;
    border-bottom: 1px solid var(--line);
    min-height: 96px;
}
.kniga-review:last-child {
    border-bottom: 0;
}

.kniga-review__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    align-self: center;
}

.kniga-review__stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.kniga-review__star {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}
.kniga-review__star--filled { fill: #F4DC70; stroke: #E0CB6D; stroke-width: 0.6; }
.kniga-review__star--empty { fill: none; stroke: #E0CB6D; stroke-width: 1.2; }

.kniga-review__name {
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.2;
    color: var(--ink);
    margin: 0;
    text-align: center;
}

.kniga-review__text {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.4;
    color: var(--ink);
    max-width: 864px;
    margin: 0;
    align-self: center;
}

.kniga-review__date {
    font-family: "BookSerif", Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.4;
    color: var(--ink);
    white-space: nowrap;
    align-self: end;
}

.kniga-reviews__cta {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}

/* ---- Footer ---- */
.kniga-footer {
    background-color: var(--footer-bg);
    padding: 40px 0 24px;
}

.kniga-footer__grid {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    min-height: 199px;
}

.kniga-footer__col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    min-width: 0;
}

.kniga-footer__line {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
}

.kniga-footer__link {
    color: var(--ink);
    transition: opacity 180ms ease;
}
.kniga-footer__link:hover { opacity: 0.72; }

.kniga-footer__credits {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 12px 0 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(149, 170, 190, 0.5);
}
.kniga-footer__credit {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink);
}

/* ===========  Mobile (≤ 720px)  =========== */
@media (max-width: 720px) {
    .kniga-shell {
        padding: 0 16px;
        max-width: 100%;
    }

    .kniga-header__inner {
        max-width: 100%;
        gap: 16px;
        padding: 10px 16px 11px;
        min-height: 68px;
        justify-content: center;
        flex-wrap: nowrap;
        border-bottom: 1px solid var(--line);
    }
    .kniga-header__nav {
        gap: 22px;
        flex: 0 1 auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin-left: 0;
    }
    .kniga-header__brand {
        margin-right: 16px;
        flex-shrink: 0;
    }
    .kniga-header__logo {
        width: 50px;
        height: 40.98px;
    }
    .kniga-header__link {
        font-size: 13px;
        font-weight: 400;
        line-height: 1;
        white-space: nowrap;
    }

    .kniga-hero {
        padding: 38px 0 30px;
    }
    .kniga-hero__inner {
        flex-direction: column;
        gap: 18px;
    }
    .kniga-hero__media {
        flex: 1 1 auto;
        max-width: 100%;
        order: 2;
    }
    .kniga-hero__thumbs-row {
        margin-top: 0;
    }
    .kniga-hero__thumbs {
        gap: 0;
    }
    .kniga-hero__thumb-btn {
        flex: 0 0 31.05%;
    }
    .kniga-hero__thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 590 / 298;
    }
    .kniga-hero__content {
        flex: 1 1 auto;
        order: 1;
        display: contents;
    }
    .kniga-hero__title {
        font-size: 23px;
        line-height: 1.2;
        margin-bottom: 0;
        order: 1;
    }
    .kniga-hero__copy {
        font-size: 14px;
        line-height: 1.4;
        max-width: 100%;
        order: 3;
        margin-top: 4px;
    }
    .kniga-hero__cta-row {
        order: 4;
        margin-top: 12px;
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        align-self: stretch;
    }
    .kniga-hero__price {
        align-self: flex-start;
        font-size: 18px;
        margin: 0;
        text-align: left;
    }
    .kniga-btn {
        width: auto;
        min-width: 220px;
        max-width: 100%;
        min-height: 32px;
        padding: 6px 24px;
        font-size: 14px;
        font-family: "BookSerif", Georgia, serif;
        align-self: center;
        margin-left: auto;
        margin-right: auto;
        white-space: nowrap;
    }

    .kniga-faq {
        padding: 60px 0 60px;
    }
    .kniga-section-title {
        font-size: 22px;
        line-height: 1.2;
        margin-bottom: 16px;
    }
    .kniga-faq__list {
        gap: 12px;
    }
    .kniga-faq__item {
        padding-bottom: 12px;
    }
    .kniga-faq__head {
        padding: 0 12px;
        gap: 14px;
        align-items: flex-start;
    }
    .kniga-faq__q {
        font-size: 16px;
        line-height: 1.4;
    }
    .kniga-faq__icon {
        font-size: 22px;
    }
    .kniga-faq__answer {
        font-size: 14px;
        line-height: 1.5;
        padding: 10px 12px 0;
    }
    .kniga-faq__answer ol,
    .kniga-faq__answer ul {
        padding-left: 21px;
    }

    .kniga-reviews {
        padding: 0 0 56px;
    }
    .kniga-review {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        padding: 16px 0;
        min-height: 0;
        align-items: center;
    }
    .kniga-review__media {
        grid-column: 1;
        grid-row: 1;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 4px;
    }
    .kniga-review__star {
        width: 16px;
        height: 16px;
    }
    .kniga-review__name {
        font-family: "BookSerif", Georgia, serif;
        font-size: 14px;
        line-height: 1.4;
        text-align: left;
        padding-left: 12px;
    }
    .kniga-review__date {
        grid-column: 2;
        grid-row: 1;
        margin-left: auto;
        font-size: 14px;
        align-self: center;
    }
    .kniga-review__text {
        grid-column: 1 / span 2;
        grid-row: 2;
        font-size: 14px;
        line-height: 1.4;
        text-align: left;
    }
    .kniga-reviews__cta {
        margin-top: 18px;
    }

    .kniga-footer {
        padding: 32px 0 16px;
    }
    .kniga-footer__grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        min-height: 0;
    }
    .kniga-footer__col--owner   { order: 1; }
    .kniga-footer__col--contact { order: 2; }
    .kniga-footer__col--legal   { order: 3; }
    .kniga-footer__col {
        gap: 6px;
    }
    .kniga-footer__credits {
        gap: 6px 16px;
    }
}
