/* The Race Place - Public site styles */

:root {
    --blue: #0A2463;
    --blue-dark: #061843;
    --red: #D62828;
    --red-dark: #aa1c1c;
    --bg: #FAFAFA;
    --white: #FFFFFF;
    --text: #1A1A1A;
    --text-strong: #0A0A0A;
    --muted: #6b6b6b;
    --border: #e3e3e3;
    --offwhite: #f4f4f6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-family: 'Bebas Neue', sans-serif;
    color: var(--text-strong);
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f0f0; padding: 0.1em 0.4em; border-radius: 3px; font-size: 0.9em; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background: var(--blue);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}
.header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    margin-right: auto;
}
.brand-mark {
    background: var(--red);
    color: var(--white);
    font-family: 'Bebas Neue', sans-serif;
    padding: 6px 10px;
    letter-spacing: 0.05em;
    border-radius: 3px;
    font-size: 1.1rem;
}
.brand-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
}
.nav-primary { display: flex; gap: 22px; }
.nav-primary a {
    color: var(--white);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}
.nav-primary a:hover { color: var(--red); }
.header-cta { padding: 8px 18px; }
.nav-toggle {
    display: none;
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    font-family: inherit;
    font-size: 0.95rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-accent { background: var(--red); color: var(--white); }
.btn-accent:hover { background: var(--red-dark); color: var(--white); }
.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}
.band-light .btn-outline { color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.band-light .btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; display: block; }
.btn-danger { background: #b91c1c; color: var(--white); }
.btn-danger:hover { background: #8a1414; }

/* Hero */
.hero {
    background: var(--blue);
    color: var(--white);
    position: relative;
    overflow: hidden;
    min-height: 540px;
    display: flex;
    align-items: center;
    padding: 60px 0;
}
.hero-track {
    position: absolute;
    inset: 0;
    opacity: 0.55;
}
.hero-track svg {
    width: 100%;
    height: 100%;
    filter: url(#motionBlur);
}
.car {
    transform-box: fill-box;
    transform-origin: center;
}
@@keyframes drive {
    from { offset-distance: 0%; }
    to { offset-distance: 100%; }
}
.car-red {
    offset-path: path("M 200,250 C 200,120 360,80 600,80 C 840,80 1000,120 1000,250 C 1000,380 840,420 600,420 C 360,420 200,380 200,250 Z");
    offset-rotate: auto;
    animation: drive 6s linear infinite;
}
.car-blue {
    offset-path: path("M 200,250 C 200,120 360,80 600,80 C 840,80 1000,120 1000,250 C 1000,380 840,420 600,420 C 360,420 200,380 200,250 Z");
    offset-rotate: auto;
    animation: drive 6.6s linear infinite;
    animation-delay: -3.3s;
}
@@media (prefers-reduced-motion: reduce) {
    .car-red, .car-blue { animation: none; }
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--white);
    margin: 0 0 0.2em;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.hero-tagline {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-bottom: 2em;
    opacity: 0.95;
}
.hero-cta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 2em;
}
.next-event-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}
.next-event-badge:hover { background: rgba(214,40,40,0.25); border-color: var(--red); text-decoration: none; }
.badge-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--red);
}
.badge-title { font-weight: 700; font-size: 1.1rem; margin: 4px 0; }
.badge-date { font-size: 0.9rem; opacity: 0.9; }

/* Bands */
.band { padding: 70px 0; }
.band-light { background: var(--white); }
.band-offwhite { background: var(--offwhite); }
.band-blue { background: var(--blue); color: var(--white); }
.band-blue h1, .band-blue h2, .band-blue h3 { color: var(--white); }
.section-heading { margin-bottom: 1.5em; }
.center-row { text-align: center; margin-top: 2em; }

/* Three-up */
.three-up {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}
.up-card {
    background: var(--white);
    padding: 28px;
    border-radius: 6px;
    border-top: 4px solid var(--red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* CTA band */
.cta-band { text-align: center; }
.cta-inner { max-width: 720px; margin: 0 auto; }

/* Page header */
.page-header { padding: 70px 0 60px; }
.page-header p { font-size: 1.1rem; opacity: 0.9; margin-top: 0.5em; }
.breadcrumb { font-size: 0.85rem; opacity: 0.85; margin-bottom: 0.5em; }
.breadcrumb a { color: var(--white); text-decoration: underline; }
.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-top: 1em;
}

/* Event grid + cards */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.event-card {
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    text-decoration: none;
}
.event-card.past { opacity: 0.85; }
.event-card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}
.event-card-image.placeholder {
    background: linear-gradient(135deg, var(--blue) 0%, #1d3a8c 100%);
}
.event-card-body { padding: 18px 20px; }
.event-tag {
    display: inline-block;
    font-family: 'Bebas Neue', sans-serif;
    background: var(--blue);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    margin-right: 6px;
}
.tag-drag { background: var(--red); }
.tag-special { background: #f4a521; color: #1a1a1a; }
.tag-open { background: #2d6a4f; }
.tag-results { background: var(--text-strong); }
.tag-cancelled { background: var(--red); }
.event-card.cancelled { opacity: 0.7; }
.event-card.cancelled h3 { text-decoration: line-through; }
.event-card h3 { margin: 6px 0 4px; }
.event-card-date, .event-card-fee, .event-card-rsvp {
    font-size: 0.92rem;
    color: var(--muted);
    margin: 2px 0;
}

/* Footer */
.site-footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,0.85);
    padding: 50px 0 20px;
    margin-top: 0;
}
.site-footer h4 { color: var(--white); }
.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer a:hover { color: var(--red); }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 30px;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 16px;
    text-align: center;
    color: rgba(255,255,255,0.6);
}
.social-links a { display: inline-block; margin-right: 12px; }

/* Past events toggle */
.past-events-toggle summary { cursor: pointer; list-style: none; }
.past-events-toggle summary::-webkit-details-marker { display: none; }
.past-events-toggle summary h2::after {
    content: " +";
    color: var(--red);
}
.past-events-toggle[open] summary h2::after { content: " -"; }
.muted { color: var(--muted); font-weight: 400; }

/* Detail */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}
.detail-image {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 24px;
}
.markdown { line-height: 1.75; }
.markdown h2 { margin-top: 1.5em; }
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
.results-table th, .results-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.results-table th {
    background: var(--blue);
    color: var(--white);
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.08em;
}
.podium-1 { background: rgba(255,215,0,0.15); }
.podium-2 { background: rgba(192,192,192,0.15); }
.podium-3 { background: rgba(205,127,50,0.15); }

.detail-aside .rsvp-box,
.detail-aside .aside-card {
    background: var(--white);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.rsvp-box h3, .aside-card h4 { color: var(--blue); margin-top: 0; }
.rsvp-count {
    background: var(--offwhite);
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 1em;
}

/* Forms */
.form-row { margin-bottom: 1.1em; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text-strong); }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row input[type="datetime-local"],
.form-row input:not([type]),
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--text);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10,36,99,0.15);
}
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row label { margin-bottom: 0; }
.hp-row { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-validation-error { color: var(--red); font-size: 0.85rem; }
.form-actions { display: flex; gap: 12px; margin-top: 1em; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2em; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1em;
}
.alert.success { background: #e7f5ee; border-left: 4px solid #2d6a4f; color: #14532d; }
.alert.error { background: #fdecec; border-left: 4px solid var(--red); color: #7a1313; }
.alert.warning { background: #fff6e6; border-left: 4px solid #f4a521; color: #6b4a00; }
.rsvp-box.cancelled-box { border-left: 4px solid var(--red); }
.rsvp-box.cancelled-box h3 { color: var(--red); }

/* Content layouts */
.content-narrow { max-width: 760px; margin: 0 auto; }
.content-narrow h2 { margin-top: 2em; }

/* Scale grid */
.scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 1em 0 2em;
}
.scale-card {
    background: var(--offwhite);
    padding: 22px;
    border-radius: 6px;
    border-left: 4px solid var(--red);
}
.scale-card h3 { margin-top: 0; color: var(--blue); }

/* Values list */
.values-list { padding-left: 0; list-style: none; }
.values-list li {
    padding: 12px 0 12px 24px;
    border-left: 3px solid var(--red);
    background: linear-gradient(90deg, var(--offwhite) 0%, transparent 100%);
    margin-bottom: 8px;
    padding-right: 16px;
}

/* FAQ */
.faq {
    background: var(--offwhite);
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-strong);
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: " +"; color: var(--red); float: right; }
.faq[open] summary::after { content: " -"; }
.faq p { margin: 12px 0 0; }

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.contact-address { font-style: normal; line-height: 1.8; }
.hours-table { width: 100%; }
.hours-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.hours-table td:first-child { font-weight: 600; }
.map-embed { border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.mall-diagram-wrap {
    background: var(--white);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-top: 1.5em;
}
.mall-diagram { width: 100%; max-height: 520px; }

/* Mobile */
@@media (max-width: 860px) {
    .nav-primary {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--blue);
        padding: 12px 24px;
    }
    .nav-primary.open { display: flex; }
    .nav-toggle { display: inline-block; }
    .header-cta { display: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}
