/* SSWSC Events Calendar */
.sswsc-events-app { margin: 1rem 0; }

.sswsc-events-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: #f6f7f9;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
}
.sswsc-events-filters .sswsc-filter { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 140px; }
.sswsc-events-filters .sswsc-filter-actions { flex: 0 0 auto; }
.sswsc-events-filters label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: #333; }
.sswsc-events-filters input[type="search"],
.sswsc-events-filters input[type="date"],
.sswsc-events-filters select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #c8ccd2;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
}
.sswsc-events-filters .sswsc-events-reset {
    padding: 0.5rem 1rem;
    border: 1px solid #c8ccd2;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.sswsc-events-filters .sswsc-events-reset:hover { background: #eef0f3; }

.sswsc-events-calendar {
    margin-bottom: 1.5rem;
    --fc-border-color: #e3e6ea;
    --fc-button-bg-color: #2c3e50;
    --fc-button-border-color: #2c3e50;
    --fc-button-hover-bg-color: #1f2d3a;
    --fc-button-hover-border-color: #1f2d3a;
    --fc-button-active-bg-color: #1f2d3a;
    --fc-today-bg-color: #fff8e1;
}
.sswsc-events-calendar .fc-event { cursor: pointer; border: none; }

.sswsc-events-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 0;
    gap: 16px;
}
.sswsc-events-list-title {
    margin: 0;
    flex: 1 1 auto;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f3660;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.sswsc-events-count { font-size: 0.9rem; color: #666; flex-shrink: 0; }
.sswsc-events-list-header .sswsc-events-past-link { flex-shrink: 0; }

.sswsc-events-list { position: relative; min-height: 100px; }
.sswsc-events-list.is-loading { opacity: 0.5; pointer-events: none; }
.sswsc-events-list.is-loading::after {
    content: '';
    position: absolute; top: 1rem; left: 50%;
    width: 24px; height: 24px;
    border: 3px solid #c8ccd2; border-top-color: #2c3e50;
    border-radius: 50%;
    animation: sswsc-spin 0.7s linear infinite;
}
@keyframes sswsc-spin { to { transform: rotate(360deg); } }

.sswsc-events-empty { padding: 1.5rem; text-align: center; color: #777; font-style: italic; }

/* Legacy card styles — kept for any old markup still in use elsewhere. */
.sswsc-event-card { padding: 1rem 0; border-bottom: 1px solid #eee; }
.sswsc-event-card:last-child { border-bottom: none; }
.sswsc-event-dates { color: #555; font-size: 0.9rem; margin: 0.25rem 0; }
.sswsc-event-categories { color: #888; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0.15rem 0 0.5rem; }

@media (max-width: 600px) {
    .sswsc-events-filters .sswsc-filter { flex: 1 1 100%; }
}

/* ==========================================================================
   Park City–style event row (event_card.php partial).
   Layout: date end-cap | optional photo | info | optional register button.
   Palette matches SSWSC: navy end-cap + red category badge & register CTA.
   ========================================================================== */

.sswsc-events-month-header {
    margin: 2rem 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2e5b96;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 2px solid #dbeafe;
    padding-bottom: 6px;
}
.sswsc-events-month-header:first-child { margin-top: 1.25rem; }

/* See Past Events link */
.sswsc-events-past-link {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2e5b96;
    text-decoration: none;
    border: 2px solid #2e5b96;
    border-radius: 30px;
    padding: 7px 18px;
    transition: background 0.2s, color 0.2s;
}
.sswsc-events-past-link:hover {
    background: #2e5b96;
    color: #fff;
    text-decoration: none;
}

/* Past Events section */
.sswsc-events-past-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}
.sswsc-events-past-header {
    margin: 0 0 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.01em;
}
.sswsc-events-past-section .sswsc-events-month-header {
    color: #9ca3af;
}
.sswsc-events-past-section .sswsc-event-row {
    opacity: 0.75;
}

.sswsc-event-row {
    display: grid;
    grid-template-columns: 88px auto 1fr auto;
    align-items: stretch;
    gap: 0;
    background: #f3f6fa;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
    min-height: 110px;
}
/* Cards without a photo collapse the photo column. */
.sswsc-event-row.no-photo {
    grid-template-columns: 88px 1fr auto;
}

/* ── Date end-cap (left) ─────────────────────────────────────────── */
.sswsc-event-row__endcap {
    background: #2e5b96; /* SSWSC blue */
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    text-decoration: none;
    line-height: 1.05;
    text-align: center;
}
.sswsc-event-row__endcap:hover,
.sswsc-event-row__endcap:focus {
    color: #fff;
    background: #25497a;
    text-decoration: none;
}
.sswsc-event-row__endcap-month {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.95;
}
.sswsc-event-row__endcap-day {
    font-size: 26px;
    font-weight: 700;
}
.sswsc-event-row__endcap-divider {
    font-size: 14px;
    opacity: 0.6;
    margin: 2px 0;
}

/* ── Photo (square, only when featured image set) ────────────────── */
.sswsc-event-row__photo {
    display: block;
    width: 110px;
    min-height: 110px;
    overflow: hidden;
    background: #e5e9ee;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ── Info column ─────────────────────────────────────────────────── */
.sswsc-event-row__info {
    padding: 14px 18px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sswsc-event-row__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #c8102e; /* SSWSC red */
    margin: 0 0 4px;
    line-height: 1.2;
}
.sswsc-event-row__title {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    color: #1f2937;
}
.sswsc-event-row__title a {
    color: inherit;
    text-decoration: none;
}
.sswsc-event-row__title a:hover { text-decoration: underline; }
.sswsc-event-row__meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sswsc-event-row__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e6ebf2;
    color: #36506f;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.3;
}
.sswsc-event-row__icon {
    flex: 0 0 14px;
    color: #36506f;
}

/* ── Register button (right, only when register_url set) ─────────── */
.sswsc-event-row__action {
    display: flex;
    align-items: center;
    padding: 14px 18px 14px 0;
}
.sswsc-event-row__register {
    display: inline-block;
    background: #c8102e;
    color: #fff;
    padding: 9px 22px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.2;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.sswsc-event-row__register:hover,
.sswsc-event-row__register:focus {
    background: #a30d25;
    color: #fff;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .sswsc-event-row,
    .sswsc-event-row.no-photo {
        grid-template-columns: 72px 1fr;
        grid-template-areas:
            "endcap info"
            "endcap action";
    }
    .sswsc-event-row__endcap { grid-area: endcap; }
    .sswsc-event-row__photo { display: none; }
    .sswsc-event-row__info  { grid-area: info; padding: 12px 14px 6px; }
    .sswsc-event-row__action {
        grid-area: action;
        justify-content: flex-start;
        padding: 0 14px 14px;
    }
    .sswsc-event-row__title { font-size: 16px; }
    .sswsc-event-row__endcap-day { font-size: 22px; }
}
