/* 갤러리 사진 뷰어 (viewer.js 와 함께 사용) - 참고 디자인: 남색 상단바, 어두운 배경, 하단 컨트롤 바 */
body.gv-lock { overflow: hidden; }

.gv-root {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 100000;
    display: none;
    flex-direction: column;
    background: #353535;
    color: #ddd;
    font-size: 14px;
    text-align: left;
}
.gv-root.is-open { display: flex; }
.gv-root *, .gv-root *::before, .gv-root *::after { box-sizing: border-box; }

/* 상단바 */
.gv-head {
    flex: 0 0 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 0 16px;
    background: #1b2a66;
}
.gv-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gv-logo { height: 32px; width: auto; display: block; }
.gv-brand-name {
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gv-close {
    width: 36px; height: 36px;
    border: 0; background: transparent;
    color: #fff; font-size: 18px; cursor: pointer;
}
.gv-close:hover { color: #ffb14a; }

/* 본문 */
.gv-body { flex: 1 1 auto; display: flex; min-height: 0; }
.gv-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 22px 16px;
}
.gv-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gv-title { color: #fff; font-size: 17px; font-weight: 600; line-height: 1.4; word-break: keep-all; }
.gv-date { color: #bdbdbd; font-size: 13px; margin-top: 4px; }
.gv-info-r { text-align: right; flex: 0 0 auto; }
.gv-count { color: #ffb14a; font-size: 16px; font-weight: 700; }
.gv-count .gv-total { color: #ddd; font-weight: 400; }
.gv-hit { color: #bdbdbd; font-size: 13px; margin-top: 4px; }

.gv-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}
.gv-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 하단 컨트롤 바 */
.gv-ctrl {
    flex: 0 0 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: #1c1c1c;
}
.gv-ctrl-c { display: flex; align-items: center; justify-content: center; gap: 22px; }
.gv-btn {
    width: 40px; height: 36px;
    border: 0; background: transparent;
    color: #f0f0f0; font-size: 17px; cursor: pointer;
}
.gv-btn:hover:not(:disabled) { color: #ffb14a; }
.gv-btn:disabled { opacity: .35; cursor: default; }
.gv-side-btn {
    width: 40px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent;
    color: #cfcfcf; font-size: 16px; cursor: pointer; text-decoration: none;
}
.gv-side-btn:hover { color: #ffb14a; text-decoration: none; }

/* 오른쪽 목록 */
.gv-side {
    flex: 0 0 230px;
    width: 230px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 12px;
    background: #2c2c2c;
}
.gv-side-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: #ddd;
    font-size: 12px;
}
.gv-all { margin: 0; font-weight: normal; cursor: pointer; }
.gv-all input, .gv-th input { margin: 0 5px 0 0; cursor: pointer; }
.gv-sel { color: #aaa; font-size: 11px; white-space: nowrap; }
.gv-dl {
    height: 34px;
    margin-bottom: 12px;
    border: 0;
    border-radius: 0;
    background: #1f3a9a;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.gv-dl:hover { background: #253dbe; }
.gv-thumbs {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-content: start;
    gap: 6px;
    overflow-y: auto;
}
.gv-th {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #111;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
}
.gv-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-th.is-active { border-color: #e53935; }
.gv-th input {
    position: absolute;
    top: 4px; left: 4px;
    margin: 0 !important;
    width: 13px; height: 13px;
}

/* 모바일 */
@media only screen and (max-width: 768px) {
    .gv-head { padding: 0 10px; height: 44px; flex-basis: 44px; }
    .gv-logo { height: 22px; }
    .gv-brand-name { font-size: 14px; }
    .gv-body { flex-direction: column; }
    .gv-main { padding: 10px 12px 10px; }
    .gv-title { font-size: 15px; }
    .gv-stage { min-height: 200px; }
    .gv-side {
        flex: 0 0 auto;
        width: auto;
        max-height: 36vh;
    }
    .gv-thumbs { grid-template-columns: repeat(6, 1fr); }
}

/* 목록에서 글 사진을 불러오는 동안 */
body.gv-loading, body.gv-loading * { cursor: progress !important; }
