/* ═══════════════════════════════════════════════════
   NEURAL OVERFLOW DIGEST — BBS Terminal Stylesheet
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap');

:root {
  --bg: #0a0e0a;
  --green: #00ff41;
  --amber: #b8507a;
  --cyan: #00e5ff;
  --dim: #2a6b2a;
  --border: #333333;
  --glow-cyan: rgba(0, 229, 255, 0.5);
  --glow-green: rgba(0, 255, 65, 0.4);
  --glow-amber: rgba(184, 80, 122, 0.5);
  --font: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ── Reset & Base ────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  animation: boot 0.8s ease-out;
}

@keyframes boot {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── CRT Glow ────────────────────────────────────── */

.crt-glow {
  text-shadow: 0 0 3px rgba(0, 255, 65, 0.2);
}

/* ── Scanlines Overlay ───────────────────────────── */

body.scanlines::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ── Selection ───────────────────────────────────── */

::selection {
  background: var(--green);
  color: var(--bg);
}

::-moz-selection {
  background: var(--green);
  color: var(--bg);
}

/* ── Scrollbar ───────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

/* ── Layout ──────────────────────────────────────── */

.terminal {
  max-width: 80ch;
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
}

/* ── Header / ASCII Art ──────────────────────────── */

.logo-header {
  text-align: center;
  margin-bottom: 4px;
  position: relative;
  display: inline-block;
  width: 100%;
}

.logo-img {
  width: 100%;
  max-width: 700px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* CRT scanline overlay on logo */
.logo-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.2) 0px,
    rgba(0, 0, 0, 0.2) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.ascii-header {
  color: var(--cyan);
  text-align: center;
  white-space: pre;
  font-size: 12px;
  line-height: 1.2;
  margin-bottom: 4px;
  text-shadow: 0 0 6px var(--glow-cyan), 0 0 15px var(--glow-cyan), 0 0 30px rgba(0, 229, 255, 0.15);
}

.ascii-header .overflow-text {
  color: var(--amber);
  text-shadow: 0 0 6px var(--glow-amber), 0 0 15px var(--glow-amber), 0 0 30px rgba(255, 106, 0, 0.15);
}

.tagline {
  text-align: center;
  color: var(--dim);
  margin-bottom: 24px;
  font-size: 13px;
}

.byline {
  text-align: center;
  color: var(--amber);
  margin-bottom: 4px;
  font-size: 13px;
}

/* ── Box Drawing Borders ─────────────────────────── */

.box-top, .box-mid, .box-bottom {
  color: var(--border);
  white-space: pre;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Section Headers ─────────────────────────────── */

.section-title {
  color: var(--amber);
  font-weight: 700;
  margin: 16px 0 8px 0;
}

/* ── Issue List ──────────────────────────────────── */

.issue-list {
  list-style: none;
  padding: 0;
}

.issue-item {
  margin-bottom: 4px;
  line-height: 1.5;
}

.issue-item {
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.issue-item:hover,
.issue-item.kb-focus {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.05);
}

.issue-info {
  margin-bottom: 2px;
}

.issue-number {
  color: var(--cyan);
  font-weight: 700;
}

.issue-title {
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
}

.issue-dots {
  color: var(--dim);
}

.issue-date {
  color: var(--dim);
}

.issue-desc {
  display: block;
  color: var(--dim);
  padding-left: 6ch;
  font-size: 13px;
  margin-bottom: 6px;
}

.issue-actions {
  padding-left: 6ch;
  display: flex;
  gap: 16px;
}

.issue-action {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: text-shadow 0.15s;
}









  50% { opacity: 0.4; }
}

/* ── Links ───────────────────────────────────────── */





a:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}

/* ── Language Toggle ─────────────────────────────── */

.lang-link {
  padding: 2px 6px;
  font-weight: 700;
  font-size: 13px;
}

.lang-link.active {
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 204, 255, 0.5);
  pointer-events: none;
}

.lang-link:not(.active) {
  color: var(--dim);
}

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

.footer {
  margin-top: 16px;
  padding: 8px 0;
  color: var(--dim);
  font-size: 13px;
}

.footer .status {
  color: var(--green);
}

/* ── Blinking Cursor ─────────────────────────────── */

.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Reader ──────────────────────────────────────── */

.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.reader-title {
  color: var(--cyan);
  font-weight: 700;
}

.reader-content {
  padding: 16px 0;
}

.reader-content pre {
  color: var(--green);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: auto;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.25);
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.error-message {
  color: var(--amber);
  text-align: center;
  padding: 40px 0;
  font-weight: 700;
}

/* ── Podcast Page ────────────────────────────────── */

.podcast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.podcast-main {
  padding: 24px 0;
  text-align: center;
}

.podcast-mode-label {
  color: var(--cyan);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 24px;
  text-shadow: 0 0 8px var(--glow-cyan);
}

/* Oscilloscope */
.oscilloscope-wrap {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  background: #050a05;
  position: relative;
  overflow: hidden;
}

.oscilloscope {
  width: 100%;
  height: 200px;
  display: block;
}

/* Controls */
.podcast-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.podcast-btn {
  background: none;
  border: 1px solid var(--dim);
  color: var(--green);
  font-family: var(--font);
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, text-shadow 0.15s;
}

.podcast-btn:hover {
  border-color: var(--green);
  text-shadow: 0 0 6px var(--glow-green);
}

.podcast-btn.playing {
  color: var(--cyan);
  border-color: var(--cyan);
  text-shadow: 0 0 6px var(--glow-cyan);
}

.podcast-time {
  color: var(--dim);
  font-size: 13px;
  min-width: 12ch;
}

/* Progress bar */
.podcast-progress-wrap {
  max-width: 500px;
  margin: 0 auto;
}

.podcast-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  cursor: pointer;
  position: relative;
}

.podcast-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  box-shadow: 0 0 8px var(--glow-green);
  transition: width 0.1s linear;
}

/* ── Scanline Toggle Hint ────────────────────────── */

.scanline-hint {
  position: fixed;
  bottom: 10px;
  right: 14px;
  color: var(--border);
  font-size: 11px;
  z-index: 10;
}

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

@media (max-width: 768px) {
  body {
    font-size: 12px;
  }

  .terminal {
    padding: 10px;
    max-width: 100vw;
  }

  .ascii-header {
    font-size: 6px;
    overflow: hidden;
  }

  /* Hide fixed-width box-drawing lines on mobile, use border instead */
  .box-top, .box-mid, .box-bottom {
    font-size: 0;
    height: 1px;
    background: var(--border);
    margin: 8px 0;
  }

  .issue-desc {
    padding-left: 2ch;
  }

  .reader-header,
  .podcast-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .issue-actions {
    padding-left: 2ch;
  }

  .oscilloscope {
    height: 120px;
  }

  .podcast-btn {
    font-size: 12px;
    padding: 4px 10px;
  }

  .reader-content pre {
    font-size: 11px;
    line-height: 1.5;
  }

  .scanline-hint {
    display: none;
  }
}

 .issue-action-leech:hover { text-shadow: 0 0 8px var(--glow-green); }

/* Synchronized Animation for all post elements */
.issue-action-listen, .issue-action-leech, .issue-action {
    /* We can sync multiple elements to the same animation if needed */
}


  50% { opacity: 0.4; }
}





  50% { opacity: 0.3; }
}





.issue-action-leech { 
  color: var(--green); 
} 

.issue-action-leech:hover { 
  text-shadow: 0 0 8px var(--glow-green); 
}

@keyframes listen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.issue-action-listen {
  color: var(--green);
  animation: listen-pulse 2s ease-in-out infinite;
}

.issue-action-listen:hover {
  animation: none;
  text-shadow: 0 0 8px var(--glow-green);
}

/* Force persistent link colors and disable underline */
a, a:visited, a:active {
  color: var(--amber);
  text-decoration: none !important;
  transition: text-shadow 0.2s;
}

a:hover {
  text-decoration: none !important;
  text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

/* Specific overrides for green links */
.issue-action, .issue-action:visited, .issue-action:active {
  color: var(--green) !important;
}

.issue-action-leech, .issue-action-leech:visited, .issue-action-leech:active {
  color: var(--green) !important;
}

.issue-action-listen, .issue-action-listen:visited, .issue-action-listen:active {
  color: var(--green) !important;
}

.lang-link, .lang-link:visited {
  color: var(--dim) !important;
}

.lang-link.active, .lang-link.active:visited {
  color: var(--cyan) !important;
}

/* Negative effect on action hover */
.issue-action:hover {
  background: var(--green) !important;
  color: var(--bg) !important;
  text-shadow: none !important;
  box-shadow: 0 0 10px var(--glow-green);
  padding: 0 4px;
}

/* Negative effect on back/archive links (Amber) */
.reader-nav a:hover, .podcast-header a:hover {
  background: var(--amber) !important;
  color: var(--bg) !important;
  text-shadow: none !important;
  box-shadow: 0 0 10px var(--glow-amber);
  padding: 0 4px;
}
