/* ============================================================
   Mike Collins Donate Popup — site-wide modal
   All rules scoped under .mc-popup
   ============================================================ */

.mc-popup {
    --mc-primary: #CE3631;
    --mc-navy: #002868;
    --mc-text: #111111;
    --mc-muted: #4b5563;
    --mc-font: "Poppins", "Montserrat", Arial, sans-serif;
    --mc-radius: 12px;

    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    font-family: var(--mc-font);
}

.mc-popup[hidden] {
    display: none !important;
}

.mc-popup *,
.mc-popup *::before,
.mc-popup *::after {
    box-sizing: border-box;
}

.mc-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    animation: mc-popup-fade 0.25s ease both;
}

.mc-popup__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: 860px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    background: #ffffff;
    border-radius: var(--mc-radius);
    border-bottom: 5px solid var(--mc-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    outline: none;
    animation: mc-popup-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

/* ── Close button (hardened against Hello Elementor / Elementor button resets) ── */
.mc-popup .mc-popup__close,
.mc-popup button.mc-popup__close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.55) !important;
    color: #ffffff !important;
    font-family: Arial, sans-serif !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.mc-popup .mc-popup__close:hover,
.mc-popup .mc-popup__close:focus-visible,
.mc-popup button.mc-popup__close:hover,
.mc-popup button.mc-popup__close:focus-visible {
    background: var(--mc-primary) !important;
    color: #ffffff !important;
    transform: scale(1.05);
    outline: none;
}

/* ── Image (never cropped: it is a graphic with text) ─── */
.mc-popup__media {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mc-navy);
    line-height: 0;
    min-height: 0;
}

.mc-popup__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Visually hidden heading for assistive tech (theme-independent) */
.mc-popup .mc-popup__title {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* ── Copy ─────────────────────────────────────────────── */
.mc-popup__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 32px 32px;
    color: var(--mc-text);
    min-width: 0;
    overflow-wrap: break-word;
}

.mc-popup__body p {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--mc-text);
}

.mc-popup__body p:first-child {
    font-weight: 600;
}

.mc-popup__body p:last-child {
    margin-bottom: 22px;
}

/* ── CTA button (theme: red, uppercase) ───────────────── */
.mc-popup__btn,
.mc-popup__btn:visited {
    display: inline-block;
    align-self: flex-start;
    background: var(--mc-primary);
    color: #ffffff !important;
    text-transform: uppercase;
    text-decoration: none !important;
    font-family: var(--mc-font);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    padding: 14px 32px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(206, 54, 49, 0.35);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.mc-popup__btn:hover,
.mc-popup__btn:focus-visible {
    box-shadow: 0 4px 16px rgba(206, 54, 49, 0.5);
    transform: translateY(-1px);
    outline: none;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes mc-popup-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mc-popup-pop {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .mc-popup__overlay,
    .mc-popup__dialog {
        animation: none;
    }
}

/* ── Lock page scroll while open ──────────────────────── */
body.mc-popup-open {
    overflow: hidden;
}

/* ── Mobile: stack image on top ───────────────────────── */
@media (max-width: 680px) {
    .mc-popup__dialog {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .mc-popup__media img {
        height: auto;
        max-height: 44vh;
        object-fit: contain;
    }

    .mc-popup__content {
        padding: 24px 20px 24px;
    }

    .mc-popup__body p {
        font-size: 0.95rem;
    }

    .mc-popup__btn,
    .mc-popup__btn:visited {
        align-self: stretch;
        text-align: center;
    }
}
