/* ==========================================================================
   Performance pages — /cdn-performance/<region>/ and /cdn-performance/<cdn>/
   --------------------------------------------------------------------------
   Pages are written by scripts/build_performance_pages.py.
   1. Hero meta ("Last updated")
   2. Data summary (one block per object size: stat tiles + tables)
   3. Responsive
   The hero card is shared by all pages → main.css
   The map section: /assets/css/tools/performance-map.css
   ========================================================================== */

/* 1. Hero meta
   ========================================================================== */
.perf-hero__meta {
  color: var(--color-ink-60);
  font-size: 15px;
}

/* 2. Data summary
   ========================================================================== */
.perf-summary {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.perf-summary__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* One block per object size: heading, stat tiles, tables */
.perf-size {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.perf-size + .perf-size {
  padding-top: 40px;
  border-top: 1px solid var(--color-ink-12);
}

.perf-size__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.perf-size__sub {
  color: var(--color-ink-60);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.perf-size__note {
  color: var(--color-ink-75);
  font-size: 15px;
  line-height: 1.45;
}

/* Stat tiles: one headline number each */
.perf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.perf-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--color-ink-06);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.perf-stat__label {
  color: var(--color-ink-60);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.perf-stat__value {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.perf-stat__note {
  color: var(--color-ink-75);
  font-size: 15px;
  line-height: 1.4;
}

/* Two tables side by side */
.perf-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(24px, 4vw, 72px);
  align-items: start;
}

.perf-table-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.perf-table-block__title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.35;
}

.perf-table th {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--color-ink-12);
  color: var(--color-ink-60);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.perf-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--color-ink-06);
}

.perf-table th:last-child,
.perf-table td:last-child {
  padding-right: 0;
}

/* Numbers line up on the right */
.perf-table .perf-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.perf-table a {
  text-decoration: underline;
  text-decoration-color: var(--color-ink-12);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms;
}

.perf-table a:hover {
  text-decoration-color: var(--color-ink);
}

.perf-table__sub {
  color: var(--color-ink-60);
}

.perf-summary__note {
  max-width: 900px;
  color: var(--color-neutral-5);
  font-size: 14px;
  line-height: 1.45;
}

/* 3. Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .perf-tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .perf-summary__inner {
    gap: 28px;
  }

  .perf-size {
    gap: 20px;
  }

  .perf-size + .perf-size {
    padding-top: 28px;
  }

  .perf-stat {
    padding: 20px;
  }

  .perf-table {
    font-size: 14px;
  }

  .perf-table th,
  .perf-table td {
    padding-right: 10px;
  }

  /* Second value in a cell (e.g. the runner-up's latency) drops to its own line */
  .perf-table__sub {
    display: block;
  }
}
