/* ============================================================
   Trang đọc chương - theme tối, khung trắng nổi bật, nút pill
   Dùng đúng class thật của Madara: reading-content-wrap,
   chapter-type-manga / chapter-type-text, entry-header.header/.footer
   ============================================================ */

.reading-content-wrap {
    background: #1b1b1e;
    padding: 20px 0 60px;
}

/* Khung trắng: tiêu đề + thanh điều hướng trên, thanh điều hướng dưới, bình luận */
.reading-content-wrap #chapter-heading {
    background: #fff;
    color: #222;
    border-radius: 8px;
    padding: 16px 20px 6px;
    margin: 0 0 0;
    font-size: 18px;
}
.reading-content-wrap .entry-header.header {
    background: #fff;
    border-radius: 0 0 8px 8px;
    padding: 10px 20px 18px;
    margin-bottom: 16px;
}
.reading-content-wrap .entry-header.footer {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 16px;
}
.reading-content-wrap #comments,
.reading-content-wrap .comments-area,
.reading-content-wrap .wp-manga-discussion {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 16px;
    color: #222;
}

/* Truyện chữ: nội dung đọc cần nền sáng để dễ đọc */
.reading-content-wrap.chapter-type-text .reading-content {
    background: #fff;
    color: #222;
    border-radius: 8px;
    padding: 24px;
    line-height: 1.9;
    font-size: 17px;
}

/* Truyện tranh: ảnh vẫn nằm trên nền tối cho đỡ chói khi đọc */
.reading-content-wrap.chapter-type-manga .reading-content {
    text-align: center;
}

/* Ảnh chương đang chờ tải: hiện gif xoay xoay thay vì mảng đen trống,
   giống truyenqqko.com.
   - Chế độ "list" (all-in-1-page): class .lazyload-ordered, ảnh có sẵn
     kích thước tự nhiên nên chỉ cần min-height làm sàn tối thiểu.
   - Chế độ "paged" (mặc định, 10 ảnh/trang): dùng lazysizes thật với
     class .lazyload/.lazyloading, mà style.css gốc của theme ép
     "height:0 !important" cho tới khi ảnh vào viewport - khiến ảnh
     hoàn toàn vô hình (không phải màu đen, mà là KHÔNG CÓ chỗ hiển thị
     gì cả) => phải ghi đè !important thì mới hiện được placeholder. */
.reading-content-wrap .reading-content img.wp-manga-chapter-img {
    min-height: 100px;
    background: #1b1b1e url('images/loading-small.gif') no-repeat center center;
}
.reading-content-wrap .reading-content img.wp-manga-chapter-img.lazyloaded {
    background: none;
    min-height: 0;
}
.reading-content-wrap .reading-content img.wp-manga-chapter-img.lazyload,
.reading-content-wrap .reading-content img.wp-manga-chapter-img.lazyloading {
    height: 150px !important;
    overflow: visible !important;
    background: #1b1b1e url('images/loading-small.gif') no-repeat center center !important;
}

/* Nút điều hướng chương dạng pill (Chap trước / Chap sau) */
.reading-content-wrap .nav-links .btn,
.reading-content-wrap .btn.prev_page,
.reading-content-wrap .btn.next_page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    background: #17a2b8;
    color: #fff !important;
    text-decoration: none !important;
}
.reading-content-wrap .btn.prev_page {
    background: #cfd4d8;
    color: #666 !important;
}
.reading-content-wrap .nav-links .btn:hover {
    opacity: .85;
}

/* Nút cuộn lên đầu trang */
.tqq-scroll-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #17a2b8;
    color: #fff;
    border: none;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    z-index: 999;
}
.tqq-scroll-top.show { display: flex; }

/* Thanh điều hướng dính đáy - chỉ hiện trên trang đọc chương, ưu tiên mobile */
.tqq-reading-bottombar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #1f1f22;
    display: none;
    align-items: center;
    justify-content: space-around;
    padding: 8px 4px;
    z-index: 998;
    box-shadow: 0 -2px 8px rgba(0,0,0,.3);
}
.tqq-reading-bottombar a,
.tqq-reading-bottombar button {
    background: transparent;
    border: none;
    color: #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    text-decoration: none;
    padding: 4px 8px;
    cursor: pointer;
}
.tqq-reading-bottombar i { font-size: 18px; }
.tqq-reading-bottombar .tqq-bb-current {
    background: #2c2c30;
    border-radius: 14px;
    padding: 6px 14px;
    color: #fff;
}
.tqq-reading-bottombar .tqq-bb-follow { color: #ff4d6d; }

@media (max-width: 768px) {
    .tqq-reading-bottombar { display: flex; }
    body.single-wp-manga.chapter-heading-set,
    .reading-content-wrap { padding-bottom: 70px; }
}
