/**
 * DocuPoint Custom Styles
 * Based on Stratechery-inspired readability principles
 *
 * Design Philosophy:
 * - Maximum readability for long-form content
 * - Serif typography for faster reading
 * - High contrast, minimal color palette
 * - Content-first, design-invisible
 *
 * Color Palette (Simplified):
 * - Background: #FFFFFF (Pure white)
 * - Text: #1a1a1a (Near black)
 * - Headlines: #0a0a0a (Deep black)
 * - Links: #2563eb (Standard blue)
 * - Accent: #FF9932 (CTA only)
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* ==========================================================================
       Typography Scale
       Base: 17px | Scale: 1.25 (Major Third)
       ========================================================================== */

    /* Font Families */
    --dp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --dp-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Base Size */
    --dp-font-base: 17px;
    --dp-line-height: 1.6;

    /* Type Scale - Fixed sizes for consistency
       Note: Ghost uses html { font-size: 62.5% }, so 1rem = 10px */
    --dp-font-h1: 2.8rem;       /* 36px - Article titles */
    --dp-font-h2: 2.2rem;       /* 28px - Section headings */
    --dp-font-h3: 1.9rem;       /* 24px - Subsections */
    --dp-font-h4: 2rem;         /* 20px - Minor headings */
    --dp-font-h5: 1.8rem;       /* 18px - Small headings */
    --dp-font-body: 1.7rem;     /* 17px - Body text */
    --dp-font-nav: 1.5rem;      /* 15px - Navigation */
    --dp-font-small: 1.6rem;    /* 16px - Captions, meta */
    --dp-font-code: 1.6rem;     /* 16px - Code blocks */
    --dp-font-tiny: 1.4rem;     /* 14px - Labels, badges */

    /* Font Weights */
    --dp-weight-normal: 400;
    --dp-weight-medium: 500;
    --dp-weight-semibold: 600;

    /* ==========================================================================
       Border Radius
       ========================================================================== */
    --dp-radius-xs: 2px;        /* Link hover, tiny elements */
    --dp-radius-sm: 4px;        /* Buttons, inline code, small elements */
    --dp-radius-md: 6px;        /* Callouts */
    --dp-radius-lg: 8px;        /* Images, code blocks, tables */
    --dp-radius-xl: 12px;       /* Cards, embeds, large elements */

    /* ==========================================================================
       Shadows
       ========================================================================== */
    --dp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --dp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);

    /* ==========================================================================
       Transitions
       ========================================================================== */
    --dp-transition-fast: 0.15s ease;
    --dp-transition-normal: 0.2s ease;

    /* ==========================================================================
       Color Palette
       ========================================================================== */

    /* Core Palette (Stratechery-aligned) */
    --dp-white: #FFFFFF;
    --dp-text-primary: #1a1a1a;
    --dp-text-secondary: #6b7280;
    --dp-headline: #0a0a0a;
    --dp-link: #2563eb;
    --dp-link-hover: #1e40af;

    /* Accent Colors */
    --dp-accent: #FF9932;           /* Deep Saffron - CTAs only */
    --dp-deep-slate: #36565F;       /* Section numbers, callouts */
    --dp-european-blue: #003399;    /* EU-specific content */
    --dp-warning: #dc2626;          /* Compliance warnings */
    --dp-success: #059669;          /* Success/checkmarks */
    --dp-info: #2563eb;             /* Info callouts */

    /* Dark mode colors */
    --dp-ocean-steel: #5F8190;
    --dp-ocean-steel-light: #8BA8B8;
    --dp-cloud-mist: #E2F0F0;

    /* Override Ghost accent color */
    --ghost-accent-color: #FF9932;

    /* Light Mode (default) */
    --dp-bg: var(--dp-white);
    --dp-text: var(--dp-text-primary);

    /* Border colors */
    --dp-border-light: rgba(0, 0, 0, 0.1);
    --dp-border-dark: rgba(255, 255, 255, 0.15);
}

/* Dark Mode */
html.dark-mode {
    --dp-bg: var(--dp-deep-slate);
    --dp-text: var(--dp-cloud-mist);
    --dp-text-secondary: var(--dp-ocean-steel-light);
    --dp-headline: var(--dp-cloud-mist);
    --dp-link: #60a5fa;
    --dp-link-hover: #93c5fd;
    --dp-border-light: rgba(226, 240, 240, 0.15);
}

/* ==========================================================================
   Logo Styling
   Logo switching handled via JavaScript (data-logo-light / data-logo-dark)
   ========================================================================== */

.gh-head-logo img {
    height: auto;
    width: auto;
    max-height: 48px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-base);
    line-height: var(--dp-line-height);
    color: var(--dp-text);
    background-color: var(--dp-bg);
}

.gh-content {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-base);
    line-height: var(--dp-line-height);
    color: var(--dp-text);
}

/* Override Ghost's default content spacing (reduced to 1/3) */
.gh-content > * + * {
    margin-top: calc(0.5em * var(--content-spacing-multiplier, 1));
}

.gh-content > blockquote,
.gh-content > blockquote + *,
.gh-content > hr,
.gh-content > hr + * {
    margin-top: calc(0.8em * var(--content-spacing-multiplier, 1));
}

a {
    color: var(--dp-link);
    text-decoration: none;
}

a:hover {
    color: var(--dp-link-hover);
}

/* Content links - Stratechery-style with DocuPoint colors */
.gh-content a {
    color: inherit;
    font-weight: var(--dp-weight-semibold);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.gh-content a:hover,
.gh-content a:focus,
.gh-content a:active {
    background-color: var(--dp-deep-slate);
    color: #fff;
    text-decoration: none;
    border-radius: var(--dp-radius-xs);
    padding: 0 2px;
    margin: 0 -2px;
}

/* Dark mode: invert hover colors */
html.dark-mode .gh-content a:hover,
html.dark-mode .gh-content a:focus,
html.dark-mode .gh-content a:active {
    background-color: var(--dp-cloud-mist);
    color: var(--dp-deep-slate);
}

/* External link icon - arrow pointing up-right */
.gh-content a[href^="http"]::after {
    content: "";
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-left: 0.2em;
    margin-right: 0.1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: text-top;
    opacity: 0.6;
}

.gh-content a[href^="http"]:hover::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
}

/* Dark mode - white icon, deep-slate on hover */
html.dark-mode .gh-content a[href^="http"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
}

html.dark-mode .gh-content a[href^="http"]:hover::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2336565F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
}

/* Hide icon for internal links (relative URLs don't get the icon) */
/* Also hide for images, buttons, and specific internal patterns */
.gh-content a[href^="#"]::after,
.gh-content a[href^="/"]::after,
.gh-content a.kg-bookmark-container::after,
.gh-content a:has(img)::after {
    display: none;
}

/* ==========================================================================
   Typography - Unified Type Scale
   All sizes use CSS variables for consistency
   ========================================================================== */

/* Headings */
h1, h2, h3, h4, h5, h6,
.gh-article-title,
.gh-card-title {
    font-family: var(--dp-font-sans);
    font-weight: var(--dp-weight-semibold);
    text-transform: none;
    letter-spacing: -0.02em;
    color: var(--dp-headline);
}

h1, .gh-article-title {
    font-size: var(--dp-font-h1);
    line-height: 1.3;
}

h2, .gh-content h2 {
    font-size: var(--dp-font-h2);
    margin-top: 3rem;
    margin-bottom: 1rem;
}

h3, .gh-content h3 {
    font-size: var(--dp-font-h3);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h4, .gh-content h4 {
    font-size: var(--dp-font-h4);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

h5, h6 {
    font-size: var(--dp-font-h5);
}

/* Body & Paragraphs */
p, .gh-content p,
.gh-card-excerpt {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-base);
    line-height: var(--dp-line-height);
}

/* Navigation & UI */
.gh-head,
.gh-head-menu,
.gh-head-menu a,
.gh-foot,
.gh-foot-menu a {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-nav);
    font-weight: var(--dp-weight-medium);
    text-transform: none;
    letter-spacing: -0.01em;
}

/* Small Text */
.gh-card-meta,
.gh-article-meta,
figcaption,
.gh-card-date,
.gh-archive-date,
.gh-archive-reading-time {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-small);
    color: var(--dp-text-secondary);
}

/* Code */
code, pre, kbd {
    font-family: var(--dp-font-mono);
}

pre {
    font-size: var(--dp-font-code);
}

code:not(pre code) {
    font-size: var(--dp-font-code);
}

.gh-article-excerpt,
.gh-article-meta,
figcaption {
    color: var(--dp-text-secondary);
}

/* ==========================================================================
   Dark Mode Toggle
   ========================================================================== */

.gh-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gh-theme-toggle .icon-sun { display: none; }
.gh-theme-toggle .icon-moon { display: block; }
html.dark-mode .gh-theme-toggle .icon-sun { display: block; }
html.dark-mode .gh-theme-toggle .icon-moon { display: none; }

/* ==========================================================================
   Header & Footer Layout
   ========================================================================== */

/* Sticky Header */
.gh-head {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* When scrolled, add shadow */
.gh-head.is-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Compact header when scrolled - hide logo row */
.gh-head.is-scrolled .gh-head-brand {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.gh-head .gh-head-brand {
    max-height: 100px;
    opacity: 1;
    transition: all 0.3s ease;
}

.gh-head-inner,
.gh-foot-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4vw;
}

html.dark-mode .gh-head,
html.dark-mode .gh-foot {
    background-color: var(--dp-bg);
    color: var(--dp-text);
}

html.dark-mode .gh-head-logo,
html.dark-mode .gh-head-menu a,
html.dark-mode .gh-foot a {
    color: var(--dp-text);
}

html.dark-mode .gh-head.is-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Stacked Header (Stratechery-style)
   ========================================================================== */

.is-head-stacked .gh-head {
    border-bottom: 1px solid var(--dp-border-light);
}

html.dark-mode .is-head-stacked .gh-head {
    border-bottom-color: var(--dp-border-dark);
}

.is-head-stacked .gh-head-inner {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 1rem 4vw !important;
}

.is-head-stacked .gh-head-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
}

.is-head-stacked .gh-head-logo,
.is-head-stacked .gh-head-brand-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* Logo size is now determined by the uploaded image - no fixed constraints */

.is-head-stacked .gh-head-menu {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: flex !important;
    justify-content: flex-start !important;
    padding: 0.5rem 0 0 !important;
    margin: 0 !important;
    gap: 2rem !important;
    height: auto !important;
}

.is-head-stacked .gh-head-menu::before,
.is-head-stacked .gh-head-menu::after {
    display: none !important;
}

.is-head-stacked .gh-head-actions {
    grid-column: 2 !important;
    grid-row: 2 / 3 !important;
    justify-self: end !important;
    align-self: center !important;
}

@media (max-width: 768px) {
    .is-head-stacked .gh-head-inner {
        grid-template-columns: 1fr !important;
    }

    .is-head-stacked .gh-head-actions {
        grid-column: 1 !important;
        grid-row: 3 !important;
        justify-self: start !important;
        margin-top: 0.5rem !important;
    }
}

/* ==========================================================================
   Buttons & CTAs
   ========================================================================== */

.gh-btn,
.gh-portal-btn,
[data-portal] {
    background-color: var(--dp-accent) !important;
    color: var(--dp-jet-black) !important;
}

.gh-btn:hover,
.gh-portal-btn:hover {
    background-color: #e88a2d !important;
}

.gh-article-tag {
    color: var(--dp-deep-slate);
    background: rgba(54, 86, 95, 0.1);
}

html.dark-mode .gh-article-tag {
    color: var(--dp-cloud-mist);
    background: rgba(233, 241, 241, 0.2);
}

/* ==========================================================================
   Two-Column Layout (shared by article and homepage)
   ========================================================================== */

.gh-article-layout,
.gh-home-layout {
    display: flex;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4vw;
    align-items: flex-start; /* Align both columns to top */
}

/* Remove default top padding to align columns consistently */
.home-template .gh-main,
.post-template .gh-main,
.page-template .gh-main {
    padding-top: 0;
}

/* Add consistent top spacing to all two-column layouts */
.gh-home-layout,
.gh-article-layout {
    padding-top: clamp(2rem, 1.5rem + 1.5vw, 4rem);
}

.gh-article-main,
.gh-home-main,
.gh-main-content {
    flex: 1;
    max-width: 720px;
    min-width: 0;
}

.gh-sidebar {
    display: none;
}

@media (min-width: 1200px) {
    .gh-sidebar {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        flex-shrink: 0;
        width: 300px;
        position: sticky;
        top: 80px;
        align-self: flex-start;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* Full-width layout (no sidebar) for technical template */
.gh-article-layout-full {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4vw;
    padding-top: clamp(2rem, 1.5rem + 1.5vw, 4rem);
}

.gh-article-layout-full .gh-article-main {
    max-width: 1020px; /* 720px + 300px sidebar space */
}

/* Shared Sidebar Card Styles */
.gh-sidebar-card {
    padding: 1.5rem;
    background: #F9FAFB;
    border: 1px solid var(--dp-border-light);
    border-radius: var(--dp-radius-lg);
}

html.dark-mode .gh-sidebar-card {
    background: rgba(226, 240, 240, 0.05);
    border-color: var(--dp-border-dark);
}

.gh-sidebar-title {
    margin: 0 0 1rem;
    font-size: var(--dp-font-h3);
    font-weight: var(--dp-weight-semibold);
    color: var(--dp-deep-slate);
}

html.dark-mode .gh-sidebar-title {
    color: var(--dp-cloud-mist);
}

.gh-sidebar-desc {
    margin: 0 0 1rem;
    font-size: var(--dp-font-small);
    line-height: 1.5;
    color: var(--dp-text-secondary);
}

/* Sidebar Search */
.gh-sidebar-search {
    margin-bottom: 0.5rem;
}

.gh-sidebar-search-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: #F9FAFB;
    border: 1px solid var(--dp-border-light);
    border-radius: var(--dp-radius-lg);
    color: var(--dp-text-secondary);
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-body);
    cursor: pointer;
    transition: all var(--dp-transition-normal);
}

.gh-sidebar-search-btn:hover {
    background: #fff;
    border-color: var(--dp-deep-slate);
    color: var(--dp-deep-slate);
}

.gh-sidebar-search-btn svg {
    flex-shrink: 0;
}

html.dark-mode .gh-sidebar-search-btn {
    background: rgba(226, 240, 240, 0.05);
    border-color: var(--dp-border-dark);
    color: var(--dp-text-secondary);
}

html.dark-mode .gh-sidebar-search-btn:hover {
    background: rgba(226, 240, 240, 0.1);
    border-color: var(--dp-cloud-mist);
    color: var(--dp-cloud-mist);
}

/* ==========================================================================
   Shared Form Components
   ========================================================================== */

/* Form Layout */
.gh-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gh-form--inline {
    flex-direction: row;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .gh-form--inline {
        flex-direction: column;
    }
}

/* Input Base Styles */
.gh-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem;
    font-size: var(--dp-font-body);
    font-family: var(--dp-font-sans);
    border: 1px solid var(--dp-border-light);
    border-radius: var(--dp-radius-sm);
    background: #fff;
    color: var(--dp-text-primary);
    transition: border-color var(--dp-transition-fast);
}

.gh-input:focus {
    outline: none;
    border-color: var(--dp-deep-slate);
}

.gh-input::placeholder {
    color: var(--dp-text-secondary);
}

/* Dark mode inputs */
html.dark-mode .gh-input {
    background: rgba(226, 240, 240, 0.1);
    border-color: var(--dp-border-dark);
    color: var(--dp-cloud-mist);
}

html.dark-mode .gh-input:focus {
    border-color: var(--dp-cloud-mist);
}

html.dark-mode .gh-input::placeholder {
    color: var(--dp-ocean-steel-light);
}

/* Button Base Styles */
.gh-btn {
    height: 42px;
    padding: 0 1.5rem;
    font-size: var(--dp-font-body);
    font-family: var(--dp-font-sans);
    font-weight: var(--dp-weight-medium);
    border: none;
    border-radius: var(--dp-radius-sm);
    cursor: pointer;
    transition: background var(--dp-transition-fast);
    white-space: nowrap;
}

.gh-btn-primary {
    background: var(--dp-accent);
    color: #fff;
}

.gh-btn-primary:hover {
    background: #e88a2d;
}

/* Inverted form (dark background in light mode, light in dark mode) */
.gh-form--inverted .gh-input {
    background: rgba(226, 240, 240, 0.1);
    border-color: rgba(226, 240, 240, 0.3);
    color: var(--dp-cloud-mist);
}

.gh-form--inverted .gh-input:focus {
    border-color: var(--dp-accent);
}

.gh-form--inverted .gh-input::placeholder {
    color: var(--dp-ocean-steel-light);
}

html.dark-mode .gh-form--inverted .gh-input {
    background: rgba(54, 86, 95, 0.1);
    border-color: rgba(54, 86, 95, 0.3);
    color: var(--dp-deep-slate);
}

html.dark-mode .gh-form--inverted .gh-input::placeholder {
    color: var(--dp-ocean-steel);
}

/* Sidebar Social Links */
.gh-sidebar-social-links {
    display: flex;
    gap: 1rem;
}

.gh-sidebar-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--dp-deep-slate);
    border-radius: var(--dp-radius-sm);
    transition: all var(--dp-transition-fast);
}

.gh-sidebar-social-links a:hover {
    color: var(--dp-accent);
    background: rgba(255, 153, 50, 0.1);
}

html.dark-mode .gh-sidebar-social-links a {
    color: var(--dp-cloud-mist);
}

html.dark-mode .gh-sidebar-social-links a:hover {
    color: var(--dp-accent);
    background: rgba(255, 153, 50, 0.15);
}

.gh-article-main .gh-canvas {
    display: block;
}

.gh-article-main .gh-canvas > * {
    max-width: 100%;
}

.gh-content {
    margin-top: 0;
}

:is(.post-template, .page-template) .no-image .gh-content {
    margin-top: 7px;
}

/* Feature image spacing */
.gh-article-image {
    margin-top: 7px;
}

/* Rounded corners for images */
.gh-article-image img,
.gh-content img,
.kg-image-card img,
.kg-gallery-image img {
    border-radius: var(--dp-radius-lg);
}

/* Paragraph spacing */
.gh-content p + p {
    margin-top: 1.5em;
}

.gh-content p + ul,
.gh-content p + ol {
    margin-top: 0.5rem;
}

.gh-content ul,
.gh-content ol {
    margin-bottom: 1rem;
}

.gh-content li {
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

/* Tables */
.gh-content table:not(.gist table) {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse;
    border-radius: var(--dp-radius-lg);
    overflow: hidden;
    background: var(--dp-cloud-mist);
    border: 1px solid var(--dp-border-light);
}

.gh-content table:not(.gist table) th {
    background: var(--dp-deep-slate);
    color: var(--dp-cloud-mist);
    font-weight: var(--dp-weight-semibold);
    text-transform: uppercase;
    font-size: var(--dp-font-small);
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border: none;
}

.gh-content table:not(.gist table) td {
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid var(--dp-border-light);
    background: #fff;
    color: var(--dp-jet-black);
}

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

.gh-content table:not(.gist table) tbody tr:nth-child(even) td {
    background: var(--dp-cloud-mist);
}

/* Dark mode tables - reversed colors */
html.dark-mode .gh-content table:not(.gist table) {
    background: #1a2428;
    border-color: var(--dp-border-dark);
}

html.dark-mode .gh-content table:not(.gist table) th {
    background: var(--dp-cloud-mist);
    color: var(--dp-deep-slate);
}

html.dark-mode .gh-content table:not(.gist table) td {
    background: #1a2428;
    color: var(--dp-cloud-mist);
    border-bottom-color: var(--dp-border-dark);
}

html.dark-mode .gh-content table:not(.gist table) tbody tr:nth-child(even) td {
    background: #243035;
}

/* ==========================================================================
   Sidebar TOC (Table of Contents)
   Uses: .gh-sidebar-card, .gh-sidebar-title
   ========================================================================== */

.gh-sidebar-toc .gh-sidebar-title {
    margin-bottom: 0;
}

.gh-sidebar-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.gh-sidebar-toc-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--dp-text-secondary);
    border-radius: var(--dp-radius-sm);
    transition: all var(--dp-transition-fast);
}

.gh-sidebar-toc-top:hover {
    color: var(--dp-accent);
    background: rgba(255, 153, 50, 0.1);
    transform: translateY(-2px);
}

html.dark-mode .gh-sidebar-toc-top:hover {
    background: rgba(255, 153, 50, 0.15);
}

.toc-link {
    display: block;
    color: var(--dp-text-secondary);
    font-size: var(--dp-font-nav) !important;
    line-height: 1.5;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color var(--dp-transition-fast);
}

.toc-link:hover,
.is-active-link {
    color: var(--dp-headline);
}

html.dark-mode .toc-link:hover,
html.dark-mode .is-active-link {
    color: var(--dp-cloud-mist);
}

/* ==========================================================================
   Sidebar Related Posts
   Uses: .gh-sidebar-card, .gh-sidebar-title
   ========================================================================== */

.gh-sidebar-related-post {
    margin-bottom: 1.25rem;
}

.gh-sidebar-related-post:last-child {
    margin-bottom: 0;
}

.gh-sidebar-related-link {
    display: block;
    text-decoration: none;
}

.gh-sidebar-related-post-title {
    font-size: var(--dp-font-nav);
    font-weight: var(--dp-weight-medium);
    line-height: 1.4;
    color: var(--dp-headline);
    margin: 0 0 0.25rem;
    transition: color var(--dp-transition-fast);
}

.gh-sidebar-related-link:hover .gh-sidebar-related-post-title {
    color: var(--dp-accent);
}

.gh-sidebar-related-date {
    font-size: var(--dp-font-small);
    color: var(--dp-text-secondary);
}

/* ==========================================================================
   Related Posts Grid (3-column layout for wide template)
   ========================================================================== */

.gh-related-grid {
    max-width: 100%;
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--dp-border-light);
}

html.dark-mode .gh-related-grid {
    border-top-color: var(--dp-border-dark);
}

.gh-related-grid-title {
    font-size: var(--dp-font-h4);
    font-weight: var(--dp-weight-semibold);
    margin: 0 0 1.5rem;
    color: var(--dp-headline);
}

html.dark-mode .gh-related-grid-title {
    color: var(--dp-cloud-mist);
}

.gh-related-grid-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.gh-related-grid-link {
    display: block;
    text-decoration: none;
}

.gh-related-grid-post-title {
    font-size: var(--dp-font-body);
    font-weight: var(--dp-weight-medium);
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: var(--dp-headline);
    transition: color var(--dp-transition-fast);
}

html.dark-mode .gh-related-grid-post-title {
    color: var(--dp-cloud-mist);
}

.gh-related-grid-link:hover .gh-related-grid-post-title {
    color: var(--dp-accent);
}

.gh-related-grid-date {
    font-size: var(--dp-font-small);
    color: var(--dp-text-secondary);
}

@media (max-width: 768px) {
    .gh-related-grid-posts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    appearance: none;
    border: none;
}

.progress-bar::-webkit-progress-bar {
    background: transparent;
}

.progress-bar::-webkit-progress-value {
    background: var(--dp-accent);
}

.progress-bar::-moz-progress-bar {
    background: var(--dp-accent);
}

/* ==========================================================================
   Typographic Feed
   ========================================================================== */

.has-typographic-feed .gh-feed {
    display: flex;
    flex-direction: column;
    max-width: 720px;
    margin: 0 auto;
}

.has-typographic-feed .gh-card {
    padding: 2rem 0;
}

/* Homepage: remove large top margin and padding on cards to align with sidebar */
.home-template.has-typographic-feed .gh-card {
    margin-top: 0;
    padding: 0;
}

/* Align card content to top (base theme uses justify-content: center) */
.home-template.has-typographic-feed .gh-card-wrapper {
    justify-content: flex-start;
}

.home-template.has-typographic-feed .gh-card + .gh-card {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--dp-border-light);
}

html.dark-mode .home-template.has-typographic-feed .gh-card + .gh-card {
    border-top-color: var(--dp-border-dark);
}

.has-typographic-feed .gh-card-link {
    display: block;
    text-decoration: none;
}

.has-typographic-feed .gh-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.01rem 0;
    font-size: var(--dp-font-small);
}

.has-typographic-feed .gh-card-date {
    color: var(--dp-text-secondary);
}

.has-typographic-feed .gh-card-tag {
    color: var(--dp-accent);
    text-transform: uppercase;
    font-size: var(--dp-font-small);
    letter-spacing: 0.05em;
    font-weight: var(--dp-weight-medium);
}

/* Card title uses H2 size */
.has-typographic-feed .gh-card-title {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-h1);
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-weight: var(--dp-weight-semibold);
    text-transform: none;
    margin: 0 0 0.5rem;
    color: var(--dp-headline);
    transition: color 0.2s ease;
}

.has-typographic-feed .gh-card-link:hover .gh-card-title {
    color: var(--dp-link-hover);
}

/* Card excerpt uses body size */
.has-typographic-feed .gh-card-excerpt {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-base);
    line-height: var(--dp-line-height);
    color: var(--dp-text);
    margin: 0;
    flex: 1;
}

/* Typographic feed: content area with excerpt + thumbnail */
.has-typographic-feed .gh-card-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.has-typographic-feed .gh-card-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    margin: 0;
    border-radius: var(--dp-radius-sm);
    overflow: hidden;
}

.has-typographic-feed .gh-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Archive Page
   ========================================================================== */

.gh-archive-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(2rem, 1.5rem + 1.5vw, 4rem) 4vw;
}

.gh-archive-header {
    margin-bottom: 3rem;
}

.gh-archive-title {
    margin-bottom: 0.5rem;
}

.gh-archive-description {
    color: var(--dp-text-secondary);
}

/* Year label - shown by default */
.gh-archive-year-label {
    margin-bottom: 1rem;
    padding-top: 2rem;
}

/* First year label - no top padding */
.gh-archive-post:first-child .gh-archive-year-label {
    padding-top: 0;
}

/* Hide year label when previous post has same year (CSS sibling selectors) */
.post-year-2020 + .post-year-2020 .gh-archive-year-label,
.post-year-2021 + .post-year-2021 .gh-archive-year-label,
.post-year-2022 + .post-year-2022 .gh-archive-year-label,
.post-year-2023 + .post-year-2023 .gh-archive-year-label,
.post-year-2024 + .post-year-2024 .gh-archive-year-label,
.post-year-2025 + .post-year-2025 .gh-archive-year-label,
.post-year-2026 + .post-year-2026 .gh-archive-year-label,
.post-year-2027 + .post-year-2027 .gh-archive-year-label,
.post-year-2028 + .post-year-2028 .gh-archive-year-label,
.post-year-2029 + .post-year-2029 .gh-archive-year-label,
.post-year-2030 + .post-year-2030 .gh-archive-year-label {
    display: none;
}

.gh-archive-item {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.gh-archive-date {
    flex-shrink: 0;
    width: 60px;
    color: var(--dp-ocean-steel);
    text-transform: uppercase;
}

.gh-archive-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gh-archive-link:hover {
    color: var(--dp-accent);
}

.gh-archive-title-text {
    flex: 1;
}

.gh-archive-access {
    color: var(--dp-accent);
    display: flex;
    align-items: center;
}

.gh-archive-reading-time {
    flex-shrink: 0;
    color: var(--dp-ocean-steel);
}

/* Dark mode archive */
html.dark-mode .gh-archive-date,
html.dark-mode .gh-archive-reading-time {
    color: var(--dp-ocean-steel-light);
}

/* ==========================================================================
   Callout Cards (Ghost built-in)
   ========================================================================== */

.kg-callout-card {
    display: flex;
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-md);
    margin: 1.5em 0;
}

.kg-callout-card-emoji {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-right: 1rem;
}

.kg-callout-text {
    line-height: 1.6;
}

.kg-callout-text strong {
    font-weight: var(--dp-weight-semibold);
}

/* Blue - Info (default) */
.kg-callout-card-blue {
    background: #EBF5FF;
    border-left: 4px solid #3B82F6;
}

.kg-callout-card-blue .kg-callout-text strong {
    color: #1E40AF;
}

/* Green - Success */
.kg-callout-card-green {
    background: #ECFDF5;
    border-left: 4px solid #10B981;
}

.kg-callout-card-green .kg-callout-text strong {
    color: #065F46;
}

/* Yellow - Warning */
.kg-callout-card-yellow {
    background: #FFFBEB;
    border-left: 4px solid #F59E0B;
}

.kg-callout-card-yellow .kg-callout-text strong {
    color: #92400E;
}

/* Red - Error/Danger */
.kg-callout-card-red {
    background: #FEF2F2;
    border-left: 4px solid #EF4444;
}

.kg-callout-card-red .kg-callout-text strong {
    color: #991B1B;
}

/* Grey - Neutral */
.kg-callout-card-grey {
    background: var(--dp-cloud-mist);
    border-left: 4px solid var(--dp-ocean-steel);
}

.kg-callout-card-grey .kg-callout-text strong {
    color: var(--dp-deep-slate);
}

/* White - Clean */
.kg-callout-card-white {
    background: #fff;
    border: 1px solid var(--dp-border-light);
    border-left: 4px solid var(--dp-deep-slate);
}

/* Pink - Accent */
.kg-callout-card-pink {
    background: #FDF2F8;
    border-left: 4px solid #EC4899;
}

.kg-callout-card-pink .kg-callout-text strong {
    color: #9D174D;
}

/* Purple */
.kg-callout-card-purple {
    background: #F5F3FF;
    border-left: 4px solid #8B5CF6;
}

.kg-callout-card-purple .kg-callout-text strong {
    color: #5B21B6;
}

/* Accent color (Deep Saffron) */
.kg-callout-card-accent {
    background: #FFF7ED;
    border-left: 4px solid var(--dp-accent);
}

.kg-callout-card-accent .kg-callout-text strong {
    color: #9A3412;
}

/* Dark mode callouts */
html.dark-mode .kg-callout-card-blue {
    background: rgba(59, 130, 246, 0.15);
}

html.dark-mode .kg-callout-card-blue .kg-callout-text strong {
    color: #93C5FD;
}

html.dark-mode .kg-callout-card-green {
    background: rgba(16, 185, 129, 0.15);
}

html.dark-mode .kg-callout-card-green .kg-callout-text strong {
    color: #6EE7B7;
}

html.dark-mode .kg-callout-card-yellow {
    background: rgba(245, 158, 11, 0.15);
}

html.dark-mode .kg-callout-card-yellow .kg-callout-text strong {
    color: #FCD34D;
}

html.dark-mode .kg-callout-card-red {
    background: rgba(239, 68, 68, 0.15);
}

html.dark-mode .kg-callout-card-red .kg-callout-text strong {
    color: #FCA5A5;
}

html.dark-mode .kg-callout-card-grey {
    background: rgba(95, 129, 144, 0.2);
}

html.dark-mode .kg-callout-card-white {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--dp-border-dark);
}

html.dark-mode .kg-callout-card-pink {
    background: rgba(236, 72, 153, 0.15);
}

html.dark-mode .kg-callout-card-pink .kg-callout-text strong {
    color: #F9A8D4;
}

html.dark-mode .kg-callout-card-purple {
    background: rgba(139, 92, 246, 0.15);
}

html.dark-mode .kg-callout-card-purple .kg-callout-text strong {
    color: #C4B5FD;
}

html.dark-mode .kg-callout-card-accent {
    background: rgba(255, 153, 50, 0.15);
}

html.dark-mode .kg-callout-card-accent .kg-callout-text strong {
    color: #FDBA74;
}

/* ==========================================================================
   Newsletter Section Styles (Smashing-inspired)
   ========================================================================== */

/* Section numbering for newsletter/structured content */
.gh-content h2::before,
.gh-content h3.numbered::before {
    content: none; /* Default: no numbers */
}

/* Add .numbered-sections class to enable section numbers */
.numbered-sections .gh-content h2 {
    counter-increment: section;
}

.numbered-sections .gh-content h2::before {
    content: counter(section) ". ";
    color: var(--dp-deep-slate);
    font-weight: 700;
}

.numbered-sections {
    counter-reset: section;
}

/* Newsletter-specific sans-serif option */
.newsletter-format .gh-content {
    font-family: var(--dp-font-sans);
    font-size: var(--dp-font-base);
    line-height: var(--dp-line-height);
}

.newsletter-format .gh-content h1,
.newsletter-format .gh-content h2,
.newsletter-format .gh-content h3 {
    font-family: var(--dp-font-sans);
}

/* Section dividers for newsletters */
.gh-content hr {
    border: none;
    border-top: 1px solid var(--dp-border-light);
    margin: 3rem 0;
}

/* ==========================================================================
   Compliance & Info Callout Styles (DocuPoint-specific)
   ========================================================================== */

/* Compliance Warning Box */
.compliance-warning,
.kg-callout-card[data-callout-type="warning"] {
    background: #FEF2F2;
    border-left: 4px solid var(--dp-warning);
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-md);
    margin: 1.5em 0;
}

.compliance-warning strong {
    color: #991B1B;
}

/* Info/Tip Box */
.info-box,
.kg-callout-card[data-callout-type="info"] {
    background: #EBF5FF;
    border-left: 4px solid var(--dp-info);
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-md);
    margin: 1.5em 0;
}

.info-box strong {
    color: #1E40AF;
}

/* Success/Compliance Check Box */
.success-box,
.kg-callout-card[data-callout-type="success"] {
    background: #ECFDF5;
    border-left: 4px solid var(--dp-success);
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-md);
    margin: 1.5em 0;
}

.success-box strong {
    color: #065F46;
}

/* European/EU-specific Box */
.eu-box,
.kg-callout-card[data-callout-type="eu"] {
    background: #EFF6FF;
    border-left: 4px solid var(--dp-european-blue);
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-md);
    margin: 1.5em 0;
}

.eu-box strong {
    color: #1E3A8A;
}

/* ==========================================================================
   Code Cards (Ghost built-in with Prism)
   ========================================================================== */

.kg-code-card {
    position: relative;
    margin: 1.5em 0;
}

/* All pre/code blocks get rounded corners */
.gh-content pre,
.kg-code-card pre,
pre[class*="language-"] {
    margin: 0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--dp-radius-lg) !important;
    background: #1d1f21 !important;
    overflow-x: auto;
    font-family: var(--dp-font-mono);
    font-size: var(--dp-font-code);
    line-height: var(--dp-line-height);
}

.kg-code-card pre code {
    background: transparent !important;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: #c5c8c6;
}

/* Prism toolbar (Copy button) */
.kg-code-card div.code-toolbar > .toolbar {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kg-code-card:hover div.code-toolbar > .toolbar {
    opacity: 1;
}

.kg-code-card div.code-toolbar > .toolbar .toolbar-item {
    display: inline-block;
}

.kg-code-card div.code-toolbar > .toolbar button,
.kg-code-card div.code-toolbar > .toolbar span {
    background: rgba(255, 255, 255, 0.1);
    color: #9CA3AF;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kg-code-card div.code-toolbar > .toolbar button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Code card caption */
.kg-code-card figcaption {
    margin-top: 0.75rem;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

/* Inline code */
.gh-content code:not(pre code) {
    background: rgba(54, 86, 95, 0.1);
    color: var(--dp-deep-slate);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--dp-font-code);
}

html.dark-mode .gh-content code:not(pre code) {
    background: rgba(226, 240, 240, 0.1);
    color: var(--dp-cloud-mist);
}

/* Prism Tomorrow theme adjustments */
pre[class*="language-"] {
    background: #1d1f21 !important;
}

code[class*="language-"],
pre[class*="language-"] {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ==========================================================================
   File Cards (Ghost built-in)
   ========================================================================== */

.kg-file-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
    margin: 1.5em 0;
    transition: box-shadow 0.2s ease;
}

.kg-file-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.kg-file-card-container {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
}

.kg-file-card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.kg-file-card-contents {
    flex: 1;
    min-width: 0;
}

.kg-file-card-title {
    font-weight: 600;
    color: var(--dp-headline);
    margin: 0;
}

.kg-file-card-metadata {
    display: flex;
    gap: 0.5rem;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

html.dark-mode .kg-file-card {
    background: transparent;
    border: 1px solid var(--dp-border-dark);
    box-shadow: none;
}

html.dark-mode .kg-file-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Image Cards (Ghost built-in)
   ========================================================================== */

.kg-image-card {
    margin: 2em 0;
}

.kg-image-card img {
    border-radius: 12px;
}

.kg-image-card figcaption {
    text-align: center;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* ==========================================================================
   Gallery Cards (Ghost built-in)
   ========================================================================== */

.kg-gallery-card {
    margin: 2em 0;
}

.kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kg-gallery-image img {
    border-radius: 12px;
}

.kg-gallery-card figcaption {
    text-align: center;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* ==========================================================================
   Toggle Cards (Ghost built-in)
   ========================================================================== */

.kg-toggle-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin: 1.5em 0;
    overflow: hidden;
}

.kg-toggle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.kg-toggle-heading:hover {
    background: rgba(0, 0, 0, 0.02);
}

.kg-toggle-heading-text {
    font-weight: 600;
    color: var(--dp-headline);
    margin: 0;
}

.kg-toggle-card-icon {
    width: 20px;
    height: 20px;
    color: var(--dp-text-secondary);
    transition: transform 0.2s ease;
}

.kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon {
    transform: rotate(180deg);
}

.kg-toggle-content {
    padding: 0 1.25rem 1rem;
    color: var(--dp-text);
}

html.dark-mode .kg-toggle-card {
    background: transparent;
    border: 1px solid var(--dp-border-dark);
    box-shadow: none;
}

html.dark-mode .kg-toggle-heading:hover {
    background: rgba(255, 255, 255, 0.03);
}

html.dark-mode .kg-toggle-card[data-kg-toggle-state="open"] {
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   Bookmark Cards (Ghost built-in)
   ========================================================================== */

.kg-bookmark-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin: 1.5em 0;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.kg-bookmark-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

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

.kg-bookmark-content {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kg-bookmark-title {
    font-weight: 600;
    color: var(--dp-headline);
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.kg-bookmark-description {
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--dp-text-secondary);
}

.kg-bookmark-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.kg-bookmark-author {
    font-weight: 500;
}

.kg-bookmark-publisher {
    color: var(--dp-text-secondary);
}

.kg-bookmark-thumbnail {
    flex-shrink: 0;
    width: 200px;
    min-height: 160px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 12px 12px 0;
}

html.dark-mode .kg-bookmark-card {
    background: transparent;
    border: 1px solid var(--dp-border-dark);
    box-shadow: none;
}

html.dark-mode .kg-bookmark-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Responsive bookmark */
@media (max-width: 600px) {
    .kg-bookmark-container {
        flex-direction: column-reverse;
    }

    .kg-bookmark-thumbnail {
        width: 100%;
        min-height: 180px;
    }

    .kg-bookmark-thumbnail img {
        border-radius: 12px 12px 0 0;
    }
}

/* ==========================================================================
   Video & Audio Cards (Embeds)
   ========================================================================== */

.kg-video-card {
    margin: 2em 0;
    border-radius: 12px;
    overflow: hidden;
}

.kg-video-card video {
    border-radius: 12px;
}

.kg-audio-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin: 1.5em 0;
    overflow: hidden;
}

.kg-audio-thumbnail {
    border-radius: 12px;
}

html.dark-mode .kg-audio-card {
    background: transparent;
    border: 1px solid var(--dp-border-dark);
    box-shadow: none;
}

/* Embed cards (YouTube, Vimeo, etc.) */
.kg-embed-card {
    margin: 2em 0;
    border-radius: 12px;
    overflow: hidden;
}

.kg-embed-card iframe {
    border-radius: 12px;
}

.kg-embed-card figcaption {
    text-align: center;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* ==========================================================================
   Tagline
   ========================================================================== */

.gh-tagline {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--dp-border-light);
}

.gh-tagline-text {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--dp-text-secondary);
    font-style: italic;
}

html.dark-mode .gh-tagline {
    border-bottom-color: var(--dp-border-dark);
}

/* ==========================================================================
   Subscribe CTA
   ========================================================================== */

.gh-subscribe-cta {
    max-width: 100%;
    margin: 3em 0;
    padding: 1.8rem 1.8rem;
    background: var(--dp-deep-slate);
    border-radius: 8px;
}

.gh-subscribe-content {
    margin-bottom: 0.75rem;
}

.gh-subscribe-title {
    margin: 0 0 0.25rem;
    color: var(--dp-cloud-mist);
}

.gh-subscribe-description {
    color: var(--dp-ocean-steel-light);
    margin: 0;
}

html.dark-mode .gh-subscribe-cta {
    background: var(--dp-cloud-mist);
}

html.dark-mode .gh-subscribe-title {
    color: var(--dp-deep-slate);
}

html.dark-mode .gh-subscribe-description {
    color: var(--dp-ocean-steel);
}

/* ==========================================================================
   Post Navigation (Previous/Next)
   ========================================================================== */

.gh-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--dp-border-light);
}

html.dark-mode .gh-article-footer {
    border-top-color: var(--dp-border-dark);
}

.gh-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.gh-navigation-link {
    font-size: var(--dp-font-tiny);
    color: var(--dp-text-secondary);
    text-decoration: none;
    transition: color var(--dp-transition-fast);
}

.gh-navigation-link:hover {
    color: var(--dp-accent);
}

.gh-navigation-next {
    text-align: right;
}

@media (max-width: 600px) {
    .gh-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .gh-navigation-next {
        text-align: left;
    }
}

/* ==========================================================================
   Comments
   ========================================================================== */

.gh-comments {
    max-width: 100%;
    margin: 3em 0;
    padding-top: 2em;
    border-top: 1px solid var(--dp-border-light);
    color: #000; /* Tells Ghost comments to use light mode */
}

html.dark-mode .gh-comments {
    border-top-color: var(--dp-border-dark);
    color: #fff; /* Tells Ghost comments to use dark mode */
}

/* ==========================================================================
   Mobile Responsive Typography
   Override CSS variables for smaller screens
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --dp-font-base: 17px;
        --dp-font-h1: 2rem;
        --dp-font-h2: 1.5rem;
        --dp-font-h3: 1.25rem;
        --dp-font-h4: 1.125rem;
        --dp-font-h5: 1rem;
    }

    h2, .gh-content h2 {
        margin-top: 2rem;
    }
}

/* ==========================================================================
   Timeline Component (for HTML cards/snippets)
   Vertical dashed line with cards on the right, dates on the left
   ========================================================================== */

.dp-timeline {
    position: relative;
    margin: 2rem 0;
    padding: 40px 0 20px 0;
}

/* Vertical dashed line - positioned left */
.dp-timeline::before {
    content: '';
    position: absolute;
    left: 100px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: repeating-linear-gradient(
        to bottom,
        var(--dp-ocean-steel) 0,
        var(--dp-ocean-steel) 8px,
        transparent 8px,
        transparent 16px
    );
    opacity: 0.5;
}

html.dark-mode .dp-timeline::before {
    background: repeating-linear-gradient(
        to bottom,
        var(--dp-ocean-steel-light) 0,
        var(--dp-ocean-steel-light) 8px,
        transparent 8px,
        transparent 16px
    );
    opacity: 0.4;
}

/* Timeline item */
.dp-timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    margin-left: 100px;
    padding-left: 60px;
}

.dp-timeline-item:last-child {
    margin-bottom: 0;
}

/* Dot on timeline - vertically centered on card */
.dp-timeline-dot {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--dp-accent);
    border: 4px solid var(--dp-white);
    box-shadow: 0 0 0 2px var(--dp-accent);
    z-index: 2;
}

html.dark-mode .dp-timeline-dot {
    border-color: #1a1a1a;
}

/* Date label - left of the dot */
.dp-timeline-date {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 20px;
    font-size: var(--dp-font-tiny);
    font-weight: var(--dp-weight-semibold);
    color: var(--dp-ocean-steel);
    white-space: nowrap;
}

html.dark-mode .dp-timeline-date {
    color: var(--dp-ocean-steel-light);
}

/* Card */
.dp-timeline-card {
    background: #fff;
    border-radius: var(--dp-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(54, 86, 95, 0.08);
    transition: all 0.3s ease;
    max-width: 500px;
    width: 100%;
    text-decoration: none;
    display: block;
    color: inherit;
}

html.dark-mode .dp-timeline-card {
    background: rgba(226, 240, 240, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

a.dp-timeline-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(54, 86, 95, 0.15);
}

html.dark-mode a.dp-timeline-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

div.dp-timeline-card:hover {
    box-shadow: 0 4px 12px rgba(54, 86, 95, 0.1);
}

/* Featured/highlighted card */
.dp-timeline-card.featured {
    border: 2px solid var(--dp-accent);
}

/* Card image */
.dp-timeline-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--dp-radius-sm);
    margin-bottom: 1rem;
}

/* Card title */
.dp-timeline-title {
    font-size: var(--dp-font-h5);
    font-weight: var(--dp-weight-semibold);
    color: var(--dp-deep-slate);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

html.dark-mode .dp-timeline-title {
    color: var(--dp-cloud-mist);
}

/* Card description */
.dp-timeline-desc {
    font-size: var(--dp-font-small);
    color: var(--dp-ocean-steel);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.dp-timeline-desc:last-child {
    margin-bottom: 0;
}

html.dark-mode .dp-timeline-desc {
    color: var(--dp-ocean-steel-light);
}

/* Card footer with status */
.dp-timeline-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--dp-font-tiny);
}

/* Status badges */
.dp-timeline-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: var(--dp-weight-medium);
}

.dp-timeline-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dp-timeline-status.completed {
    color: #2D8659;
}
.dp-timeline-status.completed::before {
    background: #2D8659;
}

.dp-timeline-status.in-progress {
    color: var(--dp-accent);
}
.dp-timeline-status.in-progress::before {
    background: var(--dp-accent);
}

.dp-timeline-status.planned {
    color: var(--dp-ocean-steel);
}
.dp-timeline-status.planned::before {
    background: var(--dp-ocean-steel);
}

html.dark-mode .dp-timeline-status.completed {
    color: #6ee7b7;
}
html.dark-mode .dp-timeline-status.completed::before {
    background: #6ee7b7;
}
html.dark-mode .dp-timeline-status.planned {
    color: var(--dp-ocean-steel-light);
}
html.dark-mode .dp-timeline-status.planned::before {
    background: var(--dp-ocean-steel-light);
}

/* Mobile responsive - shift line to left edge */
@media (max-width: 768px) {
    .dp-timeline::before {
        left: 20px;
    }

    .dp-timeline-item {
        margin-left: 20px;
        padding-left: 40px;
    }

    .dp-timeline-date {
        position: static;
        margin-right: 0;
        margin-bottom: 0.5rem;
        transform: none;
    }

    .dp-timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .dp-timeline-dot {
        top: 30px;
        transform: translate(-50%, 0);
    }

    .dp-timeline-card {
        max-width: 100%;
    }
}
