.find-events-page {
    --find-events-list-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    /* Single neutral card-border token for the whole card family (grid media/sheet, list card,
       dividers). Slate rgba rather than a --fe-* token: it composites to a visible boundary on
       both the light and dark card surfaces, has no --fe-* equivalent, and clears the brand guard. */
    --ecs-card-border: rgba(100, 116, 139, 0.4);
    --ecs-sheet-lift: 2.25rem;
}

.find-events-page .event-card-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, 20rem);
    justify-content: start;
}

.find-events-page .event-card-tile {
    max-width: 20rem;
    width: 20rem;
}

.find-events-page .event-card-tile .event-card-scheduled {
    height: 100%;
}

/* ============================================================================
   Tiling look — a photo header with a white "lifted sheet" body overlapping it.
   The card itself is a transparent shell; the sheet carries the surface + border.
   ==========================================================================*/
.find-events-page .event-card-scheduled {
    background: transparent;
    border: 0;
    border-radius: var(--fe-radius-card);
}

/* Media / photo header — the canonical --fe-cover-aspect (16:9) cover box (issue #458).
   Sibling mechanism to `img.event-cover` (fe365-styles.css): same contain-and-letterbox
   contract, but a wrapper + absolutely-positioned image so the sheet (not the photo)
   drives card height in the lifted-sheet / featured-split layouts. */
.find-events-page .ecs-media {
    align-items: center;
    aspect-ratio: var(--fe-cover-aspect);
    background: var(--fe-canvas);
    border: 1px solid var(--ecs-card-border);
    border-radius: var(--fe-radius-card) var(--fe-radius-card) 0 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Event photos are shown whole (contain) inside the 16:9 media slot — never cropped
   (issue #458); leftover space letterboxes onto the --fe-canvas media background.
   Absolutely positioned so the image never drives the card height — the sheet
   content does — which keeps the list-view row from collapsing onto its photo. */
.find-events-page .ecs-media .card-img-top {
    height: 100%;
    inset: 0;
    object-fit: contain;
    object-position: center;
    position: absolute;
    width: 100%;
}

/* Price badge overlay (top-left of the photo). */
.find-events-page .ecs-price {
    font-size: 0.8rem;
    left: 10px;
    position: absolute;
    top: 10px;
    z-index: 5;
}

/* Lifted sheet — overlaps the photo bottom in grid view. */
.find-events-page .ecs-sheet {
    background: var(--fe-surface-card);
    border: 1px solid var(--ecs-card-border);
    border-radius: var(--fe-radius-card);
    box-shadow: var(--fe-shadow);
    margin: calc(-1 * var(--ecs-sheet-lift)) 0.75rem 0;
    padding: 1rem 1.1rem 1.1rem;
    position: relative;
    z-index: 1;
}

/* Meta rows — stacked in the tiling view. */
.find-events-page .ecs-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.find-events-page .ecs-meta-item {
    align-items: baseline;
    color: var(--fe-text-secondary);
    display: flex;
    font-size: 0.9rem;
    gap: 0.5rem;
    line-height: 1.35;
}

.find-events-page .ecs-meta-item > .bi {
    color: var(--fe-text-secondary);
    flex: 0 0 auto;
    font-size: 0.95rem;
}

/* Tiling: push the CTA to the bottom so equal-height cards align their actions. */
.find-events-page .ecs-actions {
    margin-top: auto;
    padding-top: 1rem;
}

.find-events-page .event-grid-empty {
    align-items: center;
    display: flex;
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
}

.find-events-page .event-results-grid.event-results-grid--empty,
.find-events-page .event-results-grid.list-view.event-results-grid--empty {
    align-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
    min-height: clamp(18rem, 38vh, 26rem);
}

.find-events-page .event-grid-empty-content {
    align-items: center;
    color: var(--fe-text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
    margin-inline: auto;
    max-width: 34rem;
    min-height: 100%;
    text-align: center;
}

.find-events-page .event-grid-empty-icon {
    color: var(--fe-text-secondary);
    font-size: clamp(3.5rem, 4vw, 4.75rem);
    line-height: 1;
}

.find-events-page .event-grid-empty-title {
    color: var(--fe-ink);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.find-events-page .event-grid-empty-helper {
    color: var(--fe-text-secondary);
    margin: 0;
    max-width: 30rem;
}

.find-events-page #infiniteScrollSentinel.d-none {
    display: none;
}

.find-events-page #panelFavorites .my-events-pane-header {
    align-items: center;
}

.find-events-page #panelFavorites .event-card-grid {
    align-content: start;
}

.find-events-page #favoritesSection {
    padding: 1.5rem !important;
}

.find-events-page #favoritesSection .my-events-pane-header {
    margin-bottom: 1.25rem;
}

/* ============================================================================
   List view — "featured wide split": photo on the left, details on the right.
   The .list-view class is toggled on the results grid by find-events-page.js.
   ==========================================================================*/
.find-events-page .event-results-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.find-events-page .event-results-grid.list-view > .event-card-tile {
    max-width: 100%;
    width: 100%;
}

/* Block flow (not flex row): the sheet defines the card height and the photo is
   absolutely positioned into a reserved left column. This avoids the flex-row
   pitfall where the image height drives the row and clips the taller sheet. */
.find-events-page .event-results-grid.list-view .event-card-scheduled {
    background: var(--fe-surface-card);
    border: 1px solid var(--ecs-card-border);
    border-radius: var(--fe-radius-card);
    box-shadow: var(--find-events-list-shadow);
    display: block;
    height: auto; /* beat the grid equal-height rule (.event-card-tile .event-card-scheduled) via specificity so the sheet defines height */
    min-height: 15rem;
    overflow: hidden;
    padding-left: 18rem;
}

/* The photo leaves flow and fills the reserved left column; the sheet defines the card height.
   No own border here — the card border wraps the photo; a right divider separates it from the body. */
.find-events-page .event-results-grid.list-view .ecs-media {
    border: 0;
    border-radius: 0;
    border-right: 1px solid var(--ecs-card-border);
    bottom: 0;
    height: auto;
    left: 0;
    position: absolute;
    top: 0;
    width: 18rem;
}

.find-events-page .event-results-grid.list-view .ecs-sheet {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    min-height: 0; /* .card-body defaults to flex: 1 1 auto with a content min-height; clear it so the sheet hugs its content */
    padding: 1.4rem 1.5rem;
}

.find-events-page .event-results-grid.list-view .card-title {
    font-size: 1.2rem;
    line-height: 1.35;
}

/* Meta reflows to a two-column grid in the featured-split row. */
.find-events-page .event-results-grid.list-view .ecs-meta {
    display: grid;
    gap: 0.4rem 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* List: the CTA follows the meta (no bottom-push) so it never overflows the row. */
.find-events-page .event-results-grid.list-view .ecs-actions {
    margin-top: 1rem;
    max-width: 22rem;
}

.find-events-page .event-results-grid.list-view .btn-save-event {
    right: 1rem;
    top: 1rem;
}

@media (max-width: 991.98px) {
    .find-events-page .event-card-grid {
        grid-template-columns: repeat(auto-fill, 18rem);
    }

    .find-events-page .event-card-tile {
        max-width: 18rem;
        width: 18rem;
    }

    /* Collapse the featured split into a stacked photo-over-details card:
       drop the reserved left column and return the photo to normal flow on top. */
    .find-events-page .event-results-grid.list-view .event-card-scheduled {
        min-height: 0;
        padding-left: 0;
    }

    .find-events-page .event-results-grid.list-view .ecs-media {
        aspect-ratio: var(--fe-cover-aspect); /* keep the 16:9 cover box on the stacked mobile list card (issue #458) */
        border: 0;
        border-bottom: 1px solid var(--ecs-card-border);
        border-radius: var(--fe-radius-card) var(--fe-radius-card) 0 0;
        height: auto;
        inset: auto;
        position: relative;
        width: 100%;
    }

    .find-events-page .event-results-grid.list-view .ecs-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .find-events-page .event-card-grid {
        grid-template-columns: 1fr;
    }

    .find-events-page .event-card-tile {
        max-width: 100%;
        width: 100%;
    }

    .find-events-page #favoritesSection {
        padding: 1rem !important;
    }
}
