/* ── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
    --bg:           #1a1a1a;
    --surface:      #242820;
    --surface-2:    #2c2e28;
    --accent-gold:  #C8A94A;
    --accent-red:   #8B2020;
    --text:         #E8E4D9;
    --text-muted:   #9A9185;
    --border:       #3D3A2E;
    --font-head:    'Playfair Display', Georgia, serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-ui:      'Rajdhani', 'Arial Narrow', Arial, sans-serif;
    --max-width:    1200px;
    --sidebar-w:    300px;
    --gap:          1.5rem;
    --radius:       4px;
    /* Header stays dark in both modes */
    --header-bg:    #111;
    --header-text:  #E8E4D9;
    --header-muted: #9A9185;
    --on-gold:      #111;
}

/* ── Light theme (parchment / military archive) ─────────────────────────────── */
@media (prefers-color-scheme: light) {
    :root {
        --bg:          #F5F0E8;
        --surface:     #EDE6D6;
        --surface-2:   #E3DAC6;
        --accent-gold: #8B6914;
        --accent-red:  #7A1C1C;
        --text:        #2C2416;
        --text-muted:  #6B5D4F;
        --border:      #C4B89A;
        --header-bg:    #3B2F1E;
        --header-text:  #E8E4D9;
        --header-muted: #A89880;
        --on-gold:      #fff;
    }
}

/* Explicit overrides — take precedence over media query */
[data-theme="dark"] {
    --bg:          #1a1a1a;
    --surface:     #242820;
    --surface-2:   #2c2e28;
    --accent-gold: #C8A94A;
    --accent-red:  #8B2020;
    --text:        #E8E4D9;
    --text-muted:  #9A9185;
    --border:      #3D3A2E;
}

[data-theme="light"] {
    --bg:          #F5F0E8;
    --surface:     #EDE6D6;
    --surface-2:   #E3DAC6;
    --accent-gold: #8B6914;
    --accent-red:  #7A1C1C;
    --text:        #2C2416;
    --text-muted:  #6B5D4F;
    --border:      #C4B89A;
    --header-bg:    #3B2F1E;
    --header-text:  #E8E4D9;
    --header-muted: #A89880;
    --on-gold:      #fff;
}

/* ── Reset / Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-gold); text-decoration: none; }
a:hover { color: #e0c060; }

img { max-width: 100%; display: block; }

/* ── Header Banner ──────────────────────────────────────────────────────────── */
.site-banner {
    width: 100%;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.55rem 1.5rem;
    flex-wrap: wrap;
}
.banner-img { display: block; object-fit: contain; }
.banner-text { display: inline-block; }
.banner-link {
    display: block;
    text-decoration: none;
}
.banner-link:hover { opacity: 0.85; }

/* ── Site Wrapper ───────────────────────────────────────────────────────────── */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem var(--gap);
}

/* ── Header / Nav ───────────────────────────────────────────────────────────── */
.site-header {
    background: var(--header-bg);
    border-bottom: 2px solid var(--accent-gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

.site-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
    flex-shrink: 0;
}

.brand-name {
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 0.02em;
}

.brand-tagline {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--header-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.site-nav { margin-left: auto; }

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--header-text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--accent-gold); background: rgba(200,169,74,0.08); }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(232,228,217,0.3);
    border-radius: var(--radius);
    color: var(--header-text);
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    padding: 0;
    margin: 0 0.25rem;
}

.theme-toggle:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(200,169,74,0.08);
}

.nav-has-dropdown { position: relative; }

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent-gold);
    border-radius: 0 0 var(--radius) var(--radius);
    list-style: none;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 200;
}

.nav-has-dropdown.nav-open .nav-dropdown { display: block; }

.nav-dropdown-link {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--header-muted);
    padding: 0.5rem 1rem;
    transition: color 0.15s, background 0.15s;
}

.nav-dropdown-link:hover { color: var(--accent-gold); background: rgba(200,169,74,0.06); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--header-text); border-radius: 2px; }

/* ── Page + Sidebar Layout ──────────────────────────────────────────────────── */
.page-with-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 2.5rem;
    align-items: start;
}

/* ── Hero Grid (homepage first load) ───────────────────────────────────────── */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.hero-sub-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: var(--gap);
}

/* ── Post Grid ──────────────────────────────────────────────────────────────── */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

/* ── Post Card ──────────────────────────────────────────────────────────────── */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover { border-color: var(--accent-gold); transform: translateY(-2px); }

.post-card-image-link { display: block; aspect-ratio: 16/9; overflow: hidden; }

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.post-card:hover .post-card-image { transform: scale(1.03); }

.post-card-no-image {
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/9;
}

.post-card-no-image span {
    font-family: var(--font-head);
    font-size: 2rem;
    color: var(--border);
}

.post-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.post-card-category {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-gold);
    background: rgba(200,169,74,0.1);
    border: 1px solid rgba(200,169,74,0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

.post-card-date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.post-card-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent-gold); }

.post-card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.post-card-read-more {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-top: auto;
}

/* Hero card overrides — make first card larger */
.hero-grid > .post-card .post-card-title { font-size: 1.5rem; }
.hero-grid > .post-card .post-card-excerpt { -webkit-line-clamp: 5; }

/* ── Single Post ─────────────────────────────────────────────────────────────── */
.single-post { max-width: 780px; }

.breadcrumb {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-gold); }

.post-title {
    font-family: var(--font-head);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-meta-category {
    color: var(--accent-gold);
    background: rgba(200,169,74,0.1);
    border: 1px solid rgba(200,169,74,0.25);
    padding: 0.1rem 0.5rem;
    border-radius: 2px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-meta-series {
    color: var(--text-muted);
    font-style: italic;
}
.post-meta-series a { color: var(--text-muted); }
.post-meta-series a:hover { color: var(--accent-gold); }

.post-featured-image { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; }
.featured-img { width: 100%; max-height: 480px; object-fit: cover; }

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.post-content h2 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.post-content h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--text);
    margin: 1.5rem 0 0.5rem;
}

.post-content p { margin-bottom: 1.25rem; }

.post-content img {
    border-radius: var(--radius);
    max-width: 100%;
    height: auto;
}

/* WordPress alignment classes */
.post-content .aligncenter {
    display: block;
    margin: 1.5rem auto;
}

.post-content .alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
}

.post-content .alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
}

.post-content .alignnone,
.post-content img:not([class]) {
    display: block;
    margin: 1.5rem auto;
}

/* Clear floats after content blocks */
.post-content p::after,
.post-content h2::after,
.post-content h3::after {
    content: '';
    display: table;
    clear: both;
}

.post-content blockquote {
    border-left: 3px solid var(--accent-gold);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    font-style: italic;
    color: var(--text-muted);
}

.post-content a { color: var(--accent-gold); border-bottom: 1px solid rgba(200,169,74,0.3); }
.post-content a:hover { border-bottom-color: var(--accent-gold); }

.post-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.tags-label {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-tag {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    transition: color 0.15s, border-color 0.15s;
}
.post-tag:hover { color: var(--accent-gold); border-color: rgba(200,169,74,0.4); }

/* ── Related Posts ───────────────────────────────────────────────────────────── */
.related-posts { margin-top: 3rem; }

.related-title {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* ── Archive / Category Header ───────────────────────────────────────────────── */
.archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.archive-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 0.4rem;
}

.archive-title {
    font-family: var(--font-head);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--text);
}

.archive-description { margin-top: 0.75rem; color: var(--text-muted); }

/* ── Series Book Grid ────────────────────────────────────────────────────────── */
.series-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--gap);
}

.series-book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.series-book-card:hover { border-color: var(--accent-gold); transform: translateY(-2px); }

.series-book-link { display: block; text-decoration: none; color: inherit; }

.series-book-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--surface-2);
}

.series-book-img { width: 100%; height: 100%; object-fit: cover; }

.book-number-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--accent-gold);
    color: var(--on-gold);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

.series-book-info { padding: 0.75rem; }

.series-book-title {
    font-family: var(--font-head);
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.series-book-date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 80px; }

.sidebar-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.widget-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
}

.widget-label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.widget-progress { padding: 1rem; }

.progress-cover {
    display: block;
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 1rem;
    border: 2px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.progress-book-title {
    font-family: var(--font-head);
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.progress-bar-track {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 2px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--accent-gold), #e0c060);
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.progress-pct { color: var(--accent-gold); font-weight: 600; }

.widget-buy-btn {
    display: block;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--accent-gold);
    color: var(--on-gold);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.widget-buy-btn:hover { background: #e0c060; color: var(--on-gold); }

.sidebar-category-list,
.sidebar-archive-list { list-style: none; padding: 0.5rem 0; }

.sidebar-category-link,
.sidebar-archive-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.3rem 1rem;
    transition: color 0.15s, background 0.15s;
}
.sidebar-category-link:hover,
.sidebar-archive-link:hover { color: var(--accent-gold); background: rgba(200,169,74,0.05); }

.sidebar-category-count {
    font-size: 0.72rem;
    color: var(--border);
    background: var(--surface-2);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
}

/* ── Search ──────────────────────────────────────────────────────────────────── */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.65rem 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent-gold); }
.search-input::placeholder { color: var(--text-muted); }

.search-btn,
.btn-primary {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--accent-gold);
    color: var(--on-gold);
    border: none;
    border-radius: var(--radius);
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: inline-block;
}
.search-btn:hover, .btn-primary:hover { background: #e0c060; }

.search-results-count {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Pager ───────────────────────────────────────────────────────────────────── */
.pager {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pager-btn {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pager-btn:hover:not(:disabled) { color: var(--accent-gold); border-color: rgba(200,169,74,0.4); }
.pager-btn.active { background: var(--accent-gold); color: var(--on-gold); border-color: var(--accent-gold); }
.pager-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--header-bg);
    border-top: 2px solid var(--border);
    margin-top: 3rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-brand .brand-name { font-family: var(--font-head); font-size: 1.1rem; color: var(--accent-gold); }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }

.footer-social { display: flex; gap: 1rem; }

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: color 0.2s, border-color 0.2s;
}
.social-link:hover { color: var(--accent-gold); border-color: rgba(200,169,74,0.5); }
.social-link svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Error / 404 ─────────────────────────────────────────────────────────────── */
.error-page {
    max-width: 500px;
    margin: 5rem auto;
    text-align: center;
    padding: 2rem;
}
.error-code {
    font-family: var(--font-head);
    font-size: 6rem;
    font-weight: 700;
    color: var(--border);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.error-title { font-family: var(--font-head); font-size: 2rem; margin-bottom: 1rem; }
.error-message { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.loading-pulse {
    text-align: center;
    font-family: var(--font-ui);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    padding: 3rem;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.empty-state { color: var(--text-muted); font-style: italic; padding: 2rem 0; }

#blazor-error-ui {
    background: var(--accent-red);
    color: var(--text);
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
}
#blazor-error-ui .reload { color: var(--accent-gold); }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: auto; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .page-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-sub-grid { grid-template-rows: auto; grid-template-columns: 1fr 1fr; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .header-inner { height: 56px; }
    .site-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--header-bg); border-bottom: 1px solid var(--border); padding: 1rem 0; }
    .site-nav.open { display: block; }
    .nav-list { flex-direction: column; align-items: flex-start; padding: 0 var(--gap); }
    .nav-has-dropdown.nav-open .nav-dropdown { position: static; border: none; box-shadow: none; padding-left: 1rem; }
    .nav-toggle { display: flex; }
    .post-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .hero-sub-grid { grid-template-columns: 1fr; }
    .series-book-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Comments ───────────────────────────────────────────────────────────────── */
.comment-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}
.comment-section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}
.comment-list { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2.5rem; }
.comment-item { display: flex; gap: 1rem; }
.comment-avatar {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #111;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-ui);
    font-weight: 700; font-size: 1rem;
}
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .4rem; }
.comment-author { font-family: var(--font-ui); font-size: .95rem; color: var(--text); }
.comment-date { font-size: .8rem; color: var(--text-muted); }
.comment-content { font-size: .95rem; line-height: 1.65; color: var(--text); white-space: pre-wrap; }

.comment-form { max-width: 640px; }
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comment-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.comment-label { font-family: var(--font-ui); font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.comment-label .req { color: var(--accent-gold); }
.comment-hint { font-size: .78rem; color: var(--text-muted); font-weight: 400; }
.comment-input, .comment-textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: .95rem;
    padding: .55rem .75rem;
    transition: border-color .15s;
    width: 100%;
}
.comment-input:focus, .comment-textarea:focus {
    outline: none; border-color: var(--accent-gold);
}
.comment-textarea { resize: vertical; min-height: 110px; }
.comment-form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.comment-btn-primary {
    background: var(--accent-gold); color: #111;
    border: none; border-radius: var(--radius);
    font-family: var(--font-ui); font-weight: 700; font-size: .9rem;
    padding: .55rem 1.25rem; cursor: pointer; transition: opacity .15s;
}
.comment-btn-primary:hover { opacity: .85; }
.comment-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.comment-btn-secondary {
    background: none; border: 1px solid var(--border);
    color: var(--text-muted); border-radius: var(--radius);
    font-family: var(--font-ui); font-size: .9rem;
    padding: .5rem 1rem; cursor: pointer; transition: border-color .15s;
}
.comment-btn-secondary:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.comment-success {
    background: rgba(42,122,64,.15); border: 1px solid #2a7a40;
    border-radius: var(--radius); padding: 1rem 1.25rem;
    color: #6dcf8a; margin-bottom: 1rem; font-size: .95rem;
}
.comment-error {
    background: rgba(139,32,32,.15); border: 1px solid #8B2020;
    border-radius: var(--radius); padding: .75rem 1rem;
    color: #e57777; margin-bottom: .75rem; font-size: .9rem;
}
@media (max-width: 600px) {
    .comment-form-row { grid-template-columns: 1fr; }
}
