.event-popup[hidden],
.event-popup__slide[hidden] {
    display: none;
}

.event-popup {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 0.75rem;
    background: rgb(15 23 42 / 70%);
    backdrop-filter: blur(4px);
}

.event-popup__panel {
    position: relative;
    display: flex;
    width: min(100%, 36rem);
    max-height: min(calc(100vh - 1.5rem), 42rem);
    max-height: min(calc(100dvh - 1.5rem), 42rem);
    flex-direction: column;
    overflow: hidden;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 24px 80px rgb(15 23 42 / 35%);
}

.event-popup__slides {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

.event-popup__timer {
    position: absolute;
    z-index: 1;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgb(15 23 42 / 80%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.event-popup__close,
.event-popup__navigation > button {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    cursor: pointer;
    font-size: 1.4rem;
}

.event-popup__close {
    position: absolute;
    z-index: 1;
    top: 0.5rem;
    right: 0.5rem;
    background: #fff;
}

.event-popup__slide.is-active {
    display: block;
}

.event-popup__image {
    display: block;
    width: 100%;
    max-height: clamp(8rem, 30vh, 15rem);
    max-height: clamp(8rem, 30dvh, 15rem);
    object-fit: cover;
}


.event-popup__content {
    padding: clamp(1rem, 4vw, 1.5rem);
}

.event-popup__eyebrow {
    margin: 0 2.5rem 0.4rem 0;
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.event-popup__title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 0.5rem;
    color: #0f172a;
    font-size: clamp(1.25rem, 4.5vw, 1.75rem);
    font-weight: 800;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.event-popup__description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 0.6rem;
    color: #475569;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.event-popup__details {
    overflow: hidden;
    margin: 0.25rem 0;
    color: #334155;
    font-weight: bold;
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-popup__link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    background: #1d4ed8;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.event-popup__navigation {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 0.75rem 0.75rem;
}

.event-popup__indicators {
    display: flex;
    max-width: min(60vw, 20rem);
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.event-popup__indicators button {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
}

.event-popup__indicators button[aria-current="true"] {
    background: #2563eb;
}

@media (max-height: 600px) {
    .event-popup__content {
        padding: 0.7rem 0.85rem;
    }

    .event-popup__image {
        max-height: 15vh;
        max-height: 15dvh;
    }

    .event-popup__description {
        -webkit-line-clamp: 2;
    }

    .event-popup__title {
        margin-bottom: 0.3rem;
        font-size: clamp(1.15rem, 4vw, 1.5rem);
    }

    .event-popup__details {
        margin: 0.15rem 0;
        font-size: 0.8rem;
    }

    .event-popup__link {
        margin-top: 0.3rem;
        padding: 0.5rem 0.7rem;
    }

    .event-popup__navigation { padding-bottom: 0.5rem; }
}

@media (max-width: 420px) {
    .event-popup {
        padding: 0.5rem;
    }

    .event-popup__panel {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .event-popup__content {
        padding: 0.85rem;
    }

    .event-popup__timer {
        top: 0.5rem;
        left: 0.5rem;
        font-size: 0.7rem;
    }
}

@media (max-height: 420px) {
    .event-popup__content {
        padding: 0.55rem 0.75rem;
    }

    .event-popup__image {
        max-height: 12vh;
        max-height: 12dvh;
    }

    .event-popup__eyebrow {
        margin-bottom: 0.25rem;
        font-size: 0.65rem;
    }

    .event-popup__title {
        margin-bottom: 0.2rem;
        font-size: 1.1rem;
        line-height: 1.1;
    }

    .event-popup__description {
        margin-bottom: 0.3rem;
        font-size: 0.85rem;
        line-height: 1.3;
        -webkit-line-clamp: 1;
    }

    .event-popup__details {
        margin: 0.1rem 0;
        font-size: 0.75rem;
    }

    .event-popup__link {
        margin-top: 0.2rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .event-popup__navigation {
        gap: 0.5rem;
        padding-bottom: 0.4rem;
    }

    .event-popup__navigation > button {
        width: 2rem;
        height: 2rem;
    }
}
