/* TrackDay Finder — light editorial schedule */

:root {
    --paper:     #f7f6f3;
    --card:      #ffffff;
    --line:      #e4e2dc;
    --line-soft: #eeece7;
    --ink:       #21242a;
    --muted:     #6e7178;
    --accent:    #b5341f;
    --accent-dk: #932a18;
    --green:     #2e7d4f;
    --body:      "Barlow", -apple-system, "Segoe UI", sans-serif;
    --numeral:   "Barlow Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent-dk); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Masthead */

.masthead {
    background: var(--card);
    border-top: 3px solid var(--accent);
    border-bottom: 1px solid var(--line);
    padding: 34px 0 30px;
}

.brand {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--accent);
    margin: 0 0 10px;
}

.masthead h1 {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0;
    max-width: 30ch;
}

.sub {
    color: var(--muted);
    max-width: 62ch;
    margin: 10px 0 0;
}

/* Filters */

.filters {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.filter-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    min-width: 84px;
}

.pill {
    font-family: var(--body);
    font-size: .84rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}

.pill:hover { border-color: var(--muted); }

.pill.is-on {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.pill .count {
    color: var(--muted);
    font-weight: 400;
    font-size: .92em;
    margin-left: 2px;
}

.pill.is-on .count { color: rgba(255, 255, 255, .65); }

.pill.is-zero { opacity: .45; }

/* Month sections */

.month-block { margin: 34px 0; }

.month-head {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

/* Event rows */

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.event {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 170px 120px;
    align-items: center;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 8px;
}

.ev-date { line-height: 1.15; }

.d-num {
    display: block;
    font-family: var(--numeral);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.d-meta {
    display: block;
    font-size: .76rem;
    color: var(--muted);
}

.ev-track {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.ev-sub {
    margin: 3px 0 0;
    font-size: .82rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.ev-vendor { display: inline-flex; align-items: center; gap: 6px; }

.ev-type {
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .07em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 6px;
    align-self: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.ev-price { text-align: right; line-height: 1.3; }

.price { display: block; font-weight: 600; }

.avail { display: block; font-size: .78rem; color: var(--muted); }
.avail.low { color: var(--accent-dk); font-weight: 600; }
.avail.sold { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; }

.ev-action { text-align: right; }

.register {
    display: inline-block;
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-dk);
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: 7px 16px;
    transition: background .12s, color .12s;
}

.register:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.register.is-disabled {
    color: var(--muted);
    border-color: var(--line);
    cursor: default;
}

.event.sold-out { background: var(--paper); }
.event.sold-out .ev-track,
.event.sold-out .price { color: var(--muted); }

/* Misc */

.empty {
    text-align: center;
    color: var(--muted);
    padding: 56px 0;
}

.site-foot {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    background: var(--card);
    padding: 26px 0 36px;
    font-size: .84rem;
    color: var(--muted);
}

.site-foot p { max-width: 78ch; margin: 0 0 10px; }
.site-foot a { color: inherit; }
.site-foot a:hover { color: var(--accent-dk); }

.foot-credit {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    font-size: .78rem;
}

/* Responsive */

@media (max-width: 760px) {
    .event {
        grid-template-columns: 86px minmax(0, 1fr);
        grid-template-areas:
            "date main"
            "date price"
            "date action";
        row-gap: 6px;
        align-items: start;
    }
    .ev-date  { grid-area: date; }
    .ev-main  { grid-area: main; }
    .ev-price { grid-area: price; text-align: left; }
    .ev-price .price, .ev-price .avail { display: inline; margin-right: 10px; }
    .ev-action { grid-area: action; text-align: left; margin-top: 2px; }
    .filter-label { width: 100%; min-width: 0; }
}
