/* The wiki (docs/architecture/WIKI_PLAN.md). Colours and type come from the tokens in styles.css. */
:root {
  --m-physical: #e8a05c;
  --m-magic: #7fb4ee;
  --m-heal: #84cf8c;
  --m-mana: #7fb4ee;
  --m-shield: #c9d2dc;
  --m-worse: #e58a7f;
}

.wk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.65rem clamp(1rem, 4vw, 2.5rem);
  background: var(--navy);
  border-bottom: 1px solid var(--line-soft);
}
.wk-home { color: var(--gold); font-weight: 600; text-decoration: none; }
.wk-sections { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.wk-sections a { color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.wk-sections a:hover { color: var(--gold); }

.wk-search { position: relative; flex: 1 1 14rem; max-width: 24rem; margin-left: auto; }
.wk-search input, .wk-filter {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--night);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}
#wk-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  max-height: 24rem;
  overflow-y: auto;
  list-style: none;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 4px;
}
#wk-results a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  color: var(--cream);
  text-decoration: none;
}
#wk-results a:hover, #wk-results a.active { background: var(--gold-soft); }
#wk-results span { flex: 1; min-width: 0; }
#wk-results small { color: var(--mute); }
.wk-none { padding: 0.5rem; color: var(--mute); }

.wk-main {
  width: min(70rem, 100%);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3.5rem;
}
.wk-crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; color: var(--mute); font-size: 0.85rem; }
.wk-crumbs a { color: var(--mute); }
.wk-title { margin-bottom: 1.5rem; }
.wk-title h1, .wk-card h1 { margin: 0; font-family: var(--serif); font-weight: 500; color: var(--cream); line-height: 1.15; }
.wk-title h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.wk-title p { margin: 0.5rem 0 0; }
.wk-title-home { padding: 1rem 0 0.5rem; }
.wk-title-icon { display: flex; align-items: center; gap: 0.9rem; }
.wk-note { margin-top: 2rem; color: var(--mute); font-size: 0.9rem; }

.wk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; }
.wk-tile {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--navy);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.wk-tile:hover { border-color: var(--line); color: var(--ink); }
.wk-tile h2 { margin: 0; color: var(--cream); font-family: var(--serif); font-weight: 500; font-size: 1.4rem; }
.wk-tile p { margin: 0.4rem 0 0; font-size: 0.92rem; }
.wk-tile .wk-count { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.wk-skill { display: flex; align-items: center; gap: 0.8rem; }
.wk-skill h2 { font-size: 1.15rem; }

.wk-card {
  max-width: 44rem;
  padding: 1.25rem;
  background: var(--navy);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}
.wk-card-head { display: flex; align-items: flex-start; gap: 1rem; }
.wk-card h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.wk-card h2 { margin: 0; font-size: 1.1rem; font-family: var(--sans); font-weight: 600; color: var(--cream); }
.wk-card p { margin: 0.5rem 0 0; }
.wk-sub { color: var(--ink); }
.wk-req { color: var(--gold); font-size: 0.92rem; }
.wk-examine { color: var(--cream); }
.wk-facts { color: var(--mute); font-size: 0.88rem; }
.wk-dim { color: var(--mute); font-size: 0.88rem; }
.wk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.1rem 1.5rem; margin: 0.9rem 0 0; }
.wk-stats div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line-soft); }
.wk-stats dt { color: var(--mute); }
.wk-stats dd { margin: 0; color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.wk-card-section { margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid var(--line-soft); }
.wk-card-section h3 { margin: 0; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--cream); }
.wk-card-section ul { margin: 0.4rem 0 0; padding: 0; list-style: none; }
.wk-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 0.9rem; }

.wk-icon, .wk-portrait { flex: none; border-radius: 3px; background: var(--night); }
.wk-link { display: inline-flex; align-items: center; gap: 0.5rem; vertical-align: middle; }

.wk-section { margin-top: 2rem; }
.wk-section > h2 { margin: 0 0 0.6rem; color: var(--cream); font-family: var(--serif); font-weight: 500; font-size: 1.45rem; }
.wk-section h3 { margin: 1.1rem 0 0.4rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--cream); }
.wk-section ul, .wk-section ol { margin: 0; padding-left: 1.2rem; }
.wk-section li { margin: 0.25rem 0; }
.wk-scroll { overflow-x: auto; margin-bottom: 0.9rem; }
.wk-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.wk-table th { padding: 0.4rem 0.6rem; color: var(--mute); font-weight: 600; font-size: 0.82rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.wk-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.wk-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-ingredient { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 0.8rem; white-space: nowrap; }
.wk-filter { max-width: 24rem; margin-bottom: 0.5rem; }
.wk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.15rem 1rem; padding: 0 !important; list-style: none; }
.wk-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.2rem 0; }
.wk-list li[hidden], .wk-group[hidden] { display: none; }
.wk-list small { color: var(--mute); white-space: nowrap; }
.wk-spoiler summary { cursor: pointer; color: var(--gold); }
.wk-spoiler ol { margin-top: 0.7rem; }
code { font-size: 0.9em; }

.m-dmg { color: var(--m-physical); }
.m-mdmg, .m-mana { color: var(--m-magic); }
.m-heal, .m-up { color: var(--m-heal); }
.m-hp, .m-down { color: var(--m-worse); }
.m-shield { color: var(--m-shield); }
.m-kw { color: var(--gold); }
.m-dim { color: var(--mute); }

@media (max-width: 560px) {
  .wk-search { flex-basis: 100%; max-width: none; margin-left: 0; }
  .wk-card-head { gap: 0.75rem; }
  .wk-card-head img { width: 56px; height: 56px; }
}
