/* Weekend Grid NE — self-contained, no trackers, no webfonts. */
:root {
  --bg: #101114;
  --bg-elev: #181a20;
  --bg-elev-2: #22252e;
  --line: #32363f;
  --text: #f3f3ee;
  --muted: #c5c7ce;
  --gold: #e8b84a;
  --gold-hover: #f3c85a;
  --ink: #1a1404;
  --focus: #ffe08a;
  --danger: #ffb4a8;
  --ok: #9ad7b2;
  --max: 1120px;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(180deg, rgba(232, 184, 74, 0.04), transparent 180px),
    repeating-linear-gradient(
      -65deg,
      transparent 0 22px,
      rgba(255, 255, 255, 0.015) 22px 23px
    );
}

img { max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--gold-hover); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  background: var(--gold);
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  font-weight: 700;
  z-index: 100;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.header-stripe {
  height: 4px;
  background: var(--gold);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
  justify-content: center;
}
.wordmark .brand-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.wordmark .brand-name {
  font-weight: 750;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  line-height: 1.2;
}
.nav-toggle { display: none; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--bg-elev-2);
  color: var(--gold);
}

@media (max-width: 800px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
  }
  .site-nav {
    display: none;
    width: 100%;
    padding-bottom: 0.75rem;
  }
  .site-nav.is-open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { width: 100%; }
}

/* ---------- Sponsor slots ---------- */
.sponsor-slot {
  border: 1px dashed #6a5a2a;
  background:
    repeating-linear-gradient(45deg, #1a170e 0 8px, #15130c 8px 16px);
  color: var(--muted);
  border-radius: var(--radius);
  text-align: center;
  padding: 0.9rem 1rem;
  position: relative;
}
.sponsor-slot .slot-label {
  position: absolute;
  top: 0.35rem;
  left: 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.sponsor-slot p { margin: 0.4rem 0 0; }
.sponsor-slot.banner { min-height: 88px; display: flex; flex-direction: column; justify-content: center; }
.sponsor-slot.featured { min-height: 140px; }
.sponsor-slot a { font-weight: 700; }

/* ---------- Hero / typography ---------- */
main { flex: 1 0 auto; padding: 1.5rem 0 3rem; }

.hero { padding: 0.5rem 0 1.25rem; }
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}
.lede { font-size: 1.1rem; color: var(--muted); max-width: 46rem; margin: 0 0 1rem; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; margin: 2rem 0 0.85rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }

.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

/* ---------- Filters / search ---------- */
.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
  align-items: end;
}
@media (max-width: 720px) {
  .toolbar { grid-template-columns: 1fr; }
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
}
input[type="search"],
input[type="text"],
input[type="email"],
input[type="date"],
input[type="url"],
input[type="number"],
select,
textarea {
  appearance: none;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  min-height: 44px;
  width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover, .chip[aria-pressed="true"], .chip.is-active {
  border-color: var(--gold);
  color: var(--gold);
}
.chip .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ---------- Event cards / list ---------- */
.event-list {
  display: grid;
  gap: 0.75rem;
}
.event-card {
  display: grid;
  grid-template-columns: 5.2rem 1fr auto;
  gap: 0.9rem;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
}
a.event-card:hover { border-color: var(--gold); }
.date-badge {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  padding: 0.4rem 0.2rem 0.45rem;
  min-height: 68px;
}
.date-badge .mon {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.date-badge .day {
  display: block;
  font-size: 1.55rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.date-badge .wkd {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.event-card .event-title { margin: 0 0 0.15rem; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.event-card .meta { color: var(--muted); font-size: 0.92rem; margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #2a2416;
  color: #f3e2b0;
  white-space: nowrap;
}
.tag.type-track-day { background: #1b2a3a; color: #c5ddf5; }
.tag.type-race { background: #3a1b1b; color: #ffc9c4; }
.tag.type-drift { background: #2a1b3a; color: #e3c9ff; }
.tag.type-ice-racing { background: #163038; color: #b8eef5; }
.tag.type-crown-vic { background: #3a2a12; color: #ffd79a; }
.tag.type-rally { background: #1b3320; color: #c4efc8; }
.tag.type-drag { background: #3a2412; color: #ffd0a8; }
.tag.type-motorcycle { background: #143033; color: #b6ece8; }
.tag.type-off-road { background: #2c2614; color: #e6d9a8; }
.tag.type-show { background: #332e14; color: #f3e7a8; }
.tag.type-meet { background: #321824; color: #f5c6d8; }
.tag.type-auction { background: #2a2d33; color: #d5d8de; }
.tag.type-autocross { background: #1c2438; color: #c9d4ff; }
.tag.region-national, .tag.region-nearby {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 620px) {
  .event-card { grid-template-columns: 4.6rem 1fr; }
  .event-card .tag-col { grid-column: 2; }
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  color: var(--muted);
}

/* ---------- Month view ---------- */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.month-nav h2 { margin: 0; }
.month-nav button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover, .month-nav button:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 750;
}
.btn-primary:hover { background: var(--gold-hover); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }

table.calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
  margin-bottom: 1.5rem;
}
table.calendar th {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.3rem 0;
}
table.calendar td {
  vertical-align: top;
}
.cal-day {
  min-height: 5.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.35rem;
  font-size: 0.82rem;
}
.cal-day .num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.cal-day.is-today { border-color: var(--gold); }
.cal-day.is-today .num { color: var(--gold); }
.cal-day.is-muted { opacity: 0.4; }
.cal-day a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}
@media (max-width: 720px) {
  .cal-day { min-height: 3.4rem; padding: 0.2rem; }
  .cal-day a { display: none; }
  .cal-day.has-events .num::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 0.25rem;
    background: var(--gold);
    border-radius: 50%;
    vertical-align: middle;
  }
}

/* ---------- Layout helpers ---------- */
.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.prose { max-width: 44rem; }
.prose p { color: var(--text); }
.muted { color: var(--muted); }
.notice {
  border-left: 3px solid var(--gold);
  background: var(--bg-elev);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

/* ---------- Event detail ---------- */
.event-hero .when { font-size: 1.15rem; margin: 0 0 0.4rem; }
.dl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.45rem 0.75rem;
  margin: 1rem 0;
}
.dl dt { color: var(--muted); font-weight: 650; }
.dl dd { margin: 0; }

/* ---------- Forms ---------- */
form.stack {
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
}
.form-embed {
  margin: 1rem 0 1.25rem;
  width: 100%;
  max-width: 40rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.form-embed iframe {
  display: block;
  width: 100%;
  min-height: 40rem;
  border: 0;
  background: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  background: #0c0d10;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--gold); }
.house-ad {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.house-ad a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line); }
.house-ad a:hover { color: var(--gold); }

/* Newsletter teaser */
.signup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
}
@media (max-width: 560px) { .signup { grid-template-columns: 1fr; } }

/* Hidden until JS filters */
.event-card.is-hidden,
.cal-day a.is-hidden { display: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

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

.weekend-block { margin: 1.25rem 0 2rem; }
.reg-list { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; }
.reg-list li { margin: 0 0 0.75rem; }

/* Organizer-conflict / caveat note on event pages */
.event-note {
  border-left: 4px solid var(--gold);
  background: rgba(232, 184, 74, 0.08);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: var(--text, #f3f3ee);
}
