/* ── Events Stack block ─────────────────────────────────────────────────────── */

.nyehs-es {
    display:    block;
    width:      fit-content;
    padding:    20px 24px 28px 0; /* right: visual balance; left: 0 so back cards bleed left */
    margin:     0 auto;
    box-sizing: content-box;
    --_dir: -1; /* -1 = left (default), 1 = right */
}

/* Right orientation — flip the direction variable and swap the padding side */
.nyehs-es[data-orientation="right"] {
    --_dir: 1;
    padding: 20px 0 28px 24px;
}

.nyehs-es__cards {
    position:    relative;
    width:       320px;
    height:      460px;
    flex-shrink: 0;
}

/* ── Card base ──────────────────────────────────────────────────────────────── */

.nyehs-es__card {
    position:         absolute;
    inset:            0;
    border-radius:    22px;
    overflow:         hidden;
    display:          block;
    text-decoration:  none;
    color:            #fff;
    box-shadow:       0 18px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
    transition:
        transform 0.60s cubic-bezier(0.4, 0, 0.2, 1),
        filter    0.60s cubic-bezier(0.4, 0, 0.2, 1),
        opacity   0.60s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, filter, opacity;
}

/* ── Enter position — new card lands onto the front of the stack ─────────────── */

.nyehs-es__card[data-pos="enter"] {
    transform:      scale(1.04) translateY(-10px);
    opacity:        0;
    z-index:        11;
    pointer-events: none;
}

/* ── Stack positions (no rotation — depth via scale, blur, offset) ──────────── */

.nyehs-es__card[data-pos="0"] {
    transform: translateX(0)      translateY(0)    scale(1);
    filter:    none;
    opacity:   1;
    z-index:   10;
}

.nyehs-es__card[data-pos="1"] {
    transform: translateX(calc(var(--_dir) * 38px))  translateY(8px)  scale(0.95);
    filter:    blur(2px);
    opacity:   0.82;
    z-index:   9;
    cursor:    pointer;
}

.nyehs-es__card[data-pos="2"] {
    transform: translateX(calc(var(--_dir) * 68px))  translateY(14px) scale(0.89);
    filter:    blur(4px);
    opacity:   0.54;
    z-index:   8;
    cursor:    pointer;
}

.nyehs-es__card[data-pos="3"] {
    transform: translateX(calc(var(--_dir) * 94px))  translateY(19px) scale(0.82);
    filter:    blur(6px);
    opacity:   0.30;
    z-index:   7;
    cursor:    pointer;
}

.nyehs-es__card[data-pos="1"]:hover {
    filter:  blur(0px) brightness(1.1);
    opacity: 0.95;
}

.nyehs-es__card[data-pos="2"]:hover {
    filter:  blur(1px) brightness(1.1);
    opacity: 0.72;
}

.nyehs-es__card[data-pos="3"]:hover {
    filter:  blur(2px) brightness(1.1);
    opacity: 0.50;
}

/* Position 4 = hidden holding spot */
.nyehs-es__card[data-pos="4"] {
    transform:      translateX(calc(var(--_dir) * 112px)) translateY(23px) scale(0.75);
    filter:         blur(8px);
    opacity:        0;
    z-index:        6;
    pointer-events: none;
}

/* ── Exit animation (front card flies off opposite to stack direction) ────────── */

.nyehs-es__card--exiting {
    transform:      translateX(calc(var(--_dir) * -115%)) translateY(-6px) rotate(calc(var(--_dir) * -8deg)) scale(0.9) !important;
    opacity:        0 !important;
    filter:         none !important;
    z-index:        20 !important;
    pointer-events: none !important;
}

/* ── Instant reposition (no visible transition) ─────────────────────────────── */

.nyehs-es__card--instant {
    transition: none !important;
}

/* ── Background image ───────────────────────────────────────────────────────── */

.nyehs-es__card-bg {
    position:            absolute;
    inset:               0;
    background-size:     cover;
    background-position: center top;
    background-color:    #0f0f1a;
    transition:          transform 0.5s ease;
}

.nyehs-es__card[data-pos="0"]:hover .nyehs-es__card-bg {
    transform: scale(1.04);
}

/* ── Gradient overlay (upper darkening only) ────────────────────────────────── */

.nyehs-es__card-overlay {
    position: absolute;
    inset:    0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.30) 40%,
        rgba(0, 0, 0, 0.10) 65%,
        transparent          100%
    );
}

/* ── Card body — frosted-glass text panel ────────────────────────────────────── */

.nyehs-es__card-body {
    position:                absolute;
    bottom:                  0;
    left:                    0;
    right:                   0;
    padding:                 44px 54px 22px 20px;
    z-index:                 1;
    backdrop-filter:         blur(20px) brightness(0.62);
    -webkit-backdrop-filter: blur(20px) brightness(0.62);
    background:              rgba(0, 0, 0, 0.22);
    -webkit-mask-image:      linear-gradient(to top, black 52%, transparent 100%);
    mask-image:              linear-gradient(to top, black 52%, transparent 100%);
}

.nyehs-es__card-title {
    font-size:      1.15rem;
    font-weight:    700;
    line-height:    1.25;
    margin:         0 0 8px;
    color:          #fff;
    letter-spacing: -0.01em;
}

.nyehs-es__card-meta {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    margin-bottom:  8px;
}

.nyehs-es__card-venue,
.nyehs-es__card-date {
    display:     flex;
    align-items: center;
    gap:         5px;
    font-size:   0.75rem;
    color:       rgba(255, 255, 255, 0.78);
    line-height: 1.4;
}

.nyehs-es__card-venue svg,
.nyehs-es__card-date svg {
    flex-shrink: 0;
    opacity:     0.8;
}

.nyehs-es__card-desc {
    font-size:   0.78rem;
    color:       rgba(255, 255, 255, 0.62);
    line-height: 1.5;
    margin:      0;
}

/* ── Arrow button ───────────────────────────────────────────────────────────── */

.nyehs-es__card-arrow {
    position:        absolute;
    bottom:          20px;
    right:           18px;
    width:           36px;
    height:          36px;
    border-radius:   50%;
    background:      rgba(255, 255, 255, 0.16);
    border:          1px solid rgba(255, 255, 255, 0.22);
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      transform 0.25s ease, background 0.2s ease;
    z-index:         2;
}

.nyehs-es__card[data-pos="0"]:hover .nyehs-es__card-arrow {
    transform:  rotate(45deg);
    background: rgba(255, 255, 255, 0.28);
}

/* ── Empty state ────────────────────────────────────────────────────────────── */

.nyehs-es--empty {
    padding:    40px;
    color:      rgba(255, 255, 255, 0.5);
    font-size:  0.875rem;
    text-align: center;
}

.nyehs-es--empty p { margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .nyehs-es {
        /* Remove excess right padding so the block fits within the viewport */
        padding-right: 0;
        padding-left:  0;
        width:         100%;
    }
    .nyehs-es[data-orientation="right"] {
        padding-left:  0;
        padding-right: 0;
    }
    .nyehs-es__cards {
        /* Scale the card stack to fit the viewport with comfortable gutters */
        width:  min(320px, calc(100vw - 32px));
        height: min(460px, 72vw + 120px);
        margin: 0 auto;
    }
}
