/**
 * Strava ride / stat cards on eirich.ca (cycling page).
 * Lowercase + Helvetica. Load from WebStarts footer: replace the two inline
 * <style> blocks for .ride-* with:
 *   <link rel="stylesheet" href="/strava-cards-ui.css" />
 */

/* --- shared typography for all Strava card UI --- */
.recent-rides-grid,
.recent-rides-grid *,
.ride-stat-card,
.ride-stat-card * {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif !important;
}

#recent-rides-grid,
#fastest-indoor-rides-grid,
#fastest-outdoor-rides-grid,
#epic-rides-grid,
.recent-rides-grid,
.ride-stat-card,
.ride-stat-body {
  text-transform: lowercase;
}

.recent-rides-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 0;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.ride-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
  min-width: 0;
}

.ride-map-wrap {
  height: 180px;
  border-bottom: 1px solid #eee;
  background: #f6f6f6;
}

.ride-mini-map {
  width: 100%;
  height: 100%;
}

.ride-card-body {
  padding: 14px 14px 12px;
}

.ride-date {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: #fc4c02;
  margin-bottom: 6px;
}

/* Strava stores mixed-case names; force display lowercase (beats theme h3 rules). */
.ride-card .ride-title,
h1.ride-title,
h2.ride-title,
h3.ride-title,
.ride-title {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
  color: #111;
  margin: 0 0 10px 0;
  word-break: break-word;
  text-transform: lowercase !important;
}

.ride-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 14px;
  margin-bottom: 10px;
}

/* Ride cards only (not stat summary rows) */
.ride-metrics .ride-metric {
  padding: 8px 0;
  border-top: 1px solid #f1f1f1;
  min-width: 0;
}

.ride-metrics .ride-metric-label {
  font-size: 16px;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: #333;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.35;
}

.ride-metrics .ride-metric-value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 800;
  color: #111;
  line-height: 1;
  white-space: nowrap;
  flex-wrap: nowrap;
  min-width: 0;
}

.ride-metrics .ride-metric-number {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.ride-metrics .ride-metric-unit {
  font-size: 16px;
  color: #fc4c02;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  position: relative;
  top: 0;
}

.ride-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.ride-sport {
  font-size: 16px;
  color: #333;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  line-height: 1.35;
}

.ride-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  color: #fc4c02;
  text-decoration: none;
  white-space: nowrap;
}

.ride-link:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .recent-rides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .recent-rides-grid {
    grid-template-columns: 1fr;
  }
}

/* --- statistics cards (YTD / lifetime) --- */
.ride-stat-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 32px 32px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ride-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.ride-stat-kicker {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: #fc4c02;
  font-weight: 700;
  margin-bottom: 10px;
}

.ride-stat-title {
  margin: 0 0 22px 0;
  font-size: 28px;
  line-height: 1.2;
  color: #111;
  font-weight: 800;
  text-transform: lowercase !important;
}

/* Plain text / “Loading…” before JSON injects rows */
.ride-stat-body {
  display: grid;
  gap: 18px;
  font-size: 20px;
  line-height: 1.45;
  color: #333;
}

.ride-stat-body .ride-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f1f1;
}

.ride-stat-body .ride-metric:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ride-stat-body .ride-metric-label {
  font-size: 17px;
  color: #333;
  font-weight: 600;
  line-height: 1.3;
}

.ride-stat-body .ride-metric-value {
  font-size: 38px;
  line-height: 1;
  color: #111;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
}

.ride-stat-body .ride-metric-unit {
  font-size: 17px;
  color: #fc4c02;
  font-weight: 700;
  margin-left: 6px;
}

.ride-subnote {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.4;
  color: #555;
}
