/* =============================================================================
 * woosungjung.com — pages/channel.css
 * 채널 — 필터 줄 · 카드 격자 · 영상 모달.
 * 공통 조각은 여기 다시 만들지 않는다 —
 *   .box .link .none .todo → components.css
 *   .head .lead · .wrap    → layout.css · base.css
 * ========================================================================== */

/* ---------- 머리 ---------- */
.chead { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.chead .lead { margin-top: 26px; }
.subscribe {
  font-size: 13px;
  color: var(--dan-lt);
  border: 1px solid rgba(217, 96, 74, .5);
  border-radius: 4px;
  padding: 10px 20px;
  white-space: nowrap;
}
.subscribe:hover { background: rgba(217, 96, 74, .1); }

/* ---------- 필터 줄 ----------
   379건을 훑는 화면이라 스크롤해도 칩이 따라와야 한다 (nav 높이 아래로 붙인다).
   칩은 한 줄로 흐르고, 넘치면 옆으로 민다 — 여러 줄로 쌓이면 격자가 아래로 밀려난다 */
.filterwrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 9;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.filters { position: relative; display: flex; align-items: center; padding: 14px 0 15px; }

.fscroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1px 0;
  overscroll-behavior-x: contain;
}
.fscroll::-webkit-scrollbar { display: none; }
/* 끌어서 밀 때 (pages/channel.js) — 끌던 손끝에서 칩이 눌리지 않게 */
.fscroll.drag { cursor: grabbing; scroll-behavior: auto; user-select: none; }
.fscroll.drag .chip { pointer-events: none; }

.chip {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--hanji);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 7px 15px;
  line-height: 1.45;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
a.chip:hover { background: #26262B; }
.chip[aria-pressed="true"] { background: var(--hanji); color: var(--ink); }
.chip.score[aria-pressed="true"] { background: var(--cheong-lt); color: var(--ink); }
.chip.reset { background: none; border-color: var(--line); color: var(--sub); }
.chip.reset:hover { color: var(--hanji); border-color: #4A4A50; }
/* 지금 0 건인 칩 — 뷰가 링크가 아닌 span 으로 내보낸다 (눌러도 갈 곳이 없다) */
.chip.zero { opacity: .35; background: none; border-color: var(--line); }

/* 건수 — 눌러 보기 전에 몇 건인지 보인다 (/works 필터와 같은 규칙) */
.chip i { font-style: normal; font-family: var(--mono); font-size: 10px; margin-left: 7px; opacity: .65; }

.fsep { flex: 0 0 auto; width: 1px; align-self: stretch; background: var(--line); margin: 2px 5px; }

/* 좌우 화살표 — 스크롤이 남아 있을 때만 JS 가 켠다 */
.farr {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  border: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  z-index: 2;
  color: var(--hanji);
  font-size: 18px;
  padding: 0;
}
.farr.on { display: flex; }
.farr.l { left: 0; justify-content: flex-start; background: linear-gradient(90deg, var(--ink) 55%, transparent); }
.farr.r { right: 0; justify-content: flex-end; background: linear-gradient(270deg, var(--ink) 55%, transparent); }

.cmeta {
  padding: 20px 0 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sub);
}
.cmeta .dim { color: var(--faint); margin-left: 6px; }

/* ---------- 카드 격자 ----------
   카드에 마우스를 올리면 그 자리에서 커지고 아래로 설명이 열린다.
   커지는 것은 `.inner` 뿐이다 — 카드 자체가 커지면 격자가 통째로 밀린다.
   그래서 `.spacer` 가 16:9 자리를 잡아 두고, `.inner` 는 그 위에 얹혀 있다 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding: 6px 0;
}
.card {
  position: relative;
  display: block;
  isolation: isolate;
  color: inherit;
}
/* 아직 차례가 안 된 카드 — 자리도 그리지 않는다 (pages/channel.js 가 스크롤에 맞춰 푼다).
   `content-visibility` 를 쓰지 않는 이유: 그건 그리기를 가둬서 **부풀어 오른 카드가 잘린다** */
.card.hid { display: none; }
.spacer { display: block; aspect-ratio: 16 / 9; visibility: hidden; }
.inner {
  position: absolute;
  inset: 0 0 auto 0;
  border-radius: 6px;
  background: var(--surface);
  z-index: 1;
  transform-origin: center center;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1), box-shadow .3s;
}
.card:hover .inner,
.card:focus-visible .inner { transform: scale(1.28); z-index: 60; box-shadow: 0 20px 46px rgba(0, 0, 0, .75); }
.card:hover,
.card:focus-visible { z-index: 60; }
/* 줄 끝의 카드는 화면 밖으로 커지지 않게 기준점을 옮긴다 (JS 가 붙인다) */
.card.edgeL .inner { transform-origin: left center; }
.card.edgeR .inner { transform-origin: right center; }

.thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink);
  transition: border-radius .2s;
}
.card:hover .thumb,
.card:focus-visible .thumb { border-radius: 6px 6px 0 0; }
/* 어둡게 하는 데 `filter: brightness()` 를 쓰지 않는다 — 379장에 걸면 스크롤할 때마다
   그 수만큼 다시 칠한다. 바탕이 어두우니 `opacity` 로 같은 그림이 나오고, 그건 합성으로 끝난다 */
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .88; transition: opacity .3s; }
.card:hover .thumb img { opacity: 1; }

.under {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  display: block;
  background: var(--surface);
  border-radius: 0 0 6px 6px;
  padding: 0 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s, opacity .22s, padding .3s;
}
.card:hover .under,
.card:focus-visible .under { max-height: 130px; opacity: 1; padding: 11px 12px 13px; }
.under .ut { display: block; font-size: 11.5px; line-height: 1.4; margin-bottom: 3px; }
.under .uo { display: block; font-size: 9.5px; font-weight: 400; color: var(--sub); margin-bottom: 7px; }
.under .acts { display: flex; gap: 7px; align-items: center; }

/* 눌러야 할 곳은 카드 하나뿐이다 — 아래 표시는 전부 **모양**이지 단추가 아니다 */
.act {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(237, 231, 218, .55);
  position: relative;
  flex: 0 0 auto;
}
.act.play::after {
  content: '';
  position: absolute;
  left: 54%; top: 50%;
  transform: translate(-50%, -50%);
  border-left: 7px solid var(--hanji);
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}
.act.notation {
  width: auto;
  border-radius: 11px;
  padding: 0 9px;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--dan-lt);
  border-color: rgba(217, 96, 74, .5);
  line-height: 20px;
}
.under .dur { font-size: 9px; font-weight: 400; color: var(--sub); letter-spacing: .06em; }

/* 모달이 떠 있는 동안에는 카드가 부풀지 않는다 — 뒤에서 움직이면 산만하다 */
body.sheet-on .card:hover .inner { transform: none; box-shadow: none; z-index: 1; }
body.sheet-on .card:hover .under { max-height: 0; opacity: 0; padding: 0 12px; }
body.sheet-on .card:hover .thumb { border-radius: 6px; }

/* 더 펼칠 때를 알려 주는 눈금 — 보이지 않는다 (pages/channel.js 가 넣고 다 펼치면 걷어간다) */
.gridmark { height: 1px; }

/* 이어지는 곳 카드 셋. 아래로 여백을 둔다 —
   `section` 안이 아니라서 그 padding 을 못 받는다. 그냥 두면 푸터 선이 카드에 바로 붙는다 */
.cta { margin-top: 15px; border-top: 1px solid var(--line); padding: 50px 0 64px; }

/* ---------- 영상 모달 ---------- */
.overlay[hidden] { display: none; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.overlay-back { position: absolute; inset: 0; background: rgba(8, 8, 9, .9); }
.sheet {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  padding: 40px 44px 44px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.sheet .x {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: 0;
  color: var(--sub);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.sheet .x:hover { color: var(--hanji); }
.sheet h2 { font-family: var(--serif); font-weight: 300; font-size: 33px; line-height: 1.2; margin-bottom: 8px; }
.sheet .morig { color: var(--sub); font-size: 14px; }
.sheet .mtags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.tg {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--cheong-lt);
  border: 1px solid rgba(90, 165, 149, .4);
  border-radius: 9px;
  padding: 2px 9px;
}
.tg.score { color: var(--dan-lt); border-color: rgba(217, 96, 74, .45); }

.vid { margin-top: 22px; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 6px; overflow: hidden; }
.vid iframe { width: 100%; height: 100%; border: 0; display: block; }
.facade { position: relative; display: block; width: 100%; height: 100%; }
.facade img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.75); }
.facade:hover img { filter: brightness(.95); }
.facade .pb {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(237, 231, 218, .7);
}
.facade .pb::after {
  content: '';
  position: absolute;
  left: 53%; top: 50%;
  transform: translate(-50%, -50%);
  border-left: 15px solid var(--hanji);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.mlinks {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.mlinks a {
  font-size: 13px;
  color: var(--dan-lt);
  border-bottom: 1px solid rgba(217, 96, 74, .45);
  padding-bottom: 2px;
}

body.sheet-on { overflow: hidden; }

/* ---------- 반응형 ---------- */
@media (hover: none), (max-width: 700px) {
  /* 손가락으로 쓰는 화면에서는 부풀리지 않는다 — 올려둘 수가 없다 */
  .card:hover .inner,
  .card:focus-visible .inner { transform: none; box-shadow: none; z-index: 1; }
  .card:hover .under,
  .card:focus-visible .under { max-height: 0; opacity: 0; padding: 0 12px; }
  .card:hover .thumb,
  .card:focus-visible .thumb { border-radius: 6px; }
}

@media (max-width: 780px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .filterwrap { position: static; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .farr { display: none !important; }
  .subscribe { padding: 9px 16px; }
  .overlay { padding: 20px; }
  .sheet { max-height: 84vh; padding: 38px 20px 26px; }
  .sheet h2 { font-size: 24px; }
}
