/* ============================================
   CONVEQUITY BRAND OVERRIDE FOR GHOST HEADLINE
   Preserves Headline layout. Overrides colors + typography.
   ============================================ */

/* ------------------------------------------------------------------
   THEME VARIABLES — Light mode by default
   ------------------------------------------------------------------ */
:root {
    /* Accent */
    --ghost-accent-color: #5B47FB;
    --cv-accent: #5B47FB;
    --cv-accent-2: #7c6bfa;

    /* Radius */
    --cv-radius-sm: 12px;
    --cv-radius-md: 16px;
    --cv-radius-lg: 20px;
    --cv-radius-xl: 24px;

    /* Light theme palette */
    --cv-bg: #f5f7fa;
    --cv-bg-elevated: #ffffff;
    --cv-bg-secondary: #f8fafc;
    --cv-bg-tertiary: #f1f5f9;

    --cv-text-main: #0f172a;
    --cv-text-secondary: #1a202c;
    --cv-text-muted: #475569;
    --cv-text-dim: #64748b;

    --cv-line: #e2e8f0;
    --cv-border: #e2e8f0;

    --cv-header-bg: rgba(255, 255, 255, 0.95);
    --cv-footer-bg: #ffffff;
    --cv-card-bg: #ffffff;
    --cv-card-bg-gradient: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

    --cv-code-bg: #0f172a;
    --cv-code-text: #e2e8f0;
    --cv-inline-code-bg: rgba(91, 71, 251, 0.08);

    --cv-selection-bg: rgba(91, 71, 251, 0.12);
    --cv-selection-text: #0f172a;

    --cv-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --cv-shadow-md: 0 5px 15px rgba(0,0,0,0.04);
    --cv-shadow-lg: 0 10px 30px rgba(0,0,0,0.05);
    --cv-shadow-xl: 0 20px 60px rgba(0,0,0,0.08);
    --cv-shadow-accent: 0 8px 20px rgba(91, 71, 251, 0.15);
}

/* Dark theme via data attribute */
html[data-theme="dark"] {
    --cv-bg: #000000;
    --cv-bg-elevated: #0a0a0a;
    --cv-bg-secondary: #111111;
    --cv-bg-tertiary: #1a1a1a;

    --cv-text-main: #f1f5f9;
    --cv-text-secondary: #e2e8f0;
    --cv-text-muted: #94a3b8;
    --cv-text-dim: #64748b;

    --cv-line: #334155;
    --cv-border: #334155;

    --cv-header-bg: rgba(0, 0, 0, 0.95);
    --cv-footer-bg: #0a0a0a;
    --cv-card-bg: #0a0a0a;
    --cv-card-bg-gradient: linear-gradient(145deg, #0a0a0a 0%, #111111 100%);

    --cv-code-bg: #000000;
    --cv-code-text: #e2e8f0;
    --cv-inline-code-bg: rgba(91, 71, 251, 0.15);

    --cv-selection-bg: rgba(91, 71, 251, 0.25);
    --cv-selection-text: #f1f5f9;

    --cv-shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --cv-shadow-md: 0 5px 15px rgba(0,0,0,0.15);
    --cv-shadow-lg: 0 10px 30px rgba(0,0,0,0.2);
    --cv-shadow-xl: 0 20px 60px rgba(0,0,0,0.25);
    --cv-shadow-accent: 0 8px 20px rgba(91, 71, 251, 0.25);

    /* Override Ghost's original theme variables for dark mode */
    --color-primary-text: #f1f5f9;
    --color-darker-gray: #f1f5f9;
    --color-secondary-text: #94a3b8;
    --color-white: #000000;
    --color-lighter-gray: #0a0a0a;
    --color-light-gray: #1a1a1a;
    --color-mid-gray: #334155;
    --color-dark-gray: #64748b;
    --color-black: #ffffff;
}

/* System dark mode fallback (when no data-theme is set) */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        --cv-bg: #000000;
        --cv-bg-elevated: #0a0a0a;
        --cv-bg-secondary: #111111;
        --cv-bg-tertiary: #1a1a1a;

        --cv-text-main: #f1f5f9;
        --cv-text-secondary: #e2e8f0;
        --cv-text-muted: #94a3b8;
        --cv-text-dim: #64748b;

        --cv-line: #334155;
        --cv-border: #334155;

        --cv-header-bg: rgba(0, 0, 0, 0.95);
        --cv-footer-bg: #0a0a0a;
        --cv-card-bg: #0a0a0a;
        --cv-card-bg-gradient: linear-gradient(145deg, #0a0a0a 0%, #111111 100%);

        --cv-code-bg: #000000;
        --cv-code-text: #e2e8f0;
        --cv-inline-code-bg: rgba(91, 71, 251, 0.15);

        --cv-selection-bg: rgba(91, 71, 251, 0.25);
        --cv-selection-text: #f1f5f9;

        --cv-shadow-sm: 0 1px 3px rgba(0,0,0,0.2);

        /* Override Ghost's original theme variables for dark mode */
        --color-primary-text: #f1f5f9;
        --color-darker-gray: #f1f5f9;
        --color-secondary-text: #94a3b8;
        --color-white: #000000;
        --color-lighter-gray: #0a0a0a;
        --color-light-gray: #1a1a1a;
        --color-mid-gray: #334155;
        --color-dark-gray: #64748b;
        --color-black: #ffffff;
        --cv-shadow-md: 0 5px 15px rgba(0,0,0,0.15);
        --cv-shadow-lg: 0 10px 30px rgba(0,0,0,0.2);
        --cv-shadow-xl: 0 20px 60px rgba(0,0,0,0.25);
        --cv-shadow-accent: 0 8px 20px rgba(91, 71, 251, 0.25);
    }
}

/* ------------------------------------------------------------------
   BASE
   ------------------------------------------------------------------ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: var(--cv-bg);
    color: var(--cv-text-main);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--cv-selection-bg);
    color: var(--cv-selection-text);
}

/* Force light section backgrounds — never go dark regardless of system/Ghost dark mode */
.gh-card-footer,
.gh-card-link,
.gh-topic,
.gh-topic-grid,
.gh-topic-compact,
.gh-topic-footer {
    background: transparent !important;
}

.gh-card-footer {
    color: var(--cv-text-dim) !important;
}

/* Override Ghost dark mode classes */
html.dark .gh-card-footer,
html.dark .gh-topic,
html.dark .gh-topic-grid,
html.dark .gh-topic-compact,
html.dark .gh-topic-footer,
[data-color-scheme="dark"] .gh-card-footer,
[data-color-scheme="dark"] .gh-topic,
[data-color-scheme="dark"] .gh-topic-grid,
[data-color-scheme="dark"] .gh-topic-compact,
[data-color-scheme="dark"] .gh-topic-footer {
    background: transparent !important;
    color: var(--cv-text-dim) !important;
    border-color: var(--cv-line) !important;
}

html.dark .gh-topic-footer .gh-topic-link,
[data-color-scheme="dark"] .gh-topic-footer .gh-topic-link {
    background: var(--cv-bg-elevated) !important;
    color: var(--cv-accent) !important;
    border-color: var(--cv-accent) !important;
}

@media (prefers-color-scheme: dark) {
    .gh-card-footer,
    .gh-topic,
    .gh-topic-grid,
    .gh-topic-compact,
    .gh-topic-footer {
        background: transparent !important;
        color: var(--cv-text-dim) !important;
        border-color: var(--cv-line) !important;
    }
    .gh-topic-footer .gh-topic-link {
        background: var(--cv-bg-elevated) !important;
        color: var(--cv-accent) !important;
        border-color: var(--cv-accent) !important;
    }
}

a {
    color: inherit;
}

/* ------------------------------------------------------------------
   THEME TOGGLE
   ------------------------------------------------------------------ */
.gh-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.gh-theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--cv-text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.gh-theme-toggle-btn:hover {
    background: rgba(91, 71, 251, 0.08);
    color: var(--cv-accent);
}

.gh-theme-toggle-btn.active {
    background: rgba(91, 71, 251, 0.12);
    color: var(--cv-accent);
    border-color: var(--cv-accent);
}

.gh-theme-toggle-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .gh-theme-toggle {
        margin-right: 8px;
    }
    .gh-theme-toggle-btn {
        width: 28px;
        height: 28px;
    }
    .gh-theme-toggle-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ------------------------------------------------------------------
   HEADER ACTIONS — Keep theme toggle on the right
   ------------------------------------------------------------------ */

/* Desktop: force right alignment regardless of layout (left-logo / middle-logo / stacked) */
@media (min-width: 768px) {
    .gh-head-actions {
        justify-content: flex-end !important;
    }
}

/* Stacked layout override: original Headline uses space-between which spreads items */
.is-head-stacked .gh-head-inner .gh-head-actions {
    justify-content: flex-end;
    gap: var(--head-nav-gap);
}

/* Ensure toggle never shrinks or wraps out of position */
.gh-theme-toggle {
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
   READING PROGRESS BAR — slim vertical line on post pages
   ------------------------------------------------------------------ */
.gh-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-template .gh-reading-progress {
    opacity: 1;
}

.gh-reading-progress-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--cv-accent), #7c6bfa);
    height: 0%;
    border-radius: 0 2px 2px 0;
}

/* ------------------------------------------------------------------
   FORCE PURE BLACK BACKGROUND IN DARK MODE
   ------------------------------------------------------------------ */

/* Explicit dark mode */
html[data-theme="dark"] {
    background-color: #000000 !important;
}
html[data-theme="dark"] body {
    background-color: #000000 !important;
}
html[data-theme="dark"] .gh-site {
    background-color: #000000 !important;
}

/* Ghost dark class */
html.dark {
    background-color: #000000 !important;
}
html.dark body {
    background-color: #000000 !important;
}
html.dark .gh-site {
    background-color: #000000 !important;
}

/* Ghost data attribute */
[data-color-scheme="dark"] {
    background-color: #000000 !important;
}
[data-color-scheme="dark"] body {
    background-color: #000000 !important;
}
[data-color-scheme="dark"] .gh-site {
    background-color: #000000 !important;
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        background-color: #000000 !important;
    }
    html:not([data-theme]) body {
        background-color: #000000 !important;
    }
    html:not([data-theme]) .gh-site {
        background-color: #000000 !important;
    }
}

/* ------------------------------------------------------------------
   HEADER
   ------------------------------------------------------------------ */
.gh-head {
    background: var(--cv-header-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cv-line) !important;
    box-shadow: var(--cv-shadow-sm);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body:not(.is-head-stacked) .gh-head-inner {
    border-bottom: none;
}

.gh-head-logo {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: var(--cv-text-main);
    transition: color 0.3s ease;
}

.gh-head-logo img {
    border-radius: 50%;
    border: 2px solid var(--cv-accent);
    padding: 3px;
    background: var(--cv-bg-elevated);
    object-fit: cover;
    transition: background 0.3s ease;
}

.gh-head-menu a,
.gh-head-menu .nav a {
    color: var(--cv-text-dim) !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.gh-head-menu a:hover,
.gh-head-menu .nav a:hover {
    color: var(--cv-accent) !important;
    opacity: 1 !important;
}

.gh-head-menu .nav-current a {
    color: var(--cv-accent) !important;
    font-weight: 700;
}

/* Subscribe button */
.gh-head-btn,
.gh-btn.gh-primary-btn {
    background: linear-gradient(145deg, #5B47FB 0%, #7c6bfa 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: var(--cv-shadow-accent);
    border: none !important;
    transition: all 0.3s ease;
}

.gh-head-btn:hover,
.gh-btn.gh-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 71, 251, 0.25);
}

.gh-head-link {
    color: var(--cv-text-dim) !important;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.gh-head-link:hover {
    color: var(--cv-accent) !important;
}

/* Search icon */
.gh-icon-btn {
    color: var(--cv-text-dim) !important;
    transition: color 0.3s ease;
}

.gh-icon-btn:hover {
    color: var(--cv-accent) !important;
}

/* ------------------------------------------------------------------
   SECTION TITLES
   ------------------------------------------------------------------ */
.gh-topic-name,
.gh-pagehead-title {
    color: var(--cv-accent);
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.gh-topic-name::after,
.gh-pagehead-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #5B47FB, #7c6bfa);
    border-radius: 2px;
}

.gh-topic-name a {
    color: var(--cv-accent) !important;
}

/* ------------------------------------------------------------------
   CARDS (horizontal layout - Headline default)
   ------------------------------------------------------------------ */
.gh-topic-grid .gh-card-link:hover .gh-card-title {
    opacity: 1 !important;
    color: var(--cv-accent);
}

.gh-topic-grid .gh-card-title {
    font-weight: 700;
    color: var(--cv-text-main);
    transition: color 0.3s ease;
}

.gh-topic-grid .gh-card-excerpt {
    color: var(--cv-text-muted);
    transition: color 0.3s ease;
}

.gh-card-footer {
    color: var(--cv-text-dim);
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* ------------------------------------------------------------------
   FEATURED POST
   ------------------------------------------------------------------ */
.gh-topic-grid .gh-card.featured.large .gh-card-link {
    border-radius: var(--cv-radius-xl);
    overflow: hidden;
    box-shadow: var(--cv-shadow-xl), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--cv-line);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent 60%);
}

.gh-topic-grid .gh-card.featured.large .gh-card-title {
    color: white;
    font-weight: 700;
}

.gh-topic-grid .gh-card.featured.large .gh-card-footer {
    color: rgba(255,255,255,0.85);
}

/* Show excerpt on featured large card (Headline hides it by default) */
.gh-topic-grid .gh-card.featured.large .gh-card-excerpt {
    display: -webkit-box !important;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    line-height: 1.55;
    margin-top: 12px;
    max-width: 640px;
}

/* Featured large card — tag / title / date / excerpt stacked */
.gh-topic-grid .gh-card.featured.large .gh-card-meta {
    justify-content: flex-start;
    flex-direction: row;
    margin-bottom: 12px;
}

.gh-topic-grid .gh-card.featured.large .gh-card-meta .gh-card-tag {
    background: rgba(91, 71, 251, 0.35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gh-topic-grid .gh-card.featured.large .gh-card-meta-secondary {
    justify-content: flex-start;
    flex-direction: row;
    margin-top: 10px;
    margin-bottom: 0;
}

.gh-topic-grid .gh-card.featured.large .gh-card-meta-secondary .gh-card-date {
    color: rgba(255, 255, 255, 0.75);
}

/* Featured badge */
.gh-topic-grid .gh-card.featured.large .gh-card-image::after {
    content: 'Featured';
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 14px;
    background: var(--cv-accent);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(91, 71, 251, 0.3);
}

/* ------------------------------------------------------------------
   TIGHTER SPACING — override generous Headline defaults
   ------------------------------------------------------------------ */

/* Main content area */
.gh-main {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
}

/* Section gaps */
.gh-topic-grid + .gh-topic-grid {
    margin-top: 48px !important;
}

.gh-topic-list {
    gap: 24px;
    margin-top: 48px;
}

/* Section titles */
.gh-topic-name,
.gh-pagehead-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.gh-topic-name::after,
.gh-pagehead-title::after {
    width: 60px;
    height: 3px;
}

/* Page header */
.gh-pagehead {
    margin-bottom: 32px;
    padding-bottom: 20px;
}

/* Subscribe box */
.gh-subscribe {
    padding: 32px 28px;
    margin: 40px 0;
}

/* Footer */
.gh-foot {
    padding: 48px 32px 32px;
}

/* Read next */
.gh-read-next {
    margin-top: 48px;
    padding-top: 40px;
}

/* Callout cards */
.kg-callout-card {
    padding: 32px 28px !important;
}

/* ------------------------------------------------------------------
   TAG BADGES
   ------------------------------------------------------------------ */
.gh-card-tag {
    display: inline-block;
    background: rgba(91, 71, 251, 0.1);
    color: var(--cv-accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.gh-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 8px;
    margin-bottom: 8px;
}

.gh-card-date {
    color: var(--cv-text-dim);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.gh-card-meta .gh-card-tag {
    margin-bottom: 0;
}

/* ------------------------------------------------------------------
   TOPIC FOOTER LINK
   ------------------------------------------------------------------ */
.gh-topic-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cv-accent) !important;
    padding: 12px 24px;
    border: 2px solid var(--cv-accent);
    border-radius: var(--cv-radius-sm);
    background: var(--cv-bg-elevated);
    transition: all 0.3s ease;
}

.gh-topic-link:hover {
    background: var(--cv-accent);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--cv-shadow-accent);
}

.gh-topic-link svg {
    width: 16px;
    height: 16px;
}

/* ------------------------------------------------------------------
   SUBSCRIBE SECTION
   ------------------------------------------------------------------ */
.gh-subscribe {
    background: linear-gradient(145deg, #5B47FB 0%, #7c6bfa 100%);
    color: white;
    padding: 32px 28px;
    border-radius: var(--cv-radius-xl);
    text-align: center;
    margin: 40px 0;
    box-shadow: var(--cv-shadow-accent), 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.gh-subscribe::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.gh-subscribe-title {
    color: white !important;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    position: relative;
}

.gh-subscribe-description {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin-bottom: 28px;
    line-height: 1.7;
    position: relative;
}

.gh-subscribe-btn {
    background: white !important;
    color: #5B47FB !important;
    font-weight: 700 !important;
    padding: 14px 28px !important;
    border-radius: var(--cv-radius-sm) !important;
    border: none !important;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
}

.gh-subscribe-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

.gh-subscribe-btn svg {
    stroke: #5B47FB !important;
}

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */
.gh-foot {
    background: var(--cv-footer-bg);
    border-top: 1px solid var(--cv-line);
    padding: 48px 32px 32px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gh-foot-menu a {
    color: var(--cv-text-muted) !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.gh-foot-menu a:hover {
    color: var(--cv-accent) !important;
    opacity: 1 !important;
}

.gh-copyright {
    color: var(--cv-text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* ------------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------------ */
.gh-btn {
    background: linear-gradient(145deg, #5B47FB 0%, #7c6bfa 100%);
    color: white !important;
    border-radius: var(--cv-radius-sm) !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.3s ease;
}

.gh-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--cv-shadow-accent);
}

/* ------------------------------------------------------------------
   ARTICLE PAGE
   ------------------------------------------------------------------ */
.gh-article-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--cv-line);
    transition: border-color 0.3s ease;
}

.gh-article-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(91, 71, 251, 0.1);
    color: var(--cv-accent) !important;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    height: 26px;
}

/* Inline top meta row: tag + date/reading-time */
.gh-article-top-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.gh-article-meta-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cv-text-dim);
    letter-spacing: 0.2px;
    height: 26px;
}

.gh-article-meta-inline .gh-meta-sep {
    opacity: 0.5;
}

/* Hide old sidebar (author image + date on left) */
.gh-article-sidebar {
    display: none !important;
}

/* ------------------------------------------------------------------
   WIDER POST CONTENT (sidebar removed)
   ------------------------------------------------------------------ */
.post-template .gh-article-header,
.post-template .gh-content {
    grid-column: wide-start / wide-end;
}

.post-template .gh-content {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------------------------
   POST COVER HEADER — feature image as background
   Similar to homepage featured large card
   ------------------------------------------------------------------ */
.gh-article-header.has-cover-image {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    padding: 60px 40px 50px;
    border-bottom: none;
    margin-bottom: 50px;
    border-radius: var(--cv-radius-xl);
    overflow: hidden;
}

.gh-article-header.has-cover-image .gh-article-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    grid-column: auto;
    z-index: 0;
}

.gh-article-header.has-cover-image .gh-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.gh-article-header.has-cover-image .gh-article-image figcaption {
    display: none;
}

.gh-article-header.has-cover-image .gh-article-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}

.gh-article-header.has-cover-image .gh-article-header-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}

.gh-article-header.has-cover-image .gh-article-top-meta {
    justify-content: center;
    margin-bottom: 16px;
}

.gh-article-header.has-cover-image .gh-article-tag {
    background: rgba(91, 71, 251, 0.25);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gh-article-header.has-cover-image .gh-article-meta-inline {
    color: rgba(255, 255, 255, 0.75);
}

.gh-article-header.has-cover-image .gh-article-title {
    color: #fff;
    font-size: 4.2rem;
    letter-spacing: -1.5px;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.gh-article-header.has-cover-image .gh-article-title + .gh-article-meta-inline {
    margin-top: 10px;
}

.gh-article-header.has-cover-image .gh-article-excerpt {
    color: rgba(255, 255, 255, 0.85);
    max-width: 640px;
    margin: 16px auto 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.gh-article-header.has-cover-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--cv-accent) 50%, transparent 100%);
    opacity: 0.8;
    z-index: 2;
}

.gh-article-title {
    color: var(--cv-text-main);
    font-weight: 700;
    letter-spacing: -1px;
    transition: color 0.3s ease;
}

.gh-article-title + .gh-article-meta-inline {
    margin-top: 10px;
}

.gh-article-excerpt {
    color: var(--cv-text-muted);
    font-size: 18px;
    line-height: 1.7;
    transition: color 0.3s ease;
}

.gh-author-image img {
    border: 3px solid var(--cv-accent);
    box-shadow: var(--cv-shadow-accent);
}

/* ------------------------------------------------------------------
   CONTENT TYPOGRAPHY
   ------------------------------------------------------------------ */
.gh-content h2 {
    color: var(--cv-accent);
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.gh-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #5B47FB, #7c6bfa);
    border-radius: 2px;
}

.gh-content h3 {
    color: var(--cv-accent);
    font-weight: 700;
}

.gh-content h4 {
    color: var(--cv-text-main);
    font-weight: 700;
    transition: color 0.3s ease;
}

.gh-content p,
.gh-content li,
.gh-content dl,
.gh-content dt,
.gh-content dd {
    color: var(--cv-text-main);
}

.gh-content a {
    color: var(--cv-accent);
    font-weight: 600;
    border-bottom: 2px solid rgba(91, 71, 251, 0.3);
    transition: border-color 0.3s ease;
}

.gh-content a:hover {
    border-bottom-color: var(--cv-accent);
}

.gh-content blockquote {
    background: var(--cv-card-bg-gradient);
    border-left: 5px solid var(--cv-accent);
    border-radius: 0 var(--cv-radius-sm) var(--cv-radius-sm) 0;
    box-shadow: var(--cv-shadow-lg);
    border-top: 1px solid var(--cv-line);
    border-right: 1px solid var(--cv-line);
    border-bottom: 1px solid var(--cv-line);
    color: var(--cv-text-muted);
    font-style: italic;
    transition: all 0.3s ease;
}

.gh-content blockquote:hover {
    transform: translateX(5px);
    box-shadow: var(--cv-shadow-xl), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gh-content blockquote strong {
    color: var(--cv-accent);
    font-weight: 700;
}

/* Pre / code blocks */
.gh-content pre {
    background: var(--cv-code-bg);
    border-radius: var(--cv-radius-md);
    padding: 20px;
    box-shadow: var(--cv-shadow-lg);
    border: 1px solid #1e293b;
    overflow-x: auto;
    transition: background 0.3s ease;
}

.gh-content pre code {
    background: transparent;
    color: var(--cv-code-text);
    padding: 0;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.7;
}

.gh-content code {
    background: var(--cv-inline-code-bg);
    color: var(--cv-accent);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

/* ------------------------------------------------------------------
   BOOKMARK / CALLOUT CARDS
   ------------------------------------------------------------------ */
.kg-bookmark-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-md) !important;
    box-shadow: var(--cv-shadow-lg);
    transition: all 0.3s ease;
}

.kg-bookmark-card:hover {
    transform: translateY(-3px);
    border-color: var(--cv-accent) !important;
    box-shadow: 0 20px 50px rgba(91, 71, 251, 0.1);
}

.kg-callout-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 2px solid var(--cv-accent) !important;
    border-radius: var(--cv-radius-lg) !important;
    box-shadow: var(--cv-shadow-lg);
    transition: all 0.3s ease;
}

/* ------------------------------------------------------------------
   TOPIC LIST (secondary sections side by side)
   ------------------------------------------------------------------ */
.gh-topic-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.gh-topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--cv-line);
    transition: border-color 0.3s ease;
}

.gh-topic-header .gh-topic-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--cv-accent);
    margin-bottom: 0;
    padding-bottom: 0;
}

.gh-topic-header .gh-topic-name::after {
    display: none;
}

.gh-topic-header .gh-topic-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cv-accent) !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 16px;
    border: 2px solid var(--cv-accent);
    border-radius: var(--cv-radius-sm);
    background: var(--cv-bg-elevated) !important;
    transition: all 0.3s ease;
}

.gh-topic-header .gh-topic-link:hover {
    background: var(--cv-accent) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--cv-shadow-accent);
}

/* Dark mode override for secondary section "More" button */
html[data-theme="dark"] .gh-topic-header .gh-topic-link,
html.dark .gh-topic-header .gh-topic-link,
[data-color-scheme="dark"] .gh-topic-header .gh-topic-link {
    background: var(--cv-bg-elevated) !important;
    color: var(--cv-accent) !important;
    border-color: var(--cv-accent) !important;
}

html[data-theme="dark"] .gh-topic-header .gh-topic-link:hover,
html.dark .gh-topic-header .gh-topic-link:hover,
[data-color-scheme="dark"] .gh-topic-header .gh-topic-link:hover {
    background: var(--cv-accent) !important;
    color: white !important;
    border-color: var(--cv-accent) !important;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .gh-topic-header .gh-topic-link {
        background: var(--cv-bg-elevated) !important;
        color: var(--cv-accent) !important;
        border-color: var(--cv-accent) !important;
    }
    html:not([data-theme]) .gh-topic-header .gh-topic-link:hover {
        background: var(--cv-accent) !important;
        color: white !important;
        border-color: var(--cv-accent) !important;
    }
}

/* Compact cards inside topic-list */
.gh-topic-compact .gh-card {
    background: var(--cv-card-bg-gradient);
    border-radius: var(--cv-radius-md);
    border: 1px solid var(--cv-line);
    box-shadow: var(--cv-shadow-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 16px;
    position: relative;
}

.gh-topic-compact .gh-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--cv-accent) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gh-topic-compact .gh-card:hover {
    transform: translateY(-6px);
    border-color: var(--cv-accent);
    box-shadow: 0 20px 50px rgba(91, 71, 251, 0.12);
}

.gh-topic-compact .gh-card:hover::before {
    opacity: 1;
}

.gh-topic-compact .gh-card-link {
    display: flex;
    flex-direction: column;
}

.gh-topic-compact .gh-card-image {
    width: 100%;
    aspect-ratio: 4 / 1;
    overflow: hidden;
    border-bottom: 1px solid var(--cv-line);
    margin: 0;
    border-radius: var(--cv-radius-md) var(--cv-radius-md) 0 0;
}

.gh-topic-compact .gh-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    border-radius: var(--cv-radius-md) var(--cv-radius-md) 0 0;
}

.gh-topic-compact .gh-card:hover .gh-card-image img {
    transform: scale(1.05);
}

.gh-topic-compact .gh-card-wrapper {
    padding: 16px;
}

.gh-topic-compact .gh-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: var(--cv-text-main);
    margin: 0 0 6px;
    transition: color 0.3s ease;
}

.gh-topic-compact .gh-card:hover .gh-card-title {
    color: var(--cv-accent);
}

.gh-topic-compact .gh-card-excerpt {
    font-size: 13px;
    color: var(--cv-text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.gh-topic-compact .gh-card-footer {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--cv-text-dim);
    transition: color 0.3s ease;
    text-align: right;
}

/* ------------------------------------------------------------------
   PAGINATION
   ------------------------------------------------------------------ */
.gh-pagination a {
    background: var(--cv-card-bg-gradient);
    color: var(--cv-accent) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-sm);
    font-weight: 600;
    box-shadow: var(--cv-shadow-sm);
    transition: all 0.3s ease;
}

.gh-pagination a:hover {
    transform: translateY(-2px);
    border-color: var(--cv-accent) !important;
    box-shadow: 0 8px 20px rgba(91, 71, 251, 0.1);
}

/* ------------------------------------------------------------------
   AUTHOR PAGE — Team Card Inspired
   ------------------------------------------------------------------ */
.gh-pagehead:has(.gh-author-image) {
    background: var(--cv-card-bg-gradient);
    border-radius: var(--cv-radius-xl);
    padding: 50px 40px;
    box-shadow: var(--cv-shadow-xl), var(--cv-shadow-sm);
    border: 1px solid var(--cv-line);
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gh-pagehead:has(.gh-author-image) .gh-author-image {
    width: 160px;
    height: 160px;
    margin: 0;
}

.gh-pagehead:has(.gh-author-image) .gh-author-image img,
.gh-pagehead:has(.gh-author-image) .gh-author-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--cv-accent);
    box-shadow: var(--cv-shadow-accent);
    object-fit: cover;
}

.gh-pagehead:has(.gh-author-image) .gh-pagehead-title {
    font-size: 32px;
    margin-bottom: 8px;
    padding-bottom: 0;
}

.gh-pagehead:has(.gh-author-image) .gh-pagehead-title::after {
    display: none;
}

.gh-pagehead:has(.gh-author-image) .gh-author-location {
    color: var(--cv-accent);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.gh-pagehead:has(.gh-author-image) .gh-author-bio {
    font-size: 16px;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 24px;
    color: var(--cv-text-muted);
    transition: color 0.3s ease;
}

.gh-pagehead:has(.gh-author-image) .gh-author-social {
    justify-content: center;
    gap: 12px;
}

.gh-pagehead:has(.gh-author-image) .gh-author-social-link {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(91, 71, 251, 0.08);
    color: var(--cv-accent);
    transition: all 0.3s ease;
}

.gh-pagehead:has(.gh-author-image) .gh-author-social-link:hover {
    background: var(--cv-accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--cv-shadow-accent);
}

/* ------------------------------------------------------------------
   POST AUTHOR BIO CARD
   ------------------------------------------------------------------ */
.gh-post-authors {
    margin: 60px 0;
}

.gh-post-author-card {
    background: var(--cv-card-bg-gradient);
    border-radius: var(--cv-radius-xl);
    padding: 32px;
    box-shadow: var(--cv-shadow-lg), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--cv-line);
    display: flex;
    align-items: center;
    gap: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gh-post-author-card + .gh-post-author-card {
    margin-top: 20px;
}

.gh-post-author-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--cv-accent) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gh-post-author-card:hover {
    transform: translateY(-3px);
    border-color: var(--cv-accent);
    box-shadow: 0 20px 50px rgba(91, 71, 251, 0.1);
}

.gh-post-author-card:hover::before {
    opacity: 1;
}

.gh-post-author-card .gh-author-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    margin: 0;
}

.gh-post-author-card .gh-author-image img,
.gh-post-author-card .gh-author-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--cv-accent);
    box-shadow: var(--cv-shadow-accent);
    object-fit: cover;
}

.gh-post-author-card-content {
    flex: 1;
    min-width: 0;
}

.gh-post-author-card-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--cv-text-main);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}

.gh-post-author-card-name a {
    color: inherit;
    transition: color 0.3s ease;
    border-bottom: none !important;
}

.gh-post-author-card-name a:hover {
    color: var(--cv-accent);
}

.gh-post-author-card-bio {
    font-size: 14px;
    color: var(--cv-text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
    transition: color 0.3s ease;
}

.gh-post-author-card-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gh-post-author-card-social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(91, 71, 251, 0.08);
    color: var(--cv-accent);
    transition: all 0.3s ease;
}

.gh-post-author-card-social a:hover {
    background: var(--cv-accent);
    color: white;
    transform: translateY(-2px);
}

/* ------------------------------------------------------------------
   GRID CARD CONTAINER (Latest / Primary sections)
   ------------------------------------------------------------------ */
.gh-topic-grid .gh-card:not(.large) .gh-card-link {
    background: var(--cv-card-bg) !important;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-md);
    box-shadow: var(--cv-shadow-sm);
    padding: 16px 20px;
    border-left: 3px solid transparent;
    gap: 20px;
}

/* ------------------------------------------------------------------
   GRID CARD HOVER ENHANCEMENTS (Latest / SysMoore)
   ------------------------------------------------------------------ */
.gh-topic-grid .gh-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gh-topic-grid .gh-card-link {
    transition: all 0.3s ease;
}

.gh-topic-grid .gh-card:not(.large):hover {
    transform: translateY(-2px);
}

.gh-topic-grid .gh-card:not(.large):hover .gh-card-link {
    border-left-color: var(--cv-accent);
    box-shadow: var(--cv-shadow-md);
}

.gh-topic-grid .gh-card:hover .gh-card-title {
    color: var(--cv-accent);
}

/* Grid card images — consistent rounded corners */
.gh-topic-grid .gh-card-image {
    border-radius: 12px;
    overflow: hidden;
}

.gh-topic-grid .gh-card-image img {
    border-radius: 12px;
}

/* Featured large card gets glow bar */
.gh-topic-grid .gh-card.featured.large .gh-card-link {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: var(--cv-radius-xl);
}

.gh-topic-grid .gh-card.featured.large .gh-card-image {
    border-radius: var(--cv-radius-xl);
}

.gh-topic-grid .gh-card.featured.large .gh-card-image img {
    border-radius: var(--cv-radius-xl);
}

.gh-topic-grid .gh-card.featured.large .gh-card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--cv-accent) 50%, transparent 100%);
    opacity: 0.6;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.gh-topic-grid .gh-card.featured.large:hover .gh-card-link::before {
    opacity: 1;
}

/* ------------------------------------------------------------------
   TABLE STYLING
   ------------------------------------------------------------------ */
/* Responsive wrapper */
.gh-content .table-wrapper,
.gh-content figure:has(table) {
    overflow-x: auto;
    border-radius: var(--cv-radius-md);
    box-shadow: var(--cv-shadow-lg);
    border: 1px solid var(--cv-line);
    margin: 30px 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gh-content .table-wrapper table,
.gh-content figure:has(table) table {
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.gh-content table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: var(--cv-radius-md);
    overflow: hidden;
    box-shadow: var(--cv-shadow-lg);
    border: 1px solid var(--cv-line);
    margin: 30px 0;
    font-size: 14px;
    min-width: 480px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Default style: purple gradient header */
.gh-content table th {
    background: linear-gradient(145deg, #5B47FB 0%, #7c6bfa 100%);
    color: white;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 13px;
    text-align: left;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gh-content table th:first-child {
    border-radius: var(--cv-radius-md) 0 0 0;
}

.gh-content table th:last-child {
    border-radius: 0 var(--cv-radius-md) 0 0;
}

.gh-content table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cv-line);
    color: var(--cv-text-muted);
    transition: background 0.2s ease, color 0.3s ease, border-color 0.3s ease;
}

.gh-content table tr:last-child td {
    border-bottom: none;
}

.gh-content table tr:last-child td:first-child {
    border-radius: 0 0 0 var(--cv-radius-md);
}

.gh-content table tr:last-child td:last-child {
    border-radius: 0 0 var(--cv-radius-md) 0;
}

.gh-content table tr:nth-child(even) td {
    background: rgba(91, 71, 251, 0.02);
}

.gh-content table tr:hover td {
    background: rgba(91, 71, 251, 0.06);
}

/* Alternate style: tinted header */
.gh-content table.tinted-header th {
    background: rgba(91, 71, 251, 0.1);
    color: var(--cv-accent);
    border-bottom: 2px solid var(--cv-accent);
}

.gh-content table.tinted-header th:first-child,
.gh-content table.tinted-header th:last-child {
    border-radius: 0;
}

/* Color-coded cell utilities */
.gh-content table td.positive,
.gh-content table .positive {
    color: #22c55e;
    font-weight: 600;
}

.gh-content table td.negative,
.gh-content table .negative {
    color: #ef4444;
    font-weight: 600;
}

.gh-content table td.neutral,
.gh-content table .neutral {
    color: var(--cv-text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.gh-content table td.highlight,
.gh-content table .highlight {
    background: rgba(91, 71, 251, 0.08);
    font-weight: 700;
    color: var(--cv-accent);
    transition: background 0.3s ease;
}

/* ------------------------------------------------------------------
   TAG PAGE COVER
   ------------------------------------------------------------------ */
.gh-cover {
    position: relative;
}

.gh-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.65) 100%);
}

.gh-cover-content {
    position: relative;
    z-index: 2;
}

.gh-cover-title {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    font-weight: 700;
    letter-spacing: -1px;
}

.gh-cover-description {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
}

/* ------------------------------------------------------------------
   RELATED POSTS
   ------------------------------------------------------------------ */
.gh-read-next {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--cv-line);
    transition: border-color 0.3s ease;
}

.gh-read-next .gh-pagehead {
    margin-bottom: 30px;
}

.gh-read-next .gh-pagehead-title {
    font-size: 28px;
    padding-bottom: 12px;
}

.gh-read-next .gh-pagehead-title::after {
    width: 60px;
    height: 3px;
}

/* ------------------------------------------------------------------
   CONTENT TYPOGRAPHY ENHANCEMENTS
   ------------------------------------------------------------------ */
/* Horizontal rule */
.gh-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cv-line), transparent);
    margin: 48px 0;
    transition: background 0.3s ease;
}

/* Lists */
.gh-content ul,
.gh-content ol {
    margin: 20px 0 20px 24px;
}

.gh-content ul li,
.gh-content ol li {
    margin: 10px 0;
    padding-left: 4px;
    line-height: 1.7;
}

.gh-content ul li::marker {
    color: var(--cv-accent);
    font-size: 1.2em;
}

/* Bookmark card refinements */
.kg-bookmark-content {
    padding: 20px 24px;
}

.kg-bookmark-title {
    font-weight: 700;
    color: var(--cv-text-main);
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.kg-bookmark-description {
    color: var(--cv-text-muted);
    font-size: 13px;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.kg-bookmark-publisher {
    color: var(--cv-accent);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kg-bookmark-thumbnail img {
    border-radius: 0 var(--cv-radius-md) var(--cv-radius-md) 0;
}

/* File card */
.kg-file-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-md) !important;
    box-shadow: var(--cv-shadow-sm) !important;
    transition: all 0.3s ease;
}

.kg-file-card:hover {
    border-color: var(--cv-accent) !important;
    box-shadow: 0 10px 30px rgba(91, 71, 251, 0.08) !important;
}

/* Toggle card */
.kg-toggle-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-md) !important;
    box-shadow: var(--cv-shadow-sm) !important;
    transition: all 0.3s ease;
}

.kg-toggle-heading-text {
    color: var(--cv-text-main);
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Product card */
.kg-product-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-lg) !important;
    box-shadow: var(--cv-shadow-lg) !important;
    transition: all 0.3s ease;
}

.kg-product-card-title {
    color: var(--cv-text-main);
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Header card */
.kg-header-card {
    border-radius: var(--cv-radius-xl) !important;
}

/* Callout cards */
.kg-callout-card:hover {
    transform: translateX(3px);
    box-shadow: var(--cv-shadow-xl) !important;
}

.kg-callout-card-grey {
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    border-color: #94a3b8 !important;
}

html[data-theme="dark"] .kg-callout-card-grey,
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .kg-callout-card-grey {
        background: linear-gradient(145deg, #1e293b 0%, #334155 100%) !important;
        border-color: #64748b !important;
    }
}

.kg-callout-card-white {
    background: var(--cv-bg-elevated) !important;
    border-color: var(--cv-line) !important;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.kg-callout-card-accent {
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%) !important;
    border-color: var(--cv-accent) !important;
}

html[data-theme="dark"] .kg-callout-card-accent,
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .kg-callout-card-accent {
        background: linear-gradient(145deg, #1e1b4b 0%, #312e81 100%) !important;
        border-color: var(--cv-accent) !important;
    }
}

.kg-callout-emoji {
    font-size: 20px !important;
}

/* Button card */
.kg-button-card a.kg-btn {
    background: linear-gradient(145deg, #5B47FB 0%, #7c6bfa 100%) !important;
    border-radius: var(--cv-radius-sm) !important;
    font-weight: 600 !important;
    box-shadow: var(--cv-shadow-accent) !important;
    transition: all 0.3s ease !important;
}

.kg-button-card a.kg-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(91, 71, 251, 0.3) !important;
}

/* Audio card */
.kg-audio-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-md) !important;
    box-shadow: var(--cv-shadow-sm) !important;
    transition: all 0.3s ease;
}

/* Video card */
.kg-video-card {
    border-radius: var(--cv-radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--cv-shadow-lg) !important;
}

/* NFT card */
.kg-nft-card {
    background: var(--cv-card-bg-gradient) !important;
    border: 1px solid var(--cv-line) !important;
    border-radius: var(--cv-radius-md) !important;
    box-shadow: var(--cv-shadow-sm) !important;
    transition: all 0.3s ease;
}

/* ------------------------------------------------------------------
   SEARCH OVERLAY DARK MODE
   ------------------------------------------------------------------ */
html[data-theme="dark"] .gh-search-results,
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .gh-search-results {
        background: var(--cv-bg-elevated);
        color: var(--cv-text-main);
    }
}

/* ------------------------------------------------------------------
   MOBILE MENU DARK MODE
   ------------------------------------------------------------------ */
html[data-theme="dark"] .gh-burger::before,
html[data-theme="dark"] .gh-burger::after,
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .gh-burger::before,
    html:not([data-theme]) .gh-burger::after {
        background: var(--cv-text-main);
    }
}

/* ------------------------------------------------------------------
   GHOST PORTAL DARK MODE OVERRIDES
   ------------------------------------------------------------------ */
html[data-theme="dark"] .portal-popup-wrapper,
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .portal-popup-wrapper {
        background: var(--cv-bg-elevated) !important;
        color: var(--cv-text-main) !important;
    }
}

/* ------------------------------------------------------------------
   GHOST PAYWALL / POST CTA OVERRIDES
   ------------------------------------------------------------------ */
.gh-post-upgrade-cta {
    background: linear-gradient(135deg, #5B47FB 0%, #3d2dd4 100%) !important;
    border-radius: 16px !important;
}
.gh-post-upgrade-cta h2,
.gh-post-upgrade-cta .gh-post-upgrade-cta-description,
.gh-post-upgrade-cta p,
.gh-post-upgrade-cta-secondary,
.gh-post-upgrade-cta-secondary *:not(a):not(button) {
    color: #ffffff !important;
}
.gh-post-upgrade-cta .gh-btn,
.gh-post-upgrade-cta button,
.gh-post-upgrade-cta a[data-portal] {
    background: #ffffff !important;
    color: #5B47FB !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
}
.gh-post-upgrade-cta-secondary {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    margin-top: 8px !important;
}
.gh-post-upgrade-cta-secondary a {
    display: inline-block !important;
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    border: 1.5px solid rgba(255,255,255,0.5) !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
}
.gh-post-upgrade-cta-secondary a:hover {
    background: rgba(255,255,255,0.12) !important;
    border-color: #ffffff !important;
}

/* ------------------------------------------------------------------
   PRINT STYLES
   ------------------------------------------------------------------ */
@media print {
    .gh-head,
    .gh-foot,
    .gh-subscribe,
    .gh-comments,
    .gh-read-next,
    .gh-post-authors,
    .gh-author-social,
    .gh-topic-footer,
    .gh-button-share,
    .gh-theme-toggle {
        display: none !important;
    }

    body {
        background: white !important;
        color: #000 !important;
    }

    .gh-article {
        max-width: 100% !important;
    }

    .gh-content a {
        border-bottom: none !important;
        color: #000 !important;
        text-decoration: underline !important;
    }

    .gh-content h2::after,
    .gh-content h3::after {
        display: none !important;
    }

    .gh-content blockquote {
        border-left: 3px solid #999 !important;
        background: #f5f5f5 !important;
        box-shadow: none !important;
    }

    .gh-content table {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .gh-content table th {
        background: #eee !important;
        color: #000 !important;
    }

    img {
        max-width: 100% !important;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
}

/* ------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .gh-topic-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .gh-pagehead:has(.gh-author-image) {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .gh-topic-name,
    .gh-pagehead-title { font-size: 30px; }

    .gh-topic-grid .gh-card.featured.large .gh-card-link {
        min-height: 400px;
    }

    .gh-topic-list {
        grid-template-columns: 1fr;
    }

    .gh-subscribe { padding: 35px 24px; border-radius: var(--cv-radius-lg); }
    .gh-subscribe-title { font-size: 26px; }

    .gh-pagehead:has(.gh-author-image) {
        padding: 35px 24px;
        border-radius: var(--cv-radius-lg);
    }

    .gh-pagehead:has(.gh-author-image) .gh-author-image {
        width: 120px;
        height: 120px;
    }

    .gh-pagehead:has(.gh-author-image) .gh-pagehead-title {
        font-size: 26px;
    }

    .gh-post-author-card {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }

    .gh-post-author-card .gh-author-image {
        width: 80px;
        height: 80px;
    }

    .gh-post-author-card-social {
        justify-content: center;
    }

    .gh-content table {
        font-size: 13px;
    }

    .gh-content table th,
    .gh-content table td {
        padding: 10px 12px;
    }

    .gh-article-header.has-cover-image {
        min-height: 360px;
        padding: 40px 24px 32px;
        border-radius: var(--cv-radius-lg);
    }

    .gh-article-header.has-cover-image .gh-article-title {
        font-size: 2.8rem;
        letter-spacing: -0.5px;
    }

    .post-template .gh-article-header,
    .post-template .gh-content {
        grid-column: main-start / main-end;
    }
}
