/* 팝업 내 공통 UI 버튼 글꼴 (읽는 글 .kovi-pop-* 는 기존 Noto 유지) */
.kovi-btn {
    font-family: var(--font-ui);
}

/* =========================================================
   메인 레이어 팝업 (팝업존 + 한베뉴스)
   프레임, 불릿, 닫기 버튼, 이미지 없는 자리는 모두 CSS 로만 그린다.
   ========================================================= */
.kovi-pop-layer {
    display: none;
    position: absolute;
    top: 100px;
    left: 50%;
    z-index: 200000;
    width: 756px;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
    transform: translateX(-50%);
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 2px solid var(--kovi-brand);
    border-radius: 6px;
    box-shadow: 0 18px 50px rgba(2, 6, 18, .28), 0 2px 8px rgba(2, 6, 18, .08);
    color: #363535;
}
.kovi-pop-layer.is-open {
    display: block;
    /* 롤다운: 위쪽 모서리에 붙은 채로 아래로 펼쳐지며 커진다. */
    animation: kovi-pop-roll-down 1.5s cubic-bezier(.65, 0, .35, 1) both;
}

@keyframes kovi-pop-roll-down {
    from {
        clip-path: inset(0 0 100% 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.kovi-pop-layer-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 1;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8a8f98;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.kovi-pop-layer-close:hover {
    background: #f2f4f7;
    color: #111827;
}

.kovi-pop-layer-body {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    padding: 20px 20px 16px;
}
.kovi-pop-left  { flex: 0 0 300px; width: 300px; min-width: 0; }
.kovi-pop-right {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 22px;
    border-left: 1px solid #e8ebf0;
}

.kovi-pop-layer-title {
    margin: 0 0 12px;
    padding-left: 9px;
    border-left: 3px solid var(--kovi-primary);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #1f2937;
}

/* 팝업존 대표 이미지 */
.kovi-pop-lead { display: block; text-decoration: none; }
.kovi-pop-lead-img {
    display: block;
    box-sizing: border-box;
    height: 150px;
    overflow: hidden;
    border: 1px solid #cfd4dc;
    border-radius: 3px;
    background: #f2f4f7;
}
.kovi-pop-lead-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kovi-pop-lead-title {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: #363535;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kovi-pop-lead:hover .kovi-pop-lead-title { color: var(--kovi-primary); }

/* 팝업존 목록 (불릿은 CSS 로) */
.kovi-pop-lines {
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}
.kovi-pop-lines li {
    position: relative;
    padding-left: 10px;
}
.kovi-pop-lines li::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 1px;
    width: 3px;
    height: 3px;
    margin-top: -1px;
    border-radius: 50%;
    background: #9aa4b2;
}
.kovi-pop-lines a {
    display: block;
    padding: 3px 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #363535;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kovi-pop-lines a:hover { color: var(--kovi-primary); text-decoration: underline; }

/* 한베뉴스 (썸네일 리스트) */
.kovi-pop-news {
    margin: 0;
    padding: 0;
    list-style: none;
}
.kovi-pop-news li + li {
    border-top: 1px solid #eef0f3;
}
.kovi-pop-news-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    text-decoration: none;
    color: inherit;
}
.kovi-pop-news-img {
    flex: 0 0 128px;
    box-sizing: border-box;
    width: 128px;
    height: 80px;
    overflow: hidden;
    border: 1px solid #cfd4dc;
    border-radius: 3px;
    background: #f2f4f7;
}
.kovi-pop-news-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kovi-pop-news-txt {
    flex: 1 1 auto;
    min-width: 0;
}
.kovi-pop-news-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #363535;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.kovi-pop-news-link:hover .kovi-pop-news-title { color: var(--kovi-primary); }
.kovi-pop-news-date {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: #98a2b3;
    font-variant-numeric: tabular-nums;
}

/* 이미지가 없을 때의 CSS 플레이스홀더 */
.kovi-pop-lead-noimg,
.kovi-pop-news-noimg {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    background-color: #edf0f5;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, .7) 0,
        rgba(255, 255, 255, .7) 6px,
        rgba(255, 255, 255, 0) 6px,
        rgba(255, 255, 255, 0) 12px
    );
}
.kovi-pop-lead-noimg::after,
.kovi-pop-news-noimg::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 16px;
    margin: -8px 0 0 -10px;
    border: 2px solid #c2cad6;
    border-radius: 2px;
}

.kovi-pop-empty {
    margin: 10px 0;
    font-size: 12.5px;
    color: #98a2b3;
}

/* 하단 버튼 */
.kovi-pop-layer-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 11px 20px;
    border-top: 1px solid #e3e7ed;
    background: #f6f8fa;
}
.kovi-pop-layer-foot button {
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #667085;
    font-size: 12px;
    cursor: pointer;
}
.kovi-pop-layer-foot button:hover { color: #111827; text-decoration: underline; }

.kovi-pop-layer-close:focus-visible,
.kovi-pop-layer-foot button:focus-visible,
.kovi-pop-lead:focus-visible,
.kovi-pop-lines a:focus-visible,
.kovi-pop-news-link:focus-visible {
    outline: 2px solid var(--kovi-primary);
    outline-offset: 2px;
}

/* 반응형: 좁은 화면에서는 세로 1단 */
@media (max-width: 767px) {
    .kovi-pop-layer {
        top: 16px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 32px);
    }
    .kovi-pop-layer-body {
        flex-direction: column;
        gap: 18px;
        padding: 16px 14px 12px;
    }
    .kovi-pop-left { flex: none; width: auto; }
    .kovi-pop-right {
        width: 100%;
        padding-top: 16px;
        padding-left: 0;
        border-top: 1px solid #e8ebf0;
        border-left: 0;
    }
    .kovi-pop-lead-img { height: 160px; }
    .kovi-pop-news-img { flex: 0 0 96px; width: 96px; height: 60px; }
    .kovi-pop-layer-foot {
        padding: 10px 14px;
    }
}
