.history-hero {
  padding: 80px 40px 40px;
}

.history-hero__content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.history-hero__tag {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--team-color, #cd853f); /* Fixed: was #8b4513, now passes 4.5:1 */
  margin-bottom: 12px;
  text-align: center;
}

.history-hero__title {
  font-family: var(--font-display);
  font-size: 46px;
  letter-spacing: 3px;
  text-align: center;
}

.history-hero__subtitle {
  color: var(--color-muted);
  text-align: center;
  max-width: 520px;
  line-height: 1.6;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 20px 40px 40px;
}

.filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  min-height: var(--min-touch-target);
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--color-muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-btn:hover {
  border-color: rgba(205, 133, 63, 0.5);
  color: var(--color-text);
}

.filter-btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.filter-btn.is-active {
  background: #cd853f; /* Fixed: was #8b4513 */
  color: #000; /* Dark text on light background for contrast */
  border-color: #cd853f;
}

.history-grid {
  padding: 0 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.history-card {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.history-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.history-card:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.history-card__bar {
  height: 4px;
  background: var(--team-color, #cd853f);
}

.history-card__content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card__icon {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--team-color, #cd853f);
}

.history-card__years {
  color: var(--color-dim);
  font-size: 13px;
}

.history-card__stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--color-muted);
}

.history-card__highlight {
  font-style: italic;
  color: var(--team-color, #cd853f);
  font-size: 13px;
}

.history-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 40px 60px;
}

.detail-card {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 30px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-icon {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--team-color, #cd853f);
}

.detail-years {
  color: var(--color-dim);
  font-size: 13px;
}

.detail-legacy {
  color: #ccc;
  line-height: 1.7;
  margin-bottom: 24px;
}

.detail-stats {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.detail-stats span:first-child {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--team-color, #cd853f);
  display: block;
}

.detail-stats span:last-child {
  font-size: 13px;
  color: var(--color-muted);
}

.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.detail-drivers h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.driver-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.driver-tags span {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 13px;
}

.detail-highlight {
  background: color-mix(in srgb, var(--team-color, #cd853f) 15%, transparent);
  padding: 20px;
  border-radius: var(--radius-sm);
  margin-top: 20px;
}

.highlight-label {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--team-color, #cd853f);
  display: block;
  margin-bottom: 8px;
}

.vintage-dial {
  width: 180px;
  height: 180px;
}

.dial-arc {
  transform: rotate(-140deg);
  transform-origin: center;
}

/* Historical team colors - all adjusted for 4.5:1 contrast ratio on dark backgrounds */
.history-card--team-lotus,
.history-detail--team-lotus {
  --team-color: #4caf50; /* Fixed: was #1b5e20 */
}

.history-card--brabham,
.history-detail--brabham {
  --team-color: #26a69a; /* Fixed: was #00695c */
}

.history-card--tyrrell,
.history-detail--tyrrell {
  --team-color: #42a5f5; /* Fixed: was #1565c0 */
}

.history-card--brm,
.history-detail--brm {
  --team-color: #66bb6a; /* Fixed: was #2e7d32 */
}

.history-card--march,
.history-detail--march {
  --team-color: #ff9800; /* Was #e65100, already good */
}

.history-card--ligier,
.history-detail--ligier {
  --team-color: #5c9ce6; /* Fixed: was #0d47a1 */
}

.history-card--jordan,
.history-detail--jordan {
  --team-color: #ffd600; /* Already passes */
}

.history-card--arrows,
.history-detail--arrows {
  --team-color: #ff9800; /* Fixed: was #ff6f00 */
}

.history-card--minardi,
.history-detail--minardi {
  --team-color: #9e9e9e; /* Fixed: was #212121 - nearly invisible! */
}

.history-card--cooper,
.history-detail--cooper {
  --team-color: #4db6ac; /* Fixed: was #004d40 */
}

.history-card--vanwall,
.history-detail--vanwall {
  --team-color: #4caf50; /* Fixed: was #1b5e20 */
}

.history-card--matra,
.history-detail--matra {
  --team-color: #42a5f5; /* Fixed: was #1976d2, borderline */
}

@media (max-width: 900px) {
  .history-hero {
    padding: 60px 24px 30px;
  }

  .history-filters {
    padding: 16px 24px 30px;
  }

  .history-grid {
    padding: 0 24px 50px;
  }

  .history-detail {
    padding: 20px 24px 50px;
  }
}

@media (max-width: 720px) {
  .history-hero__title {
    font-size: 36px;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-stats {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
