/* ==========================================================================
   AETHERIA WIKI: layout and article styles (loaded after style.css on wiki pages)
     1. Page frame: top bar, search, three-column layout
     2. Sidebar navigation
     3. Article: title, breadcrumb, contents, pager
     4. Prose: headings, lists, tables, callouts
     5. Wiki components: cards, facts, steps, statuses, god banner
     6. Responsive
   ========================================================================== */

/* 1. PAGE FRAME --------------------------------------------------------- */
.wiki-body { background: radial-gradient(80% 40% at 50% 0%, rgba(60, 90, 220, 0.12), transparent 70%), var(--bg); }
.wiki { padding-top: var(--header-h); min-height: 70vh; }
.wiki__top { position: relative; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 13, 40, 0.9), rgba(6, 8, 26, 0.6)); margin-top: 18px; }
.wiki__topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 16px; }
.wiki__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.06em; color: var(--ice); white-space: nowrap; }
.wiki__brand svg { width: 24px; height: 24px; color: var(--frost); }

.wsearch { position: relative; flex: 0 1 460px; }
.wsearch > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--frost); pointer-events: none; }
.wsearch input {
  --cut: 8px;
  width: 100%; height: 46px; padding: 0 16px 0 44px;
  font: inherit; font-size: 0.95rem; color: var(--text);
  background: rgba(9, 12, 34, 0.9); border: 0; clip-path: var(--chamfer);
  box-shadow: inset 0 0 0 1px var(--line-3);
  -webkit-appearance: none; appearance: none;
}
.wsearch input::placeholder { color: var(--text-3); }
.wsearch input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--frost); }
.wsearch__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  max-height: min(420px, 60vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: #0b0e2c; border: 1px solid var(--line-3); border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.wsearch__results a { display: grid; gap: 2px; padding: 9px 12px; border-radius: 4px; color: var(--text); }
.wsearch__results a small { color: var(--text-3); font-size: 0.78rem; }
.wsearch__results a mark { background: none; color: var(--ice); font-weight: 700; }
.wsearch__results [aria-selected="true"] a, .wsearch__results a:hover { background: rgba(232, 194, 122, 0.12); }
.wsearch__empty { padding: 12px; color: var(--text-3); font-size: 0.9rem; }

.wiki__layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: clamp(24px, 3vw, 44px); align-items: start; padding-block: 36px 80px; width: min(1360px, 100% - var(--gutter) * 2); }

/* 2. SIDEBAR ------------------------------------------------------------ */
.wnav { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.wnav__toggle { display: none; }
.wnav__group + .wnav__group { margin-top: 22px; }
.wnav__title { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--frost); margin-bottom: 8px; }
.wnav ul { margin: 0; padding: 0; display: grid; gap: 1px; }
.wnav a { display: block; padding: 6px 10px; border-left: 2px solid transparent; color: var(--text-2); font-size: 0.93rem; line-height: 1.35; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.wnav a:hover { color: var(--text); background: rgba(150, 172, 255, 0.05); }
.wnav a[aria-current="page"] { color: var(--ice); border-left-color: var(--frost); background: linear-gradient(90deg, rgba(232, 194, 122, 0.12), transparent); font-weight: 700; }
.wnav li.sub a { padding-left: 22px; font-size: 0.88rem; }

/* 3. ARTICLE ------------------------------------------------------------ */
.wpage { min-width: 0; }
.wcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.wcrumbs a { color: var(--frost); }
.wcrumbs a:hover { color: var(--ice); }
.wpage__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.1; letter-spacing: 0.01em; margin-bottom: 14px; text-wrap: balance; }
.wpage__lead { font-size: clamp(1.05rem, 1.3vw, 1.18rem); color: var(--text-2); max-width: 68ch; padding-bottom: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.wpage__source { margin-top: 28px; font-size: 0.82rem; color: var(--text-3); }

.wtoc__title { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--frost); margin-bottom: 10px; }
.wtoc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wtoc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line-2); color: var(--text-3); font-size: 0.86rem; line-height: 1.35; transition: color 0.2s, border-color 0.2s; }
.wtoc a:hover, .wtoc a.is-active { color: var(--ice); border-left-color: var(--frost); }
.wtoc--side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.wtoc--inline { display: none; }

.wpager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.wpager__link { --cut: 10px; display: grid; gap: 4px; padding: 16px 20px; clip-path: var(--chamfer); background: rgba(11, 14, 44, 0.9); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.25s, background 0.25s; }
.wpager__link:hover { box-shadow: inset 0 0 0 1px var(--frost); background: rgba(20, 26, 70, 0.9); }
.wpager__link span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--frost); }
.wpager__link span svg { width: 14px; height: 14px; }
.wpager__link strong { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--text); }
.wpager__link--next { text-align: right; justify-items: end; }

/* 4. PROSE -------------------------------------------------------------- */
.prose { color: var(--text-2); font-size: 1rem; line-height: 1.75; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.3vw, 1.9rem); line-height: 1.2; color: var(--text); margin-top: 52px; padding-bottom: 10px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 1.6vw, 1.32rem); color: var(--text); margin-top: 34px; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose p { max-width: 75ch; }
.prose strong { color: var(--text); }
.prose a:not(.wcard) { color: var(--frost); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(232, 194, 122, 0.35); text-underline-offset: 3px; }
.prose a:not(.wcard):hover { color: var(--ice); text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 6px; max-width: 75ch; }
.prose ul[role="list"] { padding-left: 0; }
.prose li::marker { color: var(--frost); }
.prose kbd { white-space: nowrap; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 6px; background: rgba(8, 10, 32, 0.6); }
.wtable { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.5; }
.wtable th, .wtable td { padding: 10px 14px; text-align: left; vertical-align: top; }
.wtable thead th { position: sticky; top: 0; background: #12164a; color: var(--ice); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--line-3); }
.wtable tbody tr { border-top: 1px solid var(--line); }
.wtable tbody tr:nth-child(even) { background: rgba(150, 172, 255, 0.03); }
.wtable tbody tr:target { background: rgba(232, 194, 122, 0.14); box-shadow: inset 3px 0 0 var(--frost); }
.wtable td strong { color: var(--text); }
.wtable--kv tbody th { width: 34%; color: var(--text); font-weight: 700; }
.wtable--kv thead { display: none; }
.wtable--compact td { padding-block: 7px; }
.wtag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: var(--steel); background: rgba(150, 172, 255, 0.1); vertical-align: 2px; white-space: nowrap; }
.wcount { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 99px; font-family: var(--font-body); font-size: 0.72rem; font-weight: 800; color: var(--frost); background: rgba(232, 194, 122, 0.12); vertical-align: 3px; }
.wmuted { color: var(--text-3); }

.callout { --cut: 10px; padding: 14px 18px; clip-path: var(--chamfer); background: linear-gradient(90deg, rgba(80, 140, 255, 0.12), rgba(11, 14, 44, 0.9)); box-shadow: inset 3px 0 0 var(--rune); color: var(--text-2); max-width: 75ch; }
.callout--warn { background: linear-gradient(90deg, rgba(232, 180, 90, 0.14), rgba(11, 14, 44, 0.9)); box-shadow: inset 3px 0 0 var(--frost); }

/* 5. COMPONENTS --------------------------------------------------------- */
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.wcard {
  --cut: 12px; --god: var(--frost);
  position: relative; isolation: isolate; display: grid; gap: 6px; align-content: start; padding: 18px 20px;
  clip-path: var(--chamfer); background: linear-gradient(180deg, #10143a, #090b26);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 3px 0 color-mix(in srgb, var(--god) 70%, transparent);
  color: var(--text-2); transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.wcard:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--frost), inset 0 3px 0 var(--god); }
.wcard__kicker { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--frost); }
.wcard__title { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--text); }
.wcard__text { font-size: 0.92rem; line-height: 1.55; }
.wcard__more { font-size: 0.82rem; color: var(--text-3); }

.wfacts, .wstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wfacts > div, .wstats > div { --cut: 10px; display: grid; gap: 2px; padding: 14px 16px; clip-path: var(--chamfer); background: rgba(11, 14, 44, 0.9); box-shadow: inset 0 0 0 1px var(--line-2); }
.wfacts strong, .wstats strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: var(--ice); }
.wfacts span, .wstats span { font-size: 0.85rem; color: var(--text-3); }

.wsteps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.wsteps > div { --cut: 10px; padding: 16px 18px; clip-path: var(--chamfer); background: rgba(11, 14, 44, 0.9); box-shadow: inset 0 0 0 1px var(--line-2); }
.wsteps strong { display: block; font-family: var(--font-display); font-size: 1.08rem; color: var(--text); margin-bottom: 4px; }
.wsteps p { font-size: 0.93rem; line-height: 1.6; }

.wcols { columns: 3 200px; column-gap: 28px; padding-left: 1.2em !important; display: block !important; }
.wcols li { break-inside: avoid; padding: 2px 0; }

.wstatus { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; color: var(--text-3); background: rgba(150, 172, 255, 0.08); }
.wstatus.ok { color: #9be7b0; background: rgba(60, 200, 110, 0.14); }
.wstatus.warn { color: #f3d58f; background: rgba(232, 180, 90, 0.16); }
.wstatus.bad { color: #ffa8a8; background: rgba(240, 80, 80, 0.15); }

.godbanner { --cut: 14px; padding: 22px 24px; clip-path: var(--chamfer); background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--god) 28%, transparent), transparent 70%), #0b0e2c; box-shadow: inset 4px 0 0 var(--god); max-width: none; }
.godbanner p { max-width: 70ch; }
.godbanner__epithet { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--god-accent); margin-bottom: 8px; }
.godbanner__spec { margin-top: 10px; font-size: 0.95rem; }

/* 6. RESPONSIVE --------------------------------------------------------- */
@media (max-width: 1280px) {
  .wiki__layout { grid-template-columns: 220px minmax(0, 1fr); }
  .wtoc--side { display: none; }
  .wtoc--inline { display: block; --cut: 10px; padding: 16px 20px; margin-bottom: 30px; clip-path: var(--chamfer); background: rgba(11, 14, 44, 0.8); box-shadow: inset 0 0 0 1px var(--line-2); }
  .wtoc--inline ol { columns: 2 220px; display: block; }
}
@media (max-width: 900px) {
  .wiki__layout { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .wnav { position: relative; top: 0; max-height: none; overflow: visible; padding: 0; }
  .wnav__toggle {
    --cut: 8px; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 18px;
    clip-path: var(--chamfer); background: rgba(11, 14, 44, 0.95); box-shadow: inset 0 0 0 1px var(--line-3);
    font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.06em; color: var(--text);
  }
  .wnav__toggle span { width: 10px; height: 10px; border-right: 2px solid var(--frost); border-bottom: 2px solid var(--frost); transform: rotate(45deg) translateY(-3px); transition: transform 0.3s var(--ease); }
  .wnav.is-open .wnav__toggle span { transform: rotate(-135deg) translateY(-3px); }
  .js .wnav__list { display: none; }
  .js .wnav.is-open .wnav__list { display: block; padding: 18px 6px 4px; }
  .wnav a { padding-block: 9px; }
  .wfacts, .wstats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .wiki__top { margin-top: 10px; }
  .wiki__topbar { flex-direction: column; align-items: stretch; gap: 12px; padding-block: 14px; }
  .wsearch { flex: none; }
  .wsteps { grid-template-columns: 1fr; }
  .wpager { grid-template-columns: 1fr; }
  .wpager__link--next { text-align: left; justify-items: start; }
  .wtable { font-size: 0.88rem; }
  .wtable th, .wtable td { padding: 9px 11px; }
  .wtable--kv tbody th { width: 40%; }
  .prose h2 { margin-top: 40px; }
}

/* 7. DATA PAGES: prices, drops, finished content, voice modes ---------- */
.wtable td.wnum, .wdrops .wnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wtable td.wnum { text-align: right; }
.wdrops { margin: 0; padding: 0 !important; display: grid !important; gap: 4px; }
.wdrops li { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; gap: 12px; align-items: baseline; }
.wdrops li .wnum { color: var(--ice); font-weight: 700; text-align: right; }
.wdrops li .wmuted { text-align: right; font-size: 0.85rem; }
.wcontent { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 0 !important; max-width: none !important; }
.wcontent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 5px; background: rgba(11, 14, 44, 0.7); color: var(--text); font-size: 0.93rem; }
.wbadge { flex: none; padding: 2px 8px; border-radius: 99px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; color: var(--steel); background: rgba(150, 172, 255, 0.12); }
.wbadge--live { color: #9be7b0; background: rgba(60, 200, 110, 0.14); }
.wvoice { display: inline-block; padding: 2px 10px; border-radius: 4px; background: #2b2418; box-shadow: inset 0 0 0 1px #5a4a2c; font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; font-weight: 700; }
.wvoice--listen { color: #00ffff; } .wvoice--on { color: #00ff00; } .wvoice--off { color: #ff4040; }
@media (max-width: 760px) {
  .wdrops li { grid-template-columns: minmax(0, 1fr) auto; }
  .wdrops li .wmuted { grid-column: 2; }
}
@media (max-width: 760px) {
  /* Wide data tables scroll sideways instead of squeezing their columns */
  .wtable:not(.wtable--kv):not(.wtable--compact) { min-width: 580px; }
}
