/*
 * GARS Event Popup — Donkey Derby 2026
 * Auto-opening flyer modal, time-boxed to the event window.
 */

#gars-event-overlay {
    position: fixed;
    inset: 0;
    z-index: 9200;
    background: rgba(10, 30, 60, 0.66);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

#gars-event-overlay.gars-overlay-open {
    opacity: 1;
    pointer-events: auto;
}

#gars-event-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow:
        0 24px 70px rgba(10, 30, 80, 0.32),
        0 6px 18px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transform: translateY(36px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.34, 1.46, 0.64, 1),
                opacity 0.28s ease;
    opacity: 0;
    position: relative;
}

#gars-event-overlay.gars-overlay-open #gars-event-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

#gars-event-modal::-webkit-scrollbar { width: 6px; }
#gars-event-modal::-webkit-scrollbar-track { background: transparent; }
#gars-event-modal::-webkit-scrollbar-thumb { background: #cdd8e8; border-radius: 3px; }

#gars-event-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(10, 20, 35, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease;
    outline: none;
}

#gars-event-close:hover {
    background: rgba(10, 20, 35, 0.78);
    transform: rotate(90deg);
}

#gars-event-close:focus-visible {
    outline: 3px solid #7dc8f0;
    outline-offset: 2px;
}

#gars-event-modal img.gars-event-flyer {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px 16px 0 0;
}

#gars-event-body {
    padding: 20px 22px 24px;
}

#gars-event-body h3 {
    margin: 0 0 8px;
    font-size: 1.15em;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

#gars-event-body p {
    margin: 0 0 10px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #3a4a5c;
}

#gars-event-body p:last-of-type {
    margin-bottom: 0;
}

#gars-event-body a.gars-event-link {
    color: #1a6bbf;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px solid rgba(26, 107, 191, 0.35);
    transition: border-color 0.18s ease, color 0.18s ease;
}

#gars-event-body a.gars-event-link:hover {
    color: #144f8f;
    border-color: #144f8f;
}

#gars-event-body a.gars-event-link:focus-visible {
    outline: 2px solid #7dc8f0;
    outline-offset: 2px;
}

@media screen and (max-width: 520px) {
    #gars-event-modal {
        max-width: 100%;
        max-height: 96vh;
        border-radius: 14px;
    }

    #gars-event-modal img.gars-event-flyer {
        border-radius: 14px 14px 0 0;
    }

    #gars-event-body {
        padding: 16px 18px 20px;
    }
}
