* {
  box-sizing: border-box;
}
.race-discovery-page {
  margin: 0;
  line-height: 1.55;
  font-family: var(--brand-font);
}
.race-discovery-page .frame {
  max-width: 1280px;
  margin: auto;
  padding: 0 32px;
}
.race-discovery-page a {
  color: var(--page-link);
  text-underline-offset: 4px;
}
.race-discovery-page header {
  border-bottom: 1px solid var(--page-line);
}
.race-discovery-page .header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.race-discovery-page .wordmark {
  color: var(--page-text);
}
.race-discovery-page .wordmark span {
  color: var(--page-link);
}
.race-discovery-page nav {
  display: flex;
  gap: 25px;
  align-items: center;
  font-size: 13px;
  font-weight: 650;
}
.race-discovery-page nav a {
  text-decoration: none;
}
.race-discovery-page nav .active {
  border-bottom: 2px solid var(--page-accent);
  padding-block: 8px;
}
.race-discovery-page button,
.race-discovery-page input,
.race-discovery-page select {
  font: inherit;
}
.race-discovery-page .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 15px;
  background: var(--page-surface);
  border: 1px solid var(--page-line);
  border-radius: 5px;
  color: var(--page-link);
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}
.race-discovery-page .button:hover {
  border-color: var(--page-link);
}
.race-discovery-page .primary {
  background: var(--brand-gold);
  color: var(--brand-ink);
  border-color: var(--brand-gold);
}
.race-discovery-page :focus-visible {
  outline: 3px solid var(--page-link);
  outline-offset: 4px;
}
.race-discovery-page .hero {
  padding: 44px 0 25px;
  border-bottom: 1px solid var(--page-line);
}
.race-discovery-page .eyebrow {
  color: var(--page-link);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 2px;
}
.race-discovery-page h1 {
  font-size: clamp(35px, 4.5vw, 60px);
  max-width: 850px;
  line-height: 1.07;
  letter-spacing: -2px;
  margin: 18px 0;
}
.race-discovery-page .intro {
  max-width: 760px;
  color: var(--page-muted);
}
.race-discovery-page .small {
  font-size: 12px;
  color: var(--page-muted);
}
.race-discovery-page .layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 45px;
}
.race-discovery-page .filters {
  align-self: start;
  background: var(--page-surface);
  border: 1px solid var(--page-line);
  border-radius: 7px;
  padding: 20px;
}
.race-discovery-page h2 {
  font-size: 18px;
  margin: 0 0 18px;
}
.race-discovery-page .field {
  margin-bottom: 18px;
}
.race-discovery-page label {
  display: block;
  color: var(--page-muted);
  font-size: 12px;
  margin-bottom: 7px;
}
.race-discovery-page :is(input, select) {
  width: 100%;
  min-height: 44px;
  background: var(--page-bg);
  color: var(--page-text);
  border: 1px solid var(--page-line);
  border-radius: 5px;
  padding: 10px;
}
.race-discovery-page .search {
  min-height: 50px;
  margin-bottom: 20px;
}
.race-discovery-page .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--page-text);
  cursor: pointer;
  margin-bottom: 14px;
}
.race-discovery-page .checkbox input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--page-link);
}
.race-discovery-page .reset {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--page-link);
  cursor: pointer;
  text-decoration: underline;
  font-size: 12px;
}
.race-discovery-page .notice {
  background: var(--page-surface2);
  color: var(--page-muted);
  padding: 13px 16px;
  font-size: 12px;
  border-radius: 5px;
  margin: 0 0 20px;
}
.race-discovery-page .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.race-discovery-page .race {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--page-line);
  border-radius: 7px;
  background: var(--page-surface);
}
.race-discovery-page .race-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.race-discovery-page .date {
  color: var(--page-link);
  font-size: 12px;
  font-weight: 750;
}
.race-discovery-page .status {
  background: var(--page-surface2);
  color: var(--page-muted);
  padding: 3px 6px;
  font-size: 10px;
  border-radius: 4px;
}
.race-discovery-page .status.tentative {
  color: var(--page-accent);
}
.race-discovery-page .race .city {
  color: var(--page-muted);
  font-size: 12px;
  margin: 0 0 6px;
}
.race-discovery-page .race h3 {
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.3px;
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}
.race-discovery-page .facts {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
}
.race-discovery-page .distance {
  font-size: 17px;
  font-weight: 750;
}
.race-discovery-page .terrain {
  color: var(--page-muted);
  font-size: 11px;
  background: var(--page-surface2);
  border-radius: 4px;
  padding: 3px 6px;
}
.race-discovery-page .quality {
  font-size: 11px;
  color: var(--page-muted);
  border-top: 1px solid var(--page-line);
  padding-top: 12px;
  margin: 14px 0;
}
.race-discovery-page .race .button {
  width: 100%;
  font-size: 12px;
  justify-content: space-between;
}
.race-discovery-page .pager {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 25px;
}
.race-discovery-page .pager button:disabled {
  opacity: 0.45;
  cursor: default;
}
.race-discovery-page .empty {
  grid-column: 1/-1;
  padding: 35px;
  border: 1px dashed var(--page-line);
  color: var(--page-muted);
}
.race-discovery-page .missing-race {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  border: 1px solid var(--page-line);
  border-radius: 7px;
  margin-bottom: 40px;
}
.race-discovery-page .missing-race p {
  color: var(--page-muted);
  font-size: 13px;
  margin-bottom: 0;
}
.race-discovery-page footer {
  border-top: 1px solid var(--page-line);
  padding-block: 25px 35px;
  font-size: 12px;
}
.race-discovery-page dialog {
  width: min(700px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--page-line);
  border-radius: 9px;
  background: var(--page-bg);
  color: var(--page-text);
  overflow: auto;
}
.race-discovery-page dialog::backdrop {
  background: #000a;
}
.race-discovery-page .dialog-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 16px 25px;
  border-bottom: 1px solid var(--page-line);
}
.race-discovery-page .dialog-body {
  padding: 25px;
}
.race-discovery-page .dialog-body h2 {
  font-size: 27px;
  line-height: 1.25;
}
.race-discovery-page .dialog-body h3 {
  font-size: 17px;
  margin-top: 24px;
}
.race-discovery-page .dialog-body p {
  color: var(--page-muted);
}
.race-discovery-page .detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--page-line);
  border: 1px solid var(--page-line);
  border-radius: 5px;
  overflow: hidden;
  margin: 22px 0;
}
.race-discovery-page .detail-cell {
  background: var(--page-surface);
  padding: 14px;
  min-width: 0;
}
.race-discovery-page .detail-cell span {
  display: block;
  color: var(--page-muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.race-discovery-page .detail-cell strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.race-discovery-page .warning {
  color: var(--page-accent) !important;
  font-size: 13px;
}
.race-discovery-page .sources {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 25px;
}
.race-discovery-page .dialog-actions {
  display: flex;
  margin-top: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.race-context {
  background: var(--page-surface2, var(--surface));
  border: 1px solid var(--page-line, var(--line));
  border-radius: 7px;
  padding: 18px;
  margin: 18px 0;
  color: var(--page-text, var(--text));
}
.race-context h2 {
  color: var(--page-link, var(--accent));
  font: 700 12px var(--brand-font);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.race-context h3 {
  font-size: 18px;
  margin: 7px 0;
}
.race-context p {
  margin: 9px 0;
  line-height: 1.6;
  font-size: 12px;
}
.race-context a,
.race-context button {
  color: var(--page-link, var(--accent));
}
.race-context button {
  background: transparent;
  border: 1px solid var(--page-line, var(--line));
  padding: 9px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.race-context .warning {
  color: var(--page-accent, var(--accent));
}
.race-context .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 12px;
}
.home-race-entry {
  background: var(--page-surface2, #edf3f1);
  color: var(--page-text, #172b32);
  padding: 50px 0;
}
.home-race-entry h2 {
  max-width: 700px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.2;
  margin-bottom: 18px;
}
.home-race-entry p {
  max-width: 750px;
  color: var(--page-muted, #4b626c);
}
.home-race-entry form {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin-top: 22px;
}
.home-race-entry input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--page-line, #becbd0);
  border-radius: 5px;
  background: var(--page-bg, #fbfaf7);
  color: var(--page-text, #172b32);
  font: inherit;
}
@media (max-width: 1100px) {
  .race-discovery-page .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 740px) {
  .race-discovery-page .frame {
    padding-inline: 18px;
  }
  .race-discovery-page .header-inner {
    flex-wrap: wrap;
    padding-block: 14px;
    gap: 18px;
  }
  .race-discovery-page nav {
    gap: 16px;
    font-size: 12px;
  }
  .race-discovery-page nav .button {
    display: none;
  }
  .race-discovery-page .hero {
    padding-top: 28px;
  }
  .race-discovery-page h1 {
    letter-spacing: -1.2px;
  }
  .race-discovery-page .layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .race-discovery-page .filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .race-discovery-page .cards {
    grid-template-columns: 1fr;
  }
  .race-discovery-page .missing-race {
    flex-direction: column;
    align-items: flex-start;
  }
  .race-discovery-page .detail-grid {
    grid-template-columns: 1fr;
  }
  .race-discovery-page .dialog-body {
    padding: 20px;
  }
  .home-race-entry form {
    flex-direction: column;
  }
}

.tri-program-status {
  color: var(--page-link);
  font-weight: 650;
}
.tri-program-panel {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid var(--page-line);
  border-left: 3px solid var(--page-accent);
  border-radius: 6px;
}
.tri-program-panel h3 {
  margin-top: 0;
}
.route-resource {
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #777);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.route-resource a {
  display: block;
  margin-block: 0.5rem;
}
/* The complete directory is exported independently of the current page. */
.directory-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.event-website {
  margin-top: 0.7rem;
  overflow-wrap: anywhere;
}
.event-website a {
  font-weight: 600;
}
