/* DIRTy Racing — base styles */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color: #1a1a1a; background: #f5f5f5; }
a { color: #c0392b; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block; padding: .55rem 1.25rem; border-radius: 5px;
    font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer;
    border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn--primary  { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn--primary:hover { background: #a93226; border-color: #a93226; color: #fff; }
.btn--outline  { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--outline:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--ghost    { background: transparent; color: #c0392b; border-color: #c0392b; }
.btn--ghost:hover { background: #fdf0ee; }
.btn--sm       { padding: .35rem .85rem; font-size: .82rem; }
.btn--lg       { padding: .75rem 2rem; font-size: 1rem; }

/* ── Site header ─────────────────────────────────────────────────────────── */
.site-header {
    background: #1a1a1a; color: #fff; padding: .65rem 1.5rem;
    display: flex; align-items: center; gap: 2rem;
    position: sticky; top: 0; z-index: 100;
}
.site-logo { color: #fff; font-weight: 800; font-size: 1.1rem; text-decoration: none; letter-spacing: -.5px; }
.site-logo span { color: #c0392b; }
.site-nav  { display: flex; gap: 1.5rem; flex: 1; }
.site-nav a { color: #b0b0b0; text-decoration: none; font-size: .9rem; font-weight: 500; }
.site-nav a:hover { color: #fff; }
.site-header__user { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-header__name { color: #e0e0e0; text-decoration: none; font-size: .88rem; }
.site-header__name:hover { color: #fff; }
.site-header__link { color: #b0b0b0; text-decoration: none; font-size: .88rem; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.site-header__link:hover { color: #fff; }
.site-header__logout { display: contents; }

/* ── Site main / footer ──────────────────────────────────────────────────── */
.site-main { min-height: calc(100vh - 52px - 64px); }
.site-footer { background: #1a1a1a; color: #888; padding: 1.25rem 1.5rem; font-size: .82rem; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer__copy { margin: 0; }
.site-footer__copy a { color: #b0b0b0; }
.site-footer__nav { display: flex; gap: 1.25rem; }
.site-footer__nav a { color: #888; text-decoration: none; }
.site-footer__nav a:hover { color: #ccc; }

/* ── Container ───────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.u-text-left { text-align: left; }
.u-text-center { text-align: center; }
.u-text-right { text-align: right; }
.u-bold { font-weight: 700; }
.u-italic { font-style: italic; }
.u-hidden { display: none !important; }
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Auth helpers ────────────────────────────────────────────────────────── */
.auth-container { max-width: 400px; margin: 4rem auto; background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
@media (max-width: 640px) {
  .auth-container { margin: 1.5rem auto; padding: 1.25rem; }
}

/* ── Hamburger / site-nav toggle ─────────────────────────────────────────── */
.site-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem .5rem;
  margin-left: auto;
  line-height: 1;
}
@media (max-width: 900px) {
  .site-nav-toggle { display: block; }
}

/* ── Mobile nav panel ────────────────────────────────────────────────────── */
.site-nav-panel {
  display: contents; /* desktop: behave like inline elements inside the flex header */
}
@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0;
    padding: .65rem 1rem;
  }
  .site-logo { flex: 1; }
  .site-nav-toggle { order: 2; }
  .site-nav-panel {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 3;
    background: #1a1a1a;
    border-top: 1px solid #333;
    padding: .75rem 0;
  }
  .site-nav-panel.open { display: flex; }
  .site-nav-panel .site-nav {
    flex-direction: column;
    gap: 0;
    flex: none;
  }
  .site-nav-panel .site-nav a {
    padding: .6rem 1rem;
    font-size: 1rem;
    display: block;
  }
  .site-nav-panel .site-header__user {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding: .6rem 1rem;
    margin-left: 0;
    border-top: 1px solid #333;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .site-nav-panel {
    transition: none; /* slide handled by display toggle */
  }
}
