/* gallery.css — 세계관 갤러리 페이지 · 제품 페이지 [세계관 보기] 버튼 · 가운데 뷰어 (WEB-N-013)
   tailwind.css 는 빌드된 파일이라 새 클래스를 쓰지 않고 여기 gal-* / wv-* 만 쓴다. */

/* ── 제품 페이지 [세계관 보기] 버튼 — 회색 도구 칩 무게 ─────────────────── */
.wv-entry { display: flex; justify-content: center; margin-top: 12px; }
.wv-open-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid #e5e7eb; background: #f3f4f6; color: #374151;
    font-size: 14px; font-weight: 500; line-height: 1.4; cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.wv-open-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.wv-open-btn:focus-visible { outline: 2px solid #d97706; outline-offset: 2px; }
.wv-open-count { color: #6b7280; font-weight: 400; }

/* ── 갤러리 페이지 ───────────────────────────────────────────────────────── */
.gal-page { min-height: 100vh; background: #f9fafb; }
.gal-wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.gal-header { background: #fff; border-bottom: 1px solid #e5e7eb; }
.gal-header .gal-wrap { padding-top: 32px; padding-bottom: 32px; }
.gal-header h1 { margin: 0; font-size: 30px; font-weight: 700; color: #111827; }
.gal-header p { margin: 8px 0 0; color: #4b5563; }
.gal-body { padding-top: 24px; padding-bottom: 64px; }

.gal-chips {
    display: flex; gap: 8px; margin-bottom: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gal-chips::-webkit-scrollbar { display: none; }
.gal-chip {
    flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
    border: 1px solid #e5e7eb; background: #fff; color: #374151;
    font-size: 14px; cursor: pointer; white-space: nowrap;
}
.gal-chip span { color: #9ca3af; margin-left: 4px; }
.gal-chip.is-on { background: #111827; border-color: #111827; color: #fff; }
.gal-chip.is-on span { color: #d1d5db; }
.gal-chip:focus-visible { outline: 2px solid #d97706; outline-offset: 2px; }

/* 원래 비율 그대로 벽돌 쌓기 (열 배치) */
.gal-grid { list-style: none; margin: 0; padding: 0; column-count: 4; column-gap: 16px; }
.gal-card { break-inside: avoid; margin: 0 0 16px; }
.gal-card[hidden] { display: none; }
.gal-card-btn {
    display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in;
    border-radius: 10px; overflow: hidden; text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: box-shadow .15s, transform .15s;
}
.gal-card-btn:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .12); transform: translateY(-1px); }
.gal-card-btn:focus-visible { outline: 2px solid #d97706; outline-offset: 2px; }
.gal-card-btn img { display: block; width: 100%; height: auto; background: #e5e7eb; }
.gal-card-meta { display: block; padding: 10px 12px 12px; }
.gal-card-title { display: block; font-size: 14px; font-weight: 600; color: #111827; }
.gal-card-product { display: block; margin-top: 2px; font-size: 12px; color: #6b7280; }
.gal-empty { padding: 64px 0; text-align: center; color: #6b7280; }

@media (max-width: 1024px) { .gal-grid { column-count: 3; } }
@media (max-width: 768px)  { .gal-grid { column-count: 2; column-gap: 10px; } .gal-card { margin-bottom: 10px; } }
@media (max-width: 640px)  {
    .gal-header h1 { font-size: 24px; }
    .gal-card-meta { padding: 8px 10px 10px; }
}

/* ── 가운데 뷰어 ─────────────────────────────────────────────────────────── */
html.wv-lock, html.wv-lock body { overflow: hidden; }
.wv-overlay {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0, 0, 0, .86);
}
.wv-overlay[hidden], .wv-overlay [hidden] { display: none !important; }
.wv-panel {
    display: flex; flex-direction: column; gap: 10px;
    width: 100%; max-width: 1100px; max-height: 100%; min-width: 0; color: #f9fafb;
}
.wv-head { display: flex; align-items: center; gap: 12px; }
.wv-heading { font-weight: 600; font-size: 15px; }
.wv-count { color: #9ca3af; font-size: 13px; }
.wv-close {
    margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.wv-close:hover { background: rgba(255, 255, 255, .28); }

.wv-stage {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 100%; min-width: 0; min-height: 0; flex: 1 1 auto;
}
.wv-img {
    display: block; max-width: 100%; max-height: calc(100vh - 260px);
    width: auto; height: auto; min-width: 0; flex: 0 1 auto; object-fit: contain;
    border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, .6); background: #111;
}
.wv-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 32px; line-height: 1; cursor: pointer;
}
.wv-nav:hover { background: rgba(255, 255, 255, .3); }
.wv-prev { left: 4px; }
.wv-next { right: 4px; }
.wv-close:focus-visible, .wv-nav:focus-visible, .wv-thumb:focus-visible, .wv-link:focus-visible {
    outline: 2px solid #fbbf24; outline-offset: 2px;
}

.wv-meta { text-align: center; }
.wv-product { color: #fbbf24; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.wv-title { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.wv-caption { margin: 4px auto 0; max-width: 720px; color: #d1d5db; font-size: 14px; line-height: 1.6; }
.wv-foot { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 4px; font-size: 13px; }
.wv-date { color: #9ca3af; }
.wv-link { color: #fbbf24; text-decoration: none; }
.wv-link:hover { text-decoration: underline; }

.wv-strip {
    display: flex; gap: 8px; justify-content: safe center;
    overflow-x: auto; padding: 4px 2px; scrollbar-width: thin;
}
.wv-thumb {
    flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 6px;
    background: none; cursor: pointer; opacity: .55; transition: opacity .15s;
}
.wv-thumb img { display: block; height: 56px; width: auto; border-radius: 4px; }
.wv-thumb:hover { opacity: .85; }
.wv-thumb[aria-current="true"] { opacity: 1; border-color: #fbbf24; }

@media (max-width: 640px) {
    .wv-overlay { padding: 10px; }
    .wv-img { max-height: calc(100vh - 230px); }
    .wv-nav { width: 40px; height: 40px; font-size: 26px; }
    .wv-title { font-size: 16px; }
    .wv-thumb img { height: 44px; }
}
