/* ---------------------------------------------------------------
 * 팝업 스타일
 * --------------------------------------------------------------- */

/* ── 팝업 공통 ─────────────────────────────────────── */
.js-popup-item {
    position: relative;
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
    border-radius: 4px;
    overflow: hidden;
}
.js-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 22px;
    color: #999;
    opacity: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: center;
    z-index: 10;
}
.js-popup-close:hover { color: #222222; }
.js-popup-title {
    padding: 20px 24px 0;
    font-size: 29px;
    font-weight: 700;
    color: #222222;
    line-height: 1.4;
}
.js-popup-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 80vh;
}
/* 제목 바로 다음에 본문이 올 경우 상단 패딩 축소 */
.js-popup-title + .js-popup-body {
    padding-top: 12px;
}
.js-popup-body img { max-width: 100%; height: auto; display: block; }
/* reset.css의 * { margin: 0 } 으로 제거된 단락 여백 복원 */
.js-popup-body p { margin-bottom: 16px; }
.js-popup-body p:last-child { margin-bottom: 0; }
.js-popup-body ul,
.js-popup-body ol { padding-left: 24px; margin-bottom: 16px; }
.js-popup-body ul { list-style: disc outside; }
.js-popup-body ol { list-style: decimal outside; }
.js-popup-body li { margin-bottom: 4px; list-style-position: outside; }
.js-popup-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 15px; }
.js-popup-body th,
.js-popup-body td { border: 1px solid #ddd; padding: 8px 11px; text-align: left; vertical-align: top; }
.js-popup-body th { background: #f8f6f3; font-weight: 700; }
.js-popup-body blockquote { border-left: 3px solid #c8a676; padding: 10px 16px; margin: 0 0 16px; background: rgba(200,166,118,0.08); }
.js-popup-body blockquote p:last-child { margin-bottom: 0; }
.js-popup-body hr { border: 0; border-top: 1px solid rgba(0,0,0,0.08); margin: 16px 0; }
.js-popup-body a { color: #c8a676; text-decoration: underline; }
.js-popup-body h1,.js-popup-body h2,.js-popup-body h3,.js-popup-body h4,.js-popup-body h5,.js-popup-body h6 { margin: 16px 0 6px; }
.js-popup-body h1:first-child,.js-popup-body h2:first-child,.js-popup-body h3:first-child { margin-top: 0; }
.js-popup-body > *:last-child { margin-bottom: 0; }
.js-popup-body::after { content: ''; display: table; clear: both; }
.js-popup-body code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 3px; font-family: "SF Mono", Consolas, monospace; font-size: 14px; }
.js-popup-body pre { background: #2d2d2d; color: #f8f8f2; padding: 13px 16px; border-radius: 6px; overflow-x: auto; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.js-popup-body pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }
.js-popup-body figure { margin: 0 0 16px; }
.js-popup-body figcaption { margin-top: 6px; font-size: 14px; color: #827568; text-align: center; }
.js-popup-body strong,.js-popup-body b { font-weight: 700; }
.js-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 16px;
    border-top: 1px solid rgba(0,0,0,.10);
    background: #f9f7f4;
}
.js-popup-hide-today,
.js-popup-hide-week {
    font-size: 14px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}
.js-popup-hide-today:hover,
.js-popup-hide-week:hover { color: #222; }

/* ── 팝업 오버레이 ─────────────────────────────────── */
.js-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99990;
    background: rgba(11,11,11,0.8);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.js-popup-overlay.is-visible { opacity: 1; }
.js-popup-overlay--transparent {
    pointer-events: none;
    background: transparent;
}

/* ── 팝업 프레임 공통 ──────────────────────────────── */
.js-popup-frame { position: fixed; }

/* 정중앙 */
.js-popup-frame.js-pf-center {
    top: 50%;
    left: 50%;
    transform: translate(
        calc(-50% + var(--js-off, 0px)),
        calc(-50% + var(--js-off, 0px))
    );
}

/* 좌측 상단 */
.js-popup-frame.js-pf-top-left {
    top:  calc(32px + var(--js-off, 0px));
    left: calc(32px + var(--js-off, 0px));
}

/* 우측 상단 */
.js-popup-frame.js-pf-top-right {
    top:   calc(32px + var(--js-off, 0px));
    right: calc(32px + var(--js-off, 0px));
}

/* 좌측 중앙 */
.js-popup-frame.js-pf-center-left {
    top:  50%;
    left: calc(32px + var(--js-off, 0px));
    transform: translateY(calc(-50% + var(--js-off, 0px)));
}

/* 우측 중앙 */
.js-popup-frame.js-pf-center-right {
    top:   50%;
    right: calc(32px + var(--js-off, 0px));
    transform: translateY(calc(-50% + var(--js-off, 0px)));
}

/* 좌측 하단 */
.js-popup-frame.js-pf-bottom-left {
    bottom: calc(32px + var(--js-off, 0px));
    left:   calc(32px + var(--js-off, 0px));
}

/* 우측 하단 */
.js-popup-frame.js-pf-bottom-right {
    bottom: calc(32px + var(--js-off, 0px));
    right:  calc(32px + var(--js-off, 0px));
}
