/* World of Clashes — Codex Wiki styles (layers on styles.css vars + glass + aurora) */

.wiki-body { min-height: 100vh; }

/* per-article accent themes */
.theme-gold    { --ac: #ffcf4a; --acg: rgba(255,207,74,.22); }
.theme-light   { --ac: #ffcf4a; --acg: rgba(255,207,74,.22); }
.theme-dark    { --ac: #9b6dff; --acg: rgba(155,109,255,.24); }
.theme-fire    { --ac: #ff7a3c; --acg: rgba(255,122,60,.24); }
.theme-frost   { --ac: #64c7f5; --acg: rgba(100,199,245,.22); }
.theme-steel   { --ac: #cfd6e0; --acg: rgba(207,214,224,.18); }
.theme-neutral { --ac: #c9a4ff; --acg: rgba(201,164,255,.2); }

/* ── top bar ─────────────────────────────────────────────────────────────── */
.wk-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 11px clamp(12px, 3vw, 28px);
}
.wk-menu { display: none; background: none; border: none; color: var(--text); font-size: 20px; line-height: 1; }
.wk-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-px); font-size: 12px; color: var(--sand); white-space: nowrap; }
.wk-brand img { width: 26px; height: 26px; image-rendering: pixelated; }
.wk-search-wrap { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.wk-search-i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
#wkSearch {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-ar); font-size: 14.5px;
  padding: 10px 16px 10px 36px;
  outline: none;
  transition: border-color .15s, background .15s;
}
html[dir='rtl'] #wkSearch { padding: 10px 36px 10px 16px; }
#wkSearch:focus { border-color: rgba(255,207,74,.6); background: rgba(255,255,255,.1); }
.wk-actions { display: flex; align-items: center; gap: 9px; }
.wk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: var(--text); font-weight: 800; font-size: 13px;
  padding: 8px 15px; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.wk-btn:hover { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.12); }

/* ── layout ──────────────────────────────────────────────────────────────── */
.wk-layout { display: grid; grid-template-columns: 270px 1fr; gap: 0; align-items: start; }
.wk-sidebar {
  position: sticky; top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  padding: 22px 14px 40px 22px;
  border-inline-end: 1px solid rgba(255,255,255,.08);
}
/* reset the site's global nav{} rule that would otherwise hijack this <nav> */
.wk-nav { position: static; display: block; inset: auto; z-index: auto; margin: 0; padding: 0; gap: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: none; }
.wk-cat { margin-bottom: 18px; }
.wk-cat-h { font-weight: 900; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--sand); margin-bottom: 8px; opacity: .9; }
.wk-cat-h span { color: var(--muted); }
.wk-cat-list { display: flex; flex-direction: column; gap: 1px; }
.wk-link {
  display: block; padding: 7px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 600;
  border-inline-start: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.wk-link:hover { background: rgba(255,255,255,.06); color: var(--text); }
.wk-link.active { background: rgba(255,207,74,.12); color: #ffe9a3; border-inline-start-color: var(--gold); }
.wk-noresults { color: var(--muted); padding: 12px; font-size: 14px; }

/* ── article scroll column ──────────────────────────────────────────────── */
.wk-scroll { min-height: calc(100vh - 62px); }
.wk-article { max-width: 900px; margin: 0 auto; padding: 26px clamp(18px, 4vw, 48px) 40px; }

.wk-crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.wk-crumb a { color: var(--muted); }
.wk-crumb a:hover { color: var(--gold); }
.wk-crumb span { opacity: .5; margin: 0 4px; }

.wk-hero {
  height: clamp(160px, 26vw, 260px);
  border-radius: var(--r-lg);
  background-size: cover; background-position: center;
  image-rendering: pixelated;
  border: 1px solid var(--ac);
  box-shadow: 0 14px 44px rgba(4,2,14,.5), 0 0 50px var(--acg), inset 0 1px 0 rgba(255,255,255,.18);
  position: relative;
}
.wk-hero::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(17,13,36,0) 40%, rgba(17,13,36,.6)); }
.wk-hero.fit-contain { background-size: contain; background-repeat: no-repeat; background-color: rgba(10,7,24,.4); }

.wk-head { margin: 22px 0 20px; }
.wk-title {
  font-family: var(--font-px);
  font-size: clamp(18px, 3vw, 30px);
  line-height: 1.3;
  color: var(--ac);
  text-shadow: 0 3px 0 var(--ink), 0 0 26px var(--acg);
}
html[lang='ar'] .wk-title { font-family: var(--font-ar); font-weight: 900; }
.wk-lead { color: var(--text); font-size: 17px; margin-top: 12px; opacity: .92; }

.wk-grid { display: grid; grid-template-columns: 1fr 290px; gap: 28px; align-items: start; }
.wk-body { min-width: 0; }
.wk-h { font-size: 19px; font-weight: 900; margin: 22px 0 8px; color: var(--text); }
.wk-h::before { content: ''; display: inline-block; width: 10px; height: 10px; background: var(--ac); border-radius: 3px; margin-inline-end: 9px; vertical-align: middle; }
.wk-p { color: var(--muted); font-size: 15.5px; line-height: 1.8; margin-bottom: 14px; }
.wk-ul { margin: 0 0 16px; padding-inline-start: 4px; }
.wk-ul li { color: var(--muted); font-size: 15px; line-height: 1.7; padding-inline-start: 22px; position: relative; }
.wk-ul li::before { content: '◆'; color: var(--ac); position: absolute; inset-inline-start: 2px; font-size: 10px; top: 5px; }
.wk-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--acg); border: 1px solid var(--ac);
  border-radius: 14px; padding: 13px 16px; margin: 6px 0 18px;
  color: var(--text); font-size: 14.5px; line-height: 1.65;
}
.wk-note-i { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--ac); color: #160f30; font-weight: 900; text-align: center; line-height: 20px; }
.wk-quote { border-inline-start: 3px solid var(--ac); padding: 6px 16px; margin: 6px 0 18px; font-size: 17px; font-style: italic; color: #e9e3f6; }
.wk-quote cite { display: block; font-size: 13px; color: var(--muted); font-style: normal; margin-top: 6px; }

.wk-fig { margin: 6px 0 18px; }
.wk-fig img { width: 100%; border-radius: var(--r-md); image-rendering: pixelated; border: 1px solid rgba(255,255,255,.12); }
.wk-fig figcaption, .wk-row-fig figcaption { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.wk-row-fig { margin: 6px 0 18px; }
.wk-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-md); }
.wk-row img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }

.wk-stat { display: flex; flex-direction: column; gap: 0; margin: 6px 0 18px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-md); overflow: hidden; }
.wk-stat > div { display: grid; grid-template-columns: 40% 60%; gap: 0; }
.wk-stat > div:nth-child(odd) { background: rgba(255,255,255,.04); }
.wk-stat dt { padding: 10px 14px; font-weight: 800; font-size: 13.5px; color: var(--ac); }
.wk-stat dd { padding: 10px 14px; color: var(--muted); font-size: 14px; }

.wk-related { margin-top: 28px; }
.wk-related h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.wk-rel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-chip {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 700; color: var(--text);
  transition: border-color .12s, background .12s;
}
.wk-chip:hover { border-color: var(--ac); background: var(--acg); color: #fff; }

/* infobox */
.wk-info { position: sticky; top: 78px; padding: 18px; align-self: start; }
.wk-portrait { display: flex; justify-content: center; margin-bottom: 12px; }
.wk-portrait img {
  width: 132px; height: 132px; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)) drop-shadow(0 0 22px var(--acg));
}
.wk-info-title { text-align: center; font-weight: 900; font-size: 16px; color: var(--ac); margin-bottom: 12px; }
.wk-ib { display: flex; flex-direction: column; gap: 0; }
.wk-ib > div { display: grid; grid-template-columns: 42% 58%; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.wk-ib > div:first-child { border-top: none; }
.wk-ib dt { font-weight: 800; font-size: 12.5px; color: var(--muted); }
.wk-ib dd { font-size: 13px; color: var(--text); }

/* prev / next */
.wk-nav-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.wk-pn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  transition: border-color .12s, background .12s;
}
.wk-pn:hover { border-color: var(--ac); background: var(--acg); }
.wk-pn span { font-size: 11.5px; color: var(--muted); }
.wk-pn b { font-size: 14.5px; color: var(--text); }
.wk-pn-next { text-align: end; }

.wk-empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.wk-foot { text-align: center; color: #6f6296; font-size: 12.5px; padding: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.wk-foot a { color: var(--sand); }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .wk-grid { grid-template-columns: 1fr; }
  .wk-info { position: static; order: -1; }
  .wk-menu { display: block; }
  .wk-back { display: none; }
  .wk-layout { grid-template-columns: 1fr; }
  .wk-sidebar {
    position: fixed; top: 0; inset-inline-start: 0; z-index: 60;
    width: 280px; max-width: 84vw; height: 100vh;
    background: rgba(15, 11, 32, .96);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: 0 0 60px rgba(0,0,0,.6);
  }
  html[dir='rtl'] .wk-sidebar { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(104%); }
  .wk-sidebar.open { transform: translateX(0); }
  .wk-search-wrap { order: 5; flex-basis: 100%; max-width: none; margin-top: 4px; }
  .wk-topbar { flex-wrap: wrap; }
  .wk-actions .wk-btn span { display: none; }
}
