/* Книга «Гости не должны узнать»: плавающая карточка (.bkw) и страница /kniga (.bkp) */

:root { --bkw-offset: 0px; }

/* ---------- Плавающая карточка ---------- */
.bkw {
    position: fixed; z-index: 900;
    left: 20px; bottom: calc(20px + var(--bkw-offset));
    width: 360px; max-width: calc(100vw - 24px);
    transform: translateY(24px); opacity: 0;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s, bottom .25s;
}
.bkw.bkw-in { transform: none; opacity: 1; }
.bkw[hidden], .bkw-tab[hidden] { display: none !important; }

.bkw-card {
    display: flex; gap: 12px; align-items: center;
    padding: 12px 16px 12px 10px;
    /* Светлая карточка на тёмном сайте — заметна, книга на ней не сливается */
    background: radial-gradient(ellipse 60% 90% at 18% 50%, #fffaf2 0%, transparent 70%), linear-gradient(135deg, #fbf1e4 0%, #f1dcc3 100%);
    border: 1px solid rgba(255, 107, 53, .45);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 107, 53, .12);
    color: #1f1712; text-decoration: none;
}
.bkw-card:hover .bkw-btn { filter: brightness(1.08); transform: translateY(-1px); }
.bkw-cover { flex: 0 0 84px; width: 84px; height: auto; margin: -10px 0 -12px; filter: drop-shadow(0 8px 10px rgba(60, 30, 10, .35)); }
.bkw-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bkw-kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #d9531e; }
.bkw-title { font-size: 17px; font-weight: 800; line-height: 1.2; color: #1f1712; }
.bkw-sub { font-size: 12.5px; line-height: 1.4; color: #5e4c3d; }
.bkw-btn {
    margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border-radius: 10px;
    background: linear-gradient(135deg, #FF6B35, #f7931e); color: #fff;
    font-size: 14px; font-weight: 700; white-space: nowrap;
    transition: transform .15s, filter .15s;
}
.bkw-close {
    position: absolute; top: -10px; right: -10px; z-index: 1;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: #374151; border: 1px solid #E5E7EB; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.bkw-close:hover { color: #111827; }

/* Свёрнутый ярлык у левого края */
.bkw-tab {
    position: fixed; z-index: 899;
    left: 0; bottom: calc(96px + var(--bkw-offset));
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px 10px 12px;
    background: linear-gradient(135deg, #fbf1e4, #f1dcc3);
    border: 1px solid rgba(255, 107, 53, .5); border-left: 0;
    border-radius: 0 12px 12px 0;
    color: #1f1712; font-size: 13px; font-weight: 700; text-decoration: none;
    box-shadow: 0 8px 22px rgba(0,0,0,.45);
    transition: bottom .25s, padding .15s;
}
.bkw-tab svg { color: #FF6B35; flex: 0 0 auto; }
.bkw-tab:hover { padding-left: 16px; }

@media (max-width: 640px) {
    .bkw { left: 12px; right: 12px; width: auto; bottom: calc(12px + var(--bkw-offset)); }
    .bkw-card { padding: 12px; gap: 12px; border-radius: 14px; }
    .bkw-cover { flex-basis: 64px; width: 64px; margin: -8px 0 -10px; }
    .bkw-title { font-size: 15px; }
    .bkw-sub { display: none; }
    .bkw-btn { font-size: 13.5px; padding: 8px 12px; align-self: flex-start; }
    .bkw-close { top: -9px; right: -6px; width: 28px; height: 28px; }
    .bkw-tab { bottom: calc(14px + var(--bkw-offset)); padding: 9px 12px 9px 10px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .bkw { transition: none; } }

/* ---------- Страница /kniga ---------- */
.bkp { margin: 0; background: #14100c; color: #f5efe8; -webkit-font-smoothing: antialiased; }
.bkp-h1, .bkp-h2, .bkw-title { font-family: var(--font-display, inherit); letter-spacing: -.01em; }
.bkp a { color: inherit; }
.bkp-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.bkp-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-size: 14px; }
.bkp-logo { font-weight: 800; text-decoration: none; letter-spacing: .01em; }
.bkp-logo span { color: #FF6B35; }
.bkp-top-link { color: rgba(245,239,232,.7); text-decoration: none; }
.bkp-top-link:hover { color: #fff; }

.bkp-hero { display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: center; padding: 28px 0 56px; }
.bkp-cover { width: 100%; height: auto; border-radius: 6px 12px 12px 6px; box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); }
/* Тёплый свет за книгой: тёмная обложка не тонет в тёмной странице */
.bkp-cover-wrap { position: relative; }
.bkp-cover-wrap::before {
    content: ""; position: absolute; inset: -18% -30%; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 190, 120, .42) 0%, rgba(255, 130, 60, .16) 45%, transparent 70%);
}
.bkp-cover-3d { position: relative; z-index: 1; border-radius: 0; box-shadow: none; filter: drop-shadow(0 28px 30px rgba(0,0,0,.55)); }
.bkp-cover-photo { position: relative; z-index: 1; border-radius: 18px; box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 1px rgba(255,220,170,.18); }
.bkp-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #E8B06C; margin-bottom: 14px; }
.bkp-h1 { font-size: 46px; line-height: 1.08; margin: 0 0 16px; font-weight: 800; color: #fff; }
.bkp-lead { font-size: 18px; line-height: 1.55; color: rgba(245,239,232,.8); margin: 0 0 26px; max-width: 560px; }
.bkp-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; }
.bkp-facts li { padding: 7px 13px; border: 1px solid rgba(232,176,108,.3); border-radius: 999px; font-size: 13.5px; color: #f1e3d0; }
.bkp-cta {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 26px; border-radius: 14px;
    background: linear-gradient(135deg, #FF6B35, #f7931e); color: #fff !important;
    font-size: 17px; font-weight: 800; text-decoration: none;
    box-shadow: 0 12px 30px rgba(255,107,53,.35); transition: transform .15s, filter .15s;
}
.bkp-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
.bkp-note { margin-top: 12px; font-size: 13.5px; color: rgba(245,239,232,.6); }

.bkp-section { padding: 52px 0; border-top: 1px solid rgba(255,255,255,.07); }
.bkp-h2 { font-size: 30px; margin: 0 0 24px; color: #fff; font-weight: 800; }
.bkp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bkp-card { padding: 20px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.bkp-card b { display: block; font-size: 16px; margin-bottom: 6px; color: #fff; }
.bkp-card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: rgba(245,239,232,.72); }
.bkp-toc { columns: 2; column-gap: 40px; margin: 0; padding: 0; list-style: none; counter-reset: ch; }
.bkp-toc li { break-inside: avoid; padding: 9px 0 9px 40px; position: relative; font-size: 15.5px; border-bottom: 1px dashed rgba(255,255,255,.08); }
.bkp-toc li::before { counter-increment: ch; content: counter(ch, decimal-leading-zero); position: absolute; left: 0; top: 9px; color: #E8B06C; font-weight: 700; font-size: 13.5px; }
.bkp-authors { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.bkp-authors p { margin: 0 0 10px; font-size: 16px; line-height: 1.6; color: rgba(245,239,232,.8); }
.bkp-final { text-align: center; padding: 64px 0 80px; }
.bkp-final .bkp-lead { margin-left: auto; margin-right: auto; }
.bkp-foot { padding: 24px 0 40px; font-size: 13px; color: rgba(245,239,232,.45); text-align: center; }
.bkp-foot a { color: rgba(245,239,232,.7); }

@media (max-width: 860px) {
    .bkp-hero { grid-template-columns: 1fr; gap: 18px; padding: 0 0 40px; text-align: center; }
    .bkp-cover { max-width: 190px; margin: 0 auto; display: block; }
    .bkp-cover-wrap::before { inset: -12% 0; }
    .bkp-kicker { margin-bottom: 8px; font-size: 11.5px; }
    .bkp-h1 { font-size: 30px; margin-bottom: 10px; }
    .bkp-lead { font-size: 15.5px; margin: 0 auto 16px; }
    .bkp-facts { gap: 6px; margin-bottom: 18px; }
    .bkp-facts li { padding: 5px 10px; font-size: 12.5px; }
    .bkp-facts { justify-content: center; }
    .bkp-top { padding: 12px 0; }
    .bkp-grid { grid-template-columns: 1fr; }
    .bkp-toc { columns: 1; }
    .bkp-h2 { font-size: 24px; }
    .bkp-authors { grid-template-columns: 1fr; }
    .bkp-cta { width: 100%; justify-content: center; box-sizing: border-box; }
}
