/* The web wiki (tools/wiki/build_site.py). The game's own sheets, in the site's dress:
   sections down the left, the section's entries as a list, then every entry's sheet. */

.wiki { padding: 2rem 0 4rem; }
.w-layout.is-active { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }

/* sections */
.w-side { min-width: 0; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: .3rem; }
.w-side .label { margin: 0 0 .6rem; }
.w-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.w-sections a {
  display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: var(--radius);
  color: var(--muted); font: 600 .98rem/1.2 var(--font-head); letter-spacing: .02em; border: 1px solid transparent;
}
.w-sections a:hover { color: #fff; background: rgba(58, 160, 255, .06); text-decoration: none; }
.w-sections a.is-on { color: #fff; border-color: var(--line-hi); background: var(--panel-2); }
.w-sections img { width: 22px; height: 22px; object-fit: contain; flex: none; }

/* head of the page */
.w-main { min-width: 0; }
.w-title { font-size: clamp(2rem, 5vw, 2.8rem); color: #fff; margin: .6rem 0 .5rem; }
.w-intro { color: var(--text); max-width: 72ch; margin-bottom: 1.6rem; }
.w-source { color: var(--muted); font-size: .8rem; margin-top: 2.5rem; }

/* search */
.w-search { position: relative; margin: 0 0 1rem; max-width: 520px; }
.w-search input {
  width: 100%; padding: .7rem .95rem; border-radius: var(--radius); border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text); font: 500 .95rem var(--font-body);
}
.w-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(58, 160, 255, .18); }
.w-hits {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem 0;
  list-style: none; background: var(--panel); border: 1px solid var(--line-hi); border-radius: var(--radius);
  max-height: 60vh; overflow-y: auto; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
}
.w-hits a { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .9rem; color: var(--text); }
.w-hits a:hover, .w-hits a.is-sel { background: var(--panel-2); text-decoration: none; color: #fff; }
.w-hits small { color: var(--muted); white-space: nowrap; }
.w-hits .w-nohit { padding: .45rem .9rem; color: var(--muted); }

/* the section cards on the front page */
.w-cards { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.w-cards a { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; color: #fff; font: 600 1.05rem/1.2 var(--font-head); }
.w-cards a:hover { text-decoration: none; border-color: var(--blue); }
.w-cards img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.w-cards small { margin-left: auto; color: var(--muted); font: 500 .8rem var(--font-body); }

/* the entry list */
.w-index { margin-bottom: 2rem; }
.w-group { font: 700 .82rem/1 var(--font-head); letter-spacing: .14em; color: var(--accent); margin: 1.1rem 0 .5rem; }
.w-index ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; }
.w-index a {
  display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem; min-height: 44px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: .92rem; line-height: 1.25;
}
.w-index a:hover { border-color: var(--line-hi); color: #fff; text-decoration: none; }
.w-index img, .w-noicon { width: 32px; height: 32px; object-fit: contain; flex: none; }
.w-index span { flex: 1; min-width: 0; }
.w-index small { color: var(--muted); font-size: .78rem; white-space: nowrap; }

/* one entry's sheet */
.w-entry { padding: 1.3rem 1.5rem 1.2rem; margin-bottom: 1.2rem; scroll-margin-top: 90px; display: flow-root; }
.w-entry:target, .w-entry.is-target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px -10px var(--glow); }
.w-name { font-size: 1.7rem; color: #fff; margin: 0 0 .15rem; }
.w-sub { font: 700 .8rem/1.3 var(--font-head); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .8rem; }
.w-pic { float: right; width: 190px; height: auto; margin: -2.4rem 0 .6rem 1.2rem; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .6)); }
.w-h { clear: none; font: 700 .9rem/1 var(--font-head); letter-spacing: .14em; color: var(--accent); margin: 1.3rem 0 .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.w-p { font-size: .95rem; margin: 0 0 .55rem; }
.w-note { background: linear-gradient(180deg, #d9a233, #8a5a08); color: #241c04; padding: .75rem 1rem; border-radius: var(--radius); font-size: .92rem; margin: .9rem 0 .6rem; clear: both; }
.w-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-weight: 600; margin: .3rem 0 .6rem; }
.w-top { display: inline-block; margin-top: .6rem; font-size: .8rem; color: var(--muted); clear: both; }

.w-kv { display: grid; gap: 0; margin-bottom: .6rem; }
.w-kv-row { display: flex; justify-content: space-between; gap: 1.2rem; padding: .28rem 0; border-bottom: 1px dashed rgba(43, 95, 149, .35); font-size: .94rem; }
.w-kv-row:last-child { border-bottom: 0; }
.w-v { text-align: right; font-weight: 600; }

.w-table-wrap { overflow-x: auto; margin-bottom: .8rem; clear: both; }
.w-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.w-table th { text-align: left; color: var(--muted); font-weight: 600; padding: .35rem .6rem; border-bottom: 1px solid var(--line-hi); white-space: nowrap; }
.w-table td { padding: .3rem .6rem; border-bottom: 1px solid var(--line); }

/* the game's colours */
.c-text { color: var(--text); }
.c-dim { color: var(--muted); }
.c-orange { color: #f39a1e; }
.c-green { color: #5fcf5a; }
.c-red { color: #ff6a5e; }
.c-gold { color: #ffd700; }
.c-link { color: #f0b040; }
.c-blue { color: var(--blue); }
.c-yellow { color: #ffd33d; }

@media (max-width: 900px) {
  .w-layout.is-active { grid-template-columns: 1fr; gap: 1rem; }
  .w-side { position: static; max-height: none; overflow: visible; }
  .w-side .label { display: none; }
  .w-sections { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; }
  .w-sections a { white-space: nowrap; border-color: var(--line); }
}
@media (max-width: 560px) {
  .w-entry { padding: 1rem 1rem .9rem; }
  .w-pic { float: none; width: 150px; margin: 0 auto .6rem; }
  .w-index ul { grid-template-columns: 1fr; }
  .w-kv-row { font-size: .9rem; }
}
