/* =========================================================
   SAGA STORIES — SINGLE COMIC + COMIC GRID
========================================================= */

/* =========================================================
   GLOBAL COMIC AREA
========================================================= */

body.single-comic,
body.post-type-archive-comic {
    background: #f7f8fc;
}

/* =========================================================
   COMIC PAGE LAYOUT
========================================================= */

.comic-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;

    max-width: 1200px;

    margin: 50px auto;

    padding: 0 20px;
}

/* =========================================================
   LEFT CONTENT
========================================================= */

.comic-left {
    width: 100%;
}

/* =========================================================
   RIGHT SIDEBAR
========================================================= */

.comic-right {
    width: 100%;
}

/* =========================================================
   SIDEBAR CARD
========================================================= */

.comic-sidebar {
    background: #fff;

    border-radius: 28px;

    padding: 32px;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.05);
}

.comic-sidebar img,
.comic-cover {
    width: 180px;

    border-radius: 20px;

    display: block;

    margin: 0 auto 24px;

    box-shadow:
        0 12px 24px rgba(0,0,0,0.12);
}

.comic-sidebar p {
    color: #555;

    font-size: 16px;

    line-height: 1.8;
}

/* =========================================================
   SYNOPSIS
========================================================= */

.comic-synopsis {
    margin-top: 20px;
}

.synopsis-text {
    color: #555;

    line-height: 1.8;

    font-size: 15px;
}

/* =========================================================
   ACTION BUTTONS
========================================================= */

.comic-action-buttons,
.episode-buttons {
    display: flex;
    flex-direction: column;

    gap: 14px;

    margin-top: 28px;
}

.comic-read-btn,
.episode-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 56px;

    border-radius: 18px;

    text-decoration: none;

    font-size: 16px;
    font-weight: 700;

    transition: 0.25s ease;
}

.comic-read-btn,
.episode-btn.first {
    background:
        linear-gradient(
            135deg,
            #7a3cff,
            #944dff
        );

    color: #fff;
}

.comic-read-btn:hover,
.episode-btn.first:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            #692cf0,
            #823fff
        );
    color: #f5f0ff;
}

.comic-read-btn.secondary,
.episode-btn.latest {
    background: #efe7ff;

    color: #6d36ff;
}

.comic-read-btn.secondary:hover,
.episode-btn.latest:hover {
    background: #e5d6ff;
}

/* =========================================================
   CHAPTER SECTION
========================================================= */

.comic-chapter-wrapper {
    width: 100%;
}

/* =========================================================
   SECTION TITLE
========================================================= */

.episode-title {
    font-size: 42px;
    font-weight: 800;

    margin-bottom: 26px;

    color: #111;
}

/* =========================================================
   CHAPTER SORT
========================================================= */

.chapter-sort {
    display: flex;
    justify-content: flex-end;

    gap: 10px;

    margin-bottom: 18px;
}

.sort-btn {
    border: none;

    background: #fff;

    color: #666;

    padding: 10px 16px;

    border-radius: 12px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;

    box-shadow:
        0 4px 12px rgba(0,0,0,0.05);
}

.sort-btn:hover {
    background: #f5f0ff;
    color: #6d36ff;
}

.sort-btn.active {
    background: #7a3cff;
    color: #fff;
}

/* =========================================================
   CHAPTER LIST
========================================================= */

.chapter-list {
    display: flex;
    flex-direction: column;

    background: #fff;

    border-radius: 26px;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.04);
}

/* =========================================================
   SINGLE CHAPTER ITEM
========================================================= */

.chapter-item {
    display: flex;
    align-items: center;

    gap: 16px;

    padding: 16px 20px;

    text-decoration: none;

    border-bottom:
        1px solid rgba(0,0,0,0.06);

    transition: 0.2s ease;

    color: #111;

    background: #fff;
}

.chapter-item:hover {
    background: #faf7ff;
}

/* =========================================================
   THUMBNAIL
========================================================= */

.chapter-thumb {
    width: 92px;

    flex-shrink: 0;
}

.chapter-thumb img,
.chapter-thumb-placeholder {
    width: 92px;
    height: 54px;

    object-fit: cover;

    border-radius: 10px;

    display: block;

    background: #ececec;
}

/* =========================================================
   META
========================================================= */

.chapter-meta {
    display: flex;
    flex-direction: column;

    gap: 4px;

    flex: 1;
}

.chapter-title {
    font-size: 16px;
    font-weight: 700;

    color: #111;

    line-height: 1.4;
}

.chapter-date {
    font-size: 13px;

    color: #888;
}

/* =========================================================
   PAGINATION
========================================================= */

.comic-pagination {
    margin-top: 30px;

    display: flex;
    justify-content: center;

    gap: 10px;

    flex-wrap: wrap;
}

.page-btn {
    min-width: 46px;
    height: 46px;

    border: none;

    border-radius: 14px;

    background: #fff;

    color: #111;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;

    box-shadow:
        0 6px 16px rgba(0,0,0,0.06);
}

.page-btn:hover:not(:disabled) {
    background: #7a3cff;
    color: #fff;
}

.page-btn.active {
    background: #7a3cff;
    color: #fff;
}

/* =========================================================
   COMIC GRID
========================================================= */

.comics-grid,
.comic-card-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(240px, 1fr));

    gap: 26px;

    max-width: 1250px;

    margin: auto;
}

/* =========================================================
   COMIC CARD
========================================================= */

.comic-card {
    position: relative;

    border-radius: 22px;

    overflow: hidden;

    background: #fff;

    padding: 10px;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    box-shadow:
        0 8px 24px rgba(0,0,0,0.06);
}

.comic-card:hover {
    transform: translateY(-6px);

    box-shadow:
        0 18px 40px rgba(0,0,0,0.14);
}

/* =========================================================
   CARD IMAGE
========================================================= */

.comic-image,
.comic-cover-wrap {
    width: 100%;

    aspect-ratio: 3 / 4;

    overflow: hidden;

    border-radius: 16px;

    background: #eee;
}

.comic-image img,
.comic-cover-wrap img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform 0.4s ease;
}

.comic-card:hover img {
    transform: scale(1.04);
}

/* =========================================================
   OVERLAY
========================================================= */

.comic-overlay {
    position: absolute;

    left: 10px;
    right: 10px;
    bottom: 10px;

    padding: 20px 18px 18px;

    border-radius: 0 0 16px 16px;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.92),
            rgba(0,0,0,0.45),
            rgba(0,0,0,0)
        );
}

/* =========================================================
   CARD TITLE
========================================================= */

.comic-title {
    color: #fff;

    font-size: 1.5rem;
    font-weight: 800;

    line-height: 1.15;

    margin: 0 0 10px;
}

/* =========================================================
   STATUS BADGE
========================================================= */

.comic-status {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 7px 14px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
}

.status-ongoing {
    background: #23d96b;
    color: #fff;
}

.status-hiatus {
    background: #ffb347;
    color: #fff;
}

.status-ended {
    background: #8a8a8a;
    color: #fff;
}

.comic-hero {
    position: relative;
    min-height: 520px;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: flex-end;
    padding: 100px 7% 70px;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    isolation: isolate;
}

.comic-hero::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(10,10,15,.92) 0%,
            rgba(10,10,15,.58) 45%,
            rgba(10,10,15,.22) 100%
        );

    z-index: -1;
}

.comic-hero-content {
    max-width: 700px;
    color: #fff;
}

.comic-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 18px;
}

.comic-description {
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 620px;
    opacity: .92;
    margin-bottom: 24px;
}

.comic-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.comic-status {
    background: #7c4dff;
    color: #fff;

    padding: 10px 18px;
    border-radius: 999px;

    font-weight: 700;
    font-size: .95rem;
}

/* =========================
   STATUS BADGE
========================= */

.comic-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 18px;
    padding: 10px 22px;

    border-radius: 999px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;

    color: #fff;

    backdrop-filter: blur(10px);

    box-shadow:
        0 8px 25px rgba(0,0,0,.25);

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.comic-status:hover {
    transform: translateY(-2px);
}

/* Ongoing */
.comic-status--ongoing {
    background:
        linear-gradient(135deg, #16a34a, #22c55e);

    box-shadow:
        0 10px 24px rgba(34,197,94,.35);
}

/* Hiatus */
.comic-status--hiatus {
    background:
        linear-gradient(135deg, #f59e0b, #fb923c);

    box-shadow:
        0 10px 24px rgba(251,146,60,.35);
}

/* Ended */
.comic-status--ended {
    background:
        linear-gradient(135deg, #dc2626, #ef4444);

    box-shadow:
        0 10px 24px rgba(239,68,68,.35);
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .comic-wrapper {
        display: flex;
        flex-direction: column;

        gap: 24px;
    }

    .comic-right {
        order: 1;
    }

    .comic-left {
        order: 2;
    }

    .comic-sidebar {
        padding: 24px;
    }

    .comic-sidebar img,
    .comic-cover {
        width: 150px;
    }

    .comic-sidebar p,
    .synopsis-text {
        text-align: justify;

        font-size: 15px;
    }

    .episode-title {
        font-size: 28px;
    }

    .chapter-item {
        gap: 12px;

        padding: 14px;
    }

    .chapter-thumb {
        width: 78px;
    }

    .chapter-thumb img,
    .chapter-thumb-placeholder {
        width: 78px;
        height: 46px;
    }

    .chapter-title {
        font-size: 15px;
    }

    .chapter-date {
        font-size: 12px;
    }

    .chapter-sort {
        justify-content: center;
    }

    .sort-btn {
        flex: 1;
    }

    .comics-grid,
    .comic-card-grid {
        grid-template-columns: repeat(2, 1fr);

        gap: 14px;
    }

    .comic-title {
        font-size: 1.05rem;
    }

    .comic-status {
        font-size: 9px;

        padding: 5px 10px;
    }

    .comic-hero,
    .saga-global-hero {
        min-height: 380px;
        padding: 80px 24px 50px;
    }

    .comic-title,
    .saga-global-hero__content h1 {
        font-size: 2.5rem;
    }

    .comic-description {
        font-size: .95rem;
    }
}