/* jenquist.com — Shared Blog Theme — Warm Dark (sepia night) */

:root {
    --bg-color: #19170f;
    --surface-color: #211f14;
    --text-color: #d4cdb8;
    --text-muted: #7a7060;
    --text-faint: #4a4535;
    --accent-color: #7eb3f5; /* overridden per-feed via <style> in base.html */
    --border-color: #2d2a1e;
    --border-hover: #3d3924;
    --code-bg: #1c1a11;
    --quote-border: #3d3924;
    --font-display: 'DM Serif Display', 'Georgia', ui-serif, serif;
    --font-ui: 'DM Sans', 'Helvetica Neue', sans-serif;
}

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

body {
    margin: 0;
    font-family: ui-serif, 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    letter-spacing: 0.012em;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Animations ─────────────────────────────────────── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─────────────────────────────────────────── */

header {
    background: #130f0a;
    border-bottom: 1px solid #2d2a1e;
    padding: 1rem 2rem;
}

header .inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    margin: 0;
    font-size: 1.3rem;
    font-family: var(--font-ui);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f0ece2;
}

header h1 a { color: inherit; text-decoration: none; }
header h1 span { color: var(--accent-color); }

header nav a {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    margin-left: 1.5rem;
    transition: color 0.15s;
}

header nav a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* ─── Main ───────────────────────────────────────────── */

main {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 2rem;
    animation: fadeUp 0.4s ease both;
}

/* ─── Footer ─────────────────────────────────────────── */

footer {
    border-top: 1px solid #2d2a1e;
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-faint);
    font-family: var(--font-ui);
}

footer a { color: #5a5443; transition: color 0.15s; }
footer a:hover { color: var(--accent-color); text-decoration: none; }

/* ─── Typography ─────────────────────────────────────── */

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.25;
}

h2 {
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    font-size: 1.35rem;
    color: #e0dac8;
    border-left: 3px solid var(--accent-color);
    padding-left: 0.875rem;
}

/* Dispatch section-specific h2 colors */
h2#top-stories       { border-color: #e0dac8; }
h2#left-perspective  { border-color: #5b9cf6; }
h2#right-perspective { border-color: #f27a5e; }
h2#international-view { border-color: #a78bfa; }
h2#underreported     { border-color: #fbbf24; }
h2#sources           { border-color: #4ade80; }

h3 { color: #c8c2b0; font-size: 1.1rem; margin-top: 1rem; }
p { margin: 0.75rem 0; }
ul, ol { padding-left: 1.5rem; }
li { margin: 0.4rem 0; }
strong { color: #ddd8c8; }

code {
    background: var(--code-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

blockquote {
    border-left: 3px solid var(--quote-border);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Post list (archive index) ──────────────────────── */

.post-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.post-list li {
    margin: 0; padding: 0; border: none;
    animation: fadeUp 0.35s ease both;
}

.post-list li:nth-child(1)  { animation-delay: 0.04s; }
.post-list li:nth-child(2)  { animation-delay: 0.09s; }
.post-list li:nth-child(3)  { animation-delay: 0.14s; }
.post-list li:nth-child(4)  { animation-delay: 0.18s; }
.post-list li:nth-child(5)  { animation-delay: 0.22s; }
.post-list li:nth-child(6)  { animation-delay: 0.25s; }
.post-list li:nth-child(7)  { animation-delay: 0.28s; }
.post-list li:nth-child(8)  { animation-delay: 0.30s; }

.post-card {
    display: block;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.post-card:hover {
    border-color: var(--border-hover);
    box-shadow: inset 3px 0 0 var(--accent-color), 0 6px 24px rgba(0,0,0,0.4);
    transform: translateY(-1px);
    text-decoration: none;
}

.post-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

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

.post-date-label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

.post-card h2 {
    margin: 0 0 0.4rem;
    border: none;
    padding: 0;
    font-size: 1.1rem;
    color: #d8d3c4;
}

.post-summary {
    font-size: 0.88rem;
    color: #7a7060;
    line-height: 1.55;
    margin: 0 0 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-faint);
}

.post-read-arrow {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-faint);
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
    display: inline-block;
}

.post-card:hover .post-read-arrow {
    color: var(--accent-color);
    transform: translateX(4px);
}

/* ─── Individual post ─────────────────────────────────── */

article h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: #ece8e0;
    letter-spacing: -0.01em;
}

article { max-width: 720px; margin: 0 auto; }

article .post-meta {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.post-lead {
    font-style: italic;
    color: #a8a090;
    font-size: 1.08rem;
    line-height: 1.65;
    border-left: 3px solid rgba(255,240,210,0.1);
    padding-left: 1.1rem;
    margin: 1.75rem 0 2rem;
}

article .content { margin-bottom: 3rem; }
article .content a { color: var(--accent-color); }
article .content a:hover { text-decoration: underline; }

/* ─── Article images injected from source media ───────── */

figure.article-image {
    margin: 1rem 0 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    max-height: 340px;
}
figure.article-image img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* ─── Back link ───────────────────────────────────────── */

.back-link { margin-bottom: 2rem; }
.back-link a {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.15s;
}
.back-link a:hover { color: var(--accent-color); text-decoration: none; }

/* ─── Empty state ─────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* ─── Source Posts (tweets) ───────────────────────────── */

.source-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.source-heading {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    border-left-color: #4a4535 !important;
}

.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.source-post-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.source-post-card .post-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0;
}

.source-post-card .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2d2a1e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-family: var(--font-ui);
}

.source-post-card .author-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-family: var(--font-ui);
}

.source-post-card .display-name { font-weight: 600; color: var(--text-color); font-size: 0.9rem; }
.source-post-card .username { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; }
.source-post-card .username:hover { color: var(--accent-color); }
.source-post-card .date-sep { color: var(--text-faint); }
.source-post-card .post-date { color: var(--text-muted); font-size: 0.8rem; }

.source-post-card .post-content {
    padding: 0.75rem 1rem;
    color: #b8b0a0;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.source-post-card .post-link { color: var(--accent-color); text-decoration: none; }
.source-post-card .post-link:hover { text-decoration: underline; }

.source-post-card .quoted-tweet {
    margin: 0 1rem 0.75rem;
    border: 1px solid #2d2a1e;
    border-radius: 10px;
    padding: 0.75rem;
}

.source-post-card .quoted-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-ui);
}

.source-post-card .quoted-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2d2a1e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
}

.source-post-card .quoted-name { font-weight: 500; font-size: 0.85rem; color: var(--text-color); }
.source-post-card .quoted-username { font-size: 0.75rem; color: var(--text-muted); }
.source-post-card .quoted-content { font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; }

.source-post-card .article-card {
    margin: 0 1rem 0.75rem;
    border: 1px solid #2d2a1e;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.source-post-card .link-icon { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; margin-top: 2px; }
.source-post-card .article-info { flex: 1; min-width: 0; }
.source-post-card .article-title { font-size: 0.875rem; font-weight: 500; color: var(--text-color); margin-bottom: 0.25rem; font-family: var(--font-ui); }
.source-post-card .article-excerpt { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; font-family: var(--font-ui); }

.source-post-card .post-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.source-post-card .view-on-x {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-faint);
    font-size: 0.8rem;
    font-family: var(--font-ui);
    text-decoration: none;
}

.source-post-card .view-on-x:hover { color: var(--accent-color); text-decoration: none; }
.source-post-card .x-icon { width: 14px; height: 14px; }

/* ─── Source Articles (dispatch) ──────────────────────── */

.article-source-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.article-source-card.has-image {
    display: flex;
    gap: 0.75rem;
    padding: 0;
    overflow: hidden;
}

.article-thumb {
    flex-shrink: 0;
    width: 96px;
    display: block;
}

.article-thumb img {
    width: 96px;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-source-card.has-image .article-source-body {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem 0.75rem 0;
}

.article-source-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: #5a5443;
    flex-wrap: wrap;
}

.article-source-name { color: #6a6455; }
.article-source-date { color: #4a4535; }

.article-source-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
}

.article-source-title a { color: var(--text-color); }
.article-source-title a:hover { color: var(--accent-color); text-decoration: none; }

.article-source-topic {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: #4a4535;
}

/* ─── Bias badges ─────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    border-radius: 999px;
    font-size: 0.72rem;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-left       { background: #1e3a5f; color: #7eb3f5; }
.badge-lean-left  { background: #1a3352; color: #93c5fd; }
.badge-center     { background: #2d2a1e; color: #a89e88; }
.badge-lean-right { background: #3d1f1f; color: #fca5a5; }
.badge-right      { background: #4a1010; color: #f87171; }

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
    header { padding: 1rem; }
    main { padding: 0 1rem; margin: 1.5rem auto; }
    article h1 { font-size: 1.6rem; }
    .post-card { padding: 1rem; }
    .source-post-card .post-header { padding: 0.75rem 0.75rem 0; }
    .source-post-card .post-content { padding: 0.5rem 0.75rem; }
    .source-post-card .quoted-tweet,
    .source-post-card .article-card { margin: 0 0.75rem 0.5rem; }
    .source-post-card .post-footer { padding: 0.5rem 0.75rem; }
}

/* ─── Post Media Grid ─────────────────────────────────── */

.post-media { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; margin: 0 1rem 0.75rem; }
.post-media.media-count-1 { grid-template-columns: 1fr; }
.post-media.media-count-2 { grid-template-columns: 1fr 1fr; }
.post-media.media-count-3 { grid-template-columns: 1fr 1fr; }
.post-media.media-count-3 .media-item:first-child { grid-column: 1 / -1; }
.post-media.media-count-4 { grid-template-columns: 1fr 1fr; }
.media-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.media-item { display: block; overflow: hidden; }
.media-item:hover img { opacity: 0.9; }

/* ─── Noise texture overlay ───────────────────────────── */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='256' height='256' filter='url(%23n)'/></svg>");
    background-size: 256px 256px;
    mix-blend-mode: soft-light;
}

/* ─── Per-feed visual personality ─────────────────────── */

/* Finance — terminal / Bloomberg: dense, data-forward */
body.feed-finance {
    line-height: 1.72;
}
body.feed-finance article h1 {
    font-size: 1.85rem;
    letter-spacing: 0;
}
body.feed-finance h2 {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.01em;
}
body.feed-finance .post-date-label {
    letter-spacing: 0.14em;
    font-size: 0.67rem;
}

/* Gaming — energetic, playful: big headings, vivid lead border */
body.feed-gaming h2 {
    font-size: 1.45rem;
}
body.feed-gaming .post-lead {
    border-left-color: var(--accent-color);
}

/* F1 — speed, urgency: tight type, compressed headlines */
body.feed-f1 {
    line-height: 1.72;
}
body.feed-f1 article h1 {
    font-size: 2.25rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}
body.feed-f1 h2 {
    letter-spacing: -0.015em;
}

/* MTG — rich, collectible: golden accents on blockquotes and lead */
body.feed-mtg blockquote {
    border-left-color: var(--accent-color);
    color: #c9ba7a;
}
body.feed-mtg .post-lead {
    border-left-color: var(--accent-color);
}
body.feed-mtg h2 {
    font-size: 1.4rem;
}

/* Reality TV — expressive, dramatic: italic section headings */
body.feed-realitytv {
    line-height: 1.85;
}
body.feed-realitytv h2 {
    font-style: italic;
}
body.feed-realitytv .post-lead {
    border-left-color: var(--accent-color);
}

/* Pop Culture — high energy, playful: italic headings, vivid lead */
body.feed-popculture {
    line-height: 1.85;
}
body.feed-popculture h2 {
    font-style: italic;
}
body.feed-popculture .post-lead {
    border-left-color: var(--accent-color);
}

/* News — authoritative: larger section headings for newspaper presence */
body.feed-news h2 {
    font-size: 1.4rem;
}

/* Local — warm, community: full-opacity date label */
body.feed-local .post-date-label {
    opacity: 1;
}
