/* MMA.SOCIAL - the desktop rail on stats pages (includes/components/stats-rail.php)
 *
 * Owner, 2026-10-09: "IMPROVE DESKTOP SIDEBAR DESIGN TOO. BASED ON EACH PAGE. EACH PAGE
 * TYPE SHOULD HAVE ITS OWN DESING". Three rails, one family look:
 *   .srl--board      the board's own family: face, board, leader, figure - a quiet list
 *   .srl--record     the record book: the FIGURE leads, in gold (they are records), with a
 *                    gold rule over the card - the one rail that reads like a ledger
 *   .srl--analytics  the finishers: each row carries its method colour (KO / SUB / all)
 *                    as a bar and a ring on the face
 * plus .srl-feat, one leader from another family with a big face and the key number in
 * gold. Colour roles: red (--cyan) = action, gold (--belt) = records / #1 / key number,
 * grey (--ash) = metadata, text --chalk. 2px corners. Every colour is a theme token, so
 * both themes work from the same rules.
 * Desktop only: the rail is hidden under 1080px (css/site.css).
 */

.srl { display: flex; flex-direction: column; gap: 14px; }
.srl *, .srl *::before, .srl *::after { box-sizing: border-box; }

.srl .srl-card {
  background: var(--fan-card, var(--bg-card));
  box-shadow: var(--fan-shadow, none);
  border-radius: 2px;
  padding: 16px 16px 6px;
  margin: 0;
}

/* ---- the card heading: a grey kicker over a display title ---- */
.srl .srl-h {
  margin: 0 0 6px;
  font-family: var(--f-display);
  font-size: 1.25rem;
  line-height: 1.05;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--chalk);
  -webkit-text-fill-color: currentColor;
  background: none;
  border: 0;
  padding: 0;
}
.srl .srl-h-k {
  display: block;
  margin-bottom: 4px;
  font-family: var(--f-data);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  color: var(--ash);
  -webkit-text-fill-color: currentColor;
}

.srl .srl-list { list-style: none; margin: 0; padding: 0; }
.srl .srl-list > li { margin: 0; padding: 0; border-top: 1px solid var(--fan-line, var(--border)); }
.srl .srl-list > li:first-child { border-top: 0; }
.srl .srl-list > li::before, .srl .srl-list > li::marker { content: none; }

/* ---- a row: face | board + leader | figure ---- */
.srl .srl-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 6px;
  margin: 0 -6px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--chalk);
  background: transparent;
  transition: background-color .12s ease;
}
.srl .srl-row:hover, .srl .srl-row:focus-visible { background: var(--fan-card-hi, var(--bg-hover)); }
.srl .srl-row:hover .srl-lab, .srl .srl-row:focus-visible .srl-lab { color: var(--cyan); }

.srl .srl-face, .srl .srl-feat-face {
  position: relative;
  display: block;
  overflow: hidden;
  flex: none;
  background: none;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
.srl .srl-face { width: 36px; height: 40px; }
.srl .srl-face img, .srl .srl-feat-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  transform: scale(1.28);
  transform-origin: 50% 4%;
}
/* a head-found bust is already framed on the head - no zoom */
.srl .srl-face img[src*="/bust/"], .srl .srl-feat-face img[src*="/bust/"] { transform: none; }

/* no portrait: the leader's initials on a tonal plate (same footprint, no fade) */
.srl .srl-ini {
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-image: none;
          mask-image: none;
  background: var(--sf-6, var(--fan-card-hi));
  border-radius: 2px;
  font-family: var(--f-data);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ash);
}
.srl .srl-ini--none { background: var(--sf-5, var(--fan-card-hi)); }

.srl .srl-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.srl .srl-lab, .srl .srl-who {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* a board's name may take two lines - "Streak Without a Titl..." told nobody anything */
.srl .srl-lab {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.srl .srl-lab {
  font-family: var(--f-body, inherit);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--chalk);
  transition: color .12s ease;
}
.srl .srl-who { font-size: 12.5px; line-height: 1.25; color: var(--ash); }
.srl .srl-fig {
  font-family: var(--f-display);
  font-size: 1.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--chalk);
  -webkit-text-fill-color: currentColor;
  white-space: nowrap;
  text-align: right;
}

/* ---- RECORD BOOK: a ledger - the record first, in gold ---- */
.srl--record .srl-book { border-top: 2px solid var(--belt); }
.srl .srl-rec {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 6px;
  margin: 0 -6px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--chalk);
  transition: background-color .12s ease;
}
.srl .srl-rec:hover, .srl .srl-rec:focus-visible { background: var(--fan-card-hi, var(--bg-hover)); }
.srl .srl-rec:hover .srl-lab, .srl .srl-rec:focus-visible .srl-lab { color: var(--cyan); }
.srl .srl-rec-fig {
  font-family: var(--f-display);
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--belt);
  -webkit-text-fill-color: currentColor;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.srl .srl-switch {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 4px -16px 0;
  padding: 0 16px;
  border-top: 1px solid var(--fan-line, var(--border));
  font-family: var(--f-data);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cyan);
}
.srl .srl-switch:hover { background: var(--fan-card-hi, var(--bg-hover)); }

/* ---- ANALYTICS: the finishers, in their method colours ---- */
.srl--analytics .srl-row { padding-left: 14px; box-shadow: inset 3px 0 0 var(--srl-m, var(--fan-line)); }
.srl--analytics .srl-row .srl-face { box-shadow: none; }
.srl--analytics .srl-row--ko  { --srl-m: var(--fan-ko); }
.srl--analytics .srl-row--sub { --srl-m: var(--fan-sub); }
.srl--analytics .srl-row--all { --srl-m: var(--chalk); }   /* every finish: neutral, so red stays KO */
.srl--analytics .srl-row .srl-fig { color: var(--srl-m, var(--chalk)); }
.srl--analytics .srl-list > li { border-top-color: transparent; }
.srl--analytics .srl-list > li + li { margin-top: 2px; }

/* ---- the featured leader, from another family ---- */
.srl .srl-feat { padding: 16px; }
.srl .srl-feat-k {
  display: block;
  margin-bottom: 10px;
  font-family: var(--f-data);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ash);
}
.srl .srl-feat-a {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  text-decoration: none;
  color: var(--chalk);
}
.srl .srl-feat-face { width: 72px; height: 80px; }
.srl .srl-feat-face.srl-ini { font-size: 20px; }
.srl .srl-feat-txt { display: flex; flex-direction: column; min-width: 0; gap: 3px; padding-bottom: 2px; }
.srl .srl-feat-lab {
  font-family: var(--f-data);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srl .srl-feat-who {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--chalk);
  transition: color .12s ease;
}
.srl .srl-feat-fig {
  font-family: var(--f-display);
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--belt);
  -webkit-text-fill-color: currentColor;
}
.srl .srl-feat-a:hover .srl-feat-who, .srl .srl-feat-a:focus-visible .srl-feat-who { color: var(--cyan); }

/* ---- the way back to everything: the rail's one primary action ---- */
.srl .srl-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 2px;
  background: var(--fan-card, var(--bg-card));
  box-shadow: var(--fan-shadow, none);
  font-family: var(--f-data);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cyan);
  transition: background-color .12s ease;
}
.srl .srl-all:hover, .srl .srl-all:focus-visible { background: var(--fan-card-hi, var(--bg-hover)); }

@media (prefers-reduced-motion: reduce) {
  .srl .srl-row, .srl .srl-rec, .srl .srl-all, .srl .srl-lab, .srl .srl-feat-who { transition: none; }
}

/* a unit after a figure ("4,180 days", "19.1 min") - small, grey, so the number leads */
.srl .srl-unit {
  margin-left: 3px;
  font-family: var(--f-data);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ash);
  -webkit-text-fill-color: currentColor;
}
.srl .srl-feat-fig .srl-unit { font-size: 13px; }

/* The custom sl-* boards (most strikes, takedowns, knockdowns, control time...) live in
   .stats-leaderboard-page, not .rankings-page-narrow, so they get the same two-column
   grid here (css/arena-components.css owns it for .rankings-page-narrow). */
@media (min-width: 1080px) {
  .stats-leaderboard-page.rk-with-aside .rk-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
    align-items: start;
  }
}
