/*
 * Donation popup.
 *
 * Styling only — behaviour lives in modal.js and the browser's own <dialog>.
 */

.w4h-dialog {
    width: min(64rem, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100vh - 3rem);
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    overflow: visible;
}

.w4h-dialog::backdrop {
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(2px);
}

.w4h-dialog__inner {
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    -webkit-overflow-scrolling: touch;
}

/* Pinned flush into the dialog's top-right corner. Attached to the dialog,
   not the scroller, so the form scrolls underneath it. */
.w4h-dialog__close {
    position: absolute;
    top: 0;
    right: 0;
    padding: .7rem 1.2rem;
    border: 0;
    border-radius: 0 4px 0 4px;
    background: #2f6f9e;
    color: #fff;
    font: inherit;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 2;
}


.w4h-dialog__close:hover { filter: brightness(1.1); }
.w4h-dialog__close:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* The panel already centres itself; inside the dialog it should fill. */
.w4h-dialog .w4h-panel { max-width: none; }

/* --- Trigger button ------------------------------------------------------ */

.w4h-donate-trigger--button {
    display: inline-block;
    padding: .9rem 2.25rem;
    border: 1px solid currentColor;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

.w4h-donate-trigger--button:hover { background: currentColor; }
.w4h-donate-trigger--button:hover span { color: #fff; }

@media (max-width: 782px) {
    .w4h-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .w4h-dialog__inner { max-height: 100vh; }
}

/* Someone who asked for less motion should not get a scaling panel. */
@media (prefers-reduced-motion: no-preference) {
    .w4h-dialog[open] { animation: w4h-dialog-in .18s ease-out; }

    @keyframes w4h-dialog-in {
        from { opacity: 0; transform: translateY(8px) scale(.99); }
        to   { opacity: 1; transform: none; }
    }
}
