/* PDF 미리보기 (member_plaza/notice/pdf_viewer.html) */
html,
body.pdfv-body {
    margin: 0;
    height: 100%;
    background: #525659;
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
}

.pdfv {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* 상단 바 */
.pdfv__bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 12px;
    background: #323639;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.pdfv__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 500;
}

.pdfv__page {
    flex-shrink: 0;
    font-size: 14px;
    color: #ddd;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pdfv__zoom {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.pdfv__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pdfv__btn:hover:not(:disabled),
.pdfv__btn:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

.pdfv__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.pdfv__btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pdfv__zoom-value {
    min-width: 56px;
    font-variant-numeric: tabular-nums;
}

.pdfv__download {
    flex-shrink: 0;
    background: #007bff;
}

.pdfv__download:hover {
    background: #0056b3 !important;
}

/* 변환 미리보기 안내 (한글 문서) */
.pdfv__notice {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 16px;
    background: #fff8e1;
    color: #6d4c00;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    word-break: keep-all;
}

/* 페이지 영역 */
.pdfv__scroll {
    position: relative;   /* 페이지 offsetTop 기준 */
    flex: 1;
    overflow: auto;
    /* 두 손가락 확대는 viewer.js 가 처리(브라우저 화면 확대 대신 페이지를 다시 그림) */
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.pdfv__pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0 32px;
    /* 확대해서 페이지가 화면보다 넓어지면 가로 스크롤 */
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}

.pdfv__pageframe {
    position: relative;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pdfv__pageframe canvas,
.pdfv__pageframe img {
    display: block;
    width: 100%;
    height: 100%;
}

/* 투명 PNG 가 배경과 섞이지 않게 */
.pdfv__pageframe--image {
    background: #fff;
}

/* 불러오는 중 / 오류 */
.pdfv__status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 60%;
    padding: 24px;
    color: #eee;
    font-size: 15px;
    text-align: center;
}

.pdfv__status[hidden] {
    display: none;
}

.pdfv__status p {
    margin: 0;
    line-height: 1.6;
}

.pdfv__status a {
    color: #8ec5ff;
}

.pdfv__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pdfv-spin 0.9s linear infinite;
}

.pdfv__status.is-error .pdfv__spinner {
    display: none;
}

@keyframes pdfv-spin {
    to { transform: rotate(360deg); }
}

.pdfv__noscript {
    margin: 0;
    padding: 16px;
    color: #fff;
    text-align: center;
}

/* 모바일 */
@media (max-width: 600px) {
    .pdfv__bar {
        gap: 2px;
        height: 48px;
        padding: 0 4px;
    }

    .pdfv__title {
        font-size: 14px;
    }

    .pdfv__page {
        font-size: 13px;
        padding: 0 4px;
    }

    .pdfv__btn {
        min-width: 36px;
        height: 36px;
        padding: 0 6px;
    }

    .pdfv__zoom-value {
        min-width: 48px;
        font-size: 13px;
    }

    .pdfv__download-text {
        display: none;
    }

    .pdfv__notice {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pdfv__pages {
        gap: 8px;
        padding: 8px 0 24px;
    }
}

@media (max-width: 380px) {
    /* 아주 좁은 화면: 배율 숫자는 숨기고 +/- 만 */
    .pdfv__zoom-value {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pdfv__spinner {
        animation-duration: 3s;
    }
}
