/* =========================================
   모모튜브 — style.css
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Noto+Serif+KR:wght@700&display=swap');

:root {
  --bg:          #f9f9f9;
  --bg-white:    #ffffff;
  --bg-hover:    #f2f2f2;
  --border:      #e0e0e0;
  --text:        #0f0f0f;
  --text-sub:    #606060;
  --text-muted:  #909090;
  --accent:      #c8392b;       /* 모모튜브 레드 */
  --accent-dark: #a52d22;
  --tab-active:  #0f0f0f;
  --font:        'Noto Sans KR', sans-serif;
  --nav-h:       56px;
  --ch-banner-h: clamp(80px, 13vw, 212px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── 스크롤바 ── */
::-webkit-scrollbar { height: 4px; width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.nav-logo-mark {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
}

.nav-search input {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  padding: 0 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-white);
  outline: none;
}
.nav-search input:focus { border-color: #aaa; }

.nav-search button {
  height: 36px;
  padding: 0 1.1rem;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 20px 20px 0;
  background: var(--bg-hover);
  cursor: pointer;
  color: var(--text-sub);
  transition: background 0.15s;
}
.nav-search button:hover { background: var(--border); }

.nav-actions { margin-left: auto; }

/* =========================================
   CHANNEL PAGE WRAPPER
   ========================================= */
.channel-page {
  padding-top: var(--nav-h);
  max-width: 1280px;
  margin: 0 auto;
}

/* ── 배너 ── */
.channel-banner {
  width: 100%;
  max-height: 212px;        /* PC 최대 높이 */
  background: #e8e8e8;
  overflow: hidden;
  aspect-ratio: 2560 / 423; /* 이미지 비율 고정 */
}
.channel-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.channel-banner-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #f0e8e0 0%, #e8d8cc 50%, #ddd0c8 100%);
}

/* ── 채널 헤더 ── */
.channel-header {
  background: var(--bg-white);
  padding: 1.5rem 2rem 0;
  border-bottom: 1px solid var(--border);
}

.channel-info {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.channel-avatar {
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: #ddd;
  overflow: hidden;
  border: 2px solid var(--border);
}
.channel-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.channel-avatar-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #c8392b 0%, #e05040 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
}

.channel-meta { flex: 1; min-width: 0; }

.channel-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.channel-handle-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.channel-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.55;
  margin-bottom: 0.5rem;
  white-space: pre-line;
}

.channel-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.channel-links a {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}
.channel-links a:hover { text-decoration: underline; }

.channel-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.btn-subscribe {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1.1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-subscribe:hover { background: #333; }

/* ── 탭 ── */
.channel-tabs {
  display: flex;
  gap: 0;
  margin-top: 0.5rem;
}

.tab {
  padding: 0.75rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
  font-weight: 700;
}

/* =========================================
   CHANNEL CONTENT
   ========================================= */
.channel-content {
  padding: 1.8rem 2rem;
}

/* ── 대표 영상 ── */
.featured-section {
  margin-bottom: 2.5rem;
}

.featured-card {
  display: flex;
  gap: 1.5rem;
  background: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s;
  border: 1px solid var(--border);
}
.featured-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }

.featured-thumb {
  flex-shrink: 0;
  width: 320px;
  aspect-ratio: 16/9;
  background: #222;
  position: relative;
  overflow: hidden;
}
.featured-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.featured-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1710 0%, #2a2218 100%);
  display: flex; align-items: center; justify-content: center;
}
.featured-thumb-placeholder svg { opacity: 0.3; }

.thumb-duration {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.featured-info {
  flex: 1;
  padding: 1.2rem 1.2rem 1.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.featured-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.featured-meta {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.featured-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 영상 섹션 ── */
.video-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* 가로 스크롤 그리드 */
.video-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* ── 영상 카드 ── */
.video-card {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.15s;
}
.video-card:hover { transform: translateY(-2px); }

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #ddd;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}
.video-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.video-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #2a2218 0%, #1a1710 100%);
  display: flex; align-items: center; justify-content: center;
}
.video-thumb-placeholder svg { opacity: 0.25; }

.video-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .video-row { grid-template-columns: repeat(3, 1fr); }
  .featured-thumb { width: 240px; }
  .channel-content { padding: 1.2rem 1rem; }
  .channel-header { padding: 1.2rem 1rem 0; }
}

@media (max-width: 640px) {
  .nav-search { max-width: none; }

  .video-row { grid-template-columns: repeat(2, 1fr); }

  .featured-card { flex-direction: column; }
  .featured-thumb { width: 100%; }
  .featured-info { padding: 0.8rem; }

  .channel-info { gap: 1rem; }
  .channel-avatar { width: 60px; height: 60px; }
  .channel-name { font-size: 1.1rem; }

  .tab { padding: 0.6rem 0.8rem; font-size: 0.82rem; }
}

@media (max-width: 420px) {
  .video-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
}
