/*
Theme Name: InkBox
Description: Modern, fast comics theme with dark aesthetic. Built for manga and comic book sites. Integrates with VideoTube Pro plugin for archive downloads.
Version: 1.0.0
Author: MoneyPlatform
Text Domain: inkbox
Tags: dark, comics, manga, grid, responsive, seo-ready
Requires at least: 5.8
Requires PHP: 7.4
*/

/* ======================================================
   1. CUSTOM PROPERTIES
   ====================================================== */
:root {
    /* Dark theme (default) */
    --bg:           #08080d;
    --bg-surface:   #0f0f18;
    --bg-card:      #131320;
    --bg-card-h:    #1a1a2a;
    --bg-elevated:  #1e1e30;
    --bg-overlay:   rgba(8,8,13,.85);

    --text:         #e4e4f2;
    --text-muted:   #7878a0;
    --text-faint:   #3d3d5a;

    --accent:       #9333ea;
    --accent-h:     #a855f7;
    --accent-dim:   #6d28d9;
    --accent-glow:  rgba(147,51,234,.32);
    --accent-sub:   rgba(147,51,234,.12);

    --gold:         #f59e0b;
    --gold-sub:     rgba(245,158,11,.14);
    --green:        #10b981;
    --green-sub:    rgba(16,185,129,.14);
    --amber:        #f59e0b;
    --amber-sub:    rgba(245,158,11,.14);
    --red:          #ef4444;
    --red-sub:      rgba(239,68,68,.14);
    --blue:         #3b82f6;
    --blue-sub:     rgba(59,130,246,.14);

    --border:       rgba(255,255,255,.06);
    --border-s:     rgba(255,255,255,.12);

    /* Typography */
    --sans:    system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    --display: 'Bebas Neue','Impact','Arial Narrow',sans-serif;

    --xs:  .75rem;
    --sm:  .875rem;
    --md:  1rem;
    --lg:  1.125rem;
    --xl:  1.25rem;
    --2xl: 1.5rem;
    --3xl: 2rem;
    --4xl: 2.75rem;
    --5xl: 3.75rem;

    /* Spacing */
    --s1: .25rem;  --s2: .5rem;   --s3: .75rem;  --s4: 1rem;
    --s5: 1.25rem; --s6: 1.5rem;  --s8: 2rem;    --s10: 2.5rem;
    --s12: 3rem;   --s16: 4rem;   --s20: 5rem;

    /* Layout */
    --wrap:   1480px;
    --pad:    clamp(1rem,4vw,3rem);
    --hdr:    60px;

    /* Radius */
    --r:    8px;
    --r-sm: 4px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-f:  9999px;

    /* Shadows */
    --sh-sm: 0 1px 4px rgba(0,0,0,.35);
    --sh:    0 4px 16px rgba(0,0,0,.45);
    --sh-lg: 0 8px 40px rgba(0,0,0,.55);
    --sh-xl: 0 16px 64px rgba(0,0,0,.65);
    --sh-ac: 0 4px 24px var(--accent-glow);

    /* Easing */
    --ease:     cubic-bezier(.4,0,.2,1);
    --spring:   cubic-bezier(.34,1.56,.64,1);
    --fast:     120ms;
    --dur:      200ms;
    --slow:     350ms;

    /* Z */
    --z-card:   10;
    --z-hdr:    100;
    --z-drawer: 200;
    --z-modal:  300;
}

/* Light mode overrides */
[data-theme="light"] {
    --bg:          #f2f2f8;
    --bg-surface:  #ffffff;
    --bg-card:     #ffffff;
    --bg-card-h:   #f6f6ff;
    --bg-elevated: #eaeaf6;
    --bg-overlay:  rgba(242,242,248,.9);

    --text:        #12121e;
    --text-muted:  #5a5a80;
    --text-faint:  #b0b0c8;

    --border:      rgba(0,0,0,.07);
    --border-s:    rgba(0,0,0,.14);

    --sh-sm: 0 1px 4px rgba(0,0,0,.08);
    --sh:    0 4px 16px rgba(0,0,0,.1);
    --sh-lg: 0 8px 40px rgba(0,0,0,.12);
    --sh-xl: 0 16px 64px rgba(0,0,0,.16);
}

/* ======================================================
   2. BASE
   ====================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    font-size: var(--md);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }

a {
    color: var(--accent-h);
    text-decoration: none;
    transition: color var(--fast) var(--ease);
}
a:hover { color: var(--accent-h); text-decoration: underline; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-sm);
}
::selection { background: var(--accent-sub); color: var(--text); }

/* ======================================================
   3. LAYOUT
   ====================================================== */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding-top: var(--hdr);
}

/* ======================================================
   4. HEADER
   ====================================================== */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: var(--z-hdr);
    height: var(--hdr);
    background: rgba(8, 8, 13, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    transition: box-shadow var(--dur) var(--ease);
}
[data-theme="light"] .site-header {
    background: rgba(242, 242, 248, 0.88);
}
.site-header.is-scrolled {
    box-shadow: 0 1px 32px rgba(0,0,0,.4);
}

.hdr-inner {
    display: flex;
    align-items: center;
    gap: var(--s4);
    height: 100%;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--s3);
    flex-shrink: 0;
    text-decoration: none !important;
}
.site-logo img { height: 34px; width: auto; }
.logo-text {
    font-family: var(--display);
    font-size: var(--2xl);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
}
.logo-text em {
    color: var(--accent-h);
    font-style: normal;
}

/* Primary nav */
.primary-nav {
    display: flex;
    align-items: center;
    gap: var(--s1);
    margin-left: var(--s6);
}
.primary-nav a {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
    font-size: var(--sm);
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--r);
    transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
    color: var(--text);
    background: var(--bg-elevated);
}

/* Header search */
.hdr-search {
    flex: 1;
    max-width: 380px;
    margin-left: auto;
}
.hdr-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-f);
    padding: 0 var(--s4);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.hdr-search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-sub);
}
.hdr-search-form input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    padding: 9px 0;
    font-size: var(--sm);
    color: var(--text);
}
.hdr-search-form input::placeholder { color: var(--text-faint); }
.hdr-search-form button {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    padding: var(--s1) 0;
}
.hdr-search-form button:hover { color: var(--text); }

/* Header actions */
.hdr-actions {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-shrink: 0;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-s); }

.menu-toggle { display: none; }

/* Mobile drawer */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    pointer-events: none;
}
.mobile-nav.open { pointer-events: all; }

.mobile-nav__bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}
.mobile-nav.open .mobile-nav__bg { opacity: 1; }

.mobile-nav__drawer {
    position: absolute;
    inset: 0 auto 0 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: var(--s6);
    transform: translateX(-100%);
    transition: transform var(--slow) var(--ease);
    overflow-y: auto;
}
.mobile-nav.open .mobile-nav__drawer { transform: translateX(0); }

.mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s8);
}

.mobile-nav__menu a {
    display: block;
    padding: var(--s3) var(--s4);
    font-size: var(--md);
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--r);
    transition: all var(--fast) var(--ease);
    text-decoration: none;
}
.mobile-nav__menu a:hover { color: var(--text); background: var(--bg-elevated); }

.mobile-nav__sep {
    margin: var(--s6) 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* ======================================================
   5. HERO SPOTLIGHT
   ====================================================== */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    padding-block: var(--s12);
    margin-bottom: var(--s10);
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(.35) saturate(1.5);
    transform: scale(1.08);
    z-index: 0;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 100%);
    z-index: 1;
}
.hero__fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    z-index: 1;
}

.hero__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--s8);
    align-items: flex-end;
    max-width: 860px;
}

.hero__cover {
    aspect-ratio: 2/3;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-xl);
    border: 1px solid var(--border-s);
    flex-shrink: 0;
}
.hero__cover img { width: 100%; height: 100%; object-fit: cover; }

.hero__info { padding-bottom: var(--s4); }

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent-h);
    margin-bottom: var(--s3);
}

.hero__title {
    font-family: var(--display);
    font-size: clamp(2.4rem,5vw,4rem);
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.05;
    margin-bottom: var(--s4);
}

.hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin-bottom: var(--s4);
}

.hero__desc {
    font-size: var(--sm);
    color: rgba(228,228,242,.75);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: var(--s6);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero__actions {
    display: flex;
    gap: var(--s3);
    flex-wrap: wrap;
}

/* ======================================================
   6. SECTION
   ====================================================== */
.section { padding-block: var(--s8); }
.section + .section { padding-top: 0; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    margin-bottom: var(--s6);
}

.section-title {
    font-family: var(--display);
    font-size: var(--3xl);
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: var(--s3);
}
.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.1em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-all {
    display: flex;
    align-items: center;
    gap: var(--s1);
    font-size: var(--sm);
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--fast) var(--ease);
}
.section-all:hover { color: var(--accent-h); text-decoration: none; }

/* ======================================================
   7. FILTER BAR
   ====================================================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
    padding-block: var(--s4);
    margin-bottom: var(--s6);
    border-bottom: 1px solid var(--border);
}

.filter-bar__label {
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-right: var(--s2);
    white-space: nowrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--s1) var(--s3);
    font-size: var(--xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-f);
    cursor: pointer;
    transition: all var(--fast) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.filter-pill:hover,
.filter-pill.is-active {
    color: var(--accent-h);
    background: var(--accent-sub);
    border-color: var(--accent);
    text-decoration: none;
}

/* ======================================================
   8. COMIC GRID
   ====================================================== */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), 1fr);
    gap: var(--s4) var(--s3);
}

/* ======================================================
   9. COMIC CARD
   ====================================================== */
.comic-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition:
        border-color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease),
        transform var(--dur) var(--ease);
    will-change: transform;
}
.comic-card:hover {
    border-color: rgba(147,51,234,.5);
    box-shadow: var(--sh-lg), 0 0 0 1px rgba(147,51,234,.3) inset;
    transform: translateY(-3px);
}

/* Cover */
.comic-card__cover {
    position: relative;
    display: block;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-elevated);
    flex-shrink: 0;
}
.comic-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--slow) var(--ease);
}
.comic-card:hover .comic-card__cover img { transform: scale(1.05); }

/* Cover placeholder */
.cover-ph {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
    color: var(--text-faint);
    font-family: var(--display);
    font-size: var(--lg);
    letter-spacing: .05em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}

/* Status badges on cover */
.comic-card__badges {
    position: absolute;
    top: var(--s2);
    left: var(--s2);
    right: var(--s2);
    display: flex;
    gap: var(--s1);
    flex-wrap: wrap;
    pointer-events: none;
}

/* Chapter badge, bottom-right */
.comic-card__chap {
    position: absolute;
    bottom: var(--s2);
    right: var(--s2);
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(4px);
    border-radius: var(--r-sm);
    padding: 2px var(--s2);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    transition: opacity var(--fast) var(--ease);
}
.comic-card:hover .comic-card__chap { opacity: 0; }

/* Hover overlay */
.comic-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(8,8,13,.88) 100%);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--s4);
    gap: var(--s2);
}
.comic-card:hover .comic-card__overlay { opacity: 1; }

.card-overlay-meta {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
}

/* Info below cover */
.comic-card__info {
    padding: var(--s3) var(--s3) var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    flex: 1;
}

.comic-card__title {
    font-size: var(--sm);
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.comic-card__title a { color: var(--text); text-decoration: none; }
.comic-card__title a:hover { color: var(--accent-h); text-decoration: none; }

.comic-card__meta {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
    margin-top: var(--s1);
}

.comic-card__author {
    font-size: var(--xs);
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comic-card__author:hover { color: var(--accent-h); text-decoration: none; }

.comic-card__date {
    font-size: var(--xs);
    color: var(--text-faint);
    white-space: nowrap;
    margin-left: auto;
}

/* ======================================================
   10. BADGES
   ====================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--s2);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--r-sm);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    line-height: 1.6;
}
.badge--ongoing   { background: var(--blue-sub);  color: var(--blue); }
.badge--completed { background: var(--green-sub); color: var(--green); }
.badge--hiatus    { background: var(--amber-sub); color: var(--amber); }
.badge--cancelled { background: var(--red-sub);   color: var(--red); }
.badge--genre     { background: var(--accent-sub); color: var(--accent-h); }
.badge--new       { background: var(--green-sub); color: var(--green); }
.badge--hot       { background: var(--red-sub);   color: var(--red); }
.badge--featured  { background: var(--gold-sub);  color: var(--gold); }

/* ======================================================
   11. BUTTONS
   ====================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s3) var(--s5);
    font-size: var(--sm);
    font-weight: 600;
    border-radius: var(--r);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--fast) var(--ease);
    white-space: nowrap;
    text-decoration: none !important;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-h);
    border-color: var(--accent-h);
    box-shadow: var(--sh-ac);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-s);
}
.btn-outline:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-elevated); }

.btn-download {
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff;
    border-color: transparent;
    padding: var(--s4) var(--s6);
    font-size: var(--md);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-ac);
    width: 100%;
    justify-content: center;
    gap: var(--s3);
}
.btn-download:hover {
    background: linear-gradient(135deg, var(--accent-h), var(--accent));
    box-shadow: 0 6px 32px var(--accent-glow);
    transform: translateY(-2px);
    color: #fff;
}

.btn-sm {
    padding: var(--s2) var(--s3);
    font-size: var(--xs);
}
.btn-lg {
    padding: var(--s4) var(--s8);
    font-size: var(--md);
}

/* ======================================================
   12. SINGLE POST — HERO (shero)
   ====================================================== */
.shero {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    padding-block: var(--s16) var(--s12);
    margin-bottom: 0;
}
.shero__bg {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center top;
    filter: blur(28px) brightness(.25) saturate(1.4);
    z-index: 0;
}
.shero__bg--plain {
    background: linear-gradient(135deg, #1a0533, #0d0d20);
    filter: none;
}
.shero__veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right,  rgba(8,8,13,.96) 0%, rgba(8,8,13,.6) 55%, rgba(8,8,13,.2) 100%),
        linear-gradient(to bottom, transparent 40%, rgba(8,8,13,.95) 100%);
    z-index: 1;
}
.shero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
}
.shero__layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--s8);
    align-items: flex-end;
    margin-top: var(--s6);
}
.shero__thumb {
    aspect-ratio: 2/3;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.1);
    flex-shrink: 0;
    background: var(--bg-elevated);
}
.shero__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shero__thumb-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}
.shero__info {
    padding-bottom: var(--s4);
    max-width: 680px;
}
.shero__genres {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin-bottom: var(--s4);
}
.shero__title {
    font-family: var(--display);
    font-size: clamp(2.2rem, 4.5vw, 4rem);
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.05;
    margin-bottom: var(--s4);
    text-shadow: 0 2px 24px rgba(0,0,0,.5);
}
.shero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s5);
    font-size: var(--sm);
}
.shero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    color: rgba(228,228,242,.7);
    font-size: var(--xs);
}
.shero__meta-item a { color: inherit; text-decoration: none; }
.shero__meta-item a:hover { color: #fff; }
.shero__excerpt {
    font-size: var(--sm);
    color: rgba(228,228,242,.65);
    max-width: 520px;
    line-height: 1.7;
    margin-bottom: var(--s6);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shero__actions {
    display: flex;
    gap: var(--s3);
    flex-wrap: wrap;
}
/* Override full-width download btn inside hero */
.shero__actions .btn-download {
    width: auto;
    padding: var(--s3) var(--s6);
    font-size: var(--sm);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--xs);
    color: var(--text-muted);
    flex-wrap: wrap;
    margin-bottom: var(--s8);
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color var(--fast) var(--ease); }
.breadcrumbs a:hover { color: var(--accent-h); }
.breadcrumbs__sep { color: var(--text-faint); flex-shrink: 0; }
.breadcrumbs__cur { color: var(--text); font-weight: 500; }

/* Two-column layout */
.single-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--s10);
    align-items: start;
}

/* Left: sticky sidebar */
.single-aside {
    position: sticky;
    top: calc(var(--hdr) + var(--s6));
}

.single-cover {
    aspect-ratio: 2/3;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--sh-xl);
    border: 1px solid var(--border-s);
    margin-bottom: var(--s5);
}
.single-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Download box */
.download-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--s5);
    margin-bottom: var(--s4);
}
.download-box__label {
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-bottom: var(--s4);
}
.download-box__host {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--xs);
    color: var(--text-muted);
    margin-top: var(--s3);
    justify-content: center;
}
.download-box__host svg { color: var(--text-faint); }

/* Stats */
.comic-stats {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
}
.stat-row {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border);
    font-size: var(--sm);
}
.stat-row:last-child { border-bottom: none; }
.stat-icon { color: var(--text-faint); flex-shrink: 0; }
.stat-label { color: var(--text-muted); flex: 1; font-size: var(--xs); }
.stat-value { font-weight: 600; color: var(--text); }

/* Right: main content */
.single-main { min-width: 0; }

.single-genres {
    display: flex;
    gap: var(--s2);
    flex-wrap: wrap;
    margin-bottom: var(--s4);
}

.single-title {
    font-family: var(--display);
    font-size: clamp(2rem,4vw,3.5rem);
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: var(--s3);
}

.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s4);
    font-size: var(--sm);
    color: var(--text-muted);
    padding-block: var(--s4);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s6);
}
.single-meta__item {
    display: flex;
    align-items: center;
    gap: var(--s2);
}
.single-meta__item a { color: var(--text-muted); text-decoration: none; }
.single-meta__item a:hover { color: var(--accent-h); }

/* Synopsis */
.synopsis { margin-bottom: var(--s8); }
.synopsis__label {
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-bottom: var(--s3);
}
.synopsis__text {
    font-size: var(--md);
    color: var(--text-muted);
    line-height: 1.75;
}

/* Post content / preview images */
.comic-content {
    margin-top: var(--s8);
    padding-top: var(--s8);
    border-top: 1px solid var(--border);
}
.comic-content__title {
    font-family: var(--display);
    font-size: var(--2xl);
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: var(--s6);
    display: flex;
    align-items: center;
    gap: var(--s3);
}
.comic-content__title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.1em;
    background: var(--accent);
    border-radius: 2px;
}

/* WordPress entry content */
.entry-content { color: var(--text-muted); line-height: 1.75; }
.entry-content h2,.entry-content h3 { color: var(--text); margin-top: var(--s6); margin-bottom: var(--s3); }
.entry-content p { margin-bottom: var(--s4); }
.entry-content a { color: var(--accent-h); text-decoration: underline; }
.entry-content ul,.entry-content ol { list-style: revert; padding-left: var(--s6); margin-bottom: var(--s4); }
.entry-content li { margin-bottom: var(--s2); }
.entry-content img { border-radius: var(--r); max-width: 100%; }
.entry-content .wp-block-image { margin-bottom: var(--s6); }
.entry-content figure { margin-bottom: var(--s6); }
.entry-content figcaption { font-size: var(--xs); color: var(--text-faint); margin-top: var(--s2); text-align: center; }
.entry-content .wp-block-gallery { margin-bottom: var(--s6); }

/* Lightbox-able images */
.entry-content img { cursor: zoom-in; }

/* Image preview strip */
.preview-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--s3);
    margin-bottom: var(--s8);
}
.preview-item {
    position: relative;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
    aspect-ratio: 3/4;
    background: var(--bg-elevated);
    transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.preview-item:hover { border-color: var(--accent); transform: scale(1.02); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }

/* ======================================================
   13. RELATED COMICS
   ====================================================== */
.related-section {
    padding-block: var(--s10);
    border-top: 1px solid var(--border);
    margin-top: var(--s10);
}

/* ======================================================
   14. ARCHIVE HEADERS
   ====================================================== */
.archive-hdr {
    padding-block: var(--s12) var(--s8);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s8);
}
.archive-label {
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent-h);
    margin-bottom: var(--s2);
}
.archive-title {
    font-family: var(--display);
    font-size: clamp(2rem,5vw,4rem);
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: var(--s3);
}
.archive-desc {
    font-size: var(--md);
    color: var(--text-muted);
    max-width: 640px;
}
.archive-count {
    font-size: var(--sm);
    color: var(--text-faint);
    margin-top: var(--s2);
}

/* Author (star) archive */
.author-hdr {
    display: flex;
    gap: var(--s6);
    align-items: flex-start;
    padding-block: var(--s10) var(--s8);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s8);
}
.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--r-f);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 2px solid var(--border-s);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info h1 {
    font-family: var(--display);
    font-size: clamp(1.8rem,4vw,3rem);
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: var(--s2);
}
.author-info .description { color: var(--text-muted); font-size: var(--sm); max-width: 520px; }

/* ======================================================
   15. SEARCH
   ====================================================== */
.search-hdr {
    padding-block: var(--s10) var(--s6);
    margin-bottom: var(--s6);
    border-bottom: 1px solid var(--border);
}
.search-hdr h1 {
    font-family: var(--display);
    font-size: var(--4xl);
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: var(--s4);
}
.search-count { font-size: var(--sm); color: var(--text-muted); }

.search-form-big {
    display: flex;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border-s);
    background: var(--bg-surface);
    transition: box-shadow var(--fast) var(--ease);
}
.search-form-big:focus-within {
    box-shadow: 0 0 0 3px var(--accent-sub);
    border-color: var(--accent);
}
.search-form-big input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    padding: var(--s4) var(--s5);
    font-size: var(--lg);
    background: transparent;
    color: var(--text);
}
.search-form-big button[type="submit"] {
    padding: var(--s4) var(--s6);
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: var(--sm);
    cursor: pointer;
    transition: background var(--fast) var(--ease);
    white-space: nowrap;
}
.search-form-big button:hover { background: var(--accent-h); }

/* No results */
.no-results {
    text-align: center;
    padding-block: var(--s20);
}
.no-results__icon {
    font-size: 4rem;
    margin-bottom: var(--s4);
    opacity: .25;
}
.no-results h2 {
    font-family: var(--display);
    font-size: var(--3xl);
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: var(--s3);
}
.no-results p { color: var(--text-muted); max-width: 400px; margin: 0 auto var(--s6); }

/* ======================================================
   16. PAGINATION
   ====================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding-block: var(--s10);
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--s3);
    border-radius: var(--r);
    font-size: var(--sm);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--fast) var(--ease);
}
.pagination .page-numbers:hover { color: var(--text); border-color: var(--border-s); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--sh-ac);
}
.pagination .page-numbers.dots { background: none; border: none; cursor: default; }

/* ======================================================
   17. FOOTER
   ====================================================== */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: var(--s12) 0 var(--s6);
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--s10);
    margin-bottom: var(--s10);
}
.footer-brand .logo-text { font-size: var(--2xl); margin-bottom: var(--s3); display: inline-block; }
.footer-brand p { font-size: var(--sm); color: var(--text-muted); line-height: 1.7; max-width: 240px; }

.footer-col h4 {
    font-size: var(--xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-bottom: var(--s4);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--s2); }
.footer-col ul a { font-size: var(--sm); color: var(--text-muted); text-decoration: none; transition: color var(--fast) var(--ease); }
.footer-col ul a:hover { color: var(--text); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding-top: var(--s6);
    border-top: 1px solid var(--border);
    font-size: var(--xs);
    color: var(--text-faint);
    flex-wrap: wrap;
}
.footer-disclaimer {
    font-size: var(--xs);
    color: var(--text-faint);
    margin-top: var(--s4);
    line-height: 1.6;
    max-width: 800px;
}

/* ======================================================
   18. 404 PAGE
   ====================================================== */
.error-404-page {
    min-height: calc(100vh - var(--hdr) - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--s20) var(--pad);
}
.error-404-page__inner { max-width: 480px; }
.error-code {
    font-family: var(--display);
    font-size: clamp(6rem,20vw,14rem);
    letter-spacing: .05em;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--accent-h));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--s4);
}
.error-title {
    font-family: var(--display);
    font-size: var(--3xl);
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: var(--s4);
}
.error-text { color: var(--text-muted); margin-bottom: var(--s8); }

/* ======================================================
   19. PAGE TEMPLATE
   ====================================================== */
.page-content {
    max-width: 800px;
    margin: var(--s12) auto;
    padding-inline: var(--pad);
}
.page-content .page-title {
    font-family: var(--display);
    font-size: clamp(2rem,4vw,3rem);
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: var(--s8);
    padding-bottom: var(--s6);
    border-bottom: 1px solid var(--border);
}

/* ======================================================
   20. LIGHTBOX
   ====================================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0,0,0,.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: var(--s8);
    cursor: zoom-out;
}
.lightbox.open { display: flex; }

.lightbox__img {
    max-width: min(90vw, 1200px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--r);
    box-shadow: var(--sh-xl);
    cursor: default;
    animation: fadeIn .2s var(--ease);
}

.lightbox__close {
    position: absolute;
    top: var(--s4);
    right: var(--s4);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-f);
    background: rgba(255,255,255,.1);
    color: #fff;
    cursor: pointer;
    transition: background var(--fast) var(--ease);
    font-size: 1.25rem;
}
.lightbox__close:hover { background: rgba(255,255,255,.2); }

/* ======================================================
   21. UTILITIES
   ====================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
hr.divider { border: none; border-top: 1px solid var(--border); margin-block: var(--s8); }

/* ======================================================
   22. ANIMATIONS
   ====================================================== */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes skelPulse { 0%,100% { opacity: .4; } 50% { opacity: .8; } }

.anim-in {
    animation: fadeInUp .4s var(--ease) both;
}
.comic-card { animation: fadeInUp .35s var(--ease) both; }
.comic-card:nth-child(2)  { animation-delay: .04s; }
.comic-card:nth-child(3)  { animation-delay: .08s; }
.comic-card:nth-child(4)  { animation-delay: .12s; }
.comic-card:nth-child(5)  { animation-delay: .16s; }
.comic-card:nth-child(6)  { animation-delay: .20s; }
.comic-card:nth-child(n+7){ animation-delay: .24s; }

.skeleton { background: var(--bg-elevated); border-radius: var(--r); animation: skelPulse 1.4s var(--ease) infinite; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ======================================================
   23. RESPONSIVE
   ====================================================== */
/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
    .primary-nav { display: none; }
    .menu-toggle { display: flex; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s8); }
    .footer-brand { grid-column: 1 / -1; }

    .single-layout { grid-template-columns: 220px 1fr; gap: var(--s6); }

    /* shero */
    .shero { min-height: 420px; }
    .shero__layout { grid-template-columns: 160px 1fr; gap: var(--s6); }

    /* homepage hero */
    .hero__inner { grid-template-columns: 160px 1fr; gap: var(--s6); }
}

/* ≤ 768px */
@media (max-width: 768px) {
    :root { --hdr: 54px; }

    .comic-grid { grid-template-columns: repeat(3,1fr); gap: var(--s3) var(--s2); }

    /* single post */
    .single-layout { grid-template-columns: 1fr; }
    .single-aside {
        position: static;
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: var(--s4);
        align-items: start;
    }
    .single-cover { margin-bottom: 0; }

    /* shero */
    .shero { min-height: 360px; padding-block: var(--s12) var(--s8); }
    .shero__layout { grid-template-columns: 120px 1fr; gap: var(--s4); }
    .shero__title { font-size: clamp(1.8rem, 5vw, 2.5rem); }

    /* homepage hero */
    .hero__inner { grid-template-columns: 120px 1fr; gap: var(--s4); }
    .hero { min-height: 320px; }

    .hdr-search { display: none; }
}

/* Mobile ≤ 540px */
@media (max-width: 540px) {
    .comic-grid { grid-template-columns: repeat(2,1fr); gap: var(--s3) var(--s2); }

    /* homepage hero */
    .hero__inner { grid-template-columns: 1fr; }
    .hero__cover { display: none; }
    .hero__title { font-size: 2.2rem; }

    /* shero */
    .shero { min-height: 300px; }
    .shero__layout { grid-template-columns: 100px 1fr; gap: var(--s3); }
    .shero__title { font-size: 1.8rem; }
    .shero__excerpt { display: none; }

    /* single aside */
    .single-aside { grid-template-columns: 1fr; }
    .single-cover { max-width: 200px; margin: 0 auto var(--s5); }

    .footer-grid { grid-template-columns: 1fr; gap: var(--s6); }
    .footer-brand { grid-column: 1; }

    .author-hdr { flex-direction: column; align-items: flex-start; gap: var(--s4); }
}

/* ≤ 360px */
@media (max-width: 360px) {
    :root { --pad: .75rem; }
}

/* ======================================================
   24. PRINT
   ====================================================== */
@media print {
    .site-header, .site-footer, .download-box, .related-section, .filter-bar, .hero__actions { display: none; }
    body { background: #fff; color: #000; }
    .single-title { color: #000; }
    a { color: #000; }
}
