/* ==========================================================================
   DayZ server tools — /tools/v2

   The index. One card per tool, rendered from utils/toolsCatalog.js rather
   than hand-written, so the grid is whatever the catalogue holds.

   There is no page script: searching is a GET form and the categories are
   links, so the page filters before any script runs. Nothing here styles a
   state that only JavaScript can reach.
   ========================================================================== */

.tlv2 {
  background: var(--sk-bg);
  color: var(--sk-text);
  min-height: 100vh;
}

.tlv2-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Visually hidden, still announced. */
.tlv2-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.tlv2-head { margin-bottom: 20px; }

.tlv2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sk-primary-text);
}

.tlv2-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.15;
}

.tlv2-lede {
  margin: 0;
  max-width: 68ch;
  color: var(--sk-text-2);
  line-height: 1.6;
}

/* Skynet UI paints <a> with --sk-primary, a FILL token, which as text on a
   card measures around 3:1 on the dark palettes. :not(.sk-btn) is
   load-bearing — without it this also repaints the label of a link styled as
   a button, pale accent on the accent fill underneath. */
.tlv2-classic,
.tlv2-foot a:not(.sk-btn) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--sk-primary-text);
  text-decoration: none;
}
.tlv2-classic:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Search + categories
   -------------------------------------------------------------------------- */
.tlv2-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
/* A flex item defaults to min-width: auto — its MIN-CONTENT width, not zero —
   so without this the field cannot shrink on a phone. The /status/v2 lesson. */
.tlv2-search > * { min-width: 0; }
.tlv2-search .sk-input { flex: 1 1 18rem; }

.tlv2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tlv2-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--sk-border);
  border-radius: 999px;
  background: var(--sk-surface);
  color: var(--sk-text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.tlv2-chip:hover { background: var(--sk-surface-2); color: var(--sk-text); }
/* White on --sk-primary is guaranteed >= 4.5:1 by `npm run test:themes`. */
.tlv2-chip.is-on {
  background: var(--sk-primary);
  border-color: var(--sk-primary);
  color: #fff;
}

.tlv2-chip-n {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}
/* Inside an active chip the count sits on a solid accent with a white label.
   Lightening it — the obvious choice — puts white on a paler fill, which is
   how /wiki/v2's category badge measured 3.12:1. Darken instead. */
.tlv2-chip.is-on .tlv2-chip-n {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  opacity: 1;
}

@media (pointer: coarse) {
  .tlv2-chip { min-height: 44px; }
  .tlv2 .sk-input { min-height: 44px; font-size: 16px; }
  .tlv2 .sk-btn { min-height: 44px; }
}

.tlv2-count {
  margin: 0 0 16px;
  color: var(--sk-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   The grid
   -------------------------------------------------------------------------- */
.tlv2-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 40em) {
  .tlv2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .tlv2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tlv2-grid > * { min-width: 0; }

.tlv2-item { display: flex; min-width: 0; }

.tlv2-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
a.tlv2-card:hover { border-color: var(--sk-primary); }
a.tlv2-card:focus-visible { outline: 2px solid var(--sk-primary); outline-offset: 2px; }

/* A tool that is switched off or in maintenance is not a link, so it must not
   read like one either. */
.tlv2-card.is-off { opacity: 0.62; cursor: not-allowed; }

.tlv2-card .sk-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.tlv2-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.tlv2-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--sk-primary-soft);
  color: var(--sk-primary-text);
  font-size: 17px;
}

.tlv2-badge {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* A class name assembled inside an output tag is invisible to the class
   checker, so the two states ride a data attribute and are written out here. */
.tlv2-badge[data-state="off"] {
  background: var(--sk-danger-soft);
  color: var(--sk-danger-text);
}
.tlv2-badge[data-state="wip"] {
  background: var(--sk-warning-soft);
  color: var(--sk-warning-text);
}

.tlv2-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  /* Tool names are other people's text and several run long without a space. */
  overflow-wrap: anywhere;
}

.tlv2-desc {
  margin: 0;
  color: var(--sk-text-2);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
/* The fifteen tools nobody has written a description for. Muted, not faint:
   --sk-faint is the one text token below the AA floor. */
.tlv2-desc-none { color: var(--sk-muted); font-style: italic; }

.tlv2-note {
  margin: 0;
  color: var(--sk-warning-text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.tlv2-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 8px 0 0;
}
.tlv2-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--sk-surface-2);
  color: var(--sk-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Empty state + footnote
   -------------------------------------------------------------------------- */
.tlv2-empty { max-width: 560px; margin: 24px auto; text-align: center; }
.tlv2-empty h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.tlv2-empty p { margin: 0 0 16px; color: var(--sk-text-2); line-height: 1.6; }

.tlv2-foot {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--sk-border);
  color: var(--sk-muted);
  font-size: 13px;
  line-height: 1.6;
}
