/* Marginalia Page - Dark theme matching the rest of the site */

.marginalia-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
}

/* ── Header ── */

.marginalia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.marginalia-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.marginalia-header-right {
    padding-top: 0;
}

/* ── Intro ── */

.marg-intro {
    padding: 1.5rem 0 2rem;
}

.marg-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.02em;
}

.marg-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.75rem 0 0;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

/* ── Metric strip ── */

.marg-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid #1e2130;
}

.marg-metric {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.marg-metric-value {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.03em;
}

.marg-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #6b7280;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Filter row ── */

.marg-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0 0.5rem;
}

.marg-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #6b7280;
    background: none;
    border: none;
    padding: 0.25rem 0.15rem;
    cursor: pointer;
    transition: color 0.2s;
}

.marg-pill:hover {
    color: #e0e0e0;
}

.marg-pill.active {
    color: #ffffff;
    font-weight: 600;
}

.marg-pill-sep {
    color: #2a2d3a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

/* ── Entry list ── */

.marg-entries {
    margin-top: 1rem;
}

.marg-entry {
    padding: 1.5rem 0;
    border-top: 1px solid #1e2130;
}

/* Hidden by filter — pure class flip, no layout jump on load. */
.marg-entry.filtered-out {
    display: none;
}

.marg-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.marg-entry-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.35;
}

a.marg-entry-title {
    transition: color 0.2s;
}

a.marg-entry-title:hover {
    color: #818cf8;
}

.marg-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.marg-badge.badge-book        { background-color: rgba(99, 102, 241, 0.15);  color: #818cf8; }
.marg-badge.badge-x           { background-color: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.marg-badge.badge-podcast     { background-color: rgba(168, 85, 247, 0.15);  color: #c084fc; }
.marg-badge.badge-pdf         { background-color: rgba(244, 63, 94, 0.15);   color: #fb7185; }
.marg-badge.badge-newsletter  { background-color: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
.marg-badge.badge-blog        { background-color: rgba(34, 197, 94, 0.15);   color: #4ade80; }

/* Meta line: author · count bar */

.marg-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.marg-meta-author {
    color: #9ca3af;
}

.marg-count-bar {
    color: #6366f1;
    letter-spacing: 0;
    white-space: nowrap;
}

.marg-count-bar .bar-empty {
    color: #2a2d3a;
}

.marg-count-label {
    color: #6b7280;
}

/* Surfaced highlight-text line */

.marg-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    margin-top: 0.85rem;
    color: #e0e0e0;
}

.marg-note.empty {
    color: #6b7280;
}

.marg-note .note-prefix {
    color: #6366f1;
}

/* ── Favorites section ── */

.marg-favorites-section {
    margin-bottom: 2.5rem;
}

.marg-fav {
    padding: 1.5rem 0;
    border-top: 1px solid #1e2130;
}

.marg-fav-quote {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    color: #e0e0e0;
    margin: 0;
}

.marg-fav .marg-note {
    margin-top: 0.75rem;
    color: #9ca3af;
}

.marg-fav-src {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.marg-fav-title {
    color: #9ca3af;
    transition: color 0.2s;
}

a.marg-fav-title:hover {
    color: #818cf8;
}

.marg-fav-author {
    color: #6b7280;
}

.marg-fav-dot {
    color: #2a2d3a;
}

/* ── Sync line ── */

.marg-syncline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    letter-spacing: 0.02em;
    padding: 2rem 0 1rem;
    margin: 0;
    border-top: 1px solid #1e2130;
    margin-top: 1.5rem;
}

/* ── Empty state ── */

.marg-empty {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 2rem 0;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .marginalia-container {
        padding: 2rem 1.25rem;
    }

    .marg-metrics {
        gap: 1.75rem;
    }

    .marg-metric-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .marginalia-header-left {
        font-size: 0.7rem;
        gap: 0.5rem;
    }

    .marg-title {
        font-size: 1.35rem;
    }

    .marg-metrics {
        gap: 1.25rem;
    }
}
