/* Shared stylesheet for the front page (index.html) and the generated archive pages. */

:root {
    --far-left:  #134e4a;
    --left:      #1a56c4;
    --center:    #6d28d9;
    --right:     #c0111a;
    --far-right: #7c2d12;
    --bg:        #f0ece3;
    --paper:     #faf8f3;
    --ink:       #1a1814;
    --muted:     #6b6760;
    --border:    #d4cfc5;
    --gold:      #b45309;
    --gold-bg:   #fef3c7;
    --card-bg:   #ffffff;
    --header-bg: #0f0e0c;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── MASTHEAD STRIPE ─────────────────────────────────── */
.masthead-stripe {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    height: 5px;
}
.masthead-stripe span:nth-child(1) { background: var(--far-left); }
.masthead-stripe span:nth-child(2) { background: var(--left); }
.masthead-stripe span:nth-child(3) { background: var(--center); }
.masthead-stripe span:nth-child(4) { background: var(--right); }
.masthead-stripe span:nth-child(5) { background: var(--far-right); }

/* ─── HEADER ──────────────────────────────────────────── */
header {
    background: var(--header-bg);
    color: white;
    text-align: center;
    padding: 2.5rem 1rem 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 4px
    );
    pointer-events: none;
}

.masthead-eyebrow {
    font-family: 'Playfair Display SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    color: #857f74;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: #f5f2eb;
    margin-bottom: 0.5rem;
}

.masthead-rule {
    width: 60px; height: 2px;
    background: #857f74;
    margin: 1rem auto;
}

.masthead-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-pill {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9c9589;
}

.meta-pill strong { color: #e8e4db; font-weight: 600; }
.meta-divider { color: #3f3c38; }
#coverage-date { color: #d4a853; font-weight: 700; }

/* ─── BIAS LEGEND ─────────────────────────────────────── */
.bias-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.55rem 1rem;
    background: #1e1c18;
    border-bottom: 1px solid #2e2c27;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #857f74;
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-toggle {
    cursor: pointer;
    border-radius: 3px;
    padding: 6px 8px;
    margin: -6px -8px;
    transition: background 0.15s;
}

.legend-toggle:hover {
    background: rgba(255,255,255,0.07);
}

/* ─── MAIN GRID ───────────────────────────────────────── */
.container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    max-width: 1800px;
    margin: 2rem auto;
    width: 95%;
    gap: 1.25rem;
    align-items: start;
    flex: 1;
}

/* ─── COLUMN ──────────────────────────────────────────── */
.column {
    background: var(--paper);
    border-radius: 3px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ─── COLUMN HEADER (clickable toggle) ───────────────── */
.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    color: white;
    font-family: 'Playfair Display SC', serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

.col-header:hover { opacity: 0.88; }

.col-header:focus-visible,
.legend-toggle:focus-visible {
    outline: 2px solid #d4a853;
    outline-offset: -2px;
}

.col-title {
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
}

.far-left-col  .col-header { background: var(--far-left); }
.left-col      .col-header { background: var(--left); }
.center-col    .col-header { background: var(--center); }
.right-col     .col-header { background: var(--right); }
.far-right-col .col-header { background: var(--far-right); }

.col-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-header-count {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(255,255,255,0.18);
    padding: 2px 8px;
    border-radius: 20px;
}

/* Chevron indicator */
.col-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
    display: inline-block;
    transition: transform 0.3s ease;
    line-height: 1;
}

/* ─── COLLAPSIBLE BODY ────────────────────────────────── */
/* Grid-row animation collapses to true content height (no max-height
   guessing) and visibility:hidden keeps collapsed links out of the
   tab order and screen readers. */
.col-body {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows 0.35s ease, opacity 0.25s ease, visibility 0s linear 0s;
}

.col-body.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.35s ease, opacity 0.25s ease, visibility 0s linear 0.35s;
}

.col-body-inner {
    min-height: 0;
    overflow: hidden;
}

.col-header.is-collapsed .col-chevron {
    transform: rotate(-90deg);
}

/* ─── NEWS LIST ───────────────────────────────────────── */
.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

/* ─── ARTICLE CARD ────────────────────────────────────── */
.article-card {
    background: var(--card-bg);
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.article-card:last-child { border-bottom: none; }
.article-card:hover { background: #f8f6f1; }

.article-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.4rem;
}

.article-source {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--muted);
}

.badge-new {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--gold-bg);
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-new::before {
    content: '';
    display: block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}

.article-title {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--ink);
}

.article-title a { text-decoration: none; color: inherit; }
.article-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.article-snippet {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #5a5652;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 500;
}

/* ─── OLDER STORIES (beyond 24h) ─────────────────────── */
.older-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1.1rem;
    background: #f5f2ec;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.older-divider span {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.older-divider::before,
.older-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── SHOW MORE BUTTON ────────────────────────────────── */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1.1rem;
    background: var(--paper);
    border: none;
    border-top: 1px solid var(--border);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

.show-more-btn:hover {
    background: #ede9e0;
    color: var(--ink);
}

.show-more-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ─── SKELETON LOADERS ────────────────────────────────── */
.skeleton-card {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.skel {
    background: linear-gradient(90deg, #e8e4db 25%, #f0ece3 50%, #e8e4db 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 3px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skel-source    { height: 10px; width: 60px;  margin-bottom: 10px; }
.skel-title-1   { height: 14px; width: 100%;  margin-bottom: 6px; }
.skel-title-2   { height: 14px; width: 80%;   margin-bottom: 10px; }
.skel-snippet   { height: 10px; width: 90%;   margin-bottom: 5px; }
.skel-snippet-2 { height: 10px; width: 65%;   margin-bottom: 10px; }
.skel-meta      { height: 9px;  width: 80px; }

/* ─── STATUS MESSAGES ─────────────────────────────────── */
.status-msg {
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: 'Source Serif 4', serif;
    font-style: italic;
}

.status-msg.error { color: var(--right); }
.status-msg.error::before { content: '⚠ '; }

/* ─── ABOUT ───────────────────────────────────────────── */
.about-section {
    max-width: 860px;
    width: 95%;
    margin: 0 auto 3rem;
}

.about-inner {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 2rem 2.25rem;
}

.about-inner h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.9rem;
}

.about-inner h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.4rem 0 0.6rem;
}

.about-inner p {
    font-family: 'Source Serif 4', serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #44403a;
}

.about-inner p + p { margin-top: 0.75rem; }

/* ─── BOTTOM / DONATE ─────────────────────────────────── */
.bottom-section {
    background: var(--header-bg);
    color: white;
    padding: 3rem 1.5rem;
    margin-top: auto;
}

.bottom-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.donate-card {
    background: #1a1814;
    border: 1px solid #2e2c27;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
}

.donate-label {
    font-family: 'Playfair Display SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: #857f74;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.donate-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f2eb;
    margin-bottom: 0.4rem;
}

.donate-sub {
    font-size: 0.82rem;
    color: #857f74;
    margin-bottom: 1.5rem;
}

.kofi-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FF5E5B;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 11px 24px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 1.5rem;
}

.kofi-btn:hover { background: #e04e4b; transform: translateY(-1px); }
.kofi-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

.crypto-toggle-btn {
    background: transparent;
    color: #857f74;
    border: 1px solid #3a3830;
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.crypto-toggle-btn:hover { border-color: #6b6760; color: #c9c4bb; }
.crypto-toggle-btn .chevron { display: inline-block; transition: transform 0.3s; }
.crypto-toggle-btn.open .chevron { transform: rotate(180deg); }

.crypto-details {
    display: none;
    margin-top: 1.5rem;
    animation: fadeSlide 0.3s ease;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.crypto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.crypto-card {
    background: #0f0e0c;
    border: 1px solid #2e2c27;
    padding: 1.2rem;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.crypto-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #f59e0b; }
.eth-label { color: #818cf8; }

.address-box {
    background: #000;
    color: #9c9589;
    padding: 8px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    word-break: break-all;
    width: 100%;
    border: 1px solid #2a2823;
    line-height: 1.5;
}

.copy-btn {
    background: #2a2823;
    color: #c9c4bb;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    width: 100%;
}

.copy-btn:hover { background: #3a3830; color: #f5f2eb; }

.qr-code {
    width: 120px; height: 120px;
    border-radius: 4px;
    background: white;
    padding: 4px;
    margin-top: 4px;
    display: block;
}

/* ─── FOOTER ──────────────────────────────────────────── */
footer {
    background: #0a0908;
    text-align: center;
    padding: 1.2rem 1rem;
    border-top: 1px solid #1e1c18;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-item { font-size: 0.7rem; color: #857f74; letter-spacing: 0.05em; }
.footer-sep  { color: #4a463f; }

/* ─── RETRY BUTTON (error state) ──────────────────────── */
.retry-btn {
    display: block;
    margin: 0.75rem auto 0;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.retry-btn:hover { background: #ede9e0; color: var(--ink); }

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1300px) {
    .container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
    .container { grid-template-columns: 1fr; }
    .crypto-grid { grid-template-columns: 1fr; }
    .masthead-meta { gap: 0.75rem; }
    .meta-divider { display: none; }   /* avoid dangling pipes when the row wraps */
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ─── LINKS IN TEXT BLOCKS ────────────────────────────────── */
.about-inner a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.about-inner a:hover { color: var(--left); }

a.footer-item { text-decoration: none; }
a.footer-item:hover { color: #c9c4bb; text-decoration: underline; }

/* ─── STATIC COLUMN HEADERS (archive pages) ───────────────── */
.col-header.static { cursor: default; user-select: text; }
.col-header.static:hover { opacity: 1; }

/* ─── ARCHIVE NAV ─────────────────────────────────────────── */
.archive-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1800px;
    width: 95%;
    margin: 1.5rem auto 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archive-nav > div { flex: 1; }
.archive-nav-home { text-align: center; }
.archive-nav-next { text-align: right; }
.archive-nav a { color: var(--muted); text-decoration: none; }
.archive-nav a:hover { color: var(--ink); text-decoration: underline; }

.live-note {
    max-width: 1800px;
    width: 95%;
    margin: 1rem auto 0;
    padding: 0.55rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    background: var(--gold-bg);
    border: 1px solid #fcd34d;
    border-radius: 3px;
}

.archive-nav + .container,
.live-note + .container { margin-top: 1.25rem; }

/* ─── ARCHIVE INDEX ───────────────────────────────────────── */
.archive-list {
    max-width: 860px;
    width: 95%;
    margin: 1.5rem auto 3rem;
    flex: 1;
}

.archive-month { margin-bottom: 2rem; }

.archive-month h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.archive-days {
    list-style: none;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.archive-days li + li { border-top: 1px solid var(--border); }

.archive-days a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.8rem 1.1rem;
    background: var(--card-bg);
    color: var(--ink);
    text-decoration: none;
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s;
}

.archive-days a:hover { background: #f8f6f1; }

.archive-day-count {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.archive-list .status-msg { padding: 3rem 1rem; }

@media (max-width: 860px) {
    .archive-nav { flex-wrap: wrap; }
    .archive-nav > div { flex: 1 1 100%; text-align: center; }
}
