/* =============================================
   Ghosts of the Wayline — Wiki Theme
   Dark space aesthetic, matching mcbn style
   ============================================= */

:root {
  --bg-primary: #0e0e16;
  --bg-secondary: #14141f;
  --bg-card: #1a1a28;
  --bg-card-hover: #20203a;
  --border: #2a2a40;
  --accent: #7b68ee;
  --accent-dim: #4a3fa8;
  --text-primary: #e0e0f0;
  --text-muted: #8888aa;
  --text-link: #9d90ff;
  --status-positive: #4ade80;
  --status-negative: #f87171;
  --status-neutral: #94a3b8;
  --system-rin: #6090d8;
  --system-holt: #50c870;
  --system-iota: #d8a840;
  --system-brekk: #e06060;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

/* ---- Navbar ---- */
.navbar {
  background-color: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
}
.navbar-brand {
  color: var(--text-primary) !important;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.navbar-brand:hover { color: #fff !important; }
.nav-link { color: var(--text-muted) !important; font-size: 0.9rem; padding: 0.4rem 0.85rem !important; border-radius: 4px; }
.nav-link:hover, .nav-link.active { color: var(--text-primary) !important; background: rgba(255,255,255,0.06); }

/* ---- Breadcrumb ---- */
.breadcrumb { background: none; padding: 0; margin: 0; font-size: 0.85rem; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--text-link); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

/* ---- Hero ---- */
.wiki-hero { border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.wiki-hero h1 { font-size: 2rem; font-weight: 600; color: #ffffff; }
.wiki-hero .lead { color: #c0c0d8 !important; }
.wiki-hero .wiki-tagline { color: #a0a0c0; }
.wiki-tagline {
  color: var(--text-muted);
  font-style: italic;
  border-left: 3px solid var(--accent-dim);
  padding-left: 1rem;
  margin-top: 1rem;
  max-width: 600px;
}
.wiki-banner {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: block;
}
.page-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 8px;
  display: block;
}
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---- Category cards (home page) ---- */
.category-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  color: var(--text-primary);
  text-decoration: none;
}
.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.category-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }
.category-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.category-title { font-weight: 600; font-size: 1rem; }
.category-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ---- System section ---- */
.system-header { margin-bottom: 1rem; }
.system-name {
  font-size: 1.3rem;
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}
.system-divider { border-color: var(--border); margin: 2rem 0; }

/* ---- Location card ---- */
.location-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  height: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.location-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  color: #fff;
  text-decoration: none;
}
.location-card-header { display: flex; justify-content: space-between; align-items: center; }
.location-name { font-weight: 600; font-size: 1rem; }
.location-ratings { display: flex; gap: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }
.location-faction { font-size: 0.78rem; }

/* ---- Rating pips ---- */
.rating-block { display: flex; flex-direction: column; gap: 0.3rem; min-width: 110px; }
.rating-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.rating-label { color: var(--text-muted); width: 42px; font-size: 0.75rem; }
.rating-pips { display: flex; gap: 4px; }
.pip {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); border: 1px solid var(--border);
}
.pip.filled { background: var(--accent); border-color: var(--accent); }

/* ---- Detail pages ---- */
.detail-header h1 { font-size: 1.75rem; font-weight: 600; }
.detail-meta { font-size: 0.875rem; }
.detail-label { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; }
.detail-notables { font-size: 0.875rem; }

.wiki-content { max-width: 720px; }
.wiki-content h2 { font-size: 1.25rem; font-weight: 600; margin-top: 1.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.wiki-content h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.25rem; }
.wiki-content h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); margin-top: 1rem; }
.wiki-content p { margin-bottom: 0.85rem; }
.wiki-content ul { padding-left: 1.4rem; margin-bottom: 0.85rem; }
.wiki-content li { margin-bottom: 0.3rem; }
.wiki-content hr { border-color: var(--border); margin: 1.5rem 0; }
.wiki-content strong { color: #fff; }
.wiki-content em { color: var(--text-muted); }
.wiki-content code { background: var(--bg-card); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.875em; color: var(--accent); }

/* ---- Session cards ---- */
.session-list { display: flex; flex-direction: column; gap: 0.5rem; max-width: 640px; }
.session-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.session-card:hover { background: var(--bg-card-hover); border-color: var(--accent-dim); color: #fff; text-decoration: none; }
.session-title { font-weight: 600; }

/* ---- Faction cards ---- */
.faction-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  height: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.faction-card:hover { background: var(--bg-card-hover); border-color: var(--accent-dim); color: #fff; text-decoration: none; }
.faction-name { font-weight: 600; font-size: 1rem; }
.faction-agenda-hero { font-style: italic; font-size: 1rem; }
.faction-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.stat-chip {
  display: inline-block;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.status-positive { color: var(--status-positive) !important; border-color: var(--status-positive) !important; }
.status-negative { color: var(--status-negative) !important; border-color: var(--status-negative) !important; }
.status-neutral { color: var(--status-neutral) !important; }

/* ---- NPC cards ---- */
.npc-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  height: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.npc-card:hover { background: var(--bg-card-hover); border-color: var(--accent-dim); color: #fff; text-decoration: none; }
.npc-name { font-weight: 600; }

.relationship-tag {
  display: inline-block;
  font-size: 0.72rem;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.relationship-ally     { background: rgba(74,222,128,0.15); color: var(--status-positive); border: 1px solid rgba(74,222,128,0.3); }
.relationship-hostile  { background: rgba(248,113,113,0.15); color: var(--status-negative); border: 1px solid rgba(248,113,113,0.3); }
.relationship-neutral  { background: rgba(148,163,184,0.1); color: var(--status-neutral); border: 1px solid rgba(148,163,184,0.2); }
.relationship-contact  { background: rgba(123,104,238,0.15); color: var(--accent); border: 1px solid rgba(123,104,238,0.3); }
.relationship-unknown  { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Clocks ---- */
.clock-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}
.clock-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.clock-name { font-weight: 600; }
.clock-svg { width: 60px; height: 60px; flex-shrink: 0; }
.clock-fraction { font-size: 8px; fill: var(--text-muted); font-family: monospace; }
.clock-segments { display: flex; gap: 4px; flex-wrap: wrap; }
.segment {
  width: 18px; height: 18px; border-radius: 3px;
  background: var(--border); border: 1px solid rgba(255,255,255,0.05);
}
.segment.filled { background: var(--accent); }
.clock-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  background: rgba(123,104,238,0.15);
  border: 1px solid rgba(123,104,238,0.3);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.clock-status-badge.status-complete { background: rgba(74,222,128,0.15); color: var(--status-positive); border-color: rgba(74,222,128,0.3); }
.clock-status-badge.status-dormant  { background: rgba(255,255,255,0.05); color: var(--text-muted); border-color: var(--border); }

/* ---- Jobs ---- */
.act-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  border-left: 3px solid var(--border);
}
.job-card.status-complete { border-left-color: var(--status-positive); }
.job-card.status-active   { border-left-color: var(--accent); }
.job-card.status-planned  { border-left-color: var(--border); }
.job-card.status-failed   { border-left-color: var(--status-negative); }
.job-header { display: flex; justify-content: space-between; align-items: center; }
.job-name { font-weight: 600; }
.job-status-badge {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  margin-top: 4rem;
  font-size: 0.8rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--text-link); }

/* ---- Bootstrap overrides ---- */
.badge.bg-secondary { background-color: rgba(255,255,255,0.1) !important; color: var(--text-muted); font-weight: 400; }
.badge.bg-dark { background-color: rgba(255,255,255,0.06) !important; color: var(--text-muted); border-color: var(--border) !important; }
