﻿/* Home hero, event cards, and the Events page (cards / list / calendar). */
:root {
    --ar-red: #e3241b;
    --ar-red-dark: #c01c14;
    --ar-navy: #1b3a7a;
    --ar-navy-dark: #10264f;
    --ar-ink: #1f2430;
    --ar-muted: #6b7280;
    --ar-line: #e5e7eb;
    --ar-soft: #f5f6f8;
    --ar-radius: 12px;
}

.btn-ar {
    background: var(--ar-red);
    border-color: var(--ar-red);
    color: #fff;
}

    .btn-ar:hover, .btn-ar:focus {
        background: var(--ar-red-dark);
        border-color: var(--ar-red-dark);
        color: #fff;
    }

.btn-ar-outline {
    border: 1px solid var(--ar-navy);
    color: var(--ar-navy);
    background: #fff;
}

    .btn-ar-outline:hover, .btn-ar-outline:focus {
        background: var(--ar-navy);
        color: #fff;
    }

.ar-section-title {
    color: var(--ar-navy);
    font-weight: 700;
    margin: 0;
}

.ar-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 32px 0 16px;
    border-bottom: 1px solid var(--ar-line);
    padding-bottom: 10px;
}

    .ar-section-head a {
        white-space: nowrap;
        font-weight: 600;
        color: var(--ar-red);
    }

/* ---------- Home hero ---------- */
.ar-hero {
    position: relative;
    margin: 16px 0 0;
    border-radius: var(--ar-radius);
    overflow: hidden;
    color: #fff;
    background: var(--ar-navy-dark) center / cover no-repeat;
}

    .ar-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(16, 38, 79, .94) 0%, rgba(16, 38, 79, .82) 45%, rgba(16, 38, 79, .35) 100%);
    }

.ar-hero__inner {
    position: relative;
    padding: 48px 40px;
    max-width: 640px;
}

.ar-hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
    font-weight: 700;
    color: #ffb4ae;
}

.ar-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 8px 0 12px;
}

.ar-hero p.lead {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .88);
    margin-bottom: 22px;
}

.ar-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.ar-hero__search {
    position: relative;
    max-width: 460px;
}

    .ar-hero__search .bi {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--ar-muted);
    }

    .ar-hero__search input {
        padding-left: 40px;
        height: 46px;
        border-radius: 999px;
        border: 0;
    }

.ar-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 26px;
}

    .ar-hero__stats strong {
        display: block;
        font-size: 1.5rem;
        font-weight: 800;
    }

    .ar-hero__stats span {
        font-size: .82rem;
        color: rgba(255, 255, 255, .75);
    }

.ar-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .ar-feature-list li {
        display: flex;
        gap: 10px;
        padding: 6px 0;
    }

    .ar-feature-list .bi {
        color: var(--ar-red);
    }

@media (max-width: 575.98px) {
    .ar-hero__inner {
        padding: 32px 20px;
    }

    .ar-hero h1 {
        font-size: 1.65rem;
    }

    .ar-hero::before {
        background: rgba(16, 38, 79, .86);
    }
}

/* ---------- Event card ---------- */
.ev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ev-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ar-line);
    border-radius: var(--ar-radius);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

    .ev-card:hover {
        box-shadow: 0 10px 24px rgba(16, 38, 79, .12);
        transform: translateY(-2px);
    }

.ev-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--ar-soft);
    overflow: hidden;
}

/* Blurred copy of the banner fills the frame; the real banner is shown uncropped on top */
.ev-card__media-bg {
    position: absolute;
    inset: -20px;
    background: center / cover no-repeat;
    filter: blur(16px) brightness(.85);
}

.ev-card__media img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ev-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ar-navy) 0%, var(--ar-navy-dark) 60%, var(--ar-red) 140%);
    color: rgba(255, 255, 255, .9);
    font-size: 3rem;
}

.ev-date {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 52px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    overflow: hidden;
    line-height: 1;
    color: var(--ar-ink);
}

    .ev-date .ev-date__mon {
        display: block;
        background: var(--ar-red);
        color: #fff;
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        padding: 4px 0;
        letter-spacing: .06em;
    }

    .ev-date .ev-date__day {
        display: block;
        font-size: 1.35rem;
        font-weight: 800;
        padding: 5px 0 6px;
    }

.ev-badge-featured {
    position: absolute;
    right: 12px;
    top: 12px;
    background: #ffc107;
    color: #3b2f00;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ev-card__body {
    flex: 1;
    padding: 14px 16px 6px;
}

.ev-meta {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ar-navy);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ev-card__title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ar-ink);
    margin: 4px 0 6px;
    line-height: 1.3;
}

    .ev-card__title a {
        color: inherit;
    }

.ev-where {
    color: var(--ar-muted);
    font-size: .9rem;
}

.ev-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ev-chip {
    font-size: .75rem;
    background: var(--ar-soft);
    border: 1px solid var(--ar-line);
    color: var(--ar-ink);
    border-radius: 999px;
    padding: 2px 9px;
}

.ev-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 16px;
}

.ev-price {
    font-size: .8rem;
    color: var(--ar-muted);
    line-height: 1.25;
}

    .ev-price strong {
        display: block;
        font-size: 1rem;
        color: var(--ar-ink);
    }

.ev-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ev-ics {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--ar-line);
    color: var(--ar-navy);
    background: #fff;
    font-size: 1rem;
}

    .ev-ics:hover, .ev-ics:focus {
        background: var(--ar-soft);
        border-color: var(--ar-navy);
        color: var(--ar-navy);
        text-decoration: none;
    }

/* "Add to calendar" menu (native <details>, no JS dependency); opens upwards, right-aligned */
.ev-cal-menu {
    position: relative;
    flex: 0 0 auto;
}

    .ev-cal-menu > summary {
        list-style: none;
        cursor: pointer;
    }

        .ev-cal-menu > summary::-webkit-details-marker {
            display: none;
        }

    .ev-cal-menu[open] > summary {
        background: var(--ar-soft);
        border-color: var(--ar-navy);
    }

.ev-cal-menu__list {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 20;
    min-width: 210px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ar-line);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(16, 38, 79, .16);
    text-align: left;
}

    .ev-cal-menu__list a {
        display: block;
        padding: 8px 10px;
        border-radius: 6px;
        color: var(--ar-ink);
        font-size: .9rem;
        white-space: nowrap;
    }

        .ev-cal-menu__list a:hover {
            background: var(--ar-soft);
            text-decoration: none;
        }

/* Cards clip overflow, so anchor the menu to the card footer rather than the icon */
.ev-card__foot {
    position: relative;
}

.ev-card .ev-cal-menu {
    position: static;
}

.ev-card .ev-cal-menu__list {
    right: 16px;
    bottom: calc(100% - 8px);
}

.ev-status {
    font-size: .8rem;
    font-weight: 600;
}

.ev-status--soon {
    color: #b45309;
}

.ev-status--closed {
    color: var(--ar-muted);
}

/* ---------- Events page toolbar ---------- */
.ev-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 16px;
}

    .ev-page-head h2 {
        color: var(--ar-navy);
        font-weight: 800;
        margin: 0;
    }

    .ev-page-head p {
        margin: 2px 0 0;
        color: var(--ar-muted);
    }

.ev-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px;
    background: var(--ar-soft);
    border-radius: var(--ar-radius);
    margin-bottom: 20px;
}

.ev-toolbar__search {
    position: relative;
    flex: 1 1 240px;
}

    .ev-toolbar__search .bi {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--ar-muted);
    }

    .ev-toolbar__search input {
        padding-left: 34px;
    }

.ev-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .ev-type-chips button {
        border: 1px solid var(--ar-line);
        background: #fff;
        border-radius: 999px;
        padding: 4px 12px;
        font-size: .85rem;
        color: var(--ar-ink);
        cursor: pointer;
    }

        .ev-type-chips button.active {
            background: var(--ar-navy);
            border-color: var(--ar-navy);
            color: #fff;
        }

.ev-view-toggle .btn {
    border-color: var(--ar-line);
    background: #fff;
    color: var(--ar-ink);
}

    .ev-view-toggle .btn.active {
        background: var(--ar-navy);
        border-color: var(--ar-navy);
        color: #fff;
    }

.ev-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--ar-muted);
}

    .ev-empty .bi {
        font-size: 2.5rem;
        display: block;
        margin-bottom: 8px;
    }

/* ---------- List view ---------- */
.ev-month {
    margin-bottom: 24px;
}

.ev-month__title {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: var(--ar-muted);
    margin: 0 0 8px;
}

.ev-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--ar-line);
    border-radius: var(--ar-radius);
    margin-bottom: 8px;
}

    .ev-row:hover {
        border-color: #c9d2e3;
    }

    .ev-row .ev-date {
        position: static;
        flex: 0 0 52px;
        box-shadow: none;
        border: 1px solid var(--ar-line);
    }

.ev-row__main {
    flex: 1;
    min-width: 0;
}

.ev-row__title {
    font-weight: 700;
    color: var(--ar-ink);
    margin: 0 0 2px;
}

.ev-row__side {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: right;
}

@media (max-width: 575.98px) {
    .ev-row {
        flex-wrap: wrap;
    }

    .ev-row__side {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }
}

/* ---------- Calendar view ---------- */
.ev-cal {
    background: #fff;
    border: 1px solid var(--ar-line);
    border-radius: var(--ar-radius);
    overflow: hidden;
}

.ev-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ar-line);
}

    .ev-cal__head h4 {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--ar-navy);
    }

.ev-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ev-cal__dow {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ar-muted);
    text-align: center;
    padding: 8px 0;
    background: var(--ar-soft);
    border-bottom: 1px solid var(--ar-line);
}

.ev-cal__cell {
    min-height: 104px;
    border-right: 1px solid var(--ar-line);
    border-bottom: 1px solid var(--ar-line);
    padding: 6px;
    min-width: 0;
}

    .ev-cal__cell:nth-child(7n) {
        border-right: 0;
    }

.ev-cal__cell--out {
    background: #fafafa;
}

    .ev-cal__cell--out .ev-cal__num {
        color: #c4c7cc;
    }

.ev-cal__cell--today .ev-cal__num {
    background: var(--ar-red);
    color: #fff;
    border-radius: 999px;
}

.ev-cal__num {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 4px;
}

.ev-cal__event {
    display: block;
    font-size: .74rem;
    line-height: 1.25;
    background: #e8eefb;
    color: var(--ar-navy);
    border-left: 3px solid var(--ar-navy);
    border-radius: 4px;
    padding: 3px 5px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .ev-cal__event:hover {
        text-decoration: none;
        background: #d6e1f7;
    }

.ev-cal__event--open {
    background: #fdeceb;
    border-left-color: var(--ar-red);
    color: #8a1610;
}

    .ev-cal__event--open:hover {
        background: #fbd9d6;
    }

.ev-cal__dot {
    display: none;
}

.ev-cal__agenda {
    border-top: 1px solid var(--ar-line);
    padding: 14px;
}

.ev-cal__legend {
    display: flex;
    gap: 16px;
    font-size: .8rem;
    color: var(--ar-muted);
    padding: 8px 14px;
    border-top: 1px solid var(--ar-line);
}

    .ev-cal__legend i {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 2px;
        margin-right: 6px;
        vertical-align: -1px;
    }

/* Phones: cells show dots, the agenda list below carries the detail */
@media (max-width: 767.98px) {
    .ev-cal__cell {
        min-height: 54px;
        padding: 4px 2px;
        text-align: center;
    }

    .ev-cal__event {
        display: none;
    }

    .ev-cal__dot {
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--ar-navy);
        margin: 1px;
    }

    .ev-cal__dot--open {
        background: var(--ar-red);
    }
}

/* ---------- Results list (Race/Past) and home "Recent results" ---------- */
a.rs-row {
    color: inherit;
    text-decoration: none;
}

    a.rs-row:hover, a.rs-row:focus {
        text-decoration: none;
        border-color: #c9d2e3;
        box-shadow: 0 2px 10px rgba(16, 38, 79, .08);
    }

    .rs-row .ev-row__title {
        display: block;
    }

    a.rs-row:hover .ev-row__title {
        color: var(--ar-red);
    }

    .rs-row .ev-where {
        display: block;
    }

.rs-row__go {
    flex: 0 0 auto;
    color: var(--ar-red);
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}

.rs-more {
    text-align: center;
    margin: 8px 0 32px;
}

.rs-loading {
    opacity: .5;
    pointer-events: none;
    transition: opacity .15s;
}

.rs-compact .ev-row {
    padding: 8px 12px;
    gap: 12px;
}

.rs-compact .ev-date__day {
    font-size: 1.15rem;
}

.rs-compact .rs-row__go-label, .rs-compact .rs-row__org {
    display: none;
}

.rs-compact .ev-empty {
    padding: 24px 16px;
}

@media (max-width: 575.98px) {
    .ev-row.rs-row {
        flex-wrap: nowrap;
    }

    .rs-row__go-label, .rs-row__org {
        display: none;
    }
}
