/* --- RESET & VARIABLES --- */
html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #1a1a1a;
    --text-color: #f4f1ea;
    --accent-color: #ff471a;
    /* Merah oranye komik klasik */
    --border-width: 2px;
    --shadow-offset: 4px;
    --border-radius: 4px;
    --border-color: #444444;
    --card-bg: #2d2d2d;
    --card-shadow: rgba(0, 0, 0, 0.3);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.reader-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    /* Font teknis/blocky */
    line-height: 1.6;
}

h1,
h2,
h3,
.logo {
    font-family: 'Roboto Slab', serif;
    /* Font judul Western */
    text-transform: uppercase;
    font-weight: 900;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- UTILITIES --- */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border: var(--border-width) solid var(--border-color);
    transition: all 0.2s ease;
    background: transparent;
    border-radius: var(--border-radius);
}

/* Efek tombol blocky */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
}

.btn-primary:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
}

.btn-outline {
    background-color: #ffffff;
    color: #000000;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
}

.btn-outline:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--card-bg);
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    letter-spacing: -1px;
}

.logo .highlight {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 700;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-decoration-color: var(--accent-color);
}

/* --- HERO SECTION --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 3rem 4rem;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--card-bg);
    min-height: auto;
}

.hero-content {
    max-width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge {
    background: black;
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    width: fit-content;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.hero h1 {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-buttons .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.hero-image {
    flex-shrink: 0;
    width: 220px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
    overflow: hidden;
    background-color: #111;
    border-radius: var(--border-radius);
    aspect-ratio: 2 / 3;
}

.hero-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.05);
}

/* --- GRID SECTION --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    white-space: nowrap;
}

.divider {
    height: 4px;
    background: var(--accent-color);
    width: 100%;
}

.comic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
}

/* --- COMIC CARD DESIGN (Horizontal) --- */
.comic-card {
    border: var(--border-width) solid var(--border-color);
    background: var(--card-bg);
    transition: transform 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.comic-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0px var(--accent-color);
}

.card-image {
    width: 105px;
    height: 100%;
    flex-shrink: 0;
    border-right: var(--border-width) solid var(--border-color);
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background-color: #111;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #111;
}

.issue-tag {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    font-size: 0.6rem;
    background: #b33000;
    color: white;
    padding: 3px 6px;
    font-weight: bold;
    border-bottom: var(--border-width) solid var(--border-color);
    border-right: var(--border-width) solid var(--border-color);
    border-left: none;
    z-index: 2;
    text-align: left;
    width: 100%;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 0.6rem 0.7rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-content h3 {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content h3 a {
    transition: color 0.2s ease;
}

.card-content h3 a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.latest-chapters {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: auto;
}

.chapter-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 7px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    font-family: 'Space Mono', monospace;
    transition: background 0.2s;
    text-decoration: none !important;
    color: var(--text-color);
}

.chapter-pill span:first-child {
    align-self: center;
}

.chapter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.badge-new {
    background: #ff3333;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 2px;
}

.chapter-date {
    color: #888;
    font-size: 0.65rem;
}

.card-content .author {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}

.read-link {
    background: black;
    color: white;
    padding: 2px 8px;
}

.read-link:hover {
    background: var(--accent-color);
}

/* --- FOOTER --- */
footer {
    margin-top: 4rem;
    border-top: var(--border-width) solid var(--border-color);
    padding: 2rem;
    background: black;
    color: white;
    text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        gap: 2rem;
        padding: 2rem;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero-content .badge {
        margin: 0 auto 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        width: 200px;
        height: 300px;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
}

/* =========================================
   CHAPTER READER STYLES
   ========================================= */

/* --- Reader Navbar Override --- */
.reader-nav {
    border-bottom: none;
    /* Kita pindahkan border ke sticky controls */
    padding: 1rem 2rem;
}

.reader-title {
    display: flex;
    gap: 0.5rem;
    font-weight: 700;
}

.reader-title .series-name {
    text-transform: uppercase;
}

.reader-title .chapter-num {
    color: var(--accent-color);
}

.btn-close {
    font-weight: 900;
    font-size: 1.5rem;
    padding: 0 1rem;
}

.btn-close:hover {
    color: var(--accent-color);
}

/* --- Sticky Controls Toolbar --- */
.sticky-controls {
    position: sticky;
    top: 0;
    z-index: 500;
    background: var(--bg-color);
    /* Matches body bg */
    border-top: var(--border-width) solid var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 10px 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
}

.control-group {
    flex: 1;
    display: flex;
}

.control-group.center {
    justify-content: center;
    flex: 2;
    /* Bagian tengah lebih lebar */
}

.control-group.right {
    justify-content: flex-end;
}

/* Custom Select Style (Brutalist) */
.chapter-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: white;
    border: var(--border-width) solid var(--border-color);
    padding: 8px 30px 8px 15px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 0;
    /* Pastikan kotak */
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    /* Custom Arrow Hack */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='square' stroke-linejoin='miter'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    width: 100%;
    max-width: 400px;
}

.chapter-select:focus {
    outline: none;
    box-shadow: 4px 4px 0px var(--accent-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* --- Comic Viewer Area --- */
.reader-container {
    max-width: 900px;
    /* Lebar optimal untuk membaca */
    margin: 0 auto;
    border-left: var(--border-width) solid var(--border-color);
    border-right: var(--border-width) solid var(--border-color);
    background-color: #e0ded5;
    /* Sedikit lebih gelap di area baca */
    min-height: 100vh;
}

.comic-pages {
    display: flex;
    flex-direction: column;
}

.comic-pages img {
    width: 100%;
    height: auto;
    display: block;
    /* Menghilangkan gap di bawah gambar */
    /* Opsional: Border antar halaman */
    border-bottom: 2px solid #000;
}

/* --- Bottom Nav --- */
.bottom-nav {
    padding: 3rem 2rem;
    background-color: white;
    text-align: center;
}

.nav-buttons-large {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
}

.big-btn {
    flex: 1;
    padding: 1.5rem;
    font-size: 1.2rem;
}

/* --- Comments Section --- */
.comments-section {
    padding: 2rem;
    background-color: var(--bg-color);
    border-top: var(--border-width) solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    border-left: 10px solid var(--accent-color);
    padding-left: 10px;
}

.comment-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.comment-box textarea {
    width: 100%;
    height: 100px;
    border: var(--border-width) solid var(--border-color);
    background: white;
    padding: 1rem;
    font-family: 'Space Mono', monospace;
    resize: vertical;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.comment-box textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.comment-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: white;
    border: 2px solid black;
    padding: 1rem;
    box-shadow: 4px 4px 0px #ccc;
}

.comment-item .avatar {
    width: 50px;
    height: 50px;
    border: 2px solid black;
    flex-shrink: 0;
}

.comment-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    border-bottom: 1px dashed black;
    padding-bottom: 4px;
}

.comment-header .username {
    font-weight: 900;
    color: black;
    text-transform: uppercase;
}

/* --- Responsive for Reader --- */
@media (max-width: 768px) {
    .reader-title {
        display: none;
        /* Sembunyikan judul di HP agar tidak sempit */
    }

    .sticky-controls {
        padding: 10px;
        gap: 5px;
    }

    .chapter-select {
        padding: 8px 10px;
        font-size: 0.8rem;
        background-position: right 5px center;
    }

    .btn-sm {
        padding: 8px 8px;
        /* Tombol navigasi lebih kecil */
    }

    .reader-container {
        border-left: none;
        border-right: none;
    }

    .nav-buttons-large {
        flex-direction: column;
    }
}

/* =========================================
   COMIC INFO SECTION
   ========================================= */

.comic-info-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 3rem 2rem;
}

.comic-info-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.comic-cover {
    flex-shrink: 0;
    width: 280px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 8px 8px 0px var(--accent-color);
    overflow: hidden;
    background: #000;
}

.comic-cover img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.comic-details {
    flex: 1;
    color: white;
}

.publisher-badge {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.comic-title {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: white;
}

.comic-creator {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

.comic-creator strong {
    color: var(--accent-color);
}

.comic-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meta-value {
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.comic-synopsis {
    margin-bottom: 1.5rem;
}

.comic-synopsis h3 {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
}

.comic-synopsis p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.comic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tag:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.comic-actions {
    display: flex;
    gap: 1rem;
}

.comic-actions .btn {
    flex: 1;
    text-align: center;
}

/* --- Responsive for Comic Info --- */
@media (max-width: 768px) {
    .comic-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .comic-cover {
        width: 200px;
    }

    .comic-title {
        font-size: 1.8rem;
    }

    .comic-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .comic-synopsis h3 {
        border-left: none;
        padding-left: 0;
        border-bottom: 2px solid var(--accent-color);
        padding-bottom: 5px;
    }

    .comic-tags {
        justify-content: center;
    }

    .comic-actions {
        flex-direction: column;
    }
}

/* =========================================
   COMPACT DETAIL PAGE STYLES
   ========================================= */

.detail-compact {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: var(--border-width) solid var(--border-color);
    margin-bottom: 2rem;
}

.detail-cover {
    flex-shrink: 0;
    width: 180px;
    position: relative;
}

.detail-cover img {
    width: 100%;
    height: auto;
    display: block;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0px var(--border-color);
}

.status-tag {
    position: absolute;
    bottom: 10px;
    left: 0;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 8px;
    text-transform: uppercase;
}

.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.publisher-tag {
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.detail-info h1 {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #ccc;
}

.detail-meta strong {
    color: #000;
}

.detail-synopsis {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
}

.detail-actions .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* Chapter Section */
.chapter-section {
    margin-bottom: 3rem;
}

.chapter-grid {
    display: flex;
    flex-direction: column;
    border: var(--border-width) solid var(--border-color);
    background: white;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
    transition: all 0.2s;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: var(--accent-color);
    color: white;
    padding-left: 1.5rem;
}

.chapter-item:hover .ch-number {
    background: white;
    color: var(--accent-color);
}

.chapter-item:hover .ch-date {
    color: rgba(255, 255, 255, 0.8);
}

.ch-number {
    background: var(--accent-color);
    color: white;
    font-weight: 900;
    font-size: 0.75rem;
    padding: 4px 8px;
    margin-right: 1rem;
    min-width: 40px;
    text-align: center;
}

.ch-title {
    flex: 1;
    font-weight: 700;
    font-size: 0.9rem;
}

.ch-date {
    font-size: 0.8rem;
    color: #888;
    font-family: 'Space Mono', monospace;
}

/* Responsive Compact Detail */
@media (max-width: 600px) {
    .detail-compact {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-cover {
        width: 150px;
    }

    .detail-info h1 {
        font-size: 1.5rem;
    }

    .detail-meta {
        justify-content: center;
    }

    .detail-synopsis {
        text-align: left;
    }

    .detail-actions {
        justify-content: center;
    }
}

/* =========================================
   NEW DETAIL LAYOUT (Sidebar + Main)
   ========================================= */

.new-layout-wrapper {
    margin-top: 2rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Fixed Sidebar + Fluid Main */
    gap: 3rem;
    align-items: start;
}

/* --- LEFT SIDEBAR PANEL --- */
.sidebar-panel {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-cover {
    width: 100%;
    border: var(--border-width) solid #555;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px #000;
    background: #000;
    /* Dark mode override integrated */
    border-radius: var(--border-radius);
    overflow: hidden;
}

.sidebar-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-block {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    align-items: center;
    padding: 12px 15px;
}

.icon-btn .icon {
    font-size: 1.2rem;
}

.sidebar-info-block {
    border-top: 2px solid #555;
    /* Dark mode border */
    padding-top: 1.5rem;
}

.sidebar-info-block h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 4px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 2px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.info-row .label {
    font-size: 0.75rem;
    color: #aaa;
    /* Dark mode label color */
    font-weight: bold;
    text-transform: uppercase;
}

.info-row .val {
    font-weight: 700;
}


/* --- MAIN CONTENT PANEL --- */
.main-panel {
    display: flex;
    flex-direction: column;
}

.manga-header {
    margin-bottom: 2rem;
    border-bottom: 1px dashed #444;
    /* Dark mode border */
    padding-bottom: 1.5rem;
}

.manga-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: white;
}

.manga-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--accent-color);
}

.manga-stats {
    display: flex;
    gap: 1.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #aaa;
    /* Dark mode color */
    font-weight: 700;
}

.manga-synopsis {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.manga-synopsis p {
    margin-bottom: 1rem;
}

/* --- Chapter List Section --- */
.chapter-list-section {
    background: transparent;
}

.chapter-header-row {
    margin-bottom: 1.5rem;
    border-bottom: var(--border-width) solid #444;
    /* Dark mode border */
    padding-bottom: 0.5rem;
}

.chapter-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tab-group {
    display: flex;
    gap: 0.5rem;
    background: #333;
    /* Dark mode bg */
    padding: 4px;
    border-radius: var(--border-radius);
    border: 1px solid #555;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #ccc;
    /* Dark mode text */
}

.tab-btn.active {
    background: #555;
    /* Dark mode active */
    color: white;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.sort-group {
    display: flex;
    gap: 5px;
}

.chapter-search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.chapter-search-bar input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border: 2px solid #555;
    background: #2d2d2d;
    /* Dark mode bg */
    font-family: 'Space Mono';
    color: white;
}

.chapter-search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.new-chapter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    /* Dark mode bg */
    border: 1px solid #444;
    padding: 12px 15px;
    transition: all 0.2s;
    color: #ddd;
}

.ch-item:hover {
    border-color: var(--accent-color);
    background: #333;
    transform: translateX(5px);
    box-shadow: 2px 2px 0px var(--accent-color);
}

.ch-name {
    font-weight: 700;
}

.ch-time {
    font-size: 0.85rem;
    color: #888;
    font-family: 'Space Mono';
}

/* --- Responsive New Layout --- */
@media (max-width: 800px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-panel {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .sidebar-cover {
        width: 140px;
        flex-shrink: 0;
    }

    .sidebar-actions {
        flex: 1;
        min-width: 200px;
    }

    .sidebar-info-block {
        width: 100%;
        border-top: none;
        border-left: 2px solid var(--border-color);
        padding-left: 1rem;
        padding-top: 0;
    }
}

@media (max-width: 500px) {
    .sidebar-panel {
        flex-direction: column;
    }

    .sidebar-cover {
        width: 180px;
        margin: 0 auto;
    }

    .sidebar-info-block {
        border-left: none;
        padding-left: 0;
        border-top: 2px solid var(--border-color);
        padding-top: 1rem;
    }
}

/* ==========================================
   FILTER BAR (index.html)
   ========================================== */
.filter-wrapper {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-color);
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 180px;
    padding: 9px 14px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    border-radius: var(--border-radius);
}

.filter-search:focus {
    outline: none;
    border-color: var(--accent-color);
}

.filter-search::placeholder {
    color: #666;
}

.filter-select {
    padding: 9px 14px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f1ea' stroke-width='3' stroke-linecap='square'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.filter-count {
    font-size: 0.78rem;
    color: #777;
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
    margin-left: auto;
}

.comic-card.filtered-out {
    display: none;
}

.no-results-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #555;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    border: 2px dashed var(--border-color);
}

/* ==========================================
   CONTINUE READING (index.html)
   ========================================== */
.continue-reading-section {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    border: var(--border-width) solid var(--accent-color);
    background: rgba(255, 71, 26, 0.06);
    display: none;
    /* shown by JS if progress exists */
}

.continue-reading-section h3 {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.continue-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.continue-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-color);
    min-width: 0;
}

.continue-card:hover {
    border-color: var(--accent-color);
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 var(--accent-color);
    color: var(--text-color);
}

.continue-card .cc-title {
    font-weight: 700;
    font-family: 'Roboto Slab', serif;
    font-size: 0.78rem;
    line-height: 1.3;
    word-break: break-word;
    white-space: normal;
}

.continue-card .cc-progress {
    color: var(--accent-color);
    font-size: 0.7rem;
    margin-top: 2px;
}

.continue-card .cc-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ==========================================
   INTERACTIVE STAR RATING (detail.html)
   ========================================== */
.star-rating-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.stars-container {
    display: flex;
    gap: 1px;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: #444;
    padding: 1px 2px;
    transition: transform 0.1s, color 0.1s;
    line-height: 1;
}

.star-btn.lit {
    color: #FFD700;
}

.star-btn:hover {
    transform: scale(1.3);
}

.rating-display {
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    color: #aaa;
}

.rating-display strong {
    color: var(--text-color);
}

.user-rating-note {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-top: 4px;
    display: none;
}

/* ==========================================
   READING PROGRESS BADGE (detail.html)
   ========================================== */
.progress-badge {
    display: none;
    /* shown by JS */
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 71, 26, 0.12);
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    font-size: 0.78rem;
    font-family: 'Space Mono', monospace;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius);
}

.ch-item.read-item {
    border-left: 3px solid #444;
    opacity: 0.65;
}

.ch-item.read-item .ch-name::after {
    content: ' ✓';
    color: #4CAF50;
    font-size: 0.8rem;
}

.ch-item.current-item {
    border-left: 3px solid var(--accent-color) !important;
    opacity: 1 !important;
    background: rgba(255, 71, 26, 0.1) !important;
}

/* ==========================================
   START READING BUTTON
   ========================================== */
.btn-start {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    align-items: center;
    padding: 12px 15px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: var(--border-width) solid var(--border-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-start:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
    color: white;
}

/* ==========================================
   CHAPTER READER — TOP PROGRESS STRIP
   ========================================== */
.reader-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1000;
    pointer-events: none;
}

.reader-progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.12s ease;
    width: 0%;
}

/* ==========================================
   CHAPTER READER — EXTRA CONTROLS BAR
   ========================================== */
.reader-extra-bar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-indicator {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #888;
    min-width: 90px;
    text-align: center;
    padding: 4px 8px;
    border: 1px solid #333;
    border-radius: var(--border-radius);
}

.zoom-btn,
.mode-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 5px 11px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.15s;
    border-radius: var(--border-radius);
    text-transform: uppercase;
}

.zoom-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.mode-btn {
    border-color: #555;
}

.mode-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.bar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

/* ==========================================
   COMIC PAGES — READ MODES
   ========================================== */
.comic-pages {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 90vh;
}

/* Webtoon mode (default): all pages visible */
.comic-pages.webtoon-mode img {
    display: block;
}

/* Page mode: only active page visible */
.comic-pages.page-mode img {
    display: none;
    animation: fadeIn 0.18s ease;
}

.comic-pages.page-mode img.active-page {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom applied on container */
.comic-pages {
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* ==========================================
   KEYBOARD HINT OVERLAY
   ========================================== */
.kbd-hint {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid #444;
    padding: 0.7rem 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #888;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: var(--border-radius);
    line-height: 1.8;
}

.kbd-hint.show {
    opacity: 1;
}

.kbd-hint kbd {
    background: #2a2a2a;
    border: 1px solid #555;
    padding: 1px 5px;
    border-radius: 2px;
    color: #ddd;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
}

/* Lazy load fade-in */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2.5rem 0 1rem;
    flex-wrap: wrap;
}

.pg-btn {
    background: transparent;
    border: var(--border-width) solid var(--border-color);
    color: var(--text-color);
    padding: 8px 18px;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--border-radius);
    box-shadow: 3px 3px 0 var(--border-color);
    transition: all 0.15s;
}

.pg-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 3px 3px 0 var(--accent-color);
}

.pg-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

.pg-numbers {
    display: flex;
    gap: 0.35rem;
}

.pg-num {
    background: transparent;
    border: var(--border-width) solid var(--border-color);
    color: var(--text-color);
    width: 36px;
    height: 36px;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-num:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pg-num.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 3px 3px 0 var(--border-color);
}

/* ==========================================
   MOBILE RESPONSIVE — FULL OVERHAUL
   ========================================== */

/* ── Tablet (max 1024px) ── */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem 1.5rem;
    }

    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .hero {
        padding: 2rem 2rem;
        gap: 2rem;
    }

    .hero-image {
        width: 180px;
    }
}

/* ── Mobile (max 768px) ── */
@media (max-width: 768px) {

    /* Navbar */
    .navbar {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        display: none;
    }

    .nav-actions .btn {
        padding: 8px 16px;
        font-size: 0.78rem;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        padding: 1.5rem 1.25rem;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }

    .hero-content {
        max-width: 100%;
        order: 2;
    }

    .hero-image {
        width: 110px;
        height: 130px;
        aspect-ratio: unset;
        flex-shrink: 0;
        margin: 0 auto;
        order: 1;
    }

    .hero h1 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        color: #aaa;
    }

    .hero-buttons {
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .hero-buttons .btn {
        padding: 9px 18px;
        font-size: 0.78rem;
    }

    .badge {
        margin: 0 auto 0.75rem;
        font-size: 0.7rem;
    }

    /* Container */
    .container {
        padding: 1rem 1rem;
    }

    /* Section header */
    .section-header {
        margin-bottom: 1rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    /* Continue reading */
    .continue-reading-section {
        padding: 1rem;
    }

    .continue-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .continue-card {
        width: 100%;
    }

    /* Filter bar */
    .filter-wrapper {
        padding: 0.85rem 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-search,
    .filter-select {
        width: 100%;
        font-size: 0.8rem;
    }

    .filter-count {
        margin-left: 0;
        text-align: right;
    }

    /* Comic grid — 1 kolom di mobile */
    .comic-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Comic card */
    .comic-card {
        flex-direction: row;
    }

    .card-image {
        width: 100px;
    }

    .card-content {
        padding: 0.65rem 0.75rem;
    }

    .card-content h3 {
        font-size: 0.78rem;
        margin-bottom: 0.4rem;
    }

    .chapter-pill {
        padding: 4px 7px;
        font-size: 0.65rem;
    }

    .badge-new {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .chapter-date {
        font-size: 0.4rem;
    }

    .latest-chapters {
        gap: 0.25rem;
    }

    /* Pagination */
    .pagination-wrapper {
        gap: 0.35rem;
        margin: 1.5rem 0 0.5rem;
    }

    .pg-btn {
        padding: 7px 12px;
        font-size: 0.7rem;
    }

    .pg-num {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    /* Footer */
    footer {
        margin-top: 2rem;
        padding: 1.25rem;
        font-size: 0.8rem;
    }
}

/* ── Small mobile (max 480px) ── */
@media (max-width: 480px) {

    .hero h1 {
        font-size: 1.2rem;
    }

    .hero-image {
        width: 110px;
    }

    .card-image {
        width: 85px;
    }

    .card-content h3 {
        font-size: 0.72rem;
    }

    .issue-tag {
        font-size: 0.58rem;
        padding: 3px 6px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    /* Stack prev/next on very small screens */
    .pagination-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ── Chapter Reader Mobile ── */
@media (max-width: 768px) {
    .reader-extra-bar {
        padding: 6px 0.75rem;
        gap: 0.4rem;
        font-size: 0.7rem;
    }

    .zoom-btn,
    .mode-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
    }

    .page-indicator {
        font-size: 0.7rem;
        min-width: 70px;
    }

    .sticky-controls {
        padding: 8px 0.75rem;
    }

    .nav-buttons-large {
        flex-direction: column;
        gap: 0.75rem;
    }

    .big-btn {
        padding: 1rem;
        font-size: 1rem;
    }

    .comments-section {
        padding: 1.25rem;
    }
}

/* ── Detail Page Mobile ── */
@media (max-width: 768px) {
    .new-layout-wrapper {
        margin-top: 1rem;
    }

    .layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar-panel {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1rem;
    }

    .sidebar-cover {
        width: 120px;
        flex-shrink: 0;
    }

    .sidebar-actions {
        flex: 1;
        min-width: 150px;
    }

    .sidebar-info-block {
        width: 100%;
        border-top: 1px solid #444;
        padding-top: 1rem;
    }

    .manga-title {
        font-size: 1.8rem;
    }

    .manga-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
        font-size: 0.8rem;
    }
}

/* ==========================================
   TRENDING THIS WEEK SLIDER
   ========================================== */
.trending-section {
    background: transparent;
    padding: 0;
}

.trending-section .container {
    padding-top: 0;
    padding-bottom: 0;
    background: var(--card-bg);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 2rem;
    margin-bottom: 0;
    overflow: hidden;
}

.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

.trending-label {
    font-family: 'Roboto Slab', serif;
    font-weight: 900;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-color);
}

.slider-controls {
    display: flex;
    gap: 0.5rem;
}

.sl-arrow {
    background: transparent;
    border: var(--border-width) solid var(--border-color);
    color: var(--text-color);
    width: 34px;
    height: 34px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sl-arrow:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Track */
.slider-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.slider-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Single slide */
.sl-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 2rem 0;
}

.sl-cover {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 2 / 3;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 6px 6px 0 #000;
    overflow: hidden;
    background: #111;
    border-radius: var(--border-radius);
    display: block;
    cursor: pointer;
}

.sl-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.sl-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sl-rank {
    font-family: 'Roboto Slab', serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
    opacity: 0.4;
}

.sl-publisher {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sl-title {
    font-family: 'Roboto Slab', serif;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--text-color);
}

.sl-creator {
    font-size: 0.82rem;
    color: #aaa;
    font-family: 'Space Mono', monospace;
}

.sl-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.sl-issue {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.sl-date {
    color: #666;
}

.sl-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.sl-btn {
    padding: 9px 20px;
    font-size: 0.8rem;
}

/* Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0;
}

.sl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.sl-dot.active {
    background: var(--accent-color);
    width: 24px;
    border-radius: 4px;
}

/* Mobile slider */
@media (max-width: 768px) {
    .trending-header {
        padding: 0.75rem 1rem;
    }

    .trending-label {
        font-size: 0.75rem;
    }

    .sl-slide {
        flex-direction: row;
        padding: 1.25rem 1rem;
        gap: 1rem;
        align-items: flex-start;
    }

    .sl-cover {
        width: 100px;
    }

    .sl-rank {
        font-size: 1.8rem;
    }

    .sl-title {
        font-size: 1rem;
    }

    .sl-creator {
        font-size: 0.7rem;
    }

    .sl-meta {
        flex-direction: column;
        gap: 0.3rem;
        font-size: 0.68rem;
        align-items: flex-start;
    }

    .sl-buttons {
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .sl-btn {
        padding: 7px 12px;
        font-size: 0.7rem;
    }

    .sl-arrow {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* Reader nav actions */
.reader-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .reader-nav-actions .btn-sm {
        display: none;
    }
}

/* ==========================================
   CHAPTER POPUP (reader)
   ========================================== */
.chapter-popup-wrapper {
    position: relative;
}

.page-indicator {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #aaa;
    min-width: 90px;
    text-align: center;
    padding: 5px 10px;
    border: 1px solid #333;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.15s;
}

.page-indicator:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.chapter-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0 #000;
    width: 260px;
    z-index: 999;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.chapter-popup.open {
    display: block;
}

.chapter-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #222;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Roboto Slab', serif;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.chapter-popup-header button {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.chapter-popup-header button:hover {
    color: var(--accent-color);
}

.chapter-popup-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chapter-popup-list::-webkit-scrollbar {
    width: 4px;
}

.chapter-popup-list::-webkit-scrollbar-track {
    background: #222;
}

.chapter-popup-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

.cp-item {
    padding: 9px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: all 0.15s;
}

.cp-item:last-child {
    border-bottom: none;
}

.cp-item:hover {
    background: rgba(255, 71, 26, 0.12);
    color: var(--accent-color);
    padding-left: 18px;
}

.cp-item.cp-active {
    background: rgba(255, 71, 26, 0.15);
    color: var(--accent-color);
    font-weight: 700;
    border-left: 3px solid var(--accent-color);
}

/* ==========================================
   INDEX LAYOUT WITH SIDEBAR
   ========================================== */
.index-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
    align-items: start;
}

.index-grid-area {
    min-width: 0;
}

.index-sidebar {
    position: static;
}

.index-sidebar .cl-sidebar-section {
    margin-bottom: 1.75rem;
}

.index-sidebar .cl-sidebar-title {
    font-family: 'Roboto Slab', serif;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color);
}

.index-sidebar .cl-filter-tag {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #777;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    padding: 5px 0;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: all 0.12s;
}

.index-sidebar .cl-filter-tag:hover {
    color: var(--text-color);
    padding-left: 5px;
}

.index-sidebar .cl-filter-tag.active {
    color: var(--accent-color);
    font-weight: 700;
}

@media (max-width: 1024px) {
    .index-layout {
        grid-template-columns: 1fr;
    }

    .index-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .index-sidebar .cl-sidebar-section {
        min-width: 130px;
        margin-bottom: 0;
    }
}

/* Detail page 3-col layout */
.detail-3col {
    grid-template-columns: 280px 1fr 200px !important;
}

@media (max-width: 1100px) {
    .detail-3col {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   COMICS LIST PAGE
   ========================================== */
.cl-hero {
    background: var(--card-bg);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 2.5rem 3rem;
}

.cl-hero-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cl-hero h1 {
    font-size: 3.5rem;
    line-height: 1;
    color: var(--text-color);
}

.cl-hero h1 span {
    color: var(--accent-color);
}

.cl-hero-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: #666;
    border-left: 3px solid var(--accent-color);
    padding-left: 0.75rem;
}

.cl-toolbar {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.cl-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    border-radius: var(--border-radius);
}

.cl-search:focus {
    outline: none;
    border-color: var(--accent-color);
}

.cl-search::placeholder {
    color: #555;
}

.cl-select {
    padding: 8px 30px 8px 12px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f1ea' stroke-width='3' stroke-linecap='square'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.cl-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.cl-count {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #555;
    margin-left: auto;
    white-space: nowrap;
}

.cl-alpha-bar {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 3rem;
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.cl-alpha-btn {
    background: none;
    border: none;
    color: #555;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 2px;
    transition: all 0.12s;
}

.cl-alpha-btn:hover {
    color: var(--accent-color);
}

.cl-alpha-btn.active {
    color: var(--accent-color);
    background: rgba(255, 71, 26, 0.12);
}

.cl-alpha-btn.disabled {
    color: #333;
    cursor: default;
}

.cl-body {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 3rem;
    align-items: start;
}

.cl-sidebar {
    position: static;
}

.cl-sidebar-section {
    margin-bottom: 2rem;
}

.cl-sidebar-title {
    font-family: 'Roboto Slab', serif;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.cl-filter-tag {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #888;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    padding: 5px 0;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: all 0.12s;
    text-decoration: none;
}

.cl-filter-tag:hover {
    color: var(--text-color);
    padding-left: 6px;
}

.cl-filter-tag.active {
    color: var(--accent-color);
    font-weight: 700;
}

.cl-filter-tag .tag-count {
    color: #444;
    font-size: 0.7rem;
}

.cl-filter-tag.active .tag-count {
    color: var(--accent-color);
}

.cl-main {}

.cl-letter-group {
    margin-bottom: 2.5rem;
}

.cl-letter-anchor {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cl-letter {
    font-family: 'Roboto Slab', serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
    min-width: 40px;
}

.cl-letter-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.cl-row {
    display: grid;
    grid-template-columns: 1fr 120px 90px 90px 70px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #222;
    transition: all 0.12s;
    text-decoration: none;
    color: var(--text-color);
    gap: 1rem;
}

.cl-row:hover {
    background: rgba(255, 71, 26, 0.05);
    padding-left: 8px;
    border-bottom-color: var(--accent-color);
}

.cl-row:hover .cl-row-title {
    color: var(--accent-color);
}

.cl-row-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.12s;
}

.cl-row-pub {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    color: #666;
}

.cl-row-issues {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #888;
    text-align: center;
}

.cl-row-year {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #666;
    text-align: center;
}

.cl-row-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cl-row-status.ongoing {
    color: #4caf50;
}

.cl-row-status.completed {
    color: #888;
}

.cl-table-header {
    display: grid;
    grid-template-columns: 1fr 120px 90px 90px 70px;
    gap: 1rem;
    padding: 0 0 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.25rem;
}

.cl-th {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cl-th:nth-child(3),
.cl-th:nth-child(4) {
    text-align: center;
}

.cl-th:nth-child(5) {
    text-align: right;
}

.cl-no-results {
    padding: 3rem 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #444;
    text-align: center;
}

/* Comics list responsive */
@media (max-width: 900px) {
    .cl-hero {
        padding: 1.5rem 1rem;
    }

    .cl-hero h1 {
        font-size: 2rem;
    }

    .cl-hero-inner {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cl-toolbar {
        padding: 1rem;
    }

    .cl-alpha-bar {
        padding: 0.5rem 1rem;
    }

    .cl-body {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .cl-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .cl-sidebar-section {
        margin-bottom: 0;
        min-width: 140px;
    }

    .cl-row {
        grid-template-columns: 1fr 90px 60px;
    }

    .cl-row-year,
    .cl-row-issues {
        display: none;
    }

    .cl-table-header {
        grid-template-columns: 1fr 90px 60px;
    }

    .cl-th:nth-child(3),
    .cl-th:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .cl-row {
        grid-template-columns: 1fr 70px;
    }

    .cl-row-pub {
        display: none;
    }

    .cl-table-header {
        grid-template-columns: 1fr 70px;
    }

    .cl-th:nth-child(2) {
        display: none;
    }
}

/* ── Reader click zone icons ── */
#readerOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    /* Overlay hugs the active page image in page mode */
}

.reader-zone {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 88px;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.4rem;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: all;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    z-index: 20;
}

.reader-zone:hover {
    background: rgba(255, 71, 26, 0.85);
    color: #fff;
}

.reader-zone-left {
    left: 12px;
    border-radius: 4px;
}

.reader-zone-right {
    right: 12px;
    border-radius: 4px;
}

.reader-zone-down {
    left: 50%;
    transform: translate(-50%, 0) rotate(90deg);
    bottom: 24px;
    top: auto;
}

.reader-zone-down {
    position: fixed;
    left: 50%;
    transform: translate(-50%, 0) rotate(90deg);
    bottom: 24px;
    top: auto;
}

/* ── Back to Top ── */
#backToTop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 3px 3px 0 #000;
    transition: background 0.15s, transform 0.15s;
}

#backToTop:hover {
    background: #cc3300;
    transform: translateY(-2px);
}

/* ── Back to Top ── */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 3px 3px 0 #000;
    transition: background 0.15s, transform 0.15s;
}

#backToTop:hover {
    background: #d43500;
    transform: translateY(-2px);
}

/* sl-publisher and sl-issue as links */
a.sl-publisher {
    text-decoration: none;
    transition: opacity 0.15s;
}

a.sl-publisher:hover {
    opacity: 0.75;
    text-decoration: underline;
}

a.sl-issue {
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.15s, border-color 0.15s;
}

a.sl-issue:hover {
    background: rgba(255, 71, 26, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.sl-synopsis {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.6;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

a.sl-title {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.15s;
}

a.sl-title:hover {
    color: var(--accent-color);
}

.info-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.15s;
}

.info-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ── Popular Posts Sidebar ── */
.pop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 0;
    border-bottom: 1px solid #222;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.12s;
}

.pop-item:hover {
    color: var(--accent-color);
}

.pop-item:last-child {
    border-bottom: none;
}

.pop-rank {
    font-family: 'Roboto Slab', serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-color);
    min-width: 22px;
    text-align: center;
    line-height: 1;
}

.pop-thumb {
    width: 48px;
    height: 66px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.pop-thumb-empty {
    width: 48px;
    height: 66px;
    background: #222;
    flex-shrink: 0;
    border-radius: 2px;
}

.pop-info {
    flex: 1;
    min-width: 0;
}

.pop-title {
    font-family: 'Roboto Slab', serif;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pop-views {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #555;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .sl-slide p[style] {
        font-size: 0.7rem !important;
        -webkit-line-clamp: 2 !important;
        margin: 0.25rem 0 !important;
    }
}

/* ── WordPress Native Comments ── */
.comments-section .comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.comments-section .comment-list .comment {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comments-section .comment-list .comment:last-child {
    border-bottom: none;
}

.comments-section .comment-list .comment-author {
    font-family: 'Roboto Slab', serif;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.comments-section .comment-list .comment-author b {
    font-weight: 900;
}

.comments-section .comment-list .comment-meta,
.comments-section .comment-list .comment-metadata {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.comments-section .comment-list .comment-meta a,
.comments-section .comment-list .comment-metadata a {
    color: #666;
    text-decoration: none;
}

.comments-section .comment-list .comment-content p {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-color);
    margin: 0;
}

.comments-section .comment-list .reply a {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-color);
    text-decoration: none;
    text-transform: uppercase;
}

.comments-section .comment-list .reply a:hover {
    text-decoration: underline;
}

/* Comment Form */
.comments-section #respond {
    margin-top: 1.5rem;
    border-top: 2px solid var(--accent-color);
    padding-top: 1.5rem;
}

.comments-section #respond h3#reply-title {
    font-family: 'Roboto Slab', serif;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-left: 6px solid var(--accent-color);
    padding-left: 10px;
}

.comments-section .comment-form p {
    margin-bottom: 0.75rem;
}

.comments-section .comment-form label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.comments-section .comment-form input[type="text"],
.comments-section .comment-form input[type="email"],
.comments-section .comment-form input[type="url"],
.comments-section .comment-form textarea {
    width: 100%;
    background: var(--card-bg);
    border: var(--border-width) solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.comments-section .comment-form input:focus,
.comments-section .comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.comments-section .comment-form textarea {
    height: 100px;
    resize: vertical;
}

.comments-section .comment-form .submit,
.comments-section .comment-form #submit {
    background: var(--accent-color);
    color: #fff;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    padding: 8px 20px;
    font-family: 'Roboto Slab', serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.1s, box-shadow 0.1s;
}

.comments-section .comment-form .submit:hover,
.comments-section .comment-form #submit:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #000;
}

.comments-section .no-comments {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: #666;
}