/* results.css — Resultaten page (shared system lives in base.css) */

#results-page {
  background: var(--c-cream);
  min-height: calc(var(--vh, 1vh) * 100);
  padding: 7vh 5vw 5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: var(--fs-h1);
  text-align: center;
  margin: 0 0 1.75rem;
}

.results-title a {
  color: var(--c-blue);
  text-decoration: none;
}

/* ---- Container ---------------------------------------------------------- */
.results-container {
  width: min(1200px, 96vw);
  background: var(--c-white);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* ---- Controls ----------------------------------------------------------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 20px);
  margin-bottom: clamp(16px, 3vw, 24px);
  align-items: center;
  justify-content: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--c-blue);
  text-align: center;
}

select,
.sort-btn {
  padding: 10px 16px;
  border: 2px solid rgba(26, 35, 80, 0.18);
  background: var(--c-cream);
  color: var(--c-navy);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: clamp(14px, 3.5vw, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
}

select {
  min-width: 140px;
}

select:focus,
.sort-btn:focus {
  outline: none;
  border-color: var(--c-blue);
}

select:hover,
.sort-btn:hover {
  border-color: var(--c-blue);
}

/* ---- Sort buttons ------------------------------------------------------- */
.sort-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.sort-btn {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 8px 14px;
  font-size: clamp(12px, 3vw, 14px);
}

.sort-btn.active {
  background: var(--c-blue);
  border-color: var(--c-blue);
  color: var(--c-white);
}

/* ---- Table -------------------------------------------------------------- */
.results-table-container {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(26, 35, 80, 0.12);
  margin-top: 12px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(13px, 3.5vw, 15px);
}

.results-table th {
  background: var(--c-blue);
  color: var(--c-white);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 12px 8px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(26, 35, 80, 0.1);
  color: var(--c-navy);
  white-space: nowrap;
}

.results-table tr:hover {
  background: rgba(42, 73, 201, 0.07);
}

.results-table tr:last-child td {
  border-bottom: none;
}

/* ---- Status ------------------------------------------------------------- */
.status-finished {
  color: var(--c-blue);
  font-weight: 700;
}

.status-dnf,
.status-dns,
.status-dsq {
  color: var(--c-red);
  font-weight: 700;
}

/* ---- Rank --------------------------------------------------------------- */
.rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-blue);
  min-width: 30px;
  text-align: center;
}

.rank-dsq {
  color: var(--c-red);
}

.rank.empty {
  color: #9aa0b8;
}

/* ---- Times -------------------------------------------------------------- */
.time {
  font-variant-numeric: tabular-nums;
}

.time-empty {
  color: #9aa0b8;
  font-style: italic;
}

/* ---- Badges ------------------------------------------------------------- */
.gender-badge {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-white);
}

.gender-M {
  background: var(--c-blue);
}

.gender-V {
  background: var(--c-red);
}

.gender-R {
  background: #f3c518; /* yellow, in line with the M/V badges */
  color: var(--c-navy);
}

.medal {
  margin-right: 4px;
}

/* ---- Summary ------------------------------------------------------------ */
.summary {
  text-align: center;
  color: var(--c-navy);
  font-size: clamp(14px, 3.5vw, 15px);
  margin-top: 1rem;
  padding: 12px;
  background: var(--c-cream-2);
  border-radius: var(--radius-sm);
}

.loading {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: clamp(16px, 4vw, 18px);
}

/* ---- Sponsors band ------------------------------------------------------ */
.sponsors-section {
  width: 100%;
  padding: 8vh 5vw;
  background: var(--c-blue);
  text-align: center;
}

.sponsors-section .wordmark {
  color: var(--c-white);
  font-size: var(--fs-h2);
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.sponsors-section .sponsor-grid img {
  filter: brightness(0) invert(1);
}

.sponsors-section .sponsor-grid a:hover img,
.sponsors-section .sponsor-grid a:focus img {
  filter: none;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
  .results-table th,
  .results-table td {
    padding: 8px 6px;
  }

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

  .control-group,
  select {
    width: 100%;
  }

  .sort-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .sort-btn {
    flex: 1;
    min-width: 60px;
  }
}

@media (max-width: 600px) {
  .results-table th.narrow,
  .results-table td.narrow {
    font-size: clamp(11px, 3.2vw, 12px);
  }
}
