/* /divisions/:slug — page-specific styles. Uses the same custom-property
   palette as /css/article.css (loaded first via the SSR shell). */

.rl-div-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px var(--rl-page-pad) 64px;
  color: var(--rl-text);
  font-family: var(--rl-font-body);
}

/* ── Hero ─────────────────────────────────────────────────────── */

.rl-div-hero {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--rl-border);
}

.rl-div-breadcrumbs {
  font-family: var(--rl-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--rl-text-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.rl-div-breadcrumbs a { color: var(--rl-text-med); text-decoration: none; }
.rl-div-breadcrumbs a:hover { color: var(--rl-text); text-decoration: underline; }
.rl-div-bc-sep { color: var(--rl-border-hi); }

.rl-div-eyebrow {
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--rl-accent-warm);
  font-weight: 700;
}

.rl-div-h1 {
  font-family: var(--rl-font-head);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0.005em;
  line-height: 0.95;
  margin: 6px 0 18px;
  text-transform: uppercase;
}

.rl-div-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rl-div-hero-stat {
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.rl-div-hero-stat-label {
  font-family: var(--rl-font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--rl-text-dim);
  text-transform: uppercase;
}

.rl-div-hero-stat-value {
  margin-top: 6px;
}

.rl-div-hero-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rl-text);
  text-decoration: none;
  flex-wrap: wrap;
}
.rl-div-hero-team:hover .rl-div-hero-name { text-decoration: underline; }

.rl-div-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rl-team, var(--rl-text-med));
  flex-shrink: 0;
}

.rl-div-hero-name {
  font-family: var(--rl-font-head);
  font-size: 16px;
  font-weight: 700;
}

.rl-div-hero-sub {
  font-family: var(--rl-font-mono);
  font-size: 11px;
  color: var(--rl-text-dim);
  letterSpacing: 0.06em;
}

/* ── Section frame ───────────────────────────────────────────── */

.rl-div-section {
  padding: 28px 0 4px;
  border-bottom: 1px solid var(--rl-border);
}
.rl-div-section:last-child { border-bottom: none; }

.rl-div-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.rl-div-section h2 {
  font-family: var(--rl-font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
  color: var(--rl-text);
}

.rl-div-section-meta {
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--rl-text-dim);
  text-transform: uppercase;
}

.rl-div-section-link {
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--rl-accent);
  text-transform: uppercase;
}

.rl-div-section-foot {
  font-family: var(--rl-font-body);
  font-size: 13px;
  color: var(--rl-text-dim);
  margin: 12px 0 4px;
  line-height: 1.5;
}

/* ── Standings tables (Actual / Optimal toggle) ──────────────── */

.rl-div-toggle {
  display: inline-flex;
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.rl-div-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rl-div-tab {
  padding: 6px 12px;
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--rl-text-med);
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.rl-div-tab:hover { color: var(--rl-text); }

.rl-div-tab-input:checked + .rl-div-tab {
  background: var(--rl-surf3);
  color: var(--rl-text);
}

/* CSS-only toggle: show the matching table, hide the other.
   IDs: rl-div-tab-actual / rl-div-tab-optimal. */
.rl-div-standings-actual  { display: table; }
.rl-div-standings-optimal { display: none;  }
#rl-div-tab-optimal:checked ~ .rl-div-standings-wrap .rl-div-standings-actual  { display: none; }
#rl-div-tab-optimal:checked ~ .rl-div-standings-wrap .rl-div-standings-optimal { display: table; }

.rl-div-standings-wrap {
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  overflow: hidden;
}

.rl-div-standings,
.rl-div-managers {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--rl-font-body);
  font-size: 14px;
}

.rl-div-standings thead th,
.rl-div-managers  thead th {
  background: var(--rl-bg1);
  border-bottom: 1px solid var(--rl-border);
  padding: 8px 12px;
  text-align: left;
  font-family: var(--rl-font-head);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--rl-text-dim);
  text-transform: uppercase;
}

.rl-div-standings tbody td,
.rl-div-managers  tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rl-border);
  vertical-align: middle;
}
.rl-div-standings tbody tr:last-child td,
.rl-div-managers  tbody tr:last-child td { border-bottom: none; }

.rl-div-col-rank { width: 36px; color: var(--rl-text-dim); font-family: var(--rl-font-mono); }
.rl-div-col-num  { text-align: right; font-family: var(--rl-font-mono); }
.rl-div-col-team { min-width: 0; }

.rl-div-team-cell { padding-left: 12px; }
.rl-div-team-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rl-text); text-decoration: none;
  font-weight: 700;
}
.rl-div-team-link:hover { text-decoration: underline; }
.rl-div-team-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.rl-div-rd-pos { color: var(--rl-positive); }
.rl-div-rd-neg { color: var(--rl-negative); }
.rl-div-rd-flat { color: var(--rl-text-dim); }
.rl-div-streak-w { color: var(--rl-positive); font-weight: 700; }
.rl-div-streak-l { color: var(--rl-negative); font-weight: 700; }

/* ── Manager grades table ────────────────────────────────────── */

.rl-div-managers-wrap {
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  overflow-x: auto;
}

.rl-div-grade {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-family: var(--rl-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 3px;
  border: 1px solid transparent;
}
.rl-div-grade-a { color: var(--rl-positive); background: rgba(46,196,182,0.12); border-color: rgba(46,196,182,0.4); }
.rl-div-grade-b { color: var(--rl-accent-blue); background: rgba(110,168,254,0.12); border-color: rgba(110,168,254,0.4); }
.rl-div-grade-c { color: var(--rl-accent-warm); background: rgba(244,162,97,0.12); border-color: rgba(244,162,97,0.4); }
.rl-div-grade-d { color: var(--rl-negative); background: rgba(230,57,70,0.12); border-color: rgba(230,57,70,0.4); }
.rl-div-grade-f { color: var(--rl-negative); background: rgba(230,57,70,0.18); border-color: rgba(230,57,70,0.55); }
.rl-div-grade-empty { color: var(--rl-text-dim); }

/* ── Run differential bars ───────────────────────────────────── */

.rl-div-rdbars {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  overflow: hidden;
}

.rl-div-rdbar-row {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rl-border);
}
.rl-div-rdbar-row:last-child { border-bottom: none; }

.rl-div-rdbar-team {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rl-text); text-decoration: none;
  font-weight: 700;
}
.rl-div-rdbar-team:hover { text-decoration: underline; }

.rl-div-rdbar-track {
  height: 8px;
  background: var(--rl-bg1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--rl-border);
}

.rl-div-rdbar-fill {
  height: 100%;
  border-radius: 4px;
}
.rl-div-rdbar-pos { background: linear-gradient(90deg, rgba(46,196,182,0.4), var(--rl-positive)); }
.rl-div-rdbar-neg { background: linear-gradient(90deg, rgba(230,57,70,0.4), var(--rl-negative)); }

.rl-div-rdbar-value {
  text-align: right;
  font-family: var(--rl-font-mono);
  font-weight: 700;
}

/* ── Recent form ─────────────────────────────────────────────── */

.rl-div-form {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  overflow: hidden;
}

.rl-div-form-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 56px 56px minmax(0,1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rl-border);
  font-family: var(--rl-font-mono);
  font-size: 13px;
}
.rl-div-form-row:last-child { border-bottom: none; }

.rl-div-form-team {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rl-text); text-decoration: none;
  font-family: var(--rl-font-body);
  font-weight: 700;
}
.rl-div-form-team:hover { text-decoration: underline; }

.rl-div-form-l10 { text-align: right; color: var(--rl-text); }
.rl-div-form-streak { text-align: right; }
.rl-div-form-note { color: var(--rl-text-dim); font-family: var(--rl-font-body); font-size: 12px; }

/* ── Insight cards ───────────────────────────────────────────── */

.rl-div-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.rl-div-insight-card {
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-div-insight-cat {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--rl-font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
}
.rl-div-insight-cat-division { color: var(--rl-accent-warm); background: rgba(244,162,97,0.12); }
.rl-div-insight-cat-manager  { color: var(--rl-accent-blue); background: rgba(110,168,254,0.12); }
.rl-div-insight-cat-team     { color: var(--rl-accent);      background: rgba(46,196,182,0.12); }
.rl-div-insight-cat-player   { color: var(--rl-text-med);    background: rgba(129,148,168,0.12); }
.rl-div-insight-cat-league   { color: var(--rl-accent-warm); background: rgba(244,162,97,0.12); }

.rl-div-insight-headline {
  font-family: var(--rl-font-head);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.005em;
  line-height: 1.3;
  color: var(--rl-text);
}

.rl-div-insight-body {
  margin: 0;
  font-size: 13px;
  color: var(--rl-text-med);
  line-height: 1.45;
}

.rl-div-insight-cta {
  align-self: flex-start;
  margin-top: 4px;
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rl-accent);
}

/* ── Keep reading ────────────────────────────────────────────── */

.rl-div-kr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.rl-div-kr-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--rl-surf1);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  color: var(--rl-text);
  text-decoration: none;
}
.rl-div-kr-card:hover { background: var(--rl-surf2); }

.rl-div-kr-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rl-team, var(--rl-text-med));
  flex-shrink: 0;
}

.rl-div-kr-name {
  font-family: var(--rl-font-head);
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}

.rl-div-kr-rec {
  font-family: var(--rl-font-mono);
  font-size: 11px;
  color: var(--rl-text-dim);
}

.rl-div-kr-links {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--rl-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rl-div-kr-links a { color: var(--rl-accent); }

/* ── Methodology ─────────────────────────────────────────────── */

.rl-div-section p code {
  background: var(--rl-bg2);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--rl-font-mono);
  font-size: 12px;
  color: var(--rl-text-med);
}

.rl-div-section p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--rl-text-med);
  margin: 0 0 10px;
}

/* ── Mobile (375px and up to 767px) ──────────────────────────── */

@media (max-width: 767px) {
  .rl-div-page {
    padding: 16px 14px 48px;
  }
  .rl-div-h1 {
    font-size: 32px;
  }
  .rl-div-hero-stats {
    grid-template-columns: 1fr;
  }
  .rl-div-section h2 {
    font-size: 18px;
  }

  /* Standings: drop PCT/GB/L10 columns on mobile to keep readable */
  .rl-div-standings thead th:nth-child(5),
  .rl-div-standings tbody td:nth-child(5),
  .rl-div-standings thead th:nth-child(6),
  .rl-div-standings tbody td:nth-child(6),
  .rl-div-standings thead th:nth-child(8),
  .rl-div-standings tbody td:nth-child(8) {
    display: none;
  }

  /* Manager grades: drop bunts + IBBs columns; keep lineup + pitching + total */
  .rl-div-managers thead th:nth-child(4),
  .rl-div-managers tbody td:nth-child(4),
  .rl-div-managers thead th:nth-child(5),
  .rl-div-managers tbody td:nth-child(5) {
    display: none;
  }

  .rl-div-rdbar-row {
    grid-template-columns: 100px 1fr 50px;
    gap: 8px;
    padding: 8px 12px;
  }

  .rl-div-form-row {
    grid-template-columns: 1fr 50px 50px;
    gap: 6px;
    padding: 8px 12px;
  }
  .rl-div-form-note { display: none; }
}
