/*!
 * popupNotice 공개 노출 스타일 — 참고 예시 (모바일 팝업 관행) 반영.
 *
 * 두 displayType:
 *   - MODAL = 백드롭 (rgba 0.5) + 화면 중앙 flex + 크기 dimension. drag handle 없음
 *   - POPUP = 백드롭 없음 + fixed div + 지정 위치 (fallback right/bottom 20px) + 상단 slim drag handle
 *
 * DOM 계층:
 *   .pn-root (per-container)
 *     .pn-stage (배경색 · shadow · min fallback · flex-column · overflow hidden)
 *       .pn-drag-handle (POPUP 만 · 24px slim · grab · [×] 없음)
 *       .pn-slide-viewport (relative · overflow hidden)
 *         .pn-slide (background-image cover 또는 backgroundColor · absolute inset · opacity fade)
 *           .pn-slide-link a > .pn-slide-inner (선택 링크 wrap)
 *             .pn-slide-body (선택 · 이미지 위 오버레이 · 반투명 backdrop-filter blur)
 *         .pn-nav (dot indicator · viewport 안 absolute bottom+56 · 투명 · 가운데)
 *         .pn-slide-actions (반투명 어두운 bar · absolute bottom 0 · 좌 안 보기 pill / 우 닫기 text)
 */

.pn-root {
    box-sizing: border-box;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
.pn-root, .pn-root * { box-sizing: border-box; }

/* MODAL: 화면 전체 백드롭 + 중앙 flex. posX/posY 지정 시 stage 는 absolute (JS 인라인 position/left/top).
 * padding = flex 중앙 시 viewport 여백 (기본 배치용). stage 가 absolute 로 전환되면 padding 무관. */
.pn-root.pn-mode-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* POPUP: 지정 위치 fixed · 백드롭 없음 · 드래그 가능.
 * posX/posY 미지정 시 = 화면 우하단 default (right/bottom 20px).
 * 렌더러가 posX/posY 있으면 left/top 인라인 override + right/bottom auto. */
.pn-root.pn-mode-popup {
    position: fixed;
    right: 20px;
    bottom: 20px;
}

.pn-stage {
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
    min-width: 320px;
    min-height: 360px;
    position: relative;
}

/* ── drag handle (POPUP 만 · 얇음 · 잡고 이동 · [×] 없음) ── */

.pn-drag-handle {
    display: none;
    flex-shrink: 0;
    height: 24px;
    background: linear-gradient(to bottom, #f8f9fa, #eceff1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: grab;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
}
.pn-drag-handle:active { cursor: grabbing; }
.pn-mode-popup .pn-drag-handle { display: flex; }
/* 안전장치 = MODAL 은 handler.php 실수로 include 되어도 절대 render 안 됨. */
.pn-mode-modal .pn-drag-handle { display: none !important; }

.pn-drag-handle-grip {
    display: inline-block;
    width: 40px;
    height: 3px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
}

/* ── slide viewport (relative · 안에 slide + nav + actions 을 absolute 로 배치) ── */

.pn-slide-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

/* ── slide (배경 이미지 cover · 텍스트 overlay) ── */

.pn-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    background-color: #ffffff;
    background-position: center;
    background-repeat: no-repeat;
    /* contain = 이미지 원본 비율 유지 · 전체 표시 · stage 여백은 backgroundColor 로 채움. */
    background-size: contain;
}
.pn-slide.pn-slide-active {
    opacity: 1;
    visibility: visible;
}

.pn-slide-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.pn-slide-inner {
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;                          /* body 하단 오버레이 */
}

.pn-slide-body {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 96px;                            /* 하단 actions bar 44 + nav 36 + 여유 */
    font-size: 14px;
    line-height: 1.6;
    color: #222;
    word-break: break-word;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.pn-slide-body:empty { display: none; }
.pn-slide-body img { max-width: 100%; height: auto; }
.pn-slide-body p:first-child { margin-top: 0; }
.pn-slide-body p:last-child  { margin-bottom: 0; }

/* ── nav (dot + arrow · viewport 안 absolute · 반투명 흰색 + shadow 로 이미지 위 가독) ── */

.pn-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 44px;                                   /* actions bar 위 */
    z-index: 2;
    min-height: 32px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    gap: 8px;
    font-size: 12px;
    pointer-events: none;
}
.pn-nav > * { pointer-events: auto; }

.pn-nav-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pn-nav-arrow {
    border: none;
    background: transparent;
    padding: 2px 4px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s ease;
}
.pn-nav-arrow:hover { color: #fff; }
.pn-nav-arrow:disabled { color: rgba(255, 255, 255, 0.35); cursor: default; }

.pn-nav-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
}
.pn-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.pn-nav-dot:hover { background: rgba(255, 255, 255, 0.75); }
.pn-nav-dot.pn-nav-dot-active {
    background: #fff;
    transform: scale(1.2);
}

/* ── actions bar (반투명 어두운 bar · 좌 안 보기 pill / 우 닫기) ── */
/* 참고 예시 (모바일 팝업 관행) = 하단 검정 반투명 bar 안 "N일 안 보기" 좌 · "닫기" 우. */

.pn-slide-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    min-height: 44px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    color: #fff;
}

.pn-slide-actions-dismisses {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pn-nav-dismiss {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    border-radius: 999px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pn-nav-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.pn-nav-close {
    border: none;
    background: transparent;
    padding: 6px 12px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s ease;
    margin-left: 8px;
    flex-shrink: 0;                                 /* pill wrap 시 close 텍스트 잘림 방지 */
    white-space: nowrap;
}
.pn-nav-close:hover { background: rgba(255, 255, 255, 0.12); }

/* ── toast ── */

.pn-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10001;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    max-width: 80vw;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
.pn-toast.pn-toast-in {
    opacity: 1;
    transform: translate(-50%, 0);
}
