/* WC public pages - shared styles (squads index, per-nation, per-player).
 *
 * Reuses design-system.css tokens. Brand rules: Anton skewed -10deg display
 * only, Red Hat Display body, Red Hat Mono numbers, gold #ff2740 WC accent,
 * mobile floor 360px, touch targets >= 44px, no emoji, UK English.
 */

/* Flat ground, no ambient wash - see the page-ground note in wc-site.css.
 * This rule used to paint its own red + blue radial blobs on the same
 * ::before pseudo-element that wc-site.css claimed at equal specificity, so
 * whichever sheet loaded last won and the two washes were never both visible.
 * Both are gone; the ground is --surface-base and nothing paints over it. */
body.page-wc {
  padding-top: 32px;
  background: var(--surface-base);
  min-height: 100vh;
}

/* ── WC sub-nav (S2 only - full nav transformation lands in S8A) ──────── */
.wc-subnav {
  /* fluid width per S8A - wc-site.css owns the padding */
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.wc-subnav a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.wc-subnav a:hover { color: var(--text-primary); border-color: var(--border-default); }
.wc-subnav a.is-current { color: #ff2740; border-color: rgba(255, 39, 64, 0.5); background: rgba(255, 39, 64, 0.06); }
.wc-subnav .home-link {
  margin-left: auto;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.wc-hero {
  /* fluid width per S8A - wc-site.css owns the padding */
  margin: 0 auto;
  padding: 24px 20px 16px;
}
.wc-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff2740;
  padding: 6px 10px; border: 1px solid rgba(255, 39, 64, 0.35);
  border-radius: 999px;
  background: rgba(255, 39, 64, 0.06);
}
.wc-hero h1,
/* A hero title that is NOT the page's h1: the player page's loading
   placeholder, which must not be a second heading. Same rule, so the
   placeholder and the real hero are indistinguishable on screen. */
.wc-hero .wc-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 16px 0 12px;
  color: var(--text-primary);
}
.wc-hero p {
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0;
  line-height: 1.55;
}
.wc-meta-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.wc-meta-line strong { color: var(--text-secondary); font-weight: 600; }

/* ── Toolbar ───────────────────────────────────────────────────────────── */
.wc-toolbar {
  /* fluid width per S8A - wc-site.css owns the padding */
  margin: 16px auto 0;
  padding: 16px 20px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.wc-toolbar label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wc-toolbar select, .wc-toolbar input {
  padding: 10px 12px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 44px;
  letter-spacing: normal;
  text-transform: none;
}
.wc-toolbar .pill-group {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.wc-pill-button {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-base);
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 36px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wc-pill-button:hover { color: var(--text-primary); border-color: var(--border-default); }
.wc-pill-button.is-active {
  color: #ff2740;
  border-color: rgba(255, 39, 64, 0.5);
  background: rgba(255, 39, 64, 0.08);
}
.wc-result-count {
  margin: 0;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Main ──────────────────────────────────────────────────────────────── */
.wc-main {
  /* fluid width per S8A - wc-site.css owns the padding */
  margin: 0 auto;
  padding: 16px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.wc-main > * { min-width: 0; }

/* ── Nation cards grid (squads.html) ──────────────────────────────────── */
.wc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.wc-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}
.wc-card.is-loaded:hover {
  border-color: rgba(255, 39, 64, 0.5);
  transform: translateY(-2px);
}
.wc-card.is-pending {
  opacity: 0.5;
  pointer-events: none;
  border-style: dashed;
}
.wc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.wc-card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  margin: 0;
}
.wc-card-confed {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.wc-card-coach {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.wc-card-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.wc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}
.wc-pill .n { color: var(--text-primary); font-size: 12px; }
.wc-pill-host { color: #ff2740; border-color: rgba(255, 39, 64, 0.4); background: rgba(255, 39, 64, 0.08); }
.wc-pill-pending { color: var(--text-muted); }
.wc-pill-warn { color: #ff2740; border-color: rgba(255, 39, 64, 0.4); background: rgba(255, 39, 64, 0.08); }

/* ── Methodology inline expandable ────────────────────────────────────── */
.wc-method-link {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.wc-method-link summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}
.wc-method-link summary::-webkit-details-marker { display: none; }
.wc-method-link summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 18px;
}
.wc-method-link[open] summary::after { content: '−'; }
.wc-method-link[open] summary { color: var(--text-primary); border-bottom: 1px solid var(--border-subtle); }
.wc-method-body { padding: 12px 16px 16px; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.wc-method-body p { margin: 0 0 8px; }
.wc-method-body a { color: #ff2740; text-decoration: none; border-bottom: 1px solid rgba(255, 39, 64, 0.3); }
.wc-method-body a:hover { border-bottom-color: #ff2740; }

/* ── Per-nation table (squad.html) ────────────────────────────────────── */
.wc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}
.wc-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  min-height: 40px;
}
.wc-tab:hover { color: var(--text-secondary); background: var(--surface-elevated); }
.wc-tab.is-active {
  color: #ff2740;
  border-color: rgba(255, 39, 64, 0.4);
  background: rgba(255, 39, 64, 0.08);
}
.wc-squad-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-elevated);
}
.wc-squad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.wc-squad-table th, .wc-squad-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.wc-squad-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--surface-elevated);
  z-index: 1;
}
.wc-squad-table th.num, .wc-squad-table td.num {
  text-align: right;
  font-family: var(--font-mono);
}
.wc-squad-table th.sorted-asc::after { content: ' ▲'; color: var(--text-primary); }
.wc-squad-table th.sorted-desc::after { content: ' ▼'; color: var(--text-primary); }
.wc-squad-table tbody tr { cursor: pointer; }
.wc-squad-table tbody tr:hover { background: var(--surface-hover); }
.wc-squad-table .player-name { font-weight: 600; color: var(--text-primary); }
.wc-squad-table .player-club { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }
.wc-row-flag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}
.wc-row-flag-gap { color: #ff2740; border-color: rgba(255, 39, 64, 0.5); }
.wc-row-flag-stub { color: var(--text-muted); border-color: var(--border-subtle); }
.wc-row-flag-low { color: var(--red-400); border-color: rgba(255, 43, 43, 0.5); }

/* ── Player detail page (player.html) ─────────────────────────────────── */
.wc-player-hero {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: baseline;
}
.wc-player-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 6vw, 48px);
  margin: 0;
  letter-spacing: 0.01em;
}
.wc-player-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.wc-player-meta strong { color: var(--text-secondary); font-weight: 600; }
.wc-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.wc-stat-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}
.wc-stat-card h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.wc-stat-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 13px;
  align-items: baseline;
}
.wc-stat-list .label { color: var(--text-secondary); }
.wc-stat-list .value { font-family: var(--font-mono); color: var(--text-primary); text-align: right; }
.wc-stat-list .value.is-missing { color: var(--text-muted); }
.wc-empty-row {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}
.wc-section-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 0;
}

/* ── Bar chart for weighted_per_90 ────────────────────────────────────── */
.wc-bars {
  display: grid;
  gap: 8px;
}
.wc-bar {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.wc-bar .label {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.wc-bar .track {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.wc-bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--blue-400), #ff2740);
  border-radius: 999px;
}
.wc-bar .value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-align: right;
}

/* ── Focus rings ──────────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Narrow widths ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .wc-result-count { margin-left: 0; flex: 1 1 100%; }
  .wc-grid { grid-template-columns: 1fr; }
  .wc-card-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .wc-card-name { font-size: 20px; }
  .wc-bar { grid-template-columns: 84px 1fr 52px; font-size: 11px; }
}
@media (max-width: 400px) {
  .wc-hero h1, .wc-hero .wc-hero-title { font-size: 30px; }
  .wc-player-hero h1 { font-size: 26px; }
}
