/* ARTPANDA — 시크 블랙&화이트 에디토리얼. 모바일 우선, 호버 의존 금지 */
:root {
  --bg: #0a0a0a;
  --bg2: #141414;
  --fg: #f4f4f2;
  --fg-dim: #8b8b8b;
  --accent: #ffffff;          /* 공개 화면은 모노크롬 */
  --edit: #ffd34d;            /* 편집 도구 전용 색 */
  --danger: #e05555;
  --line: #1f1f1f;
  --radius: 3px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* label/div의 display 선언이 hidden 속성을 덮지 않도록 */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: #fff; color: #000; }

/* 상단바 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; letter-spacing: .18em; font-size: 1rem; }
.topbar nav { display: flex; gap: 22px; align-items: center; font-size: .88rem; color: var(--fg-dim); letter-spacing: .02em; }
.topbar nav a.active { color: var(--fg); }

/* 히어로 — 에디토리얼 타이포 */
.hero {
  max-width: 1120px; margin: 0 auto;
  padding: 96px 24px 72px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.12;
}
.hero-sub {
  color: var(--fg-dim); margin-top: 18px;
  font-size: clamp(.95rem, 2.4vw, 1.08rem); max-width: 560px;
}
.hero-stats {
  margin-top: 34px; font-size: .82rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fg);
}
.hero-note { margin-top: 10px; font-size: .7rem; color: var(--fg-dim); opacity: .55; letter-spacing: .04em; }

/* 밴드 */
.band { max-width: 1120px; margin: 0 auto; padding: 44px 24px 6px; }
.band + .band { border-top: 1px solid var(--line); margin-top: 26px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.band-titles { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.band-head h2 { font-size: 1.28rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.band-desc { color: var(--fg-dim); font-size: .8rem; font-weight: 400; letter-spacing: .01em; }
.band-more { color: var(--fg-dim); font-size: .8rem; white-space: nowrap; letter-spacing: .04em; flex-shrink: 0; }
.band-more:hover, .band-more:active { color: var(--fg); }
@media (max-width: 560px) {
  .band-titles { flex-direction: column; gap: 3px; }
  .band-desc { font-size: .76rem; }
}
.band-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 250px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.band-row::-webkit-scrollbar { height: 4px; }
.band-row::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* 카드 — 정보 항상 노출 (호버는 장식만) */
.card { cursor: pointer; scroll-snap-align: start; }
.thumb {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
  position: relative;
  outline: 1px solid rgba(255,255,255,.06);
  outline-offset: -1px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .35s ease; }
@media (hover: hover) {
  .card:hover .thumb img { transform: scale(1.04); opacity: .88; }
}
.card-title {
  margin-top: 10px; font-size: .88rem; font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub {
  color: var(--fg-dim); font-size: .74rem; margin-top: 3px;
  letter-spacing: .03em;
}

/* 아카이브 */
.archive-head { max-width: 1120px; margin: 0 auto; padding: 48px 24px 6px; }
.archive-head h2 { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; }
#archive-count { color: var(--fg-dim); font-size: .9rem; font-weight: 400; margin-left: 6px; }
#archive-search {
  width: 100%; max-width: 440px; margin-top: 18px;
  background: transparent; border: 1px solid #2a2a2a; border-radius: var(--radius);
  color: var(--fg); font-family: inherit; font-size: .9rem; padding: 10px 14px;
}
#archive-search:focus { outline: none; border-color: var(--fg-dim); }
#archive-search::placeholder { color: var(--fg-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip {
  border: 1px solid #2a2a2a; border-radius: 2px;
  padding: 5px 13px; font-size: .8rem; color: var(--fg-dim); letter-spacing: .02em;
  background: none; cursor: pointer; font-family: inherit;
}
.chip:hover { color: var(--fg); border-color: var(--fg-dim); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 700; }
.grid {
  max-width: 1120px; margin: 0 auto; padding: 22px 24px 72px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, 1fr); } }

/* 라이트박스 */
#lightbox { position: fixed; inset: 0; z-index: 100; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.88); }
.lb-body { position: relative; max-width: 920px; margin: 6vh auto 0; padding: 0 16px; }
.lb-player { aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.lb-player iframe { width: 100%; height: 100%; border: 0; }
.lb-meta { padding: 16px 4px; }
.lb-meta h3 { font-size: 1.05rem; font-weight: 700; }
.lb-meta p { color: var(--fg-dim); font-size: .82rem; margin-top: 5px; letter-spacing: .02em; }
.lb-close {
  position: absolute; top: -46px; right: 12px;
  background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer;
}

/* 소개 */
.about { max-width: 720px; margin: 0 auto; padding: 100px 24px; }
.about h2 { font-size: 2rem; font-weight: 900; letter-spacing: .12em; margin-bottom: 22px; }
.about p { color: var(--fg-dim); margin-bottom: 16px; }
.about a { color: var(--fg); text-underline-offset: 3px; }
.about .contact a { border-bottom: 1px solid var(--fg-dim); }

footer { border-top: 1px solid var(--line); padding: 30px 24px; text-align: center; color: var(--fg-dim); font-size: .74rem; letter-spacing: .08em; }

/* ─────────── 편집 도구 (로컬 전용 — 노란색 계열 유지) ─────────── */
.navbtn {
  border: 1px solid #2a2a2a; border-radius: var(--radius); background: none;
  color: var(--fg-dim); font-family: inherit; font-size: .82rem;
  padding: 5px 12px; cursor: pointer;
}
.navbtn.on { background: var(--edit); color: #000; border-color: var(--edit); font-weight: 700; }
.navbtn.dirty { background: var(--danger); color: #fff; border-color: var(--danger); }
.editing .card-title[contenteditable],
.editing #hero-title[contenteditable],
.editing #hero-sub[contenteditable],
.editing .band-titles h2[contenteditable],
.editing .band-desc[contenteditable] {
  outline: 1px dashed var(--edit); border-radius: 3px; padding: 2px 5px; cursor: text;
}
.edit-btns { position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; }
.eb {
  border: 0; border-radius: 3px; background: rgba(0,0,0,.68); color: #fff;
  font-size: .76rem; padding: 4px 9px; cursor: pointer; font-family: inherit;
}
.eb-star.on { background: var(--edit); color: #000; }
.eb-hide.on { background: var(--danger); }
.card.is-hidden .thumb { opacity: .3; }
.card.is-hidden .card-title { text-decoration: line-through; color: var(--fg-dim); }

/* 영상 추가 모달 */
#add-modal { position: fixed; inset: 0; z-index: 120; }
.add-body {
  position: relative; max-width: 460px; margin: 6vh auto 0; padding: 22px;
  background: var(--bg2); border: 1px solid #262626; border-radius: 8px;
  max-height: 86vh; overflow-y: auto;
}
.add-body h3 { margin-bottom: 14px; }
.add-body label { display: block; font-size: .8rem; color: var(--fg-dim); margin-top: 10px; }
.add-body input, .add-body select {
  width: 100%; margin-top: 4px; padding: 8px 10px;
  background: var(--bg); border: 1px solid #2a2a2a; border-radius: 5px;
  color: var(--fg); font-family: inherit; font-size: .9rem;
}
.add-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
#add-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; margin-top: 12px; }
/* 수정 모드에서는 썸네일을 작게 — 폼 전체가 한눈에 들어오도록 */
.editing-item #add-thumb { max-width: 190px; }
.add-actions { position: sticky; bottom: -22px; background: var(--bg2); padding-bottom: 4px; }
.add-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.add-msg { font-size: .76rem; color: var(--edit); margin-top: 8px; min-height: 1em; }

/* 분류 관리 */
#cat-modal { position: fixed; inset: 0; z-index: 115; }
#cat-modal .add-body { max-width: 480px; }
.cat-hint { font-size: .78rem; color: var(--fg-dim); margin-bottom: 12px; line-height: 1.5; }
#cat-list { max-height: 46vh; overflow-y: auto; }
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.cat-row.off .cat-name { color: var(--fg-dim); text-decoration: line-through; }
.cat-move { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.cat-move button {
  background: none; border: 0; color: var(--fg-dim); cursor: pointer;
  font-size: .6rem; line-height: 1; padding: 1px 3px;
}
.cat-move button:hover:not(:disabled) { color: var(--fg); }
.cat-move button:disabled { opacity: .25; cursor: default; }
.cat-name { flex: 1; font-size: .9rem; font-weight: 600; min-width: 0; }
.cat-cnt { font-size: .76rem; color: var(--fg-dim); flex-shrink: 0; }
.cat-row .navbtn { font-size: .76rem; padding: 4px 10px; flex-shrink: 0; }
.cat-del { color: var(--danger) !important; border-color: var(--danger) !important; }
.cat-add { display: flex; gap: 8px; margin-top: 16px; }
.cat-add input {
  flex: 1; min-width: 0; padding: 8px 10px;
  background: var(--bg); border: 1px solid #2a2a2a; border-radius: 5px;
  color: var(--fg); font-family: inherit; font-size: .88rem;
}
.cat-add .navbtn { flex-shrink: 0; }

/* 보관함 */
#vault-modal { position: fixed; inset: 0; z-index: 110; }
.vault-body {
  position: relative; max-width: 640px; height: 84vh; margin: 5vh auto 0;
  background: var(--bg2); border: 1px solid #262626; border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
}
.vault-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.vault-head h3 { display: inline; }
#vault-count { color: var(--fg-dim); font-size: .84rem; font-weight: 400; margin-left: 8px; }
#vault-search {
  width: 100%; margin-top: 10px; padding: 8px 12px;
  background: var(--bg); border: 1px solid #2a2a2a; border-radius: 5px;
  color: var(--fg); font-family: inherit; font-size: .88rem;
}
.vault-head .lb-close { top: 10px; right: 12px; font-size: 1.5rem; }
#vault-list { overflow-y: auto; padding: 6px 18px 20px; }
.vault-sec h4 { font-size: .8rem; color: var(--edit); margin: 16px 0 8px; letter-spacing: .03em; }
.vault-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.vault-row img { width: 92px; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.vault-info { flex: 1; min-width: 0; }
.vault-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-sub { font-size: .72rem; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-restore { flex-shrink: 0; font-size: .76rem; }
.vault-memo {
  margin-top: 4px; font-size: .74rem; color: var(--edit);
  outline: 1px dashed #333; border-radius: 3px; padding: 2px 6px;
  min-height: 1.2em; cursor: text;
}
.vault-memo:empty::before { content: attr(data-ph); color: var(--fg-dim); opacity: .6; }
.vault-empty { color: var(--fg-dim); padding: 30px 0; text-align: center; }
