/* ═══════════════════════════════════════════════════════════
   ACF Comic Navigator — comic-nav.css
   ═══════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────── */
.cn-wrap { width: 100%; }

/* ══════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════ */
.cn-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 32px;
    position: relative;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.cn-tab {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cn-tab:hover,
.cn-tab--active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.cn-arrow {
    transition: transform 0.2s;
}

/* ── Tab wrap (relative for dropdown) ────────────────────── */
.cn-tab-wrap {
    position: relative;
}

.cn-tab-wrap:hover .cn-tab .cn-arrow {
    transform: rotate(180deg);
}

/* ── Dropdown ─────────────────────────────────────────────── */
.cn-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px;
    min-width: 200px;
    z-index: 999;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.cn-tab-wrap:hover .cn-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── Comic group ──────────────────────────────────────────── */
.cn-comic-group {
    position: relative;
}

/* ── Comic name button ────────────────────────────────────── */
.cn-comic-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: #ddd;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    gap: 8px;
}

.cn-comic-name:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.cn-sub-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
}

/* ── Chapters list ────────────────────────────────────────── */
.cn-chapters {
    position: absolute;
    top: 0;
    left: calc(100% + 6px);
    background: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);

    opacity: 0;
    visibility: hidden;
    transform: translateX(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.cn-comic-group:hover .cn-chapters {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.cn-comic-group:hover .cn-sub-arrow {
    transform: rotate(90deg);
}

/* ── Chapter button ───────────────────────────────────────── */
.cn-chap-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #bbb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.cn-chap-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.cn-chap-btn--active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

/* ── Empty states ─────────────────────────────────────────── */
.cn-empty,
.cn-no-chap {
    color: #666;
    font-size: 13px;
    padding: 8px 12px;
    display: block;
}

/* ══════════════════════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════════════════════ */
.cn-content-area {
    width: 100%;
    min-height: 300px;
}

/* ── Placeholder ──────────────────────────────────────────── */
.cn-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 80px 20px;
    color: #555;
    text-align: center;
}

.cn-placeholder p {
    font-size: 15px;
    margin: 0;
}

/* ── Loading spinner ──────────────────────────────────────── */
.cn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.cn-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cn-spin 0.7s linear infinite;
}

@keyframes cn-spin {
    to { transform: rotate(360deg); }
}

/* ── Chapter title header ─────────────────────────────────── */
.cn-chapter-header {
    padding: 0 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0;
}

.cn-chapter-header h3 {
    font-size: 20px;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   COMIC ROWS (Alternating layout)
   ══════════════════════════════════════════════════════════ */
.cn-row {
    display: flex;
    align-items: stretch;
    min-height: 400px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: cn-fadein 0.4s ease both;
}

.cn-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Image column ─────────────────────────────────────────── */
.cn-col--img {
    overflow: hidden;
    background: #0a0a0a;
}

.cn-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    cursor: zoom-in;
}

.cn-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cn-img-wrap:hover .cn-img {
    transform: scale(1.04);
}

.cn-pg-num {
    position: absolute;
    bottom: 14px;
    left: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.45);
    background: rgba(0,0,0,0.4);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.cn-zoom-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.cn-img-wrap:hover .cn-zoom-icon {
    opacity: 1;
}

/* ── Content column ───────────────────────────────────────── */
.cn-col--content {
    padding: 52px 48px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}


.cn-content-inner {font-size: 18px;font-family: 'Jost'; color:white;}

.cn-content-inner p         { font-size: 15px; line-height: 1.85; color: #bbb; margin-bottom: 1.2em; }
.cn-content-inner h2        { font-size: 26px; color: #fff; font-weight: 700; margin-bottom: 0.5em; }
.cn-content-inner h3        { font-size: 20px; color: #fff; font-weight: 600; margin-bottom: 0.5em; }
.cn-content-inner strong    { color: #fff; }
.cn-content-inner ul,
.cn-content-inner ol        { color: #bbb; padding-left: 1.4em; margin-bottom: 1em; }
.cn-content-inner li        { margin-bottom: 0.4em; }

/* ── No comic ─────────────────────────────────────────────── */
.cn-no-comic {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

/* ── Fade in ──────────────────────────────────────────────── */
@keyframes cn-fadein {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.cn-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cn-lightbox--open { display: flex; }

.cn-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(5px);
    cursor: pointer;
    animation: cn-fade 0.25s ease;
}

.cn-lb-inner {
    position: relative;
    z-index: 1;
    animation: cn-scale 0.28s ease;
}

.cn-lb-img {
    display: block;
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 6px;
    box-shadow: 0 20px 70px rgba(0,0,0,0.7);
    object-fit: contain;
}

.cn-lb-close {
    position: fixed;
    top: 16px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.2s;
}

.cn-lb-close:hover {
    background: rgba(255,255,255,0.12);
    transform: rotate(90deg);
}

@keyframes cn-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cn-scale { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: scale(1); } }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .cn-row { flex-direction: column !important; }
        .cn-col--img {
        order: 1;
    }

    .cn-col--content {
        order: 2;
    }

    .cn-img-wrap { min-height: 260px; }
    .cn-col--content { padding: 28px 20px; }
    .cn-content-inner { max-width: 100%; }
    .cn-chapters {
        position: static;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none;
        border: none;
        padding: 0 0 0 12px;
        background: transparent;
    }
}

/* ── Breadcrumb — paste this at the end of comic-nav.css ── */

.cn-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    font-family: inherit;
}

.cn-bc-home,
.cn-bc-parent {
    color: #888;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cn-bc-home:hover,
.cn-bc-parent:hover {
    color: #fff;
    text-decoration: underline;
}

.cn-bc-sep {
    display: flex;
    align-items: center;
    color: #555;
    flex-shrink: 0;
}

.cn-bc-current {
    color: #fff;
    font-weight: 500;
    transition: opacity 0.3s ease;
}