/* trigger button */
.event-button {
    background: 0 0;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #000;
    animation: blinker 3s linear infinite
}

.event-button svg {
    fill: currentColor
}

@keyframes blinker {
    50% {
        opacity: .5
    }
}

/* overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .6);
    z-index: 1000;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)
}

/* card */
.popup-content {
    color: #fff;
    padding: 20px 22px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .3);
    inline-size: min(92vw, 42rem);
    max-height: 90dvh;
    overflow: auto;
    text-align: left;
    position: relative;
    animation: fadeIn .3s ease-out
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(.96)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.popup-content h3 {
    margin: 0 0 12px;
    text-align: center;
    line-height: 1.2
}

/* layout */
.popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start
}

.popup-text {
    line-height: 1.5
}

/* image / thumbnail */
.popup-img {
    align-self: start
}

.popup-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px
}

.popup-thumb {
    background: 0 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: block;
    line-height: 0;
    border-radius: 8px
}

.popup-thumb:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px
}

/* lightbox */
.popup-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .88);
    z-index: 1100;
    padding: 2rem
}

.popup-lightbox img {
    max-width: 96vw;
    max-height: 92dvh;
    display: block;
    border-radius: 10px
}

.popup-lightbox .lb-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: 0 0;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    cursor: pointer
}

.popup-lightbox .lb-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px
}

/* footer */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 12px
}

/* responsive */
@media (max-width:768px) {
    .popup-body {
        grid-template-columns: 1fr
    }
}

/* motion/accessibility */
@media (prefers-reduced-motion:reduce) {

    .event-button,
    .popup-content {
        animation: none
    }
}