/* Manhattan Racing Club — site styles
   Motif: green highway guide signs (destinations + mileage out of Manhattan).
   Everything else stays quiet so the signs carry the page. */

:root {
  --sign-green: #0b5d3b;   /* guide-sign green */
  --sign-green-dark: #08482e;
  --sign-white: #ffffff;
  --exit-yellow: #f2c200;  /* used once per page at most: the "Next up" tab */
  --concrete: #ecedea;     /* page background */
  --asphalt: #222628;      /* body text */
  --asphalt-soft: #545b60; /* secondary text */
  --rule: #c9ccc8;

  --font: "Overpass", "Highway Gothic", "Roboto", system-ui, sans-serif;

  /* type scale, ratio 1.25 */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: 2.07rem;
  --step-4: 2.6rem;
  --step-5: 3.25rem;

  --measure: 64ch;
  --page: 70rem;
  --gap: clamp(1rem, 3vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--concrete);
  color: var(--asphalt);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
}

a { color: var(--sign-green); text-underline-offset: 0.18em; }
a:hover { color: var(--sign-green-dark); }

:focus-visible {
  outline: 3px solid var(--asphalt);
  outline-offset: 3px;
  border-radius: 2px;
}
.sign :focus-visible { outline-color: var(--sign-white); }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0; max-width: var(--measure); }

.wrap { width: min(100% - 2 * var(--gap), var(--page)); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--asphalt);
  text-decoration: none;
  font-weight: 800;
  font-size: var(--step-1);
}
.marker {
  display: inline-grid;
  place-items: center;
  min-width: 3.1rem;
  height: 2.2rem;
  padding: 0 0.45rem;
  background: var(--sign-green);
  color: var(--sign-white);
  border: 2px solid var(--sign-green);
  box-shadow: inset 0 0 0 2px var(--sign-white);
  border-radius: 7px;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a {
  color: var(--asphalt);
  text-decoration: none;
  font-weight: 600;
  padding-block: 0.25rem;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--sign-green); }

/* ---------- layout ---------- */
main { padding-bottom: 4rem; }
.section { margin-top: clamp(2.5rem, 7vw, 4.5rem); }
.section > * + * { margin-top: 1rem; }

.intro { padding-top: clamp(1rem, 5vw, 3rem); }
.intro > * + * { margin-top: 1.1rem; }
.tagline { font-size: var(--step-2); font-weight: 600; color: var(--asphalt-soft); line-height: 1.25; }

.lede { font-size: var(--step-1); line-height: 1.5; }

.button {
  display: inline-block;
  background: var(--asphalt);
  color: var(--sign-white);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
}
.button:hover { background: #000; color: var(--sign-white); }

/* ---------- the guide sign ---------- */
.sign {
  background: var(--sign-green);
  color: var(--sign-white);
  border-radius: 16px;
  padding: 7px;
}
.sign-inner {
  border: 3px solid var(--sign-white);
  border-radius: 11px;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3.5vw, 2.25rem);
}
.sign a { color: var(--sign-white); }

.exit-tab {
  display: inline-block;
  background: var(--exit-yellow);
  color: var(--asphalt);
  font-weight: 800;
  font-size: var(--step-1);
  padding: 0.3rem 1rem 0.2rem;
  border-radius: 10px 10px 0 0;
  margin-left: 1.25rem;
}
.exit-tab + .sign { margin-top: 0; }

.destinations { list-style: none; margin: 0; padding: 0; }
.destination {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.15rem 1.5rem;
  padding-block: 0.9rem;
}
.destination + .destination { border-top: 2px solid rgba(255, 255, 255, 0.35); }
.destination-name { font-size: var(--step-3); font-weight: 700; line-height: 1.1; }
.destination-miles { font-size: var(--step-3); font-weight: 700; white-space: nowrap; text-align: right; }
.destination-detail { grid-column: 1 / -1; font-size: var(--step-0); opacity: 0.92; }
.destination-detail a { font-weight: 600; }

/* compact two-column variant for the full track list */
.destinations.compact { columns: 2 22rem; column-gap: 3rem; }
.destinations.compact .destination {
  break-inside: avoid;
  padding-block: 0.45rem;
  border-top: 0;
}
.destinations.compact .destination-name,
.destinations.compact .destination-miles { font-size: var(--step-1); }
.destinations.compact .destination-drive { font-size: var(--step--1); opacity: 0.85; display: block; text-align: right; font-weight: 400; }

.sign-note { font-size: var(--step-1); font-weight: 600; }
.sign-note + .sign-note { margin-top: 0.5rem; font-size: var(--step-0); font-weight: 400; }

.subtle { color: var(--asphalt-soft); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; max-width: 36rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.field { display: grid; gap: 0.3rem; }
.field label { font-weight: 600; font-size: var(--step--1); }
.field .req { color: var(--asphalt-soft); font-weight: 400; }
input, select, textarea {
  font: inherit;
  color: var(--asphalt);
  background: var(--sign-white);
  border: 2px solid var(--rule);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sign-green);
  outline-offset: 0;
  border-color: var(--sign-green);
}
textarea { min-height: 8rem; resize: vertical; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 34rem; }
.inline-form input { flex: 1 1 16rem; width: auto; }
.form-status { font-weight: 600; min-height: 1.5em; }
.form-status[data-state="error"] { color: #a1261b; }

/* ---------- calendar page ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  align-items: end;
  padding: 1.25rem 0;
  border-block: 2px solid var(--rule);
}
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; padding-bottom: 0.6rem; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--sign-green); }
.results-count { font-weight: 600; color: var(--asphalt-soft); }

.month { margin-top: 2.5rem; }
.month-title { font-size: var(--step-2); padding-bottom: 0.5rem; border-bottom: 3px solid var(--asphalt); }
.events { list-style: none; margin: 0; padding: 0; }
.event {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 0.5rem 1.5rem;
  align-items: start;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.event.is-past { opacity: 0.55; }
.event-date { line-height: 1.1; }
.event-days { display: block; font-size: var(--step-2); font-weight: 800; }
.event-weekdays { display: block; font-size: var(--step--1); color: var(--asphalt-soft); margin-top: 0.25rem; }
.event-title { font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
.event-meta { color: var(--asphalt-soft); margin-top: 0.2rem; }
.event-meta strong { color: var(--asphalt); font-weight: 600; }
.event-side { display: grid; gap: 0.6rem; justify-items: end; text-align: right; }
.mileage {
  display: inline-block;
  background: var(--sign-green);
  color: var(--sign-white);
  border-radius: 7px;
  padding: 0.25rem 0.6rem 0.15rem;
  box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 4px var(--sign-white);
  font-weight: 700;
  white-space: nowrap;
}
.mileage small { font-weight: 400; font-size: var(--step--1); }
.register { font-weight: 700; white-space: nowrap; }

.empty { margin-top: 2rem; }

/* ---------- supporters & footer ---------- */
.supporters { margin-top: 3rem; color: var(--asphalt-soft); }
.site-footer {
  border-top: 2px solid var(--rule);
  padding-block: 1.5rem 2.5rem;
  color: var(--asphalt-soft);
  font-size: var(--step--1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-footer a { color: inherit; }

/* ---------- small screens ---------- */
@media (max-width: 40rem) {
  :root { --step-5: 2.45rem; --step-3: 1.7rem; }
  .destination-name, .destination-miles { font-size: var(--step-2); }
  .event { grid-template-columns: 4.5rem 1fr; }
  .event-side { grid-column: 2; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: center; gap: 1rem; }
  .exit-tab { margin-left: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.inline-form .form-status { flex-basis: 100%; }
.destination-when { display: block; font-weight: 700; font-size: var(--step-1); margin-bottom: 0.1rem; }

.event-days { white-space: nowrap; }
@media (max-width: 40rem) {
  .event { grid-template-columns: 4.75rem 1fr; }
  .event-days { font-size: var(--step-1); }
}
