/* wiki.css */
/* Tarnished & Rising — Wiki Styles */
/* Mirrors app design system exactly. Cinzel for UI, Crimson Pro italic for flavor. */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: 'Cinzel', serif;
  color: #e8dcc8;
  background:
    radial-gradient(ellipse 160% 50% at 50% 0%, rgba(18,28,75,0.9) 0%, transparent 52%),
    radial-gradient(ellipse 70% 35% at 15% 35%, rgba(12,20,60,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 70% 35% at 85% 55%, rgba(10,18,55,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 100% 40% at 50% 50%, rgba(8,12,28,0.6) 0%, transparent 70%),
    radial-gradient(ellipse 130% 45% at 50% 100%, rgba(20,25,50,0.8) 0%, transparent 60%),
    linear-gradient(180deg, #02030a 0%, #04060e 30%, #050810 60%, #060910 100%);
  background-attachment: fixed;
}

/* --- CSS Variables --- */
:root {
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-dim: #8a6f32;
  --amber: #d4813a;
  --red: #E84855;
  --green: #52B788;
  --blue: #60A0FF;
  --purple: #7B5EA7;

  --bg-dark: #07080d;
  --bg-card: #0d0f16;
  --bg-card-hover: #131620;
  --bg-overlay: rgba(0, 0, 0, 0.85);

  --text-primary: #e8dcc8;
  --text-secondary: #a89880;
  --text-dim: #6a5f50;

  --border-subtle: 1px solid rgba(180,190,220,0.08);
  --border-gold-dim: 1px solid rgba(201,168,76,0.12);
  --border-gold: 1px solid rgba(201,168,76,0.4);

  --sidebar-width: 260px;
  --header-height: 56px;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--gold-light);
}

/* ============================================================
   HEADER
   ============================================================ */

.wiki-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(4,5,12,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201,168,76,0.12);
  gap: 16px;
}

.wiki-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Hamburger — mobile only */
.wiki-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.wiki-header-logo {
  height: 48px;
  width: auto;
  display: block;
}

.wiki-header-subtitle {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(201,168,76,0.4);
  letter-spacing: 0.04em;
}

/* Search */
.wiki-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.wiki-search-input {
  width: 100%;
  background: rgba(13,15,22,0.8);
  border: 1px solid rgba(180,190,220,0.1);
  border-radius: 8px;
  padding: 8px 14px 8px 36px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s;
}

.wiki-search-input::placeholder {
  color: rgba(180,190,220,0.25);
  font-style: italic;
}

.wiki-search-input:focus {
  border-color: rgba(201,168,76,0.3);
}

.wiki-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(180,190,220,0.3);
  font-size: 13px;
  pointer-events: none;
}

/* Search results dropdown */
.wiki-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0d0f16;
  border: 1px solid rgba(180,190,220,0.12);
  border-radius: 8px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.wiki-search-results.visible {
  display: block;
}

.wiki-search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(180,190,220,0.06);
  transition: background 0.15s;
}

.wiki-search-result-item:last-child {
  border-bottom: none;
}

.wiki-search-result-item:hover {
  background: rgba(201,168,76,0.05);
}

.wiki-search-result-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.wiki-search-result-section {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 12px;
  color: rgba(180,190,220,0.4);
  margin-top: 2px;
}

.wiki-search-no-results {
  padding: 12px 14px;
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(180,190,220,0.35);
}

/* App link */
.wiki-app-link {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: rgba(201,168,76,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s;
  flex-shrink: 0;
}

.wiki-app-link:hover {
  color: var(--gold);
}

/* ============================================================
   LAYOUT — SIDEBAR + CONTENT
   ============================================================ */

.wiki-layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.wiki-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  background: rgba(9,10,16,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(180,190,220,0.07);
  padding: 20px 0 40px;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.15) transparent;
}

.wiki-sidebar::-webkit-scrollbar {
  width: 4px;
}
.wiki-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.wiki-sidebar::-webkit-scrollbar-thumb {
  background: rgba(201,168,76,0.15);
  border-radius: 2px;
}

/* Sidebar category label */
.sidebar-category {
  padding: 16px 18px 6px;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.9);
}

/* First category has less top padding */
.sidebar-category:first-child {
  padding-top: 4px;
}

/* Sidebar nav link */
.sidebar-link {
  display: block;
  padding: 8px 18px 8px 20px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0.04em;
  color: rgba(180,190,220,0.8);
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(201,168,76,0.04);
  border-left-color: rgba(201,168,76,0.2);
}

.sidebar-link.active {
  color: var(--gold-light);
  background: rgba(201,168,76,0.06);
  border-left-color: var(--gold);
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: rgba(180,190,220,0.06);
  margin: 10px 18px;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.wiki-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  padding: 48px 56px 80px;
  max-width: 860px;
}

/* ============================================================
   ARTICLE TYPOGRAPHY
   ============================================================ */

/* Page title */
.article-title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(201,168,76,0.2);
}

/* Subtitle / category label under title */
.article-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.7);
  margin-bottom: 6px;
}

/* Flavor text under title */
.article-flavor {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(180,190,220,0.45);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Title divider */
.article-title-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(201,168,76,0.4), rgba(201,168,76,0.1), transparent);
  margin-bottom: 32px;
}

/* H2 section heading */
.wiki-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

/* H3 sub-section heading */
.wiki-content h3 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}

/* Body paragraph */
.wiki-content p {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(232,220,200,0.85);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

/* Inline gold highlight */
.wiki-content strong {
  color: var(--gold-light);
  font-weight: 700;
}

/* Inline emphasis */
.wiki-content em {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  color: rgba(180,190,220,0.6);
}

/* Unordered list */
.wiki-content ul {
  list-style: none;
  margin-bottom: 16px;
  padding: 0;
}

.wiki-content ul li {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(232,220,200,0.85);
  padding: 3px 0 3px 18px;
  position: relative;
  letter-spacing: 0.02em;
}

.wiki-content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: rgba(201,168,76,0.4);
  font-size: 9px;
  top: 7px;
}

/* Ordered list */
.wiki-content ol {
  list-style: none;
  counter-reset: wiki-counter;
  margin-bottom: 16px;
  padding: 0;
}

.wiki-content ol li {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(232,220,200,0.85);
  padding: 3px 0 3px 28px;
  position: relative;
  counter-increment: wiki-counter;
  letter-spacing: 0.02em;
}

.wiki-content ol li::before {
  content: counter(wiki-counter);
  position: absolute;
  left: 0;
  color: var(--gold-dim);
  font-weight: 700;
  font-size: 11px;
  top: 5px;
}

/* ============================================================
   ARTICLE COMPONENTS
   ============================================================ */

/* Info callout box */
.wiki-callout {
  background: rgba(9,11,18,0.7);
  border: 1px solid rgba(201,168,76,0.2);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 24px 0;
}

.wiki-callout p {
  margin-bottom: 0;
  color: rgba(232,220,200,0.75);
}

.wiki-callout-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

/* Warning callout */
.wiki-callout.warning {
  border-color: rgba(232,72,85,0.2);
  border-left-color: var(--red);
}

.wiki-callout.warning .wiki-callout-label {
  color: var(--red);
}

/* Data table */
.wiki-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
  border: 1px solid rgba(180,190,220,0.08);
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Cinzel', serif;
  font-size: 12px;
}

.wiki-table thead tr {
  background: linear-gradient(105deg, #2a1f08, #3a2c0e, #2a1f08);
}

.wiki-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.wiki-table tbody tr {
  border-bottom: 1px solid rgba(180,190,220,0.05);
  transition: background 0.15s;
}

.wiki-table tbody tr:last-child {
  border-bottom: none;
}

.wiki-table tbody tr:hover {
  background: rgba(201,168,76,0.04);
}

.wiki-table tbody td {
  padding: 10px 14px;
  color: rgba(232,220,200,0.8);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.wiki-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* Stat/value pill */
.wiki-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wiki-pill.gold {
  background: rgba(201,168,76,0.12);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.2);
}

.wiki-pill.red {
  background: rgba(232,72,85,0.1);
  color: #e84855;
  border: 1px solid rgba(232,72,85,0.2);
}

.wiki-pill.green {
  background: rgba(82,183,136,0.1);
  color: #52B788;
  border: 1px solid rgba(82,183,136,0.2);
}

/* Section anchor target offset (so fixed header doesn't cover it) */
.wiki-anchor {
  display: block;
  position: relative;
  top: -80px;
  visibility: hidden;
}

/* Coming soon placeholder */
.wiki-coming-soon {
  text-align: center;
  padding: 80px 40px;
}

.wiki-coming-soon-glyph {
  font-size: 32px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.wiki-coming-soon-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(201,168,76,0.5);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.wiki-coming-soon-text {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(180,190,220,0.3);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .wiki-menu-btn {
    display: block;
  }

  .wiki-header-subtitle {
    display: none;
  }

  .wiki-app-link {
    display: none;
  }

  .wiki-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }

  .wiki-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .wiki-content {
    margin-left: 0;
    padding: 32px 20px 60px;
  }

  .article-title {
    font-size: 22px;
  }
}

/* --- Mobile Overflow Fix --- */
html, body {
  overflow-x: hidden;
}

.wiki-content {
  overflow-x: hidden;
}

.wiki-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}