/* ============================================
   DISPATCHES — Feed of transmissions + log entries
   Used on dispatches.html (full archive) and on the
   hub (latest entries).

   Lane colors come from the characters:
   copper  = the work     (CSH, in process)
   chrome  = the thinking (TQB, the mirror)
   blue    = the universe (Vibraline)

   Body copy uses a serif for readability. To go back to
   all-Courier, delete the --font-read line below.
   ============================================ */

:root {
    --lane-work: #C87533;
    --lane-thinking: #C9D6DF;
    --lane-universe: #00D9FF;
    --font-read: 'Newsreader', Georgia, 'Times New Roman', serif;
}

.dispatches-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
    min-height: calc(100vh - 200px);
}

/* ---- Page header ---- */
.dispatches-header {
    margin-bottom: 2rem;
}

.dispatches-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    letter-spacing: 0.2rem;
    margin-bottom: 1rem;
}

.dispatches-intro {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 52ch;
    font-family: var(--font-read);
}

/* ---- Lane filter ---- */
.lane-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.lane-btn {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(123, 167, 188, 0.35);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lane-btn:hover {
    color: var(--text-primary);
    border-color: var(--neon-blue);
}

.lane-btn.active {
    color: var(--darker-bg);
    background: var(--neon-blue);
    border-color: var(--neon-blue);
}

.lane-btn:focus-visible,
.dispatch-read:focus-visible,
.dispatch-upgrade:focus-visible,
.reader-close:focus-visible,
.feed-archive-link:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

.lane-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lane-dot.lane-work { background: var(--lane-work); }
.lane-dot.lane-thinking { background: var(--lane-thinking); }
.lane-dot.lane-universe { background: var(--lane-universe); }
.lane-btn.active .lane-dot { box-shadow: 0 0 0 2px var(--darker-bg); }

/* ---- Timeline ---- */
.dispatch-timeline {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* ---- Month marker ---- */
.month-marker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 -0.75rem;
}

.month-marker span {
    font-size: 0.78rem;
    letter-spacing: 0.25rem;
    color: var(--neon-blue);
    white-space: nowrap;
}

.month-marker::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 217, 255, 0.18);
}

/* ---- Base card ---- */
.dispatch {
    --lane-color: var(--lane-universe);
    position: relative;
    padding: 1.75rem 1.75rem 1.9rem;
    background: rgba(10, 22, 40, 0.55);
    border: 1px solid rgba(123, 167, 188, 0.18);
    border-top: 2px solid var(--lane-color);
}

.dispatch.lane-work { --lane-color: var(--lane-work); }
.dispatch.lane-thinking { --lane-color: var(--lane-thinking); }
.dispatch.lane-universe { --lane-color: var(--lane-universe); }

.dispatch-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    font-size: 0.72rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.dispatch-meta time {
    color: var(--text-primary);
}

.dispatch-lane {
    color: var(--lane-color);
}

.dispatch-kind {
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(123, 167, 188, 0.3);
}

.dispatch-title {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
    font-weight: bold;
}

.dispatch-subtitle {
    font-family: var(--font-read);
    font-style: italic;
    color: var(--lane-color);
    font-size: 1rem;
    margin-bottom: 0.9rem;
}

.dispatch-excerpt {
    font-family: var(--font-read);
    color: var(--text-primary);
    opacity: 0.85;
    font-size: 1.05rem;
    line-height: 1.75;
    max-width: 58ch;
    margin-bottom: 1.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dispatch-actions {
    display: flex;
}

.dispatch-read {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05rem;
    color: var(--lane-color);
    background: transparent;
    border: 1px solid var(--lane-color);
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.dispatch-read:hover {
    background: var(--lane-color);
    color: var(--darker-bg);
}

/* ---- Featured (first card in the feed) ---- */
.dispatch--featured {
    padding: 2.5rem 2rem;
    background: linear-gradient(160deg, rgba(0, 217, 255, 0.07), rgba(10, 22, 40, 0.6) 55%);
    border-top-width: 3px;
}

.dispatch--featured .dispatch-title {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 0.8rem;
}

.dispatch--featured .dispatch-excerpt {
    font-size: 1.12rem;
    -webkit-line-clamp: 6;
    opacity: 0.92;
}

.dispatch-flag {
    display: inline-block;
    font-size: 0.68rem;
    letter-spacing: 0.22rem;
    color: var(--darker-bg);
    background: var(--lane-color);
    padding: 0.2rem 0.6rem;
    margin-bottom: 1rem;
}

/* ---- Reflection: pull-quote treatment ---- */
.dispatch--reflection .dispatch-excerpt {
    font-size: 1.18rem;
    font-style: italic;
    line-height: 1.7;
    border-left: 2px solid var(--lane-color);
    padding-left: 1.25rem;
    -webkit-line-clamp: 3;
}

/* ---- Audio: waveform panel ---- */
.dispatch--audio {
    background: rgba(6, 14, 26, 0.75);
}

.dispatch-waveform {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 34px;
    margin-bottom: 1rem;
    opacity: 0.75;
}

.dispatch-waveform i {
    flex: 1;
    background: var(--lane-color);
    display: block;
}

.dispatch-audio-label {
    font-size: 0.78rem;
    letter-spacing: 0.1rem;
    color: var(--lane-color);
    margin-bottom: 1rem;
}

/* ---- Scrapped: dashed, stamped ---- */
.dispatch--scrapped {
    border-style: dashed;
    border-top-style: solid;
    background: rgba(10, 22, 40, 0.35);
}

.dispatch--scrapped .dispatch-title {
    text-decoration: line-through;
    text-decoration-color: rgba(200, 117, 51, 0.6);
    text-decoration-thickness: 1px;
}

.dispatch-stamp {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.2rem;
    color: var(--lane-color);
    border: 1px solid var(--lane-color);
    padding: 0.2rem 0.5rem;
    transform: rotate(6deg);
    opacity: 0.8;
}

.dispatch-figure {
    margin: 0 0 1.2rem;
    border: 1px solid rgba(123, 167, 188, 0.25);
    padding: 0.6rem;
}

.dispatch-figure img {
    width: 100%;
    display: block;
}

.dispatch-figure figcaption {
    font-size: 0.72rem;
    letter-spacing: 0.08rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ---- Ritual: numbered steps ---- */
.dispatch--ritual {
    background: rgba(12, 26, 38, 0.6);
}

.dispatch-steps {
    list-style: none;
    counter-reset: step;
    margin-bottom: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dispatch-steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    font-family: var(--font-read);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    opacity: 0.85;
}

.dispatch-steps li::before {
    content: '0' counter(step);
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--lane-color);
    padding-top: 0.22rem;
}

.dispatch-steps .more-steps {
    grid-template-columns: 1fr;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    opacity: 1;
}

.dispatch-steps .more-steps::before {
    content: '';
}

/* ---- Status: short note posted from the subscriber manager ---- */
.dispatch--status {
    padding: 1.25rem 1.5rem;
    background: rgba(10, 22, 40, 0.3);
    border: 1px solid rgba(123, 167, 188, 0.15);
    border-top-width: 1px;
    border-left: 3px solid var(--lane-color);
}

.dispatch--status .dispatch-meta {
    margin-bottom: 0.6rem;
}

.dispatch-status-text {
    font-family: var(--font-read);
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-primary);
    max-width: 52ch;
}

/* ---- Decision ---- */
.dispatch--decision .dispatch-title::before {
    content: '\2387  ';
    color: var(--lane-color);
}

/* ---- Locked ---- */
.dispatch-lock {
    --lock-color: var(--neon-blue);
    --lock-rgb: 0, 217, 255;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 0.4rem;
    padding: 1rem 1.1rem;
    border: 1px dashed rgba(var(--lock-rgb), 0.4);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dispatch-lock.lock-vibraline {
    --lock-color: var(--success-green);
    --lock-rgb: 0, 255, 136;
}

.dispatch-upgrade {
    color: var(--lock-color);
    border: 1px solid var(--lock-color);
    padding: 0.4rem 0.9rem;
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
}

.dispatch-upgrade:hover {
    background: var(--lock-color);
    color: var(--darker-bg);
}

/* ---- End + empty states ---- */
.timeline-sentinel {
    height: 1px;
}

.timeline-end,
.timeline-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2.5rem;
    font-family: var(--font-read);
    font-style: italic;
}

/* ---- Hub feed variant ---- */
.hub-feed .dispatch-timeline {
    gap: 2.5rem;
}

.feed-archive {
    margin-top: 2.5rem;
    text-align: center;
}

.feed-archive-link {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 0.7rem 1.6rem;
    text-decoration: none;
}

.feed-archive-link:hover {
    background: var(--neon-blue);
    color: var(--darker-bg);
}

/* ---- Reader ---- */
.dispatch-reader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.dispatch-reader[hidden] {
    display: none;
}

.reader-panel {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    background: var(--dark-bg);
    border: 1px solid var(--neon-blue);
    display: flex;
    flex-direction: column;
}

.reader-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 38px;
    height: 38px;
    background: var(--dark-bg);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2;
}

.reader-close:hover {
    background: var(--neon-blue);
    color: var(--darker-bg);
}

.reader-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2.5rem 2rem 3.5rem;
}

.reader-header {
    --lane-color: var(--lane-universe);
    max-width: 60ch;
    margin: 0 auto 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.reader-header.lane-work { --lane-color: var(--lane-work); }
.reader-header.lane-thinking { --lane-color: var(--lane-thinking); }

.reader-lane {
    display: block;
    color: var(--lane-color);
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.reader-header h2 {
    font-size: 1.9rem;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    padding-right: 2.5rem;
}

.reader-subtitle {
    font-family: var(--font-read);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--lane-color);
    margin-bottom: 0.8rem;
}

.reader-header time {
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.1rem;
}

.reader-body {
    max-width: 60ch;
    margin: 0 auto;
    font-family: var(--font-read);
    color: var(--text-primary);
    font-size: 1.12rem;
    line-height: 1.85;
}

.reader-body p {
    margin-bottom: 1.5rem;
}

.reader-body p:first-child::first-letter {
    float: left;
    font-family: 'Courier New', monospace;
    font-size: 3.2rem;
    line-height: 0.85;
    padding: 0.25rem 0.6rem 0 0;
    color: var(--neon-blue);
}

.reader-pending {
    color: var(--text-secondary);
    font-style: italic;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .dispatches-container {
        padding: 1.75rem 1.1rem 3.5rem;
    }

    .dispatches-title {
        font-size: 1.8rem;
        letter-spacing: 0.12rem;
    }

    .dispatch-timeline {
        gap: 2.5rem;
    }

    .dispatch {
        padding: 1.4rem 1.2rem 1.5rem;
    }

    .dispatch--featured {
        padding: 1.8rem 1.2rem;
    }

    .dispatch-title {
        font-size: 1.2rem;
    }

    .dispatch--featured .dispatch-title {
        font-size: 1.5rem;
    }

    .dispatch-excerpt,
    .dispatch--featured .dispatch-excerpt {
        font-size: 1rem;
    }

    .dispatch--reflection .dispatch-excerpt {
        font-size: 1.05rem;
        padding-left: 1rem;
    }

    .dispatch-stamp {
        top: auto;
        bottom: 1.2rem;
        right: 1.2rem;
    }

    .dispatch-reader {
        padding: 0;
    }

    .reader-panel {
        max-height: 100vh;
        height: 100%;
        border: none;
    }

    .reader-scroll {
        padding: 4rem 1.25rem 3rem;
    }

    .reader-header h2 {
        font-size: 1.45rem;
    }

    .reader-body {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lane-btn,
    .dispatch-read,
    .dispatch-upgrade {
        transition: none;
    }
}
