/**
 * Events UI — dedicated stylesheet for the /events/ archive, the SEO hubs
 * (/events/this-weekend/, /events/<town>/) and single-event.php.
 *
 * Conditionally enqueued by inc/events-frontend.php on event routes only, so
 * it never weighs on article pages. Design-system tokens only — white
 * editorial palette, alpine green + maple accents, NO beige (CLAUDE.md).
 *
 * Class namespace: .vts-ev-*  (kept distinct from the generic .vts-card so the
 * events agenda can evolve independently of the article grid).
 *
 * @package VTScout_News
 */

/* ── Hero header ─────────────────────────────────────────────────────── */
.vts-ev-hero {
    padding: var(--s-12) 0 var(--s-7);
    margin-bottom: 0;
    border-bottom: var(--border-1);
}
.vts-ev-hero__eyebrow {
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--c-maple);
    margin: 0 0 var(--s-3);
}
.vts-ev-hero__title {
    font-family: 'Google Sans', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.04em;
    color: var(--c-alpine);
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    margin: 0;
    text-wrap: balance;
}
.vts-ev-hero__title .dot { color: var(--c-maple); }
.vts-ev-hero__intro {
    max-width: 60ch;
    margin: var(--s-4) 0 0;
    color: var(--c-ink-3);
    line-height: var(--lh-relaxed);
    font-size: var(--t-body-lg);
}
.vts-ev-hero__row {
    margin-top: var(--s-5);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.vts-ev-hero__count {
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-body-sm);
    font-weight: 600;
    color: var(--c-ink-3);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
.vts-ev-hero__count::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-maple);
}

/* ── Sticky control bar (segmented filters) ──────────────────────────── */
.vts-ev-controls {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    padding: var(--s-3) 0;
    margin-bottom: var(--s-8);
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: var(--border-1);
}
.vts-ev-seg {
    display: inline-flex;
    background: var(--c-surface-2);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 2px;
}
.vts-ev-seg a {
    padding: 7px 15px;
    border-radius: var(--r-pill);
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-body-sm);
    font-weight: 600;
    color: var(--c-ink-3);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.vts-ev-seg a:hover { color: var(--c-alpine); }
.vts-ev-seg a[aria-current="true"] {
    background: var(--c-alpine);
    color: #fff;
    box-shadow: var(--shadow-1);
}
.vts-ev-controls__spacer { flex: 1 1 auto; }
.vts-ev-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-body-sm);
    font-weight: 600;
    color: var(--c-alpine);
    text-decoration: none;
    border: var(--border-1);
    border-radius: var(--r-pill);
    padding: 7px 14px;
    transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.vts-ev-submit:hover { border-color: var(--c-maple); color: var(--c-maple); background: var(--c-surface); }

/* ── Date group (agenda) ─────────────────────────────────────────────── */
.vts-ev-group { margin-bottom: var(--s-10); }
.vts-ev-group__head {
    position: sticky;
    top: 52px;
    z-index: 10;
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    padding: var(--s-2) 0 var(--s-3);
    margin-bottom: var(--s-5);
    border-bottom: 2px solid var(--c-alpine);
    background: linear-gradient(180deg, #fff 65%, rgba(255, 255, 255, 0));
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.vts-ev-group__rel {
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #fff;
    background: var(--c-maple);
    padding: 4px 9px;
    border-radius: var(--r-pill);
    line-height: 1;
    align-self: center;
}
.vts-ev-group__day {
    font-family: 'Google Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    letter-spacing: -.025em;
    color: var(--c-alpine);
    line-height: 1.1;
}
.vts-ev-group__count {
    margin-left: auto;
    align-self: center;
    font-size: var(--t-body-sm);
    color: var(--c-mute);
    white-space: nowrap;
}

/* ── Event grid + card ───────────────────────────────────────────────── */
.vts-ev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--s-5);
}
.vts-ev-card {
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
    border: var(--border-1);
    border-radius: var(--r-3);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.vts-ev-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-3);
    border-color: #d4d4d4;
}
.vts-ev-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--c-surface-2);
    overflow: hidden;
}
.vts-ev-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--dur-3) var(--ease);
}
.vts-ev-card:hover .vts-ev-card__media img { transform: scale(1.045); }
.vts-ev-card__media--empty {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--c-alpine), var(--c-alpine-soft));
}
.vts-ev-card__media--empty svg { width: 40px; height: 40px; color: rgba(255, 255, 255, .55); }

/* date chip (over image) */
.vts-ev-chip {
    position: absolute;
    top: var(--s-3);
    left: var(--s-3);
    background: #fff;
    border-radius: var(--r-2);
    padding: 5px 9px 6px;
    text-align: center;
    min-width: 48px;
    box-shadow: var(--shadow-2);
    line-height: 1;
}
.vts-ev-chip__m {
    display: block;
    font-family: 'Google Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-maple);
    margin-bottom: 2px;
}
.vts-ev-chip__d {
    display: block;
    font-family: 'Google Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--c-alpine);
    line-height: 1;
}
.vts-ev-card__flag {
    position: absolute;
    top: var(--s-3);
    right: var(--s-3);
    background: var(--c-maple);
    color: #fff;
    font-family: 'Google Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 9px;
    border-radius: var(--r-pill);
}

.vts-ev-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-4) var(--s-4) var(--s-5);
    flex: 1;
}
.vts-ev-card__time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-maple);
}
.vts-ev-card__time svg { width: 13px; height: 13px; flex: none; }
.vts-ev-card__title {
    font-family: 'Google Sans', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.25;
    letter-spacing: -.025em;
    color: var(--c-alpine);
    margin: 0;
    text-wrap: balance;
    transition: color var(--dur-2) var(--ease);
    /* clamp to 2 lines for grid evenness */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vts-ev-card:hover .vts-ev-card__title { color: var(--c-maple); }
.vts-ev-card__venue {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--t-body-sm);
    color: var(--c-ink-3);
    line-height: 1.35;
}
.vts-ev-card__venue svg { width: 13px; height: 13px; flex: none; color: var(--c-mute); }
.vts-ev-card__venue span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vts-ev-card__foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
    padding-top: var(--s-1);
}
.vts-ev-tag {
    font-family: 'Google Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-alpine-soft);
    background: var(--c-surface-2);
    padding: 4px 9px;
    border-radius: var(--r-pill);
}
.vts-ev-tag--free { color: var(--c-maple); background: rgba(184, 66, 31, .08); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.vts-ev-empty {
    text-align: center;
    padding: var(--s-20) var(--s-4);
    border: 1px dashed var(--c-line);
    border-radius: var(--r-3);
    background: var(--c-surface);
}
.vts-ev-empty svg { width: 48px; height: 48px; color: var(--c-mute-2); margin-bottom: var(--s-4); }
.vts-ev-empty p { color: var(--c-ink-3); font-size: var(--t-body-lg); margin: 0 0 var(--s-6); }

/* ── Pagination ──────────────────────────────────────────────────────── */
.vts-ev-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-10) 0 var(--s-20);
    margin-top: var(--s-6);
    border-top: var(--border-1);
}

/* ── Single event page ───────────────────────────────────────────────── */
.vts-ev-single { max-width: 840px; margin: 0 auto; padding: var(--s-8) 0 var(--s-16); }
.vts-ev-single__head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-6);
    align-items: start;
    margin-bottom: var(--s-7);
}
.vts-ev-single__datebox {
    background: var(--c-alpine);
    color: #fff;
    border-radius: var(--r-3);
    padding: var(--s-4) var(--s-5);
    text-align: center;
    min-width: 108px;
    line-height: 1;
}
.vts-ev-single__datebox .m {
    font-family: 'Google Sans', sans-serif;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
    color: rgba(255, 255, 255, .7);
}
.vts-ev-single__datebox .d {
    font-family: 'Google Sans', sans-serif;
    font-size: clamp(2.5rem, 5vw, 3.25rem); font-weight: 700;
    line-height: 1; margin: 4px 0 3px;
}
.vts-ev-single__datebox .wd {
    font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    font-style: italic; font-size: 13px;
    color: rgba(255, 255, 255, .72);
}
.vts-ev-single__eyebrow {
    font-family: 'Google Sans', sans-serif;
    font-size: var(--t-label); font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--c-maple); margin: 0 0 var(--s-2);
}
.vts-ev-single__title {
    font-family: 'Google Sans', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700; line-height: 1.04; letter-spacing: -.04em;
    color: var(--c-alpine); font-size: clamp(1.875rem, 4vw, 3rem);
    margin: 0; text-wrap: balance;
}
.vts-ev-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-6);
    padding: var(--s-5) 0;
    border-top: var(--border-1);
    border-bottom: var(--border-1);
    margin: var(--s-6) 0 var(--s-8);
}
.vts-ev-single__meta-item { display: flex; align-items: center; gap: 9px; font-size: var(--t-body); color: var(--c-ink-2); }
.vts-ev-single__meta-item svg { width: 17px; height: 17px; color: var(--c-maple); flex: none; }
.vts-ev-single__meta-item .lbl { font-family: 'Google Sans', sans-serif; font-size: var(--t-label); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-mute); margin-right: 2px; }
.vts-ev-single__meta-item strong { color: var(--c-alpine); font-weight: 600; }
.vts-ev-single__free {
    font-family: 'Google Sans', sans-serif; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--c-maple); background: rgba(184, 66, 31, .08);
    padding: 4px 10px; border-radius: var(--r-pill);
}
.vts-ev-single__fig {
    aspect-ratio: 16 / 8;
    border-radius: var(--r-3);
    overflow: hidden;
    background: var(--c-surface-2);
    margin: 0 0 var(--s-8);
}
.vts-ev-single__fig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vts-ev-single__cta { margin: var(--s-8) 0; }
.vts-ev-single__source { font-size: var(--t-body-sm); color: var(--c-mute); margin: var(--s-6) 0; }
.vts-ev-single__source a { color: var(--c-alpine); }
.vts-ev-single__back { display: inline-block; margin-top: var(--s-8); }
@media (max-width: 600px) {
    .vts-ev-single__head { grid-template-columns: 1fr; gap: var(--s-4); }
    .vts-ev-single__datebox { justify-self: start; min-width: 0; padding: var(--s-3) var(--s-5); }
    .vts-ev-single__datebox .d { font-size: 2.25rem; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .vts-ev-grid { grid-template-columns: 1fr; gap: var(--s-4); }
    .vts-ev-group__head { top: 48px; }
    .vts-ev-controls { gap: var(--s-2); }
    .vts-ev-seg a { padding: 6px 12px; font-size: var(--t-label); }
}
@media (prefers-reduced-motion: reduce) {
    .vts-ev-card, .vts-ev-card__media img { transition: none; }
    .vts-ev-card:hover { transform: none; }
}
