/* Sách lật văn bản — màu theo data-site-theme (site-theme.css / biến fallback đỏ) */
html, body.vb-flip-body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
}
#viewer { display: flex; flex-direction: column; height: 100vh; }
#header {
    background: var(--site-nav, #b30000);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
#header img { height: 40px; margin-right: 10px; }
.vb-flip-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}
.tieude {
    font-family: "Roboto", "Be Vietnam Pro", sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ffff00;
    text-shadow: 1px 1px 2px #000, 2px 2px 4px rgba(0,0,0,.6);
    white-space: nowrap;
}
#bookTitle {
    font-weight: 700;
    font-size: 15px;
    padding-right: 12px;
    text-align: right;
    line-height: 1.35;
}
#flipbook {
    flex: 1;
    background: linear-gradient(180deg, #f6f7fb 0%, #eceff5 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1600px;
}
#bookViewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    padding: 18px 78px;
    box-sizing: border-box;
}
#bookViewport.zoomed { cursor: grab; justify-content: flex-start; align-items: flex-start; }
#bookViewport.zoomed.dragging { cursor: grabbing; }
#bookHost {
    transform-origin: top center;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#bookHost .stf__parent { box-shadow: 0 10px 26px rgba(0,0,0,0.2); }
#bookSpineShadow {
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 36px;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    z-index: 30;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.18) 35%, rgba(0,0,0,0) 72%);
    transition: opacity .28s ease;
}
#bookSpineShadow.show { opacity: 1; }
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(34, 34, 34, 0.55);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.nav-button:hover {
    transform: translateY(-50%) scale(1.06);
    background: color-mix(in srgb, var(--site-nav, #b30000) 85%, transparent);
}
#prev { left: 20px; }
#next { right: 20px; }
#footer {
    background: #ececec;
    padding: 10px 12px;
    text-align: center;
    border-top: 1px solid #d8d8d8;
    flex-shrink: 0;
}
.control-btn {
    margin: 0 5px;
    padding: 7px 14px;
    border: 1px solid rgba(0,0,0,0.08);
    background: linear-gradient(180deg, var(--site-section-from, #b30000) 0%, var(--site-section-to, #8e0000) 100%);
    color: #fff;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0,0,0,0.16);
}
.control-btn:hover { color: #fff; filter: brightness(1.05); }
.cover { display: flex; justify-content: center; align-items: center; background: #fff; }
.cover img, .page img { max-width: 100%; max-height: 100%; }
.vb-flip-fallback {
    flex: 1;
    overflow: auto;
    padding: 28px 16px;
    background: linear-gradient(180deg, #f6f7fb 0%, #eceff5 100%);
}
.vb-flip-card {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(15,23,42,.08);
    padding: 28px;
}
.vb-flip-card dt { color: var(--site-section-deep, #9f1239); font-weight: 700; margin-top: .75rem; }
.vb-flip-card dd { margin: 0; }
.vb-flip-card h1,
.vb-flip-card .vb-flip-title { color: var(--site-section-deep, #9f1239); }
#pageInfo { margin-left: 10px; color: #444; font-weight: 600; }
.vb-flip-close { color: #fff; opacity: .9; font-size: 13px; white-space: nowrap; }
.vb-flip-close:hover { color: #ffe082; }
@media (max-width: 768px) {
    .tieude { font-size: 14px; }
    #bookTitle { font-size: 12px; }
    #bookViewport { padding: 12px 56px; }
    .nav-button { width: 42px; height: 42px; font-size: 16px; }
}
