/* ==========================================================================
 * EVENTS PREMIUM - event listing page and cards.
 *
 * Same visual language as Home / Search / DM: one violet accent, light borders,
 * quiet secondary text, segmented control for navigation, compact sidebar.
 * Scoped to the listing (.event-list, .event-card, .event-tabs, .event-filters)
 * so the event detail page and widgets are untouched.
 * ========================================================================== */

:root {
    /* 4:3 = the ratio of the event_flyer thumbnail (liip_imagine: 600x450,
     * outbound crop), so nothing is cropped twice. Wider on phones, where a
     * single full-width card would otherwise fill the whole screen. */
    --event-img-ratio: 4 / 3;
}

@media (max-width: 575.98px) {
    :root {
        --event-img-ratio: 16 / 10;
    }
}

/* --------------------------------------------------------------------------
 * Page header: title | segmented tabs | create button, on a single row.
 * -------------------------------------------------------------------------- */
.event-page-header {
    flex-wrap: wrap;
    gap: .5rem .75rem;
}

.event-page-header h1 {
    white-space: nowrap;
}

.event-page-header .event-tabs {
    margin-left: auto;
}

@media (max-width: 991.98px) {
    /* Below lg the tabs take their own full-width row under the title/actions. */
    .event-page-header .event-tabs {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
}

/* --------------------------------------------------------------------------
 * Tabs: segmented control (same component as DM / Search). Icons with a
 * tooltip; the active segment also shows its label so the current context
 * is always readable without spending width on the 4 others.
 * -------------------------------------------------------------------------- */
.event-tabs {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 3px;
    border: 0;
    border-radius: 10px;
    background-color: var(--bs-tertiary-bg, #f1f3f5);
}

.event-tabs .nav-item {
    flex: 0 0 auto;
}

.event-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    min-width: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    color: var(--text-muted, #6b7280);
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.event-tabs .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, .05);
    color: var(--bs-body-color, #222);
}

.event-tabs .nav-link.active,
.event-tabs .nav-link.active i,
.event-tabs .nav-link.active .event-tab-label {
    color: #fff;
}

.event-tabs .nav-link.active {
    background-color: var(--primary, #6D28D9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.event-tabs .nav-link:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 1px;
}

.event-tabs .event-tab-label {
    display: none;
}

.event-tabs .nav-link.active .event-tab-label {
    display: inline;
}

/* --------------------------------------------------------------------------
 * Sidebar filters: same density as the Search sidebar - no title band, compact
 * fields, small labels, no duplicate "add event" button (it lives in the page
 * header).
 * -------------------------------------------------------------------------- */
/* Mobile-only close button (same as the Search sidebar). */
.event-filters .feature-filters-header-mobile {
    padding: .75rem .75rem 0;
    text-align: right;
}

.event-filters .card-body {
    padding: .75rem;
}

.event-filters .form-label {
    margin-bottom: .25rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.event-filters .event-filter-field {
    margin-bottom: .6rem;
}

.event-filters .input-group-text,
.event-filters .form-control,
.event-filters .form-select {
    font-size: .85rem;
}

.event-filters .event-filter-actions {
    margin-top: .75rem;
}

/* --------------------------------------------------------------------------
 * Event card
 * -------------------------------------------------------------------------- */
.event-card {
    overflow: hidden;
    border-radius: 12px;
}

/* Image: dominant, same ratio on every card. Overrides the legacy fixed 180px. */
.event-card .event-image-wrapper {
    position: relative;
    height: auto;
    aspect-ratio: var(--event-img-ratio, 4 / 3);
    overflow: hidden;
    background-color: #f1f3f5;
}

.event-card .event-image-link {
    position: absolute;
    inset: 0;
    display: block;
}

.event-card .event-img,
.event-card .event-img-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Date badge, top-left of the photo. */
.event-date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    padding: 6px 8px 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    color: #1f2937;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}

.event-date-day {
    font-size: 1.25rem;
    font-weight: 800;
}

.event-date-month {
    margin-top: 3px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--primary, #6D28D9);
}

/* Quiet chips over the photo (glass). */
.event-chips {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.event-chip,
.event-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .62);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.2;
    backdrop-filter: blur(4px);
}

.event-category-chip {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.event-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 12px;
}

/* Title: 2 lines reserved whatever its length. */
.event-card .event-card-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.25;
    min-height: 2.5em;
}

.event-card .event-card-title a {
    color: var(--bs-body-color, #1f2937);
}

/* Location: city + establishment on one line. */
.event-where {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    font-size: .82rem;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

.event-where .event-meta-icon {
    color: var(--primary, #6D28D9);
}

.event-where .event-city,
.event-where .event-address {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-where .event-address {
    color: inherit;
}

.event-where .event-address:hover {
    color: var(--primary, #6D28D9);
}

.event-where-sep {
    flex: none;
    opacity: .6;
}

/* Engagement line: counts + day/time, small and quiet. */
.event-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
    margin-top: 2px;
    font-size: .74rem;
    color: var(--text-muted, #6b7280);
}

.event-people {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.event-avatars {
    display: inline-flex;
    padding-left: 6px;
}

.event-avatar {
    width: 20px;
    height: 20px;
    margin-left: -6px;
    border: 2px solid var(--bg-card, #fff);
    border-radius: 50%;
    object-fit: cover;
}

.event-counts {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-when {
    flex: none;
    font-weight: 600;
}

[data-bs-theme=dark] .event-date-badge {
    background: rgba(31, 41, 55, .96);
    color: #f3f4f6;
}
