/* 홈페이지 팝업 공지 - 프론트엔드 스타일 (PC/모바일 공용) */

.church-popup-overlay {
    position: fixed;
    z-index: 99999;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.church-popup-overlay.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.church-popup-lock {
    overflow: hidden;
}

.church-popup-box {
    position: relative;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(8px);
    transition: transform 0.25s ease;
}

.church-popup-overlay.show .church-popup-box {
    transform: translateY(0);
}

/* ── center: 화면 전체 어둡게 + 중앙 정렬 (기본, 차단형) ── */
.church-popup-overlay--center {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.6);
}

.church-popup-overlay--center .church-popup-box {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    max-height: 90dvh; /* 삼성인터넷 등 동적 주소창/툴바 대응 (dvh 미지원 브라우저는 위 vh로 폴백) */
    border-radius: 14px;
}

/* ── corner: 우하단 카드, 비차단형 (배경 어둡게 없음) ── */
.church-popup-overlay--corner {
    right: 20px;
    bottom: 20px;
    width: 300px;
    max-width: calc(100vw - 40px);
}

.church-popup-overlay--corner .church-popup-box {
    width: 100%;
    max-height: 70vh;
    max-height: 70dvh;
    border-radius: 12px;
}

/* ── bottom: 하단 전체폭 바, 비차단형 ── */
.church-popup-overlay--bottom {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

.church-popup-overlay--bottom .church-popup-box {
    width: 100%;
    max-width: 100%;
    max-height: 60vh;
    max-height: 60dvh;
    border-radius: 14px 14px 0 0;
    margin: 0 auto;
}

.church-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.church-popup-close:hover {
    background: rgba(0, 0, 0, 0.65);
}

.church-popup-body {
    flex: 1 1 auto;
}

.church-popup-image-link {
    display: block;
}

.church-popup-image {
    display: block;
    width: 100%;
    height: auto;
}

.church-popup-map-section {
    padding: 16px 18px 4px;
}

.church-popup-map-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.church-popup-map-address {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.church-popup-map-container {
    width: 100%;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}

.church-popup-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #eef0f3;
    flex-wrap: wrap;
}

.church-popup-hide-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.church-popup-hide-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.church-popup-close-btn {
    padding: 7px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.church-popup-close-btn:hover {
    background: #f3f4f6;
}

/* ── HTML 타입 ── */
.church-popup-html-content {
    padding: 20px 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1f2937;
}

.church-popup-html-content img {
    max-width: 100%;
    height: auto;
}

/* ── 텍스트 타입 (배너형) ── */
.church-popup-text-content {
    padding: 32px 22px;
    text-align: center;
}

.church-popup-text-content h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.church-popup-text-content p {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    opacity: 0.92;
}

.church-popup-text-link {
    display: inline-block;
    padding: 8px 18px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

/* corner/bottom 배너형은 여백을 좁게 */
.church-popup-overlay--corner .church-popup-text-content,
.church-popup-overlay--bottom .church-popup-text-content {
    padding: 20px 44px 20px 18px;
    text-align: left;
}

.church-popup-overlay--bottom .church-popup-box {
    flex-direction: row;
    align-items: stretch;
}

.church-popup-overlay--bottom .church-popup-body {
    display: flex;
    align-items: center;
}

.church-popup-overlay--bottom .church-popup-image {
    max-height: 120px;
    width: auto;
    object-fit: contain;
}

.church-popup-overlay--bottom .church-popup-footer {
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-left: 1px solid #eef0f3;
    flex: 0 0 auto;
}

@media (max-width: 480px) {
    .church-popup-overlay--center {
        padding: 12px;
        align-items: flex-end;
    }

    .church-popup-overlay--center .church-popup-box {
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 14px 14px 0 0;
    }

    .church-popup-overlay--corner {
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .church-popup-map-section {
        padding: 12px 14px 2px;
    }

    .church-popup-map-container {
        height: 200px;
    }

    .church-popup-footer {
        padding: 10px 14px;
    }

    .church-popup-overlay--bottom .church-popup-box {
        flex-direction: column;
    }

    .church-popup-overlay--bottom .church-popup-footer {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #eef0f3;
    }
}
