/* 갤러리 / 영상 게시판 전용 */

/* 상단 제목 + 등록 버튼 */
.media-head { padding-bottom: var(--sp-2); }
.gl-list { gap: var(--sp-8); }   /* 갤러리 목록: 머리 · 목록 · 쪽 번호 사이 */
.vl-top { gap: var(--sp-5); }    /* 영상 목록: 머리 · 종류 탭 사이 */
/* 폰: 제목 위아래 빈칸 줄임 (위 24 → 8, 제목 아래 → 탭까지 20 = 게시판 목록과 비슷) */
@media (max-width: 768px) {
  .site-main:has(.media-head) { padding-top: var(--sp-2); }
  .media-head { padding-bottom: 0; }
  .gl-list { gap: var(--sp-5); }
}

/* 필터 줄: 폰에서는 가로 스크롤 */
.media-filters { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
/* 영상 목록: 시안처럼 알약 줄 위아래에 선 */
.media-filters--band { padding: var(--sp-5) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-filters::-webkit-scrollbar { display: none; }
.media-filters .pill { flex-shrink: 0; min-height: 44px; }

/* ---------- 갤러리 카드 ---------- */
.gallery-card { display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left; overflow: hidden; color: var(--text); }
.gallery-card:active { transform: none; }
.gallery-card:hover { color: var(--text); }
.gallery-card .img-ph { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.gallery-card__body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.gallery-card__title { font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--text-strong); }
.gallery-card__meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gallery-card__meta .push { white-space: nowrap; }
.gallery-card__who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gallery-card__who .avatar { width: 20px; height: 20px; font-size: var(--fs-micro); }
@media (max-width: 640px) {
  .gallery-card__body { padding: var(--sp-3) var(--sp-3) var(--sp-4); gap: var(--sp-2); }
  .gallery-card__title { font-size: 14px; }
  .gallery-card__meta { font-size: 12px; gap: var(--sp-1) var(--sp-2); }
  .gallery-card__meta .chip { display: none; }
  .gallery-card__meta .push { margin-left: 0; width: 100%; }
}

/* ---------- 영상: 추천 + 인기 ---------- */
.video-top { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--sp-8); align-items: start; }
.video-feature { display: flex; flex-direction: column; gap: var(--sp-4); color: var(--text); }
.video-feature:hover { color: var(--text); }
.video-feature .media-thumb__play { width: clamp(56px, 8vw, 84px); height: auto; }
.video-feature__title { font-size: var(--fs-3xl); font-weight: var(--fw-semibold); color: var(--text-strong); }
.video-feature:hover .video-feature__title { color: var(--accent); }

.popular { display: flex; flex-direction: column; gap: var(--sp-4); }
.popular__list { display: flex; flex-direction: column; gap: var(--sp-3); }
.popular-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--sp-4); align-items: center; padding: var(--sp-2); margin: calc(var(--sp-2) * -1); border-radius: var(--radius); color: var(--text); }
.popular-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.popular-item .media-thumb__play { width: 28px; height: 28px; }
.popular-item__text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.popular-item__title { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--text-strong); }
.popular-item__meta { font-size: 12px; color: var(--muted); }
.popular-item__who { display: inline-flex; align-items: center; gap: 6px; }
.popular-item__who .avatar { width: 18px; height: 18px; font-size: var(--fs-micro); }

@media (max-width: 1024px) {
  .video-top { grid-template-columns: minmax(0, 1fr); gap: var(--sp-10); }
  .popular__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); }
}
@media (max-width: 640px) {
  .popular__list { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .popular-item { grid-template-columns: 120px minmax(0, 1fr); gap: var(--sp-3); }
}

/* 영상 카드 */
.video-grid { row-gap: var(--sp-8); }
@media (max-width: 640px) { .video-grid { row-gap: var(--sp-6); } }
.video-card { gap: var(--sp-3); }
.video-card__text { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; min-width: 0; }
.video-card .media-thumb__play { width: clamp(40px, 5vw, 56px); height: auto; }
@media (max-width: 640px) {
  .video-card__text { gap: var(--sp-1); }
  .video-card .chip { font-size: 11px; padding: 2px 8px; }
  .video-card .media-card__title { font-size: 14px; }
  .video-card .media-card__meta { font-size: 12px; }
}

/* ---------- 상세 공통 (갤러리·영상) ---------- */
.media-detail__title { font-size: 22px; font-weight: 800; }
.media-detail__title--lg { font-size: clamp(22px, 3vw, 30px); }
.media-detail__desc { font-size: 14px; line-height: 1.8; color: var(--text-sub); }

/* 작성자 */
.media-author { display: inline-flex; align-items: center; gap: var(--sp-3); min-width: 0; color: var(--text); }
.media-author:hover { color: var(--text); }
.media-author__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.media-author__name { color: var(--text-strong); }

/* 추천/공유/신고 버튼 줄 */
.media-actions { gap: var(--sp-2); }
.media-actions__main { flex: 1; }
.media-actions form { display: flex; }
/* 갤러리 글 오른쪽 칸(280px): 추천 · 원본 보기 · 스크랩을 한 줄 세 칸으로 (줄바꿈돼 버튼이 아래로 내려가던 것) */
.gl-detail #post-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; flex-wrap: nowrap; }
.gl-detail #post-actions form, .gl-detail #post-actions .btn { min-width: 0; }
.gl-detail #post-actions .btn { width: 100%; padding-inline: var(--sp-2); font-size: var(--fs-sm); white-space: nowrap; }
@media (max-width: 480px) {
  .media-actions { width: 100%; }
  .media-actions .btn, .media-actions form { flex: 1; padding-inline: var(--sp-3); }
  .media-actions form { padding-inline: 0; }
}

/* 댓글 */
.media-comments { display: flex; flex-direction: column; }
.media-comment { display: flex; gap: var(--sp-3); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.media-comment__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.media-comment__meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: 13px; }
.media-comment__name { font-weight: 700; color: var(--text); }
.media-comment__name:hover { color: var(--text-strong); }
.media-comment__text { font-size: 14px; line-height: 1.7; color: var(--text-sub); white-space: pre-line; overflow-wrap: anywhere; }
.media-comments__form { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.media-comments__form .input, .media-comments__form .textarea { flex: 1; min-width: 0; }
.media-comments__form { flex-wrap: wrap; align-items: flex-end; }
.media-comments__form .textarea { min-height: 44px; resize: vertical; }
.media-comment--reply { padding-left: var(--sp-10); }
.media-comment__del { display: contents; }
.media-comment__del button, .media-comment__edit { min-height: 28px; padding: 0 var(--sp-2); font-size: var(--fs-xs); color: var(--muted); background: transparent; border: 0; border-radius: var(--radius-sm); }
.media-comment__del button:hover, .media-comment__edit:hover { color: var(--text-strong); background: var(--hover); }
.media-comments__login { margin-top: var(--sp-4); }
.media-comments .comment__to { margin-right: 6px; font-weight: var(--fw-bold); color: var(--accent); }
/* 폰: 첫 줄 이름 · 레벨 … [수정] [삭제], 둘째 줄 시간 (예전엔 [삭제] 만 혼자 다음 줄로 떨어졌음). 단추는 누르기 좋게 44px */
@media (max-width: 480px) {
  .media-comment__meta { display: grid; grid-template-columns: minmax(0, auto) auto minmax(0, 1fr) auto auto; column-gap: var(--sp-2); }
  .media-comment__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .media-comment__meta > .muted { grid-row: 2; grid-column: 1 / -1; }
  .media-comment__edit { grid-column: 4; }
  .media-comment__del button { grid-column: 5; }
  .media-comment__del button, .media-comment__edit { min-height: 44px; }
}

/* ---------- 갤러리 상세: 이미지 뷰어 ---------- */
.viewer { position: relative; }
.viewer__img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: var(--art-bg); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; background: rgba(0,0,0,0.45); border-radius: 50%; }
.viewer__nav:hover { color: #fff; background: rgba(0,0,0,0.65); }
.viewer__nav--prev { left: var(--sp-3); }
.viewer__nav--next { right: var(--sp-3); }
.viewer-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); }
.viewer-thumbs__item { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--art-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.viewer-thumbs__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewer-thumbs__item:hover { border-color: var(--accent-line); }
.viewer-thumbs__item.is-current { outline: 2px solid var(--accent); outline-offset: 0; }
.media-info { display: flex; flex-direction: column; gap: var(--sp-1); font-size: 13px; line-height: 1.8; color: var(--muted); }
.media-info__title { color: var(--text); }
/* 갤러리 글: 넓은 화면은 왼쪽 그림 · 댓글, 오른쪽 글. 한 줄로 쌓이면(1024 이하) 그림 → 글(제목 · 내용 · 읽은 사람 · 추천) → 댓글 → 이미지 정보 · 목록 순서로 */
@media (max-width: 1024px) {
  .gl-detail { row-gap: var(--sp-4); }
  .gl-detail > .stack-sm, .gl-detail > .aside { display: contents; }
  .gl-detail .media-comments { order: 1; }
  .gl-detail .media-info, .gl-detail > .aside > .btn { order: 2; }
}
@media (max-width: 480px) {
  .viewer__nav { width: 40px; height: 40px; font-size: 20px; }
  .viewer-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 영상 상세 ---------- */
.video-player { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--art-bg); font-size: var(--fs-base); text-align: center; }
.video-file { aspect-ratio: auto 16 / 9; max-height: 80vh; background: #000; object-fit: contain; } /* 영상 파일(mp4) 플레이어: 칸을 영상 비율대로 (검은 여백 없이, 불러오기 전에만 16:9). 세로 영상이 너무 길어지면 화면 80% 에서 멈추고 그때만 양옆이 검게 */
/* 재생 전 썸네일 (누르면 플레이어, videos/detail.html). 4:3 옛 영상도 잘리지 않게 전체를 보여 줌 */
.video-facade { position: relative; overflow: hidden; cursor: pointer; }
.video-facade__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-facade__play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 76px; height: 76px; padding-left: 4px; color: var(--text-strong); background: var(--primary); border: 0; border-radius: 50%; transform: translate(-50%, -50%); cursor: pointer; transition: background .2s; }
.video-facade:hover .video-facade__play { background: var(--primary-hover); }
.video-facade__play:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(var(--focus-rgb), .5); }
@media (max-width: 480px) { .video-facade__play { width: 60px; height: 60px; } }

/* 영상 목록 (videos/list.html, 시안 docs/video-sian/list.html L1): 종류 탭(전체 · 공략 영상 · 일반 영상) · 공략 세부 태그 · 이번 주 추천 · 4열 카드 (옆으로 넘기지 않음) */
.vl-filter { display: flex; flex-direction: column; gap: var(--sp-3); }
.vl-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.vl-tabs a { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-5); font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-sub); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; }
.vl-tabs a small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--muted); }
.vl-tabs a:hover { color: var(--text-strong); border-color: rgba(255,255,255,.24); }
.vl-tabs a.is-on { color: var(--text-strong); background: var(--primary); border-color: var(--primary); } /* 고른 카테고리: 사이트 보라 (게시판 · 검색 탭과 같게) */
.vl-tabs a.is-on small { color: rgba(255,255,255,.78); }
.vl-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.vl-tags__label { margin-right: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); }
.vl-tags a { padding: 4px 12px; font-size: var(--fs-sm); color: var(--text-sub); border: 1px solid var(--line); border-radius: 999px; }
.vl-tags a:hover { color: var(--text-strong); border-color: var(--line-strong); }
.vl-tags a.is-on { color: var(--text-strong); background: var(--accent-soft); border-color: var(--accent-line); }
/* #태그 줄 [더보기]: 한 줄만 보이고 넘치는 태그는 숨김, 누르면 다 펼침 (js/media-more.js) */
.vl-tags a[hidden] { display: none; }
/* 카테고리 탭도 같은 [더보기] (탭 크기에 맞춤) */
.vl-tabs a[hidden] { display: none; }
.vl-tabs .vl-tags__more { min-height: 44px; padding: 0 var(--sp-4); font-size: var(--fs-md); }
/* 종류 표시 (공략 · 일반이 섞인 곳의 썸네일): 반투명 알약 + 색 점 (공략 = 노랑, 일반 = 회색) */
.vl-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; font-size: 12px; font-weight: var(--fw-bold); line-height: 1; color: #fff; background: rgba(10,10,14,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; backdrop-filter: blur(4px); }
.vl-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #9aa0aa; }
.vl-badge--guide::before { background: var(--hud-yellow); box-shadow: 0 0 6px rgba(var(--hud-yellow-rgb), .7); }
.vl-thumb { position: relative; display: block; }
.vl-thumb .vl-badge--on { position: absolute; left: 8px; top: 8px; z-index: 2; }
.vl-chapters { position: absolute; left: 8px; bottom: 8px; z-index: 2; padding: 2px 7px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.7); border-radius: 4px; }
/* 이번 주 추천: 왼쪽 썸네일 크게 + 오른쪽 소개 */
.vl-feat { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); overflow: hidden; color: var(--text); background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.vl-feat:hover { color: var(--text); border-color: var(--line-strong); }
.vl-feat .media-thumb { border: 0; border-radius: 0; }
.vl-feat__text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-8); }
.vl-feat__kick { font-size: var(--fs-xs); font-weight: var(--fw-heavy); letter-spacing: .2em; color: var(--hud-yellow); }
.vl-feat__title { font-size: clamp(22px, 2.4vw, 28px); font-weight: var(--fw-heavy); line-height: 1.3; color: var(--text-strong); word-break: keep-all; }
.vl-feat:hover .vl-feat__title { color: var(--accent); }
.vl-feat__meta { font-size: var(--fs-sm); color: var(--text-sub); }
.vl-feat__go { display: inline-flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); padding: 11px 20px; font-weight: var(--fw-heavy); color: var(--hud-ink); background: var(--hud-yellow); border-radius: 999px; }
/* 첫 화면 맨 위: 탭(베스트 5 · 역주행) + 왼쪽 큰 영상 1 · 오른쪽 작은 4 (순위 번호). 큰 영상은 썸네일 위 · 소개 아래 */
.vl-best__tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.vl-best__tab { display: flex; flex-direction: column; gap: 2px; margin-bottom: -1px; padding: 0 0 var(--sp-3); font: inherit; font-size: var(--fs-2xl); font-weight: var(--fw-heavy); text-align: left; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.vl-best__tab:hover { color: var(--text-sub); }
.vl-best__tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--hud-yellow); }
.vl-best__tab:focus-visible { outline: 2px solid rgba(var(--focus-rgb), .7); outline-offset: 2px; }
.vl-best__panel { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--sp-4); }
.vl-best__panel[hidden] { display: none; }
.vl-best__feat { grid-template-columns: minmax(0, 1fr); align-content: start; }
.vl-best__feat .vl-feat__text { gap: var(--sp-2); padding: var(--sp-5) var(--sp-6) var(--sp-6); }
.vl-best__feat .vl-feat__title { font-size: var(--fs-3xl); }
.vl-best__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.vl-best__foot .vl-feat__go { margin-top: 0; }
.vl-best__empty { grid-column: 1 / -1; margin: 0; padding: var(--sp-8); text-align: center; }
.vl-side { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.vl-side li { min-height: 0; }
.vl-side__item { display: grid; grid-template-columns: 28px minmax(0, 46%) minmax(0, 1fr); align-items: center; gap: var(--sp-3); height: 100%; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2); color: inherit; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); }
.vl-side__item:hover { color: inherit; border-color: var(--line-strong); }
.vl-side__item .media-thumb__play { width: 32px; height: 32px; }
.vl-side__item .vl-badge { height: 20px; padding: 0 8px 0 6px; font-size: var(--fs-2xs); }
.vl-side__rank { font-family: 'Bebas Neue', var(--font-display); font-size: var(--fs-4xl); line-height: 1; text-align: center; color: var(--muted); }
.vl-side li:first-child .vl-side__rank { color: var(--hud-yellow); }
.vl-side__text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.vl-side__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: var(--lh-snug); color: var(--text-strong); }
.vl-side__item:hover .vl-side__title { color: var(--accent); }
.vl-sec { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.vl-sec__title { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-heavy); color: var(--text-strong); }
.vl-sec__title .vl-sec__sub { display: inline; }
.vl-sec__en { font-family: 'Bebas Neue', var(--font-display); font-size: 15px; font-weight: 400; line-height: 1; letter-spacing: .18em; color: var(--muted); }
.vl-sec__en--guide { color: var(--hud-yellow); }
.vl-sec > a { font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; }
.vl-sec__sub { margin-left: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); }
.vl-section > .section-title { margin-bottom: var(--sp-4); }
.vl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-4); }
.vl-card { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; color: inherit; }
.vl-card:hover { color: inherit; }
.vl-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: var(--sp-1); font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.45; color: var(--text-strong); }
.vl-card:hover .vl-card__title { color: var(--accent); }
.vl-card__meta { font-size: var(--fs-xs); color: var(--muted); }
.vl-all { margin: 0; text-align: center; }
.vl-all a { display: inline-flex; padding: 10px 22px; font-size: var(--fs-sm); color: var(--text-sub); border: 1px solid var(--line-strong); border-radius: 999px; }
.vl-all a:hover { color: var(--text-strong); }
@media (max-width: 1024px) {
  .vl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vl-best__panel { grid-template-columns: minmax(0, 1fr); }
  .vl-side { grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .vl-feat { grid-template-columns: minmax(0, 1fr); }
  .vl-feat__text { padding: var(--sp-5); }
  .vl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-3); }
  .vl-tabs a { padding: 0 var(--sp-4); font-size: var(--fs-sm); }
  .vl-best__tab { font-size: var(--fs-xl); }
  .vl-best__feat .vl-feat__text { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
  .vl-best__feat .vl-feat__title { font-size: var(--fs-2xl); }
  .vl-side { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .vl-side__item { grid-template-columns: 24px minmax(0, 40%) minmax(0, 1fr); }
  .vl-side__rank { font-size: var(--fs-3xl); }
}
@media (max-width: 480px) {
  .vl-best__tabs { flex-wrap: nowrap; gap: var(--sp-4); }
  .vl-best__tab { font-size: var(--fs-lg); white-space: nowrap; }
}

/* 영상 글 보기 (videos/detail.html, 시안 docs/video-sian/magazine.html M3 — 글꼴 · 색 · 버튼은 사이트 것)
   얇은 제목 띠(썸네일을 오른쪽에 흐리게) → 2단 [플레이어 · 구간 상자(board.css .post-chapters, 게시판 글과 같음) · 설명 · 댓글 | 다음 영상] */
.vd-mag { overflow: hidden; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.vd-band { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 190px; padding: var(--sp-8) var(--sp-8) var(--sp-6); overflow: hidden; }
.vd-band__bg { position: absolute; top: 0; right: 0; z-index: -2; width: 62%; height: 100%; object-fit: cover; object-position: center 30%; }
.vd-band::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--surface-solid) 38%, rgba(var(--bg-rgb), .55) 70%, rgba(var(--bg-rgb), .3)), linear-gradient(0deg, var(--surface-solid), transparent 60%); }
.vd-band__text { max-width: 860px; }
.vd-band__kick { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.vd-band__kick a { color: var(--accent); }
.vd-band__kick a + a::before { content: '·'; margin-right: var(--sp-2); color: var(--muted); }
.vd-band__title { margin: 0 0 var(--sp-3); font-size: clamp(24px, 3vw, 34px); font-weight: var(--fw-heavy); line-height: 1.25; color: var(--text-strong); word-break: keep-all; }
.vd-band__by { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); color: var(--text-sub); }
.vd-band__who { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-strong); }

.vd-body { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside-w); grid-template-rows: auto 1fr; gap: var(--sp-5) var(--aside-gap); padding: var(--sp-2) var(--sp-8) var(--sp-8); }
.vd-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.vd-main .post-chapters { margin: 0; } /* 줄 간격은 .vd-main gap 으로 */
.vd-cmt { grid-column: 1; grid-row: 2; align-self: start; min-width: 0; }
.vd-aside { grid-column: 2; grid-row: 1 / span 2; align-self: start; display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
.vd-label { display: flex; align-items: baseline; gap: var(--sp-2); margin: 0 0 var(--sp-3); font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-strong); }
.vd-label small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--muted); }

.vd-desc { font-size: var(--fs-md); line-height: 1.8; color: var(--text); }
.vd-src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.vd-src a { color: var(--text-sub); font-weight: var(--fw-medium); text-decoration: none; }
.vd-src a:hover { color: var(--accent); }
.vd-tags { gap: var(--sp-2); }
.vd-main > .mc-stackbox { justify-content: flex-start; } /* 등장 캐릭터 얼굴: 설명 글줄과 같이 왼쪽에서 시작 */
.vd-acts { flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.vd-acts__edit { margin-left: auto; }

/* 다음 영상: 큰 썸네일 + 제목 */
.vd-next__item { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); color: inherit; }
.vd-next__text b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-strong); }
.vd-next__text small { font-size: var(--fs-xs); color: var(--muted); }
.vd-next__item:hover b { color: var(--accent); }

.video-link__text b { color: var(--text-strong); }
.video-link { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); color: var(--text); }
.video-link:hover { color: var(--text); }
.video-link__img { width: 90px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: var(--radius-sm); image-rendering: pixelated; }
.video-link__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.video-link__arrow { color: var(--accent); font-size: 20px; }

@media (max-width: 960px) {
  .vd-band { min-height: 0; padding: var(--sp-6) var(--sp-5) var(--sp-5); }
  .vd-band__bg { width: 100%; opacity: .35; }
  .vd-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; padding: var(--sp-2) var(--sp-4) var(--sp-6); }
  .vd-main, .vd-cmt, .vd-aside { grid-column: 1; grid-row: auto; }
  .vd-aside { display: contents; }   /* 다음 영상이 따로 칸이 돼서 플레이어 · 구간 → 댓글 → 다음 영상 */
  .vd-main { order: 1; } .vd-cmt { order: 2; } .vd-next { order: 3; }
  .vd-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .vd-next .vd-label { grid-column: 1 / -1; margin: 0; }
  .vd-next__item { margin: 0; }
  .vd-acts__edit { margin-left: 0; }
}

/* 갤러리 · 공략 영상 목록 그림 (fragments/media.html). 갤러리 4:3, 영상 16:9 + 가운데 재생 표시 */
.media-thumb { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--art-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.media-thumb--video { aspect-ratio: 16 / 9; }
/* 갤러리 카드 안에서는 카드 테두리를 쓰므로 그림은 아래 선만 */
.gallery-card .media-thumb { aspect-ratio: 16 / 11; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-card:hover .media-thumb img, .video-card:hover .media-thumb img, .video-feature:hover .media-thumb img, .popular-item:hover .media-thumb img { transform: scale(1.03); }
.media-thumb__play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%); fill: none; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.media-thumb__play circle { fill: rgba(var(--bg-rgb), .55); stroke: var(--accent); stroke-width: 1.2; }
.media-thumb__play path { fill: var(--accent); }
.media-filters a.pill { text-decoration: none; }
.media-empty { text-align: center; padding: var(--sp-10) var(--sp-6); }
.media-empty p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .media-thumb img { transition: none; } }

/* 폰: 영상 글의 플레이어를 화면 양끝까지 (게시판 글 속 유튜브와 같이, board.css) */
@media (max-width: 768px) {
  .vd-body .video-player { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; border-left: 0; border-right: 0; }
}

/* 폰: 영상 글도 카드를 없애고 화면 바탕에 바로 (board.css 게시판 글과 같이). 제목 띠는 화면 양끝까지 머리 그림처럼 */
@media (max-width: 768px) {
  .vd-mag { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .vd-band { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  /* 제목 띠를 따로 상자로 두지 않고 본문과 한 흐름으로: 배경 그림 · 그라데이션을 빼고 위아래 빈칸 줄임 */
  .vd-band__bg, .vd-band::after { display: none; }
  .vd-body { padding-top: 0; padding-left: 0; padding-right: 0; }
}

/* ---------- 글 보기 모양 (관리자 > 게시판 관리 · board.view.pc / board.view.m). 위 여백 · 빵조각 간격은 board.css 와 같이 ----------
   갤러리 PC 한 판: 왼쪽(그림 · 썸네일 · 댓글)을 테두리 하나로 잇고 댓글만 한 단계 밝게. 오른쪽 글 정보는 카드 그대로
   영상 PC 한 판: 이미 한 판(vd-mag)이라 댓글 상자만 없애고 위 선으로 구분
   폰 화면 꽉 차게: 그림 · 댓글 · 글 정보를 화면 양끝까지, 덩어리 사이는 어두운 띠(8) */
@media (min-width: 1025px) {
  .bd-pc-flat .layout-aside.gl-detail { gap: var(--sp-4); }
  .bd-pc-flat .gl-detail > .stack-sm { gap: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-solid); }
  .bd-pc-flat .gl-detail .viewer__img { border: 0; border-radius: 0; }
  .bd-pc-flat .gl-detail .viewer-thumbs { padding: var(--sp-4) var(--sp-6); }
  .site-main .bd-pc-flat .gl-detail .media-comments { border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-main .bd-pc-flat .vd-cmt .media-comments { padding: var(--sp-5) 0 0; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 1024px) {
  .site-main:has(> .bd-m-bleed .gl-detail) { padding-top: 0; }   /* 갤러리 글: 그림이 머리 막대 바로 아래 붙게 (board.css 의 위 여백 8 을 뺌) */
  .bd-m-bleed .gl-detail { row-gap: 0; }
  .bd-m-bleed .gl-detail .viewer { margin-inline: calc(-1 * var(--gutter)); }   /* 그림 상자째 넓혀야 ‹ › 가 그림 끝에 붙음 */
  .bd-m-bleed .gl-detail .viewer__img { border-left: 0; border-right: 0; border-radius: 0; }
  /* 그림 양옆 · 위아래 빈칸: 같은 그림(--viewer-bg, gallery/detail.html)을 크게 흐려 25% 만 비치게 */
  .bd-m-bleed .gl-detail .viewer { overflow: hidden; background: var(--art-bg); }
  .bd-m-bleed .gl-detail .viewer::before { content: ""; position: absolute; inset: -40px; background: var(--viewer-bg) center / cover no-repeat; filter: blur(40px) brightness(.5); opacity: .25; pointer-events: none; }
  .bd-m-bleed .gl-detail .viewer__img { position: relative; background: transparent; }
  .bd-m-bleed .gl-detail .viewer__nav { z-index: 1; }
  .bd-m-bleed .gl-detail .viewer-thumbs { margin-block: var(--sp-2); }
  .bd-m-bleed .gl-detail > .aside > .btn { margin-top: var(--sp-4); }
  .site-main .bd-m-bleed .gl-detail :is(.media-comments, .aside > .card) { margin-inline: calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-top: var(--sp-2) solid var(--bg); border-radius: 0; box-shadow: none; }
  .site-main .bd-m-bleed .vd-mag { margin-inline: calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-radius: 0; }
}
@media (max-width: 768px) {
  .site-main .bd-m-bleed .vd-mag { margin-inline: 0; }   /* 768 이하는 이미 상자 없이 화면 바탕 (위 '폰: 영상 글도 카드를 없애고') */
  .site-main .bd-m-bleed .vd-cmt .media-comments { margin-inline: calc(-1 * var(--gutter)); border: 0; border-block: var(--sp-2) solid var(--bg); border-radius: 0; box-shadow: none; }   /* 위아래 어두운 띠로 본문 · 다음 영상과 구분 (게시판 글과 같이) */
  /* 폰 갤러리 글: 제목 · 글쓴이 · 추천 칸을 따로 상자로 두지 않고 그림 바로 아래 한 흐름으로 (댓글 · 이미지 정보만 상자) */
  .site-main .gl-detail > .aside > .card:first-child { margin-inline: 0; padding: var(--sp-4) 0 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- 갤러리 모자이크 (fragments/media.html galleryGrid · js/gallery-list.js 가 .is-masonry 와 칸 .gl-col 을 만듦) ----------
   그림을 자르지 않고 원래 비율로 칸에 쌓음 (PC 4 · 태블릿 3 · 폰 2칸). 분류는 그림 왼쪽 위에 겹치고, 그 밖은 제목 한 줄 + 글쓴이 한 줄
   원본이 칸보다 작은 그림(.is-small)은 2배까지만 키워 가운데에, 작은 도트(.is-pixel)는 픽셀 그대로 */
.gl-masonry.is-masonry { display: flex; align-items: flex-start; gap: var(--sp-4); }
.gl-masonry .gl-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.gl-masonry.is-masonry .gallery-card { position: relative; }
.gl-masonry.is-masonry .gallery-card .media-thumb { aspect-ratio: auto; display: flex; justify-content: center; background: var(--art-bg); }
.gl-masonry.is-masonry .gallery-card .media-thumb img { width: 100%; height: auto; object-fit: contain; }
.gl-masonry.is-masonry .gallery-card.is-small .media-thumb { padding: var(--sp-4) 0; }
.gl-masonry.is-masonry .media-thumb img.is-pixel { image-rendering: pixelated; }
.gl-masonry.is-masonry .gallery-card__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); gap: var(--sp-1); }
.gl-masonry.is-masonry .gallery-card__title { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.gl-masonry.is-masonry .gallery-card__meta { flex-wrap: nowrap; }
.gl-masonry.is-masonry .gallery-card__meta .chip { position: absolute; top: var(--sp-2); left: var(--sp-2); display: inline-flex; background: rgba(var(--bg-rgb), .78); border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(4px); }
.gl-masonry.is-masonry .gallery-card__meta .mc-faces, .gl-masonry.is-masonry .gallery-card__meta .push { display: none; }
.gl-masonry.is-masonry .gallery-card__who { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 768px) {
  .gl-masonry.is-masonry, .gl-masonry .gl-col { gap: var(--sp-2); }
  .gl-masonry.is-masonry .gallery-card__body { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
}

/* 영상 · 갤러리 검색창: 분류 탭 바로 아래 (게시판 검색창 cm-search 와 같은 모양 · 같은 자리) */
/* 도구 줄 (시안 V1): 왼쪽 종류 탭 · 분류 알약, 오른쪽 검색창 + [올리기]. 768 이하는 탭이 한 줄, 아래 줄에 검색창 + 둥근 + */
.md-bar { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.md-bar > nav { min-width: 0; }
.md-bar .md-search { flex: 0 1 340px; margin-left: auto; }
.md-up { flex: none; height: 40px; min-height: 40px; }
@media (max-width: 768px) {
  .md-bar { flex-wrap: wrap; }
  .md-bar > nav { flex: 1 1 100%; }
  .md-bar .md-search { flex: 1 1 0; margin-left: 0; }
  .md-up { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 999px; }
  .md-up__t { display: none; }
}
.md-search { display: flex; align-items: stretch; width: 100%; height: 40px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-bg); }
.md-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--focus-rgb),.18); }
.md-search :focus-visible { outline: 0 !important; }
.md-search select { appearance: none; width: 112px; padding: 0 28px 0 14px; border: 0; border-right: 1px solid var(--line); color: var(--text); font: inherit; font-size: var(--fs-xs); cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9EA8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; }
.md-search option { background: var(--surface-solid); }
.md-search input { flex: 1; min-width: 0; padding: 0 14px; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); outline: none; }
.md-search input::placeholder { color: var(--placeholder); }
.md-search button { width: 48px; border: 0; background: var(--primary); color: #fff; cursor: pointer; }
.md-search button:hover { background: var(--primary-hover); }
.media-result { margin: 0; color: var(--text-sub); font-size: var(--fs-sm); }
.media-result b { color: var(--text-strong); }
.vl-result-count { margin-left: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
