/* ============================================
   LinkedTrust Blog Theme
   "Deep tech. Human trust."
   ============================================ */

/* ---- RESET & BASE ---- */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Light base */
    --bg-primary: #FAFAF8;
    --bg-white: #FFFFFF;
    --bg-warm: #FFF8F0;

    /* Dark tech sections */
    --bg-dark: #0f1117;
    --bg-dark-card: #1a1d27;
    --bg-dark-hover: #22263a;

    /* Text */
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-on-dark: #e8e8e8;
    --text-on-dark-muted: #888899;

    /* Brand */
    --brand-primary: #00B2E5;
    --brand-dark: #0090b8;
    --brand-accent: #667eea;
    --gradient: linear-gradient(135deg, #00B2E5 0%, #667eea 100%);

    /* Utility */
    --success: #10B981;
    --border: #e8e8e6;
    --border-dark: rgba(255,255,255,0.08);
    --glass: rgba(255,255,255,0.05);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    /* Radius */
    --radius: 12px;
    --radius-lg: 16px;

    /* Fonts */
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

html {
    font-size: 62.5%;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

body {
    font-family: var(--font-body);
    font-size: 1.6rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border-radius: 0; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-body); font-weight: 700; line-height: 1.2; }
p { margin: 0 0 1.5em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

kbd {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    background: #f3f3f1;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
}

mark { background-color: #fdffb6; }

figcaption {
    margin-top: 1rem;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-align: center;
}


/* ---- LAYOUT ---- */

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

.site-content {
    flex-grow: 1;
}

.outer {
    position: relative;
    padding: 0 2rem;
}

.inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}


/* ---- NETWORK GRAPH BACKGROUND ---- */

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/particles.svg');
    background-repeat: no-repeat;
    background-position: -5% 20%;
    background-size: 40% auto;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/particles.svg');
    background-repeat: no-repeat;
    background-position: 105% 60%;
    background-size: 40% auto;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    transform: scaleX(-1);
}

.viewport {
    position: relative;
    z-index: 1;
}


/* ---- NAV (matches linkedtrust.us main site) ---- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--text-primary);
    text-decoration: none;
}
.nav-logo-img {
    width: 28px;
    height: 28px;
}
.nav-logo span { color: var(--brand-primary); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 1.4rem;
    font-weight: 500;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
    background: var(--gradient);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
}

/* Nav action icons (search, login) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    border-radius: 6px;
}
.nav-icon-btn:hover { color: var(--brand-primary); background: rgba(0,0,0,0.04); }
.nav-icon-btn svg { width: 18px; height: 18px; }

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
}

/* Mobile nav */
.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    padding: 2rem;
    z-index: 99;
}
.nav-mobile-menu.active { display: block; }
.nav-mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    border: none;
}
.btn-gradient {
    background: var(--gradient);
    color: #fff;
}

@media (max-width: 767px) {
    .nav-links { display: none; }
    .nav-hamburger { display: block; }
}


/* ---- SITE HEADER (compact — no wasted space) ---- */

.site-header-content {
    padding: 1.5rem 2rem 0;
    text-align: center;
    color: var(--text-primary);
}

.site-header-content.left-aligned {
    text-align: left;
}

.site-header-content.no-content {
    padding: 0;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-description {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .site-header-content { padding: 1rem 1.5rem 0; }
    .site-description { font-size: 1.4rem; }
}


/* ---- POST FEED ---- */

.post-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    padding: 4rem 0;
}

@media (max-width: 767px) {
    .post-feed {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2.5rem 0;
    }
}

/* Post Card */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-card-image-link {
    display: block;
    overflow: hidden;
    position: relative;
}

.post-card-image-link::after {
    content: "";
    display: block;
    padding-bottom: 56%;
}

.post-card[class*="post-access-"] .post-card-image-link::after {
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.post-card.keep-ratio:not(.post-card-large):not(.post-card-full) .post-card-image-link::after {
    padding-bottom: 0;
}

.post-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-primary);
}

.post-card.keep-ratio:not(.post-card-large):not(.post-card-full) .post-card-image {
    position: static;
}

.post-card-access {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.post-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.post-card-content-link {
    display: block;
    color: var(--text-primary);
}
.post-card-content-link:hover { text-decoration: none; }

.post-card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.8rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-primary);
}

.post-card-featured {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--brand-accent);
}
.post-card-featured svg { width: 14px; height: 14px; }

.post-card-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.01em;
}

.post-card-content-link:hover .post-card-title {
    color: var(--brand-primary);
}

.post-card-excerpt {
    display: -webkit-box;
    overflow-y: hidden;
    margin-top: 0.8rem;
    font-size: 1.4rem;
    line-height: 1.55;
    color: var(--text-secondary);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-muted);
}

.post-card-meta > * {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-card-meta > * + *:not(script)::before {
    content: "";
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* Large first card on classic layout */
.post-card-large {
    grid-column: span 2;
    flex-direction: row;
}

.post-card-large .post-card-image-link {
    flex: 1;
    min-width: 0;
}

.post-card-large .post-card-image-link::after {
    padding-bottom: 60%;
}

.post-card-large .post-card-content {
    flex: 1;
    padding: 2.5rem;
}

.post-card-large .post-card-title {
    font-size: 2.6rem;
}

.post-card-large .post-card-excerpt {
    -webkit-line-clamp: 4;
    font-size: 1.5rem;
}

@media (max-width: 767px) {
    .post-card-large {
        grid-column: span 1;
        flex-direction: column;
    }
    .post-card-large .post-card-title { font-size: 2rem; }
}

/* Dynamic cards (2nd/3rd in classic) */
.post-card.dynamic .post-card-title { font-size: 1.8rem; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0 4rem;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-muted);
}

.pagination a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--brand-primary);
}

.pagination a:hover { color: var(--brand-dark); }


/* ---- SINGLE POST ---- */

.article {
    padding: 0 2rem;
}

.article-header {
    max-width: 720px;
    margin: 4rem auto 0;
}

.article-tag {
    margin-bottom: 1rem;
}

.article-tag a {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-primary);
}

.article-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.article-excerpt {
    margin-top: 1.5rem;
    font-size: 2rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Byline */
.article-byline {
    display: flex;
    align-items: center;
    margin: 2rem 0 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.article-byline-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.author-list {
    display: flex;
    list-style: none;
}

.author-avatar {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-primary);
}

.author-profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-list-item + .author-list-item {
    margin-left: -8px;
}

.article-byline-meta .author-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.article-byline-meta .author-name a {
    color: var(--text-primary);
}

.byline-meta-content {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Feature image */
.article-image {
    max-width: 1040px;
    margin: 0 auto 3rem;
}

.article-image img {
    width: 100%;
    border-radius: 0;
}

.article-image figcaption {
    margin-top: 1.2rem;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-align: center;
}

.image-full .article-image {
    max-width: none;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.image-small .article-image {
    max-width: 720px;
}

/* Article Content — gh-canvas controls width */
.gh-canvas {
    max-width: 720px;
    margin: 0 auto;
}

.gh-content {
    font-size: 1.7rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gh-content > * + * { margin-top: 2rem; }

.gh-content a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gh-content a:hover { color: var(--brand-dark); }

.gh-content h2 { font-size: 2.6rem; margin-top: 4rem; }
.gh-content h3 { font-size: 2.2rem; margin-top: 3rem; }
.gh-content h4 { font-size: 1.8rem; margin-top: 2.5rem; }

.gh-content ul, .gh-content ol {
    padding-left: 2em;
    list-style: disc;
}
.gh-content ol { list-style: decimal; }
.gh-content li + li { margin-top: 0.5em; }

.gh-content blockquote {
    border-left: 3px solid var(--brand-primary);
    padding: 0 0 0 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.gh-content pre {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    line-height: 1.5;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-radius: var(--radius);
    padding: 2rem;
    overflow-x: auto;
    margin: 2.5rem 0;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f3f3f1;
    padding: 2px 6px;
    border-radius: 4px;
}

.gh-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.gh-content hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 3rem 0;
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.5rem;
    margin: 2rem 0;
}

.gh-content th, .gh-content td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.gh-content th {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Responsive images in content */
.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img {
    border-radius: 0;
}

.gh-content .kg-width-wide {
    max-width: 1040px;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    transform: translateX(calc(50vw - 50%));
}

.gh-content .kg-width-full {
    max-width: none;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.gh-content .kg-image-card figcaption,
.gh-content .kg-gallery-card figcaption,
.gh-content .kg-embed-card figcaption {
    margin-top: 1.2rem;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-align: center;
}

.gh-content .kg-callout-card {
    padding: 2rem;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.gh-content .kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.gh-content .kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.gh-content .kg-bookmark-content {
    flex: 1;
    padding: 1.5rem;
}

.gh-content .kg-bookmark-title {
    font-weight: 600;
    font-size: 1.5rem;
}

.gh-content .kg-bookmark-description {
    margin-top: 0.5rem;
    font-size: 1.3rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-content .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.gh-content .kg-bookmark-icon {
    width: 16px;
    height: 16px;
    display: inline;
}

.gh-content .kg-bookmark-thumbnail {
    width: 200px;
    min-height: 100%;
    object-fit: cover;
}

/* FitVids responsive video */
.fluid-width-video-wrapper {
    margin: 2rem 0;
}

@media (max-width: 767px) {
    .article-header { margin-top: 2rem; }
    .article-title { font-size: 2.8rem; }
    .article-excerpt { font-size: 1.6rem; }
    .gh-content { font-size: 1.6rem; }
    .gh-content h2 { font-size: 2.2rem; }
    .gh-content h3 { font-size: 1.9rem; }
}


/* ---- COMMENTS ---- */

.article-comments {
    max-width: 720px;
    margin: 4rem auto;
}


/* ---- FOOTER CTA (subscribe) ---- */

.footer-cta {
    background: var(--gradient);
    padding: 6rem 2rem;
    text-align: center;
    color: #fff;
}

.footer-cta-title {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.footer-cta-button {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 48px;
    padding: 4px 4px 4px 2rem;
    text-decoration: none;
    color: #fff;
}

.footer-cta-input {
    font-size: 1.4rem;
    opacity: 0.8;
    margin-right: 1rem;
}

.footer-cta-button span {
    background: #fff;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.4rem;
    padding: 8px 20px;
    border-radius: 48px;
}


/* ---- READ MORE ---- */

.read-more-wrap {
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.read-more {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.read-more .post-card {
    grid-column: span 1;
}

@media (max-width: 767px) {
    .read-more { grid-template-columns: 1fr; }
}


/* ---- FOOTER (4-column, matches linkedtrust.us) ---- */

.site-footer {
    background: var(--bg-dark);
    color: var(--text-on-dark-muted);
    padding: 4rem 2rem 3rem;
    margin-top: 0;
    font-size: 1.3rem;
}

.site-footer a {
    color: var(--text-on-dark-muted);
}
.site-footer a:hover { color: #fff; }

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand p {
    margin-top: 0.8rem;
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--text-on-dark-muted);
    max-width: 300px;
}

.footer-brand .nav-logo {
    color: var(--text-on-dark);
}

.footer-col h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-on-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li + li {
    margin-top: 0.5rem;
}

.footer-col a {
    font-size: 1.3rem;
}

@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-brand {
        grid-column: span 2;
    }
}


/* ---- AUTHOR TEMPLATE ---- */

.author-template .post-feed { padding-top: 2rem; }

.author-profile {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.author-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
}

.author-profile-image svg { width: 80px; height: 80px; }

.author-profile h1 { font-size: 3rem; margin-bottom: 0.5rem; }

.author-profile-location {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.author-profile-bio {
    font-size: 1.6rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.author-profile-social-link {
    display: inline-flex;
    margin: 1rem 0.5rem 0;
    color: var(--text-muted);
}
.author-profile-social-link:hover { color: var(--brand-primary); }
.author-profile-social-link svg { width: 20px; height: 20px; }


/* ---- TAG TEMPLATE ---- */

.tag-template .post-feed { padding-top: 2rem; }

.tag-header {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem 0;
    text-align: center;
}

.tag-header h1 {
    font-size: 3rem;
}

.tag-header p {
    margin-top: 1rem;
    color: var(--text-secondary);
}


/* ---- ERROR PAGES ---- */

.error-template .site-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem;
    text-align: center;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 8rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1;
}

.error-message {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.error-link {
    display: inline-block;
    margin-top: 2rem;
    font-weight: 600;
    color: var(--brand-primary);
}


/* ---- DARK MODE ---- */

html.dark-mode body {
    background: var(--bg-dark);
    color: var(--text-on-dark);
}

html.dark-mode body::before,
html.dark-mode body::after {
    opacity: 0.06;
}

html.dark-mode .site-nav {
    background: rgba(15, 17, 23, 0.92);
    border-bottom-color: var(--border-dark);
}

html.dark-mode .nav-logo { color: var(--text-on-dark); }
html.dark-mode .nav-links a { color: var(--text-on-dark-muted); }
html.dark-mode .nav-links a:hover { color: var(--text-on-dark); }
html.dark-mode .nav-hamburger span { background: var(--text-on-dark); }
html.dark-mode .nav-mobile-menu { background: var(--bg-dark); }
html.dark-mode .nav-mobile-menu a { color: var(--text-on-dark); border-color: var(--border-dark); }
html.dark-mode .nav-icon-btn { color: var(--text-on-dark-muted); }
html.dark-mode .nav-icon-btn:hover { color: var(--brand-primary); background: rgba(255,255,255,0.06); }

html.dark-mode .post-card {
    background: var(--bg-dark-card);
    border-color: var(--border-dark);
}
html.dark-mode .post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
html.dark-mode .post-card-content-link { color: var(--text-on-dark); }
html.dark-mode .post-card-title { color: var(--text-on-dark); }
html.dark-mode .post-card-excerpt { color: var(--text-on-dark-muted); }
html.dark-mode .post-card-image { background: var(--bg-dark); }

html.dark-mode .site-header-content { color: var(--text-on-dark); }
html.dark-mode .site-description { color: var(--text-on-dark-muted); }

html.dark-mode .article-title { color: var(--text-on-dark); }
html.dark-mode .article-excerpt { color: var(--text-on-dark-muted); }
html.dark-mode .article-byline { border-color: var(--border-dark); }
html.dark-mode .article-byline-meta .author-name a { color: var(--text-on-dark); }
html.dark-mode .author-avatar { background: var(--bg-dark-card); }

html.dark-mode .gh-content a { color: var(--brand-primary); }
html.dark-mode .gh-content code { background: var(--bg-dark-card); color: var(--text-on-dark); }
html.dark-mode .gh-content hr { background: var(--border-dark); }
html.dark-mode .gh-content th, html.dark-mode .gh-content td { border-color: var(--border-dark); }
html.dark-mode .gh-content blockquote { color: var(--text-on-dark-muted); }

html.dark-mode .read-more-wrap { border-color: var(--border-dark); }
html.dark-mode .pagination a { color: var(--brand-primary); }

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    html.auto-color body { background: var(--bg-dark); color: var(--text-on-dark); }
    html.auto-color body::before, html.auto-color body::after { opacity: 0.06; }
    html.auto-color .site-nav { background: rgba(15,17,23,0.92); border-bottom-color: var(--border-dark); }
    html.auto-color .nav-logo { color: var(--text-on-dark); }
    html.auto-color .nav-links a { color: var(--text-on-dark-muted); }
    html.auto-color .nav-links a:hover { color: var(--text-on-dark); }
    html.auto-color .nav-hamburger span { background: var(--text-on-dark); }
    html.auto-color .nav-mobile-menu { background: var(--bg-dark); }
    html.auto-color .nav-mobile-menu a { color: var(--text-on-dark); border-color: var(--border-dark); }
    html.auto-color .nav-icon-btn { color: var(--text-on-dark-muted); }
    html.auto-color .nav-icon-btn:hover { color: var(--brand-primary); background: rgba(255,255,255,0.06); }
    html.auto-color .post-card { background: var(--bg-dark-card); border-color: var(--border-dark); }
    html.auto-color .post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
    html.auto-color .post-card-content-link { color: var(--text-on-dark); }
    html.auto-color .post-card-title { color: var(--text-on-dark); }
    html.auto-color .post-card-excerpt { color: var(--text-on-dark-muted); }
    html.auto-color .post-card-image { background: var(--bg-dark); }
    html.auto-color .site-header-content { color: var(--text-on-dark); }
    html.auto-color .site-description { color: var(--text-on-dark-muted); }
    html.auto-color .article-title { color: var(--text-on-dark); }
    html.auto-color .article-excerpt { color: var(--text-on-dark-muted); }
    html.auto-color .article-byline { border-color: var(--border-dark); }
    html.auto-color .article-byline-meta .author-name a { color: var(--text-on-dark); }
    html.auto-color .gh-content a { color: var(--brand-primary); }
    html.auto-color .gh-content code { background: var(--bg-dark-card); color: var(--text-on-dark); }
    html.auto-color .gh-content hr { background: var(--border-dark); }
    html.auto-color .read-more-wrap { border-color: var(--border-dark); }
    html.auto-color .site-footer { background: #0a0c10; }
}


/* ---- LIGHTBOX (from Casper, needed for image galleries) ---- */

.pswp {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    overflow: hidden;
    outline: none;
    backface-visibility: hidden;
}

.pswp img { max-width: none; }
.pswp--open { display: block; }
.pswp--zoom-allowed .pswp__img { cursor: zoom-in; }
.pswp--zoomed-in .pswp__img { cursor: grab; }
.pswp--dragging .pswp__img { cursor: grabbing; }

.pswp__bg {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 23, 0.95);
}

.pswp__scroll-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.pswp__container,
.pswp__zoom-wrap {
    position: absolute;
    inset: 0;
    touch-action: none;
    backface-visibility: hidden;
}

.pswp__container { z-index: 1; }

.pswp__item { position: absolute; inset: 0; overflow: hidden; }
.pswp__img { position: absolute; width: auto; height: auto; top: 0; left: 0; }

.pswp__img--placeholder { backface-visibility: hidden; }
.pswp__img--placeholder--blank { background: var(--bg-dark); }

.pswp--ie .pswp__img {
    width: 100% !important;
    height: auto !important;
    left: 0;
    top: 0;
}

.pswp__error-msg { position: absolute; top: 50%; left: 0; width: 100%; text-align: center; font-size: 1.4rem; line-height: 1.6; margin-top: -0.8rem; color: var(--text-on-dark-muted); }
.pswp__error-msg a { color: var(--text-on-dark); text-decoration: underline; }

.pswp__button {
    position: relative;
    display: block;
    float: right;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    cursor: pointer;
    border: 0;
    background: none;
    transition: opacity 0.2s;
    opacity: 0.75;
}
.pswp__button:hover { opacity: 1; }
.pswp__button--close svg, .pswp__button--arrow--left svg, .pswp__button--arrow--right svg { fill: #fff; width: 24px; height: 24px; }

.pswp__counter {
    position: absolute;
    top: 0;
    left: 0;
    height: 44px;
    padding: 0 15px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 44px;
    color: #fff;
    user-select: none;
}

.pswp__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 44px;
}

.pswp__caption__center {
    max-width: 420px;
    padding: 25px 15px 30px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
}

.pswp__ui { z-index: 1550; visibility: visible; opacity: 1; }
.pswp__top-bar { position: absolute; top: 0; left: 0; width: 100%; height: 44px; }
