/* Server catalog: sidebar filters with counts, cards with the numbers people
   pick a server by. Builds on site.css and the list rows in pages.css. */

.cat-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* ---------- region pills ---------- */
.pills { display: inline-flex; flex-wrap: wrap; box-shadow: inset 0 0 0 1px var(--line); }
.pills button, .quick button, .opts button, .rates button, .view button, .linkish {
  all: unset; cursor: pointer; box-sizing: border-box;
}
.pills button {
  padding: 11px 16px; font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  transition: color .2s, background .2s;
}
.pills button:hover { color: var(--ash); }
.pills button[aria-pressed="true"] { background: var(--ember); color: #1c0d04; }

/* ---------- quick scenarios ---------- */
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 14px; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, box-shadow .2s, background .2s;
}
.quick button:hover { color: var(--ash); box-shadow: inset 0 0 0 1px rgba(239, 228, 214, .3); }
.quick button[aria-pressed="true"] { color: var(--ash); background: rgba(255, 138, 61, .12); box-shadow: inset 0 0 0 1px var(--ember); }
.quick i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-fresh { background: var(--ok); box-shadow: 0 0 10px rgba(155, 211, 90, .6); }
.dot-soon { background: var(--warn); }
.dot-full { background: var(--bad); }
.quick span, .opts span, .rates small { font: 12px/1 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.cat { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.facets-toggle { display: none; }

/* ---------- sidebar ---------- */
.facets { position: sticky; top: 88px; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line); }
.facets-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.facets-head b { font: 600 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.linkish { font-size: 13px; color: var(--dim); }
.linkish:hover { color: var(--ember); }
.facets section { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.facets h3 { font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.opts { display: flex; flex-direction: column; gap: 2px; }
.opts button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; font-size: 14px; color: var(--muted);
  transition: color .15s, background .15s;
}
.opts button span { margin-left: auto; }
.opts button:hover { color: var(--ash); background: rgba(239, 228, 214, .04); }
.opts button[aria-pressed="true"] { color: var(--ash); background: rgba(255, 138, 61, .1); box-shadow: inset 2px 0 0 var(--ember); }
.sw { width: 10px; height: 10px; flex: none; }
.sw.official { background: var(--warn); }
.sw.modded { background: var(--ember); }
.sw.vanilla { background: var(--ok); }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rates button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px;
  font: 700 17px/1 var(--display); color: var(--ash); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s;
}
.rates button:hover { box-shadow: inset 0 0 0 1px rgba(239, 228, 214, .3); }
.rates button[aria-pressed="true"] { background: rgba(255, 138, 61, .14); box-shadow: inset 0 0 0 1px var(--ember); color: var(--ember); }
.rates small { font-size: 11px; }
.facets-note { padding: 14px 18px; font-size: 12px; line-height: 1.5; color: var(--dim); }
.opts button:focus-visible, .rates button:focus-visible, .pills button:focus-visible, .quick button:focus-visible,
.view button:focus-visible, .linkish:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.view { display: inline-flex; box-shadow: inset 0 0 0 1px var(--line); }
.view button { display: grid; place-items: center; width: 44px; height: 44px; color: var(--dim); transition: color .2s, background .2s; }
.view button svg { width: 18px; height: 18px; }
.view button:hover { color: var(--ash); }
.view button[aria-pressed="true"] { color: var(--ember); background: rgba(255, 138, 61, .12); }
.found { margin: 14px 0; font: 13px/1 var(--mono); color: var(--dim); }
.found b { color: var(--ember); font-weight: 600; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cards.as-list { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); box-shadow: 0 0 0 1px var(--line-2); }

.sv {
  --accent: var(--ok);
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--accent);
  text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s;
}
.sv.official { --accent: var(--warn); }
.sv.modded { --accent: var(--ember); }
.sv:hover { box-shadow: inset 0 0 0 1px rgba(239, 228, 214, .28), inset 3px 0 0 var(--accent); transform: translateY(-2px); }
.sv:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.sv-top { padding: 16px 16px 12px 19px; }
.sv-name {
  font-weight: 600; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.sv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.sv-tags .chip { font-size: 10px; padding: 4px 7px; }
.chip.t-official { color: var(--warn); box-shadow: inset 0 0 0 1px rgba(255, 196, 83, .45); }
.chip.t-modded { color: var(--ember); box-shadow: inset 0 0 0 1px rgba(255, 138, 61, .45); }
.chip.t-vanilla { color: var(--ok); box-shadow: inset 0 0 0 1px rgba(155, 211, 90, .4); }

.sv-pop { padding: 12px 16px 14px 19px; border-top: 1px solid var(--line-2); }
.sv-pop-l { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sv-pop-l span { font: 600 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.sv-pop-l b { font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.sv-pop-l b small { font-size: 15px; color: var(--dim); font-weight: 600; }
.sv-bar { display: block; height: 4px; margin-top: 9px; background: rgba(239, 228, 214, .1); position: relative; overflow: hidden; }
.sv-bar::after { content: ""; position: absolute; inset: 0; background: var(--ember); transform: scaleX(var(--fill, 0)); transform-origin: left; }
.sv-bar.hot::after { background: var(--bad); }
.sv-queue { display: block; margin-top: 7px; font: 12px/1 var(--mono); color: var(--warn); }

.sv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); }
.sv-kpis > div { padding: 12px 8px 12px 16px; min-width: 0; }
.sv-kpis > div + div { box-shadow: -1px 0 0 var(--line-2); padding-left: 12px; }
.sv-kpis span { display: block; font: 600 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sv-kpis b { display: block; margin-top: 7px; font: 700 19px/1.05 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-kpis b.off { color: var(--dim); font-weight: 600; }
.sv-kpis b small { font-size: 13px; color: var(--dim); font-weight: 600; }

.sv-wipe { display: flex; gap: 8px; padding: 0 16px 12px 19px; flex-wrap: wrap; }
.sv-wipe > span {
  display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 9px; font: 12px/1 var(--mono); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sv-wipe > span b { color: var(--ash); font-weight: 600; }
.sv-wipe > span.fresh { color: var(--ok); box-shadow: inset 0 0 0 1px rgba(155, 211, 90, .45); }
.sv-wipe > span.fresh b { color: var(--ok); }

.sv-graph { position: relative; height: 78px; margin-top: auto; border-top: 1px solid var(--line-2); }
.sv-graph svg { position: absolute; left: 0; right: 0; bottom: 0; top: 26px; width: 100%; height: calc(100% - 26px); display: block; }
.sv-graph .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sv-graph .area { stroke: none; }
.sv-graph .cap {
  position: absolute; left: 19px; top: 10px; font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.sv-graph .wait { position: absolute; inset: 0; display: grid; place-items: center; font: 12px/1.3 var(--mono); color: var(--dim); text-align: center; padding: 0 16px; }

.sv-go {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 12px 19px; border-top: 1px solid var(--line-2);
  font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.sv-go svg { width: 16px; height: 16px; transition: transform .2s; }
.sv:hover .sv-go { color: var(--ember); }
.sv:hover .sv-go svg { transform: translateX(3px); }

.sv-skel { height: 380px; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .cat { grid-template-columns: 1fr; }
  .facets-toggle { display: inline-flex; justify-self: start; }
  .facets { position: static; display: none; }
  .facets.open { display: block; }
}
@media (max-width: 560px) {
  .cat-top { flex-direction: column; align-items: stretch; }
  .pills { justify-content: space-between; }
  .pills button { padding: 11px 12px; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sv, .sv-go svg { transition: none; }
  .sv:hover { transform: none; }
}

/* The catalog is a grid of cards, not a column of text: let it use the
   screen. Text pages keep the 1320px measure from site.css. */
.page.wide main { max-width: 1840px; }
@media (min-width: 1500px) { .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
