/* ===================================================
   media-gallery.css — 공용 갤러리 .mg-* / .gallery-lb-* 네임스페이스
   토큰: base.css 변수(--acc, --bg 계열, --t 계열, --bor 계열, --r, --r-sm) 단일 출처
   ★위 줄에 `--bg*` 처럼 별표를 슬래시 앞에 쓰지 말 것 — `*​/` 가 되어 주석이 그 자리에서
     닫힌다. 실제로 그랬고, 뒤따르던 두 줄이 CSS 본문으로 새면서 파서가 복구하는 동안
     첫 규칙 `.wt-gallery-panel{padding:16px 0}` 이 통째로 소실됐다(2026-08-06 CSSOM 실측:
     규칙 52개 중 첫 규칙이 .mg-section-head 였고 패널 padding 이 0px 였다).
     같은 함정의 재발이다 — work-detail-zine.css 에선 :root 토큰 블록이 날아갔었다.
   매직넘버 금지. z-index=var(--z-modal)

   50% = 원형 요소 전용. 이 파일의 border-radius:50% 5건은 전부 원형 요소(재생버튼·닫기버튼·
   도트 등 아이콘 원판) 전용 — CLAUDE.md §8-2 ② 사유 주석.
   =================================================== */

/* ─── 공용 갤러리 .mg-* ─── */
.wt-gallery-panel {
  padding: 16px 0;
}

.mg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mg-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--t2);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.mg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* 영상 카드 */
.mg-video-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
}
.mg-video-card__thumb {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1e1e2e 0%, #12122a 40%, #0d1117 100%);
}
.mg-video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-card-layer-1);
}
.mg-video-card__play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-white);
  transition: background .12s ease, border-color .12s ease;
}
.mg-video-card:hover .mg-video-card__play-circle {
  background: var(--acc);
  border-color: var(--acc);
}
.mg-video-card__label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 44px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-white);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  z-index: var(--z-card-layer-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mg-video-card__yt-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: var(--z-card-layer-2);
  display: flex;
  align-items: center;
}

/* 이미지 카드 */
.mg-image-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  transition: opacity .12s ease;
}
.mg-image-card:hover { opacity: .82; }
.mg-image-card__inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg4), var(--bg));
}
.mg-image-card__inner--a { background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.mg-image-card__inner--b { background: linear-gradient(160deg, #2e1a1a 0%, #3e1616 50%, #600f0f 100%); }
.mg-image-card__inner--c { background: linear-gradient(160deg, #1a2e1a 0%, #16301e 50%, #0b4023 100%); }
.mg-image-card__inner--d { background: linear-gradient(160deg, #2e2a1a 0%, #3e3416 50%, #604b0f 100%); }

/* 더보기 버튼 */
.mg-more-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--bor);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.mg-more-btn:hover { background: var(--bg4); color: var(--t1); }

/* 빈 상태 */
.mg-empty {
  background: var(--bg3);
  border: 1px solid var(--bor);
  border-radius: var(--r);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.mg-empty__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--bor);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
}
.mg-empty__title { font-weight: 700; color: var(--t2); font-size: 12px; }
.mg-empty__sub { font-size: 11px; color: var(--t3); margin-top: -4px; }

/* 섹션 구분선 */
.mg-divider { height: 1px; background: var(--bor); border: none; margin: 20px 0; }

/* ─── 편집 갤러리 .mg-edit-* ─── */
.mg-edit-block {
  background: var(--bg3);
  border: 1px solid var(--bor);
  border-radius: var(--r);
  padding: 16px 20px;
}

/* 카드 래퍼 — 삭제X 위치 앵커 */
.mg-card {
  position: relative;
}

/* 삭제 X (editable:true 시만 DOM 포함) */
.mg-edit-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t1);
  cursor: pointer;
  z-index: var(--z-card-layer-3);
  font-size: 14px;
  line-height: 1;
  transition: background .12s ease, border-color .12s ease;
}
.mg-edit-del:hover {
  background: var(--acc);
  border-color: var(--acc);
}

/* 추가 버튼 바 */
.mg-edit-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 검수 안내 문구 */
.mg-edit-notice {
  font-size: 11px;
  color: var(--t3);
  background: var(--bg4);
  border: 1px solid var(--bor);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

/* ─── 라이트박스 .gallery-lb-* ─── */
.gallery-lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,.94);
  flex-direction: column;
  outline: none;
}
.gallery-lb-overlay.open {
  display: flex;
}

.gallery-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  flex-shrink: 0;
  position: relative;
}
.gallery-lb-counter { font-size: 12px; font-weight: 700; color: var(--t2); }
.gallery-lb-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--t1);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-lb-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--bor);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.gallery-lb-close:hover { background: var(--bor2); color: var(--t1); }

.gallery-lb-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 12px;
  padding: 0 20px 20px;
}
.gallery-lb-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: #000;
  position: relative;
}
.gallery-lb-main__img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg4), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bor2);
  border-radius: var(--r-sm);
}
.gallery-lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1px solid var(--bor);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t1);
  cursor: pointer;
  z-index: var(--z-card-layer-1);
  transition: background .12s ease;
}
.gallery-lb-arrow:hover { background: rgba(0,0,0,.85); }
.gallery-lb-arrow--prev { left: 12px; }
.gallery-lb-arrow--next { right: 12px; }

.gallery-lb-strip {
  width: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex-shrink: 0;
  padding-right: 2px;
}
.gallery-lb-strip::-webkit-scrollbar { width: 3px; }
.gallery-lb-strip::-webkit-scrollbar-track { background: transparent; }
.gallery-lb-strip::-webkit-scrollbar-thumb { background: var(--bor2); border-radius:var(--rad); }

.gallery-lb-thumb {
  aspect-ratio: 16 / 9;
  border-radius:var(--r);
  background: var(--bg4);
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color .12s ease;
  position: relative;
  overflow: hidden;
}
.gallery-lb-thumb.active { border-color: var(--acc); }
.gallery-lb-thumb:hover:not(.active) { border-color: var(--bor2); }
.gallery-lb-thumb__inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .ent-sec-t 는 components.css에 정의됨 — 중복 금지 */
