/* ============================================================================
   FRIENDS OF GOD — WEBSITE CAMPAIGN POPUP ("fog-popup")
   Featured-campaign welcome popup for the public website. Rendered by
   views/partials/campaign-popup.php (included from the site footer) only when
   an administrator has enabled it and picked an active campaign, and at most
   once per visit/session. Visual language matches the Grove-FOG public shell:
   deep navy, gold accents, Sora display type, soft card shadows.
   ============================================================================ */

.fog-popup { position: fixed; inset: 0; z-index: 3000; }

.fog-popup[hidden] { display: none !important; }

.fog-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 20, 39, .62);
    backdrop-filter: blur(3px);
    animation: fogPopupFade .28s ease both;
}

.fog-popup-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(430px, calc(100vw - 28px));
    max-height: min(86vh, 700px);
    overflow-y: auto;
    padding: 0 0 26px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 110px rgba(3, 20, 39, .45);
    animation: fogPopupIn .32s cubic-bezier(.2, .8, .3, 1.04) both;
    text-align: left;
}

.fog-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    color: #082a47;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(3, 20, 39, .22);
    transition: background .16s ease, transform .16s ease;
}
.fog-popup-close:hover { background: #fff; transform: scale(1.05); }
.fog-popup-close:focus-visible { outline: 3px solid #d0b340; outline-offset: 3px; }
.fog-popup-close .fog-i { width: 17px; height: 17px; }

.fog-popup-media { position: relative; display: block; }
.fog-popup-media img { display: block; width: 100%; height: 168px; object-fit: cover; border-radius: 22px 22px 0 0; }
.fog-popup-media::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, rgba(3, 20, 39, 0) 40%, rgba(3, 20, 39, .38));
    pointer-events: none;
}

.fog-popup-body { padding: 20px 24px 0; }

.fog-popup-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #a2862d;
    font: 800 .62rem/1 var(--fog-font-body, 'Plus Jakarta Sans', sans-serif);
    letter-spacing: .16em;
    text-transform: uppercase;
}
.fog-popup-kicker .fog-i { width: 14px; height: 14px; }

.fog-popup-title {
    margin: 10px 0 8px;
    color: #06264a;
    font-family: var(--fog-font-display, 'Sora', sans-serif);
    font-size: clamp(1.25rem, 4.6vw, 1.5rem);
    line-height: 1.25;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.fog-popup-desc {
    margin: 0;
    color: #54707f;
    font-size: .82rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress */
.fog-popup-progress { margin: 16px 0 4px; }
.fog-popup-progress progress {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 7px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e8eef4;
    accent-color: #d0b028;
}
.fog-popup-progress progress::-webkit-progress-bar { background: #e8eef4; }
.fog-popup-progress progress::-webkit-progress-value { background: linear-gradient(90deg, #d0b028, #e7c94f); border-radius: 999px; }
.fog-popup-progress progress::-moz-progress-bar { background: linear-gradient(90deg, #d0b028, #e7c94f); border-radius: 999px; }
.fog-popup-figures { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 9px; }
.fog-popup-figures strong { color: #06264a; font-size: .95rem; letter-spacing: -.02em; }
.fog-popup-figures span { color: #7d94a6; font-size: .7rem; font-weight: 600; }

.fog-popup-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.fog-popup-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #f2f7fb;
    border: 1px solid #dfe9f1;
    color: #43688a;
    font: 700 .66rem/1.2 var(--fog-font-body, 'Plus Jakarta Sans', sans-serif);
}
.fog-popup-tag .fog-i { width: 12px; height: 12px; color: #a2862d; }
.fog-popup-tag.urgent { background: #fdf6ec; border-color: #ecd9b0; color: #8a6d1f; }

/* CTAs */
.fog-popup-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 18px 24px 0;
    min-height: 50px;
    padding: 13px 18px;
    border-radius: 13px;
    background: linear-gradient(135deg, #06264a, #004790);
    color: #fff;
    font: 800 .82rem/1 var(--fog-font-body, 'Plus Jakarta Sans', sans-serif);
    letter-spacing: .02em;
    text-decoration: none;
    box-shadow: 0 16px 34px rgba(0, 71, 144, .35);
    transition: transform .16s ease, box-shadow .16s ease;
}
.fog-popup-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(0, 71, 144, .42); color: #fff; }
.fog-popup-cta:focus-visible { outline: 3px solid #d0b340; outline-offset: 3px; }
.fog-popup-cta .fog-i { width: 17px; height: 17px; }

.fog-popup-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 12px 24px 0;
    color: #004790;
    font: 700 .74rem/1.2 var(--fog-font-body, 'Plus Jakarta Sans', sans-serif);
    text-decoration: none;
}
.fog-popup-more:hover { text-decoration: underline; }
.fog-popup-more .fog-i { width: 13px; height: 13px; }

.fog-popup-note {
    margin: 16px 24px 0;
    padding-top: 14px;
    border-top: 1px solid #eaf0f5;
    color: #93a8b8;
    font-size: .64rem;
    line-height: 1.6;
    text-align: center;
}

body.fog-popup-open { overflow: hidden; }

@keyframes fogPopupFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fogPopupIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Mobile: bottom sheet, thumb-friendly */
@media (max-width: 640px) {
    .fog-popup-card {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translate(0, 0);
        width: 100%;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        animation: fogPopupSheet .34s cubic-bezier(.2, .8, .3, 1.04) both;
        padding-bottom: max(26px, env(safe-area-inset-bottom));
    }
    .fog-popup-media img { height: 140px; border-radius: 22px 22px 0 0; }
    .fog-popup-media::after { border-radius: 22px 22px 0 0; }
    .fog-popup-cta { margin-inline: 18px; }
    .fog-popup-more { margin-inline: 18px; }
    .fog-popup-note { margin-inline: 18px; }
}
@keyframes fogPopupSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .fog-popup-overlay,
    .fog-popup-card { animation: none; }
    .fog-popup-cta:hover { transform: none; }
}
