/* Book reader chrome — RTL. Shared look is duplicated in custom-ltr.css; side-specific rules stay here. */

body {
    background: #f3eee4 !important;
}

#header .header-body-second {
    background: #fffdf8 !important;
    border-bottom: 3px solid #b8923a !important;
    box-shadow: 0 8px 18px rgba(22, 56, 44, 0.06) !important;
}

.book-page .menu-operation {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: auto !important;
    min-height: 58px;
    padding: 8px 18px !important;
    background: #16382c !important;
    box-shadow: 0 8px 18px rgba(22, 56, 44, 0.22) !important;
    direction: rtl;
}

.book-page .menu-operation > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: 0 1 auto;
    padding: 0 !important;
    float: none !important;
}

.book-page .menu-operation > .col-md-4 {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
}

.book-page .menu-operation > .col-md-4 a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f4efe6 !important;
    font-weight: 600;
}

.book-page .operations {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
}

.book-page .operations a,
.book-page .operations .socicon-custom {
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    border-radius: 10px;
    background: rgba(255, 253, 248, 0.12);
    color: #fffdf8 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.book-page .operations a:hover {
    background: #b8923a;
    color: #16382c !important;
}

.book-page .operations .change-font {
    height: 34px;
    width: 148px !important;
    max-width: 148px;
    margin: 0 !important;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: #fffdf8;
    color: #16382c;
    float: none !important;
}

.book-page .position-fix {
    background: #fffdf8;
    border-radius: 18px 0 0 18px;
    box-shadow: -8px 12px 28px rgba(22, 56, 44, 0.08);
    border-left: 3px solid #b8923a;
    padding: 10px 10px 0 12px;
    top: 172px;
    right: 12px !important;
    left: auto !important;
    width: calc(25vw - 28px) !important;
    bottom: 12px;
    overflow: hidden;
}

.book-page .book-index {
    height: calc(100% - 4px) !important;
}

.book-page .position-fix .nav-tabs {
    display: flex;
    gap: 4px;
    border: 0;
    background: #f3eee4;
    border-radius: 12px;
    padding: 4px;
    margin: 0;
}

.book-page .position-fix .nav-tabs .nav-item {
    flex: 1 1 0;
    float: none;
    text-align: center;
    margin: 0;
}

.book-page .position-fix .nav-tabs .nav-link {
    border: 0 !important;
    border-radius: 10px !important;
    color: #16382c !important;
    background: transparent;
    padding: 8px 4px;
    font-size: 13px;
    text-align: center;
}

.book-page .position-fix .nav-tabs .nav-link.active {
    background: #16382c !important;
    color: #fffdf8 !important;
}

.book-page .font-home,
.book-page .font-home .child {
    padding-right: 8px;
    padding-left: 0;
}

.book-page .tab-pane ul li a {
    color: #16382c !important;
    line-height: 1.8;
}

.book-page .tab-pane ul li a:hover,
.book-page .MsoToc1:hover,
.book-page .MsoToc2:hover,
.book-page .MsoToc3:hover {
    background: rgba(184, 146, 58, 0.16) !important;
    color: #16382c !important;
    text-decoration: none !important;
}

.book-page .page-header-bread {
    margin: 0 0 10px !important;
    padding: 12px 0 0 !important;
    text-align: right;
}

.book-page .page-header-bread .breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    background: #fffdf8;
    border-radius: 999px;
    margin: 0;
    padding: 8px 16px;
    box-shadow: 0 6px 16px rgba(22, 56, 44, 0.06);
}

.book-page .page-header-bread .breadcrumb > li {
    float: none;
}

.book-page .page-header-bread .breadcrumb > li > a {
    color: #16382c;
}

.book-page .page-header-bread .breadcrumb > li + li:before {
    float: right;
    content: "\f104";
    padding: 0 8px 0 4px;
    color: #b8923a;
    opacity: 1;
}

.book-page .section-book {
    margin-top: 12px;
    margin-right: 12px;
    margin-left: 20px;
    padding: 8px 22px 56px;
    background: #fffdf8;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(22, 56, 44, 0.06);
}

.book-page .newStyle,
.book-page #pg0 {
    background: transparent !important;
    border-bottom: 1px solid rgba(22, 56, 44, 0.08) !important;
}

.book-page .cover {
    float: right;
    margin-top: 0;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(22, 56, 44, 0.12);
}

.book-page .book-search-box {
    padding: 14px;
    margin-bottom: 16px;
    background: #f3eee4;
    border: 0;
    border-radius: 14px;
}

.book-page .book-search-box h4 {
    margin: 0 0 10px;
    color: #16382c;
    font-size: 16px;
}

.book-page .book-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-page .book-search-submit,
.book-page .book-search-clear {
    border: 0;
    border-radius: 10px;
    white-space: nowrap;
}

.book-page .book-search-submit {
    background: #16382c;
    color: #fffdf8;
}

.book-page .book-search-clear {
    display: none;
    background: #efe6d4;
    color: #16382c;
}

.book-page #searchResults div.search-item {
    flex-direction: row-reverse;
    border-color: rgba(22, 56, 44, 0.12);
    background: #fffdf8;
}

.book-page #searchResults .page-number,
.book-page .skeleton.page-number {
    margin-right: 10px;
    margin-left: 0;
}

.book-phone-nav {
    display: none !important;
}

@media (max-width: 991px) {
    .book-page .book-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(22, 56, 44, 0.46);
        z-index: 380;
    }

    .book-page .position-fix {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: auto !important;
        height: min(72vh, 560px);
        bottom: 74px;
        margin: 0 !important;
        padding: 8px 12px 12px !important;
        border: 0 !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -18px 40px rgba(22, 56, 44, 0.22);
        transform: translateY(calc(100% + 96px));
        transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 390;
        pointer-events: none;
    }

    .book-page .position-fix::before {
        content: "";
        display: block;
        width: 46px;
        height: 4px;
        margin: 4px auto 10px;
        border-radius: 999px;
        background: rgba(22, 56, 44, 0.22);
        flex: 0 0 auto;
    }

    .book-page .position-fix.is-open {
        transform: translateY(0);
        pointer-events: auto;
    }

    .book-page .position-fix .book-index {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        overflow: auto;
    }

    .book-page .position-fix .nav-tabs .nav-link {
        padding: 10px 6px;
        font-size: 14px;
    }

    .book-page .position-fix .cover {
        float: none;
        display: block;
        margin: 8px auto 12px;
    }

    .book-page .row {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .book-page .menu-operation.hidden-mobile {
        display: flex !important;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 400;
        min-height: 62px;
        padding: 8px 10px 12px !important;
        border-radius: 18px 18px 0 0;
        justify-content: space-between;
    }

    .book-page .menu-operation > .col-md-4,
    .book-page .operations .socicon-btn,
    .book-page .operations .change-font {
        display: none !important;
    }

    .book-page .book-sheet-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: rgba(255, 253, 248, 0.14);
        color: #fffdf8;
        flex: 0 0 auto;
        order: 2;
    }

    .book-page .book-sheet-toggle[aria-expanded="true"] {
        background: #b8923a;
        color: #16382c;
    }

    .book-page .operations {
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-start;
        order: 1;
        gap: 4px;
    }

    .book-page .operations a {
        width: 32px !important;
        height: 32px !important;
    }

    .book-page .margin-top-65 {
        margin-top: 8px !important;
    }

    .book-page .normal-column {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        padding: 0 12px 88px !important;
    }

    .book-page .section-book {
        margin: 0 !important;
        padding: 4px 12px 28px;
        border-radius: 16px;
    }

    .book-page .page .pageContent {
        margin: 12px 4px 8px !important;
        width: auto !important;
        min-height: 0;
    }

    .book-page .page-header-bread .breadcrumb {
        border-radius: 14px;
        width: 100%;
    }
}
