/* Jomboy Reference — "The Scorebook Desk" Design System
   Created: 2026-07-10
   Tokens: validated hex values, verbatim.
*/

:root {
  /* Surfaces + ink */
  --paper: #f4f6f8;
  --surface: #ffffff;
  --ink: #10192b;
  --ink-2: #44506a;
  --ink-3: #8b94a7;
  --rule: #dde3ea;
  --accent: #d62828;
  --link: #1d4ed8;

  /* Chart palette (validated 2026-07-10) */
  --viz-1: #3b82f6;
  --viz-2: #d62828;
  --viz-3: #2a9d8f;
  --viz-4: #e76f51;
  --delta-up: #16a34a;
  --delta-down: #dc2626;

  /* Type */
  --font-display: 'Anton', sans-serif;
  --font-label: 'Barlow Condensed', sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
}

/* Apply tabular numbers to numeric elements */
td.num, .stat-value, .rank { font-variant-numeric: tabular-nums; }

/* Power Rankings page layout */
.power-rankings {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.board-header {
  margin-bottom: 2rem;
}

.board-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--ink);
  margin: 0.5rem 0;
}

.board-header p {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

.breadcrumb {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.breadcrumb a {
  color: var(--link);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* StatStrip — 4-tile summary */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  margin-bottom: 2rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.stat-tile {
  padding: 1.5rem;
  border-right: 1px solid var(--rule);
  text-align: center;
}

.stat-tile:last-child {
  border-right: none;
}

.stat-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--ink);
  margin: 0;
}

/* TopTenBar — SVG bar chart */
.top-ten-bar {
  margin-bottom: 2rem;
}

.top-ten-bar svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* MonthTimeline — SVG column chart */
.month-timeline {
  margin-bottom: 2rem;
}

.month-timeline svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* FilterRow — filter UI */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--paper);
  border-radius: 6px;
  align-items: center;
  font-family: var(--font-label);
  font-size: 0.875rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  color: var(--ink-2);
  font-weight: 600;
}

.filter-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-group select:hover {
  border-color: var(--ink-3);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.1);
}

.filter-summary {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.zero-state {
  padding: 2rem;
  text-align: center;
  color: var(--ink-3);
}

.zero-state button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--link);
  color: var(--surface);
  border: none;
  border-radius: 3px;
  font-family: var(--font-label);
  cursor: pointer;
}

.zero-state button:hover {
  background: #1e40af;
}

/* RankingTable — main product table */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.ranking-table thead {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.ranking-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--font-label);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  border-bottom: 2px solid var(--rule);
  font-weight: 600;
}

.ranking-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.ranking-table th.sortable::after {
  content: ' ↕';
  opacity: 0.5;
}

.ranking-table tbody tr {
  height: 56px;
  border-bottom: 1px solid var(--rule);
}

.ranking-table tbody tr:nth-child(even) {
  background: var(--surface);
}

.ranking-table tbody tr:nth-child(odd) {
  background: #fafbfc;
}

.ranking-table tbody tr:hover {
  background: #f0f4f9;
}

.ranking-table tbody tr.rank-1 {
  border-left: 2px solid var(--accent);
}

.ranking-table td {
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-size: 0.9375rem;
}

/* Rank column */
.rank {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  width: 60px;
}

.rank-1 .rank {
  color: var(--accent);
}

.rank-2 .rank, .rank-3 .rank {
  color: var(--ink);
}

/* Delta badge */
.delta-badge {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  margin-top: 0.25rem;
}

.delta-badge.up {
  color: var(--delta-up);
}

.delta-badge.down {
  color: var(--delta-down);
}

.delta-badge.neutral {
  color: var(--ink-3);
}

/* Thumbnail column */
.thumbnail {
  width: 80px;
  height: 45px;
  border-radius: 3px;
  object-fit: cover;
  display: block;
}

/* Title + chips column */
.title-cell {
  max-width: 400px;
}

.title-cell a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.title-cell a:hover {
  color: var(--link);
}

.entity-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--ink-3);
  font-family: var(--font-label);
}

/* Team column */
.team {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* Date column */
.date {
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* Views column */
.views {
  text-align: right;
}

.views-number {
  display: block;
  font-weight: 600;
}

.magnitude-bar {
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.magnitude-bar-fill {
  height: 100%;
  background: var(--viz-1);
  border-radius: 2px;
}

/* Likes column */
.likes {
  text-align: right;
}

/* Trend column */
.trend {
  text-align: center;
}

.trend svg {
  display: block;
  margin: 0 auto;
  width: 100px;
  height: 24px;
}

.trend-placeholder {
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* Board directory */
.board-directory {
  margin-top: 3rem;
}

.board-directory h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.board-directory h2:first-of-type {
  margin-top: 0;
}

.board-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}

.board-row:last-of-type {
  border-bottom: none;
}

.board-name {
  font-family: var(--font-label);
  font-size: 0.9375rem;
  font-weight: 600;
}

.board-name a {
  color: var(--link);
  text-decoration: none;
}

.board-name a:hover {
  text-decoration: underline;
}

.board-fact {
  text-align: right;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* Methodology footer */
.methodology-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.methodology-footer h3 {
  font-family: var(--font-label);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  margin: 1rem 0 0.5rem 0;
}

.methodology-footer dt {
  font-weight: 600;
  margin-top: 0.5rem;
}

.methodology-footer dd {
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.methodology-footer a {
  color: var(--link);
  text-decoration: none;
}

.methodology-footer a:hover {
  text-decoration: underline;
}

/* Tooltips (hover) */
[title] {
  position: relative;
}

.tooltip {
  position: absolute;
  background: var(--ink);
  color: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: 3px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip.visible {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .power-rankings {
    padding: 1rem;
  }

  .board-header h1 {
    font-size: 1.75rem;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .ranking-table {
    font-size: 0.875rem;
  }

  .ranking-table td, .ranking-table th {
    padding: 0.5rem;
  }

  .title-cell {
    max-width: 200px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    width: 100%;
  }

  .filter-summary {
    margin-left: 0;
  }

  .board-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .board-fact {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .ranking-table {
    font-size: 0.8125rem;
  }

  .ranking-table td, .ranking-table th {
    padding: 0.5rem 0.375rem;
  }

  .thumbnail {
    width: 60px;
    height: 34px;
  }

  .rank {
    font-size: 1rem;
    width: 50px;
  }
}
