/* ============================================
   BLOG STYLES
   Extends the main site aesthetic
   ============================================ */

/* Blog Index */
.blog-index {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    position: relative;
    z-index: 1;
}

.blog-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--text-dim);
}

.blog-header h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 8px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.blog-header p {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-dim);
}

.blog-back {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-dim);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

.blog-back:hover {
    color: var(--accent-cyan);
}

/* Post cards on index */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.blog-post-card {
    display: flex;
    gap: 24px;
    align-items: stretch;
    background-color: var(--bg-primary);
    background-image: linear-gradient(rgba(10, 10, 20, 0.5), rgba(10, 10, 20, 0.5));
    border: 1px solid rgba(58, 61, 74, 0.3);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s ease;
}

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

.post-card-image {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    object-fit: cover;
    border: 1px solid rgba(58, 61, 74, 0.4);
    align-self: flex-start;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    background: var(--bg-primary);
}

.blog-post-card:hover .post-card-image {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
}

.post-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 700px) {
    .blog-post-card {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    .post-card-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

.post-card-date {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card-excerpt {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.post-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.post-card-tag {
    font-size: 8px;
    letter-spacing: 2px;
    padding: 2px 8px;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
}

.post-card-read {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--accent-cyan);
    margin-top: 12px;
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-post-card:hover .post-card-read {
    opacity: 1;
}

/* Article page */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    position: relative;
    z-index: 1;
}

.article-meta {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(58, 61, 74, 0.3);
}

.article-meta .post-card-date {
    margin-bottom: 12px;
}

.article-container h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-subtitle {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-tags {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Article body */
.article-body {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-primary);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body h2 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    margin-top: 40px;
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--accent-cyan);
}

.article-body h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

.article-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 2px solid var(--accent-violet);
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-secondary);
    font-style: italic;
}

.article-body ul, .article-body ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.article-body li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body a {
    color: var(--accent-cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    transition: border-color 0.3s ease;
}

.article-body a:hover {
    border-color: var(--accent-cyan);
}

.article-body .highlight-box {
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 20px;
    margin: 24px 0;
    font-size: 13px;
}

/* Article footer */
.article-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(58, 61, 74, 0.3);
}

.article-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.article-cta a {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    padding: 8px 16px;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-cta a:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.article-cta a.primary {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.related-posts {
    margin-top: 32px;
}

.related-posts h3 {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.related-posts a {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1px solid rgba(58, 61, 74, 0.15);
    transition: color 0.3s ease;
}

.related-posts a:hover {
    color: var(--accent-cyan);
}

/* Blog footer */
.blog-footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
}

.blog-footer a {
    font-size: 8px;
    letter-spacing: 3px;
    color: var(--text-dim);
    text-decoration: none;
    opacity: 0.4;
}

.blog-footer a:hover {
    opacity: 0.8;
    color: var(--accent-cyan);
}

/* ============================================
   AD UNITS
   ============================================ */
.ad-unit {
    margin: 24px 0;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(58, 61, 74, 0.15);
    border-bottom: 1px solid rgba(58, 61, 74, 0.15);
    padding: 12px 0;
    position: relative;
}

.ad-unit::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: -8px;
    left: 0;
    font-family: var(--font-mono);
    font-size: 7px;
    letter-spacing: 3px;
    color: var(--text-dim);
    opacity: 0.4;
    background: var(--bg-primary);
    padding: 0 6px;
}

.ad-unit-top {
    margin-top: 0;
    margin-bottom: 32px;
}

.ad-unit-bottom {
    margin-top: 32px;
    margin-bottom: 0;
}

/* Reading time indicator */
.reading-time {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-top: 8px;
}

@media (max-width: 900px) {
    .blog-index,
    .article-container {
        padding: 60px 20px 40px;
    }

    .article-body {
        font-size: 13px;
    }

    .article-body h2 {
        font-size: 13px;
        letter-spacing: 3px;
    }
}

@media (max-width: 600px) {
    .blog-index,
    .article-container {
        padding: 48px 16px 32px;
    }

    .article-container h1 {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .blog-header h1 {
        font-size: 16px;
        letter-spacing: 3px;
    }

    .article-body {
        font-size: 13px;
        line-height: 1.8;
    }

    .article-body h2 {
        font-size: 12px;
        letter-spacing: 2px;
        margin-top: 28px;
    }

    .post-card-title {
        font-size: 13px;
    }

    .post-card-excerpt {
        font-size: 11px;
    }

    .article-cta {
        flex-direction: column;
    }

    .article-cta a {
        text-align: center;
    }

    /* Inputs — prevent iOS zoom */
    input, textarea, select {
        font-size: 16px;
    }

    /* Ad units compact */
    .ad-unit {
        margin: 16px 0;
    }

    .ad-unit-top {
        margin-bottom: 20px;
    }
}

@media (max-width: 380px) {
    .article-container h1 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .blog-header h1 {
        font-size: 14px;
    }
}

/* ============================================
   SCHOLARLY ARTICLE COMPONENTS
   Review articles, meta-analyses, annotated
   chronologies, methodology papers
   ============================================ */

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    padding: 14px 0;
    margin: 18px 0 24px;
    border-top: 1px solid rgba(58, 61, 74, 0.4);
    border-bottom: 1px solid rgba(58, 61, 74, 0.4);
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    color: #6b7080;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta-item strong {
    color: #c8ccd4;
    font-weight: normal;
    letter-spacing: 2px;
}

.article-meta-item .meta-label {
    font-size: 8px;
    color: #3a3d4a;
    letter-spacing: 2px;
}

.article-byline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: #6b7080;
    margin-bottom: 6px;
}

.article-byline .author-name {
    color: #00f0ff;
    letter-spacing: 2px;
}

.article-byline .author-affiliation {
    color: #3a3d4a;
    font-size: 9px;
    display: block;
    margin-top: 2px;
}

/* Article type badge */
.article-type-badge {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    letter-spacing: 3px;
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 3px 10px;
    margin-bottom: 8px;
}

/* TL;DR / Abstract box */
.article-abstract {
    border: 1px solid rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.02);
    padding: 20px 24px;
    margin: 24px 0 32px;
}

.article-abstract-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 4px;
    color: #00f0ff;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-abstract-label .abstract-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    color: #3a3d4a;
    letter-spacing: 2px;
}

.article-abstract-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #c8ccd4;
}

.article-abstract-body p {
    margin-bottom: 12px;
}

.article-abstract-body p:last-child {
    margin-bottom: 0;
}

.article-abstract-findings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
}

.article-abstract-findings-label {
    font-size: 8px;
    letter-spacing: 3px;
    color: #00f0ff;
    margin-bottom: 8px;
}

.article-abstract-findings ul {
    list-style: none;
    padding: 0;
}

.article-abstract-findings li {
    font-size: 11px;
    line-height: 1.6;
    color: #c8ccd4;
    padding: 4px 0 4px 16px;
    position: relative;
}

.article-abstract-findings li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #00f0ff;
}

/* Inline citations */
.cite {
    display: inline;
    font-size: 0.75em;
    color: #00f0ff;
    cursor: pointer;
    text-decoration: none;
    vertical-align: super;
    line-height: 0;
    padding: 0 1px;
    border-bottom: 1px dotted rgba(0, 240, 255, 0.4);
    transition: color 0.15s ease;
}

.cite:hover {
    color: #fff;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

.cite::before { content: '['; }
.cite::after { content: ']'; }

.cite-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 380px;
    padding: 12px 14px;
    background: #0a0a12;
    border: 1px solid rgba(0, 240, 255, 0.3);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    line-height: 1.6;
    color: #c8ccd4;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.cite-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.cite-tooltip-num {
    font-size: 8px;
    color: #00f0ff;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.cite-tooltip-author {
    color: #c8ccd4;
}

.cite-tooltip-title {
    color: #00f0ff;
    font-style: italic;
    display: block;
    margin: 3px 0;
}

.cite-tooltip-venue {
    color: #6b7080;
    display: block;
}

.cite-tooltip-link {
    display: inline-block;
    font-size: 9px;
    color: #00f0ff;
    text-decoration: none;
    margin-top: 6px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
}

.cite-tooltip-link:hover {
    color: #fff;
}

/* Confidence/evidence markers inline */
.evidence-marker {
    display: inline-block;
    font-size: 8px;
    letter-spacing: 2px;
    padding: 1px 5px;
    margin: 0 2px;
    vertical-align: middle;
    border: 1px solid;
}

.evidence-marker.verified { color: #00f0ff; border-color: rgba(0, 240, 255, 0.3); }
.evidence-marker.consensus { color: #8b5cf6; border-color: rgba(139, 92, 246, 0.3); }
.evidence-marker.contested { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.evidence-marker.projected { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* Sidebar boxes for methodology notes, caveats, key distinctions */
.article-sidebar {
    margin: 28px 0;
    padding: 18px 22px;
    border-left: 3px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.02);
}

.article-sidebar.note {
    border-left-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.02);
}

.article-sidebar.caveat {
    border-left-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.02);
}

.article-sidebar.methodology {
    border-left-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.02);
}

.article-sidebar-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    letter-spacing: 3px;
    color: #f59e0b;
    margin-bottom: 8px;
}

.article-sidebar.note .article-sidebar-label { color: #00f0ff; }
.article-sidebar.methodology .article-sidebar-label { color: #8b5cf6; }

.article-sidebar-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #c8ccd4;
}

/* References section */
.article-references {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px solid rgba(58, 61, 74, 0.6);
}

.article-references-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.article-references-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 4px;
    color: #00f0ff;
}

.article-cite-tools {
    display: flex;
    gap: 6px;
}

.cite-tool-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    letter-spacing: 2px;
    color: #6b7080;
    background: none;
    border: 1px solid rgba(58, 61, 74, 0.5);
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cite-tool-btn:hover {
    color: #00f0ff;
    border-color: #00f0ff;
}

.reference-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: ref;
}

.reference-list li {
    padding: 10px 0 10px 36px;
    border-bottom: 1px solid rgba(58, 61, 74, 0.2);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    line-height: 1.7;
    color: #6b7080;
    position: relative;
    counter-increment: ref;
}

.reference-list li::before {
    content: '[' counter(ref) ']';
    position: absolute;
    left: 0;
    top: 10px;
    color: #00f0ff;
    font-size: 9px;
    letter-spacing: 1px;
}

.reference-list li:target {
    background: rgba(0, 240, 255, 0.05);
    box-shadow: -3px 0 0 #00f0ff;
}

.ref-authors {
    color: #c8ccd4;
}

.ref-year {
    color: #6b7080;
}

.ref-title {
    color: #c8ccd4;
    font-style: italic;
    display: block;
    margin: 2px 0;
}

.ref-venue {
    color: #6b7080;
}

.ref-link {
    color: #00f0ff;
    text-decoration: none;
    letter-spacing: 1px;
    font-size: 9px;
    display: inline-block;
    margin-left: 4px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
}

.ref-link:hover {
    color: #fff;
}

.ref-type {
    display: inline-block;
    font-size: 7px;
    letter-spacing: 2px;
    color: #3a3d4a;
    border: 1px solid rgba(58, 61, 74, 0.4);
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Methodology disclosure at article end */
.article-methodology {
    margin-top: 36px;
    padding: 20px 24px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.02);
}

.article-methodology-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 4px;
    color: #8b5cf6;
    margin-bottom: 12px;
}

.article-methodology-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    line-height: 1.8;
    color: #c8ccd4;
}

/* Citation export modal */
.cite-export-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cite-export-modal.visible {
    display: flex;
}

.cite-export-content {
    max-width: 600px;
    width: 100%;
    background: #050508;
    border: 1px solid #00f0ff;
    padding: 24px;
}

.cite-export-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 4px;
    color: #00f0ff;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cite-export-close {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #6b7080;
    background: none;
    border: 1px solid #3a3d4a;
    padding: 4px 10px;
    cursor: pointer;
}

.cite-export-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.cite-export-tab {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: #6b7080;
    background: none;
    border: 1px solid rgba(58, 61, 74, 0.5);
    padding: 6px 14px;
    cursor: pointer;
}

.cite-export-tab.active {
    color: #00f0ff;
    border-color: #00f0ff;
}

.cite-export-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #c8ccd4;
    background: #0a0a12;
    padding: 16px;
    border: 1px solid rgba(58, 61, 74, 0.5);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

.cite-export-copy {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: #00f0ff;
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 6px 14px;
    cursor: pointer;
    margin-top: 10px;
}

.cite-export-copy:hover {
    background: rgba(0, 240, 255, 0.1);
}

/* Back-to-text links from references */
.ref-backlinks {
    display: inline-block;
    margin-left: 4px;
}

.ref-backlink {
    font-size: 8px;
    color: #6b7080;
    text-decoration: none;
    padding: 0 2px;
}

.ref-backlink:hover {
    color: #00f0ff;
}
