/* gallery.css — V-PLI 착용사진 갤러리 (features/gallery.js)
   메이슨리(CSS column) + 라이트박스 + 계정 필터 칩. 테마 토큰 재사용. */

/* ===== 헤더 ===== */
.gal-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem;
}
.gal-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.gal-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }
.gal-last-refreshed { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }

/* ===== 필터 칩 ===== */
.gal-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.gal-chip {
    padding: 0.4rem 0.95rem; border-radius: 999px; cursor: pointer;
    background: var(--card-bg); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    transition: var(--transition);
}
.gal-chip:hover { border-color: var(--accent-color); color: var(--text-primary); }
.gal-chip.active {
    background: var(--accent-color); border-color: var(--accent-color);
    color: var(--accent-text, #fff);
}

/* ===== 메이슨리 그리드 (CSS multicol) ===== */
.gal-grid { column-count: 4; column-gap: 1rem; }
@media (max-width: 1400px) { .gal-grid { column-count: 3; } }
@media (max-width: 1000px) { .gal-grid { column-count: 2; } }
@media (max-width: 640px)  { .gal-grid { column-count: 1; } }

.gal-tile {
    position: relative; break-inside: avoid; margin-bottom: 1rem;
    border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--card-bg);
    transition: var(--transition);
}
.gal-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-color); }

/* placeholder(그라디언트) 위에 실제 이미지가 덮음. 로드 실패 시 그라디언트 노출 */
.gal-ph {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 22%, var(--card-bg)), var(--card-bg));
}
.gal-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 영상 ▶ 오버레이 */
.gal-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: #fff; pointer-events: none;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.gal-play::before {
    content: ''; position: absolute; width: 58px; height: 58px; border-radius: 50%;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
}
.gal-play { z-index: 1; }

/* 다중미디어 +N 뱃지 */
.gal-multi {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
}
/* 계정 뱃지 */
.gal-acct {
    position: absolute; left: 8px; bottom: 8px; z-index: 2;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 999px; max-width: 70%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* admin 숨김 버튼 (hover 시 노출) */
.gal-hide {
    position: absolute; top: 6px; left: 6px; z-index: 3;
    width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 0.9rem; line-height: 1;
    opacity: 0; transition: var(--transition);
}
.gal-tile:hover .gal-hide { opacity: 1; }
.gal-hide:hover { background: #e5484d; }

/* ===== 빈 상태 ===== */
.gal-empty { text-align: center; padding: 4rem 1rem; color: var(--text-secondary); }
.gal-empty-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.gal-empty h3 { color: var(--text-primary); margin-bottom: 0.5rem; }
.gal-empty p { font-size: 0.9rem; line-height: 1.6; }

/* ===== 라이트박스 (.popup-overlay 위에 얹음) ===== */
.gal-lb-card {
    width: min(1100px, 96vw); max-width: 96vw; max-height: 92vh;
    padding: 0; overflow: hidden; display: flex; flex-direction: column;
    background: var(--card-bg);
}
.gal-lb-close { z-index: 5; }
.gal-lb-stage {
    position: relative; background: #0d0d10;
    display: flex; align-items: center; justify-content: center;
    min-height: 240px; max-height: 72vh;
}
.gal-lb-media { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; }
.gal-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(0,0,0,0.5); color: #fff; font-size: 1.8rem; line-height: 1;
}
.gal-lb-nav:hover { background: rgba(0,0,0,0.75); }
.gal-lb-prev { left: 12px; }
.gal-lb-next { right: 12px; }
.gal-lb-count {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 0.78rem; padding: 3px 10px; border-radius: 999px;
}

.gal-lb-caption { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; }
.gal-lb-author { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.gal-lb-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.gal-lb-name { font-weight: 700; color: var(--text-primary); }
.gal-lb-handle { font-size: 0.8rem; color: var(--text-secondary); }
.gal-lb-rt { font-size: 0.72rem; color: var(--accent-color); font-weight: 600; margin-left: 4px; }
.gal-lb-text { font-size: 0.9rem; line-height: 1.6; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; margin-bottom: 0.75rem; }
.gal-lb-link {
    display: inline-block; font-size: 0.85rem; font-weight: 600;
    color: var(--accent-text, #fff); background: var(--accent-color);
    padding: 0.45rem 0.9rem; border-radius: var(--radius-md); text-decoration: none;
}
.gal-lb-link:hover { filter: brightness(1.08); }
