/* ================================================================
   next/list-page.css
   Shared styles: list page + post reader
   Depends on: ../../style.css (CSS variables)
   ================================================================ */

body { background: var(--bg); }

/* ── Layout ─────────────────────────────────────────────────────── */
.list-wrap,
.post-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 52px 24px 120px;
}

/* ── Back button ─────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 12px;
  background: rgba(179, 136, 255, 0.05);
  border: 1px solid rgba(179, 136, 255, 0.22);
  border-radius: 11px;
  text-decoration: none;
  color: var(--violet);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  margin-bottom: 48px;
  animation: fadeUp 0.5s 0.05s both;
}
.back-btn:hover {
  border-color: var(--violet);
  box-shadow: 0 0 14px rgba(179, 136, 255, 0.28);
  background: rgba(179, 136, 255, 0.08);
}
.back-arr {
  font-size: 9px;
  transition: transform 0.2s;
  display: inline-block;
}
.back-btn:hover .back-arr { transform: translateX(-2px); }

/* ── Tags inside a post row ─────────────────────────────────────── */
.row-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ── Section label ───────────────────────────────────────────────── */
.page-label {
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeUp 0.5s 0.15s both;
}
.page-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--card-br), transparent);
}

/* ── Search ──────────────────────────────────────────────────────── */
.search-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 8px 0;
  margin-bottom: 28px;
  outline: none;
  transition: border-color 0.2s;
  animation: fadeUp 0.5s 0.2s both;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: rgba(0, 229, 255, 0.35); }

/* ── Tags inside post row ───────────────────────────────────────── */
.row-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ── Tag filters (writeups) ──────────────────────────────────────── */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s 0.25s both;
}
.tag-filter {
  font-size: 9px;
  font-family: 'Space Mono', monospace;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid rgba(179, 136, 255, 0.2);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tag-filter {
  font-size: 9px;
  font-family: 'Space Mono', monospace;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid rgba(179, 136, 255, 0.2);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, opacity 0.2s;
}
.tag-filter:hover,
.tag-filter.active {
  color: var(--violet);
  border-color: rgba(179, 136, 255, 0.6);
}
.tag-filter.dimmed {
  color: rgba(107, 100, 148, 0.35);
  border-color: rgba(255, 255, 255, 0.04);
  opacity: 0.4;
}

/* ── Post list ───────────────────────────────────────────────────── */
#post-list { animation: fadeUp 0.5s 0.25s both; }

.post-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}
.post-pipe {
  color: var(--muted);
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  flex-shrink: 0;
  transition: color 0.15s;
}
.post-title {
  color: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  flex: 1;
  min-width: 120px;
  word-break: break-word;
  transition: color 0.15s;
}
.post-date {
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  flex-shrink: 0;
}
.post-row:hover .post-title { color: var(--cyan); }
.post-row:hover .post-pipe  { color: var(--cyan); }

.empty-msg {
  color: var(--muted);
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  padding: 16px 0;
}

/* ── Post reader: header ─────────────────────────────────────────── */
.post-h-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
  line-height: 1.3;
  animation: fadeUp 0.5s 0.1s both;
}
.post-h-date {
  font-size: 10px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  animation: fadeUp 0.5s 0.15s both;
}
.post-h-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  animation: fadeUp 0.5s 0.2s both;
}
.post-tag {
  font-size: 9px;
  font-family: 'Space Mono', monospace;
  padding: 2px 9px;
  border-radius: 5px;
  color: var(--violet);
  border: 1px solid rgba(179, 136, 255, 0.25);
  background: rgba(179, 136, 255, 0.08);
}
.post-divider {
  border: none;
  border-top: 1px solid var(--card-br);
  margin: 24px 0 36px;
  animation: fadeUp 0.5s 0.2s both;
}

/* ── Post reader: content ────────────────────────────────────────── */
.post-content { animation: fadeUp 0.5s 0.25s both; }

.post-content h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 2em 0 0.7em;
}
.post-content h2 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--violet);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 1.8em 0 0.6em;
}
.post-content h3 {
  font-size: 0.85rem;
  color: var(--pink);
  margin: 1.5em 0 0.5em;
}
.post-content p {
  font-size: 0.85rem;
  color: rgba(240, 238, 255, 0.75);
  line-height: 1.9;
  margin-bottom: 1em;
}
.post-content ul,
.post-content ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.post-content li {
  font-size: 0.85rem;
  color: rgba(240, 238, 255, 0.75);
  line-height: 1.9;
}
.post-content code {
  background: rgba(179, 136, 255, 0.12);
  color: var(--violet);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: 'Space Mono', monospace;
}
.post-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  margin-bottom: 1em;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--cyan);
  font-size: 0.8rem;
}
.post-content a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
  transition: border-color 0.15s;
}
.post-content a:hover { border-color: var(--cyan); }
.post-content blockquote {
  border-left: 2px solid var(--violet);
  padding: 8px 16px;
  color: var(--muted);
  background: rgba(179, 136, 255, 0.05);
  border-radius: 0 6px 6px 0;
  margin-bottom: 1em;
}
.post-content img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin-bottom: 1em;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--card-br);
  margin: 2em 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 0.8rem;
}
.post-content th {
  color: var(--violet);
  border-bottom: 1px solid rgba(179, 136, 255, 0.3);
  padding: 6px 12px;
  text-align: left;
  font-family: 'Space Mono', monospace;
}
.post-content td {
  color: rgba(240, 238, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
}

.post-error {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--pink);
  padding: 24px 0;
}

/* ── Adaptive ────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .list-wrap,
  .post-wrap  { padding: 36px 16px 72px; }
  .back-btn   { margin-bottom: 32px; }
}