/* PostDrama — shared styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --surface: #f7f7f9;
    --raised: #eeeef2;
    --border: #e0e0e6;
    --text: #2a2a32;
    --text-bright: #111118;
    --text-dim: #5a5a6e;
    --text-faint: #8a8a9a;
    --red: #d04040;
    --amber: #c08020;
    --purple: #7c4fc8;
    --teal: #1a9e78;
    --blue: #3070d0;
    --sans: 'Inter', -apple-system, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-bright);
    text-decoration: none;
}

.logo b { color: var(--red); }

.tagline {
    font-size: 13px;
    color: var(--text-faint);
    margin-top: 2px;
}

header .meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    text-align: right;
}

.back {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
}

.back:hover { color: var(--red); }

/* ===== SECTIONS ===== */
main { padding: 32px 0 64px; }

.section-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-faint);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section + .section { margin-top: 48px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge .pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge.meltdown  { background: rgba(208,64,64,0.1);   color: var(--red); }
.badge.heated     { background: rgba(192,128,32,0.1);  color: var(--amber); }
.badge.brewing    { background: rgba(124,79,200,0.1);  color: var(--purple); }
.badge.simmering  { background: rgba(26,158,120,0.1);  color: var(--teal); }
.badge.cooling-off{ background: rgba(48,112,208,0.1);  color: var(--blue); }

.badge.meltdown .pip  { background: var(--red); }
.badge.heated .pip    { background: var(--amber); }
.badge.brewing .pip   { background: var(--purple); }
.badge.simmering .pip { background: var(--teal); }
.badge.cooling-off .pip { background: var(--blue); }

.cat {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    background: var(--raised);
    padding: 3px 8px;
    border-radius: 4px;
}

.sources-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.timestamp {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

/* ===== TAKES ===== */
.takes-row {
    display: flex;
    gap: 12px;
}

.take-box {
    flex: 1;
    padding: 16px 20px;
    border-radius: 8px;
    min-width: 0;
}

.take-box.side-a {
    background: rgba(208,64,64,0.05);
    border: 1px solid rgba(208,64,64,0.15);
}

.take-box.side-b {
    background: rgba(48,112,208,0.05);
    border: 1px solid rgba(48,112,208,0.15);
}

.take-box .take-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.take-box.side-a .take-label { color: var(--red); }
.take-box.side-b .take-label { color: var(--blue); }

.take-box p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}

/* ===== SOURCE BADGES ===== */
.source-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.source-badges-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-right: 4px;
}

a.source-pill {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 100px;
    text-decoration: none;
    transition: 0.15s;
}

a.source-pill:hover {
    color: var(--red);
    border-color: var(--red);
}

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-faint);
}

/* ===== LEAD STORY ===== */
.lead {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
}

.lead .badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lead h1 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-bright);
    margin-bottom: 14px;
}

.lead h1 a {
    color: inherit;
    text-decoration: none;
}

.lead h1 a:hover { color: var(--red); }

.lead .body {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 16px;
}

.lead .context {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    background: var(--raised);
    border-left: 3px solid var(--red);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.lead .full-link {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--red);
    text-decoration: none;
    margin-left: 4px;
}

.lead .full-link:hover { text-decoration: underline; }

/* ===== FILTER BAR ===== */
.filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters button {
    font-family: var(--mono);
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-faint);
    cursor: pointer;
    transition: 0.15s;
}

.filters button:hover {
    color: var(--text);
    border-color: #444;
}

.filters button.on,
.filters button[aria-pressed="true"] {
    background: rgba(208,64,64,0.08);
    border-color: var(--red);
    color: var(--red);
}

/* ===== DRAMA BOARD ===== */
a.board-item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    transition: background 0.1s;
    text-decoration: none;
    color: inherit;
}

a.board-item:hover { background: var(--raised); border-radius: 8px; }

.board-item .rank {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-faint);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.board-item .title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-item .score-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    width: 110px;
}

.board-item .bar {
    width: 50px;
    height: 4px;
    background: var(--raised);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.board-item .bar-fill {
    height: 100%;
    border-radius: 2px;
}

.bar-fill.meltdown  { background: var(--red); }
.bar-fill.heated    { background: var(--amber); }
.bar-fill.brewing   { background: var(--purple); }
.bar-fill.simmering { background: var(--teal); }
.bar-fill.cooling-off { background: var(--blue); }

.board-item .pct {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    width: 40px;
    text-align: right;
}

.pct.meltdown  { color: var(--red); }
.pct.heated    { color: var(--amber); }
.pct.brewing   { color: var(--purple); }
.pct.simmering { color: var(--teal); }
.pct.cooling-off { color: var(--blue); }

.board-item .board-cat {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    width: 100px;
    text-align: right;
    flex-shrink: 0;
}

/* ===== STORY CARDS ===== */
.cards { display: flex; flex-direction: column; gap: 8px; }

a.card {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    gap: 20px;
    transition: border-color 0.15s;
    text-decoration: none;
    color: inherit;
}

a.card:hover { border-color: #bbb; }

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

.card .card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.4;
    margin-bottom: 4px;
}

.card .desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card .card-score {
    flex-shrink: 0;
    text-align: center;
    width: 56px;
}

.card .card-score .num {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.card .card-score .lvl {
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.num.meltdown, .lvl.meltdown     { color: var(--red); }
.num.heated, .lvl.heated          { color: var(--amber); }
.num.brewing, .lvl.brewing        { color: var(--purple); }
.num.simmering, .lvl.simmering    { color: var(--teal); }
.num.cooling-off, .lvl.cooling-off{ color: var(--blue); }

.card .card-sources {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-faint);
    margin-top: 6px;
}

.card .card-sources a {
    color: var(--text-dim);
    text-decoration: none;
}

.card .card-sources a:hover {
    color: var(--red);
}

/* ===== STORY PAGE ===== */
.story-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

article {
    padding: 40px 0 64px;
}

.story-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

article h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-bright);
    margin-bottom: 24px;
}

.story-section {
    margin-bottom: 32px;
}

.story-section-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-faint);
    margin-bottom: 12px;
}

.story-section p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.context-box {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-dim);
    background: var(--surface);
    border-left: 3px solid var(--red);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
}

/* Story page takes — slightly larger */
.story-section .takes-row { gap: 16px; }
.story-section .take-box { padding: 20px 24px; border-radius: 10px; }
.story-section .take-box .take-label { margin-bottom: 10px; }
.story-section .take-box p { font-size: 15px; line-height: 1.75; }

/* ===== SOURCE LIST ===== */
.source-list {
    list-style: none;
}

.source-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.source-list li:last-child { border-bottom: none; }

.source-list a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
    text-decoration: none;
    line-height: 1.4;
}

.source-list a:hover {
    color: var(--red);
}

.source-list .source-origin {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 2px;
}

/* ===== RELATED ===== */
.related-list {
    list-style: none;
}

.related-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.related-list li:last-child { border-bottom: none; }

.related-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.related-list a:hover .related-title { color: var(--red); }

.related-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
    line-height: 1.4;
    transition: color 0.1s;
}

.related-score {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.related-score.meltdown  { color: var(--red); }
.related-score.heated    { color: var(--amber); }
.related-score.brewing   { color: var(--purple); }
.related-score.simmering { color: var(--teal); }
.related-score.cooling-off { color: var(--blue); }

/* ===== SHARE BUTTONS ===== */
.share-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.share-bar-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-faint);
    margin-right: 4px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    text-decoration: none;
    cursor: pointer;
    transition: 0.15s;
}

.share-btn:hover {
    border-color: var(--text-dim);
    color: var(--text-bright);
}

.share-btn.copied {
    border-color: var(--teal);
    color: var(--teal);
}

/* ===== SHOW ALL BUTTON ===== */
.show-all-wrap {
    text-align: center;
    margin-top: 16px;
}

.show-all-btn {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.15s;
}

.show-all-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ===== ARCHIVE PAGE ===== */
.archive-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.archive-nav a {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.15s;
}

.archive-nav a:hover,
.archive-nav a.active {
    border-color: var(--red);
    color: var(--red);
}

.archive-day {
    margin-bottom: 40px;
}

.archive-day-title {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ===== STORY TIMELINE ===== */
.timeline-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    margin-top: 12px;
}

.timeline-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    position: relative;
}

.timeline-bar:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-faint);
    margin-top: 4px;
}

/* ===== TRENDING INDICATORS ===== */
.trending-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
}

.trending-badge.rising {
    color: var(--red);
    background: rgba(208,64,64,0.08);
}

.trending-badge.new {
    color: var(--purple);
    background: rgba(124,79,200,0.08);
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text-dim);
    transition: 0.15s;
}

.theme-toggle:hover {
    border-color: var(--text-dim);
}

/* ===== EMPTY ===== */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-dim);
}

.empty h2 { font-size: 20px; margin-bottom: 8px; }
.empty p  { font-size: 14px; color: var(--text-faint); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .wrap, .story-wrap { padding: 0 16px; }
    .lead { padding: 20px; }
    .lead h1 { font-size: 20px; }
    article h1 { font-size: 22px; }
    .takes-row { flex-direction: column; }
    .board-item .board-cat { display: none; }
    .board-item .title { font-size: 13px; }
    .card { padding: 14px 16px; gap: 14px; }
    header .wrap { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg: #1a1a22;
    --surface: #22222c;
    --raised: #2a2a36;
    --border: #333340;
    --text: #d0d0d8;
    --text-bright: #eeeef2;
    --text-dim: #9090a0;
    --text-faint: #606070;
}

[data-theme="dark"] header {
    background: rgba(26,26,34,0.92);
}

[data-theme="dark"] a.card:hover {
    border-color: #555;
}

[data-theme="dark"] a.board-item:hover {
    background: var(--raised);
}
