/* WikiPath — minimal stylesheet. Monochrome, system fonts, mobile-friendly. */
:root {
  --fg: #1a1a1a;
  --muted: #666;
  --bg: #fafafa;
  --accent: #2050aa;
  --accent-soft: #e6edf8;
  --border: #d0d0d0;
  --pos: #2a7a3a;
  --neg: #a04030;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --muted: #a0a0a0;
    --bg: #181818;
    --accent: #6892d8;
    --accent-soft: #243248;
    --border: #404040;
    --pos: #5cae6c;
    --neg: #c87060;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.tagline {
  color: var(--muted);
  margin: 0.2rem 0 1.5rem;
  font-size: 0.9rem;
}

#loader { margin: 2rem 0; }
#loader-status { color: var(--muted); margin-bottom: 0.5rem; }
#loader-progress { width: 100%; }

#article-title {
  margin: 0;
  font-size: 1.4rem;
}

#article-excerpt {
  margin: 0.6rem 0 1.5rem;
  color: var(--fg);
}

h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1.5rem 0 0.6rem;
}

#axis-buttons {
  display: grid;
  /* Six columns (one per axis) × two rows (↑ on top, ↓ on bottom).
     grid-auto-flow:column means buttons fill column-by-column, so the JS can
     emit them in (axis, direction) order and they land in the right cells. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 0.3rem;
}

@media (max-width: 640px) {
  /* On phones, fall back to 3 columns × 4 rows so labels stay readable. */
  #axis-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
  }
}

.axis-btn {
  /* Stack the label above the arrow now that columns are narrow. */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.4rem;
  gap: 0.15rem;
  font-size: 0.85rem;
  min-height: 3.4rem;
}

.axis-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  display: flex;
}

.axis-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.axis-btn .arrow {
  font-weight: 700;
  font-size: 1rem;
}

.axis-btn.pos .arrow { color: var(--pos); }
.axis-btn.neg .arrow { color: var(--neg); }

.note {
  margin: 1.5rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

#trail {
  padding-left: 1.4rem;
  font-size: 0.9rem;
  color: var(--fg);
}

#trail li {
  margin: 0.2rem 0;
}

#trail li .axis-tag {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.4rem;
}

#reset {
  margin-top: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}

#reset:hover {
  color: var(--fg);
  border-color: var(--fg);
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
