/* ============================================
   EVENTS PAGE — RESPONSIVE + ACCESSIBILITY
   Tablet 2-up listing, desktop table layout,
   focus-visible, reduced motion.
   ============================================ */

/* ---------------------------------------------------------------------------
   Tablet — intro splits, listing goes 2-up
   --------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .events-shell {
        padding-top: var(--space-8);
    }

    .events-intro {
        grid-template-columns: 1.5fr 1fr;
        align-items: end;
        gap: var(--space-8);
        padding-bottom: var(--space-8);
    }

    .events-stats { align-self: end; }

    .events-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--space-7);
    }

    .ev-row__title { padding-right: var(--space-8); }
}

/* ---------------------------------------------------------------------------
   Desktop — table layout
   --------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .events-thead {
        display: grid;
        grid-template-columns: var(--ev-cols);
        gap: var(--ev-gap);
        padding: var(--space-3) 0;
        margin: 0;
        /* Pin the column labels under the navbar (80px tall on desktop) so
           events scroll beneath them. Solid cream background hides scrolling
           content; soft hairline reads as a divider only when sticking. */
        position: sticky;
        top: 80px;
        z-index: 10;
        background-color: var(--color-cream);
        box-shadow: 0 1px 0 var(--color-ink-08);
    }

    /* The thead already provides breathing room below its labels — drop
       the first section's top margin so the labels sit visually centred
       between the refine bar's hairline above and the section's dark
       divider below. */
    .events-section:first-child .events-section__head {
        margin-top: 0;
    }

    .events-list {
        display: block;
    }

    .ev-row {
        grid-template-columns: var(--ev-cols);
        gap: var(--ev-gap);
        align-items: start;
        padding: var(--space-6) 0;
        /* Drop the mobile hover-bleed margin so the row's columns line up
           with the section head and column header. The hover band already
           spans the full listing width on desktop. */
        margin: 0;
    }

    .ev-row__date {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .ev-row__title { padding-right: 0; }

    .ev-row__where {
        align-items: flex-end;
        text-align: right;
    }

    .ev-row__add {
        position: static;
        justify-self: end;
    }

    /* Section head columns line up with the row grid on desktop:
       eyebrow → date col, title → event col. */
    .events-section__head {
        display: grid;
        grid-template-columns: var(--ev-cols);
        gap: var(--ev-gap);
        align-items: baseline;
    }

    .events-section__head .eyebrow {
        margin: 0;
    }
}

/* ---------------------------------------------------------------------------
   Focus-visible — keyboard users only (mouse/touch never see rings)
   --------------------------------------------------------------------------- */
.events-page a:focus-visible,
.events-page button:focus-visible,
.events-page input:focus-visible,
.refine-panel .field:focus-visible {
    outline: 2px solid var(--color-dark-brown);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

/* ---------------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .events-page *,
    .refine-panel * {
        transition-duration: 0.01ms;
    }
}
