/* ─── Disclosure Door — YouTube-inspired UI ─── */

:root {
  --yt-bg: #0f0f0f;
  --yt-bg-elevated: #212121;
  --yt-bg-hover: #272727;
  --yt-text: #f1f1f1;
  --yt-text-secondary: #aaaaaa;
  --yt-text-muted: #717171;
  --yt-blue: #3ea6ff;
  --yt-red: #ff0000;
  --yt-border: #2a2a2a;
  --yt-thumb-bg: #1a1a1a;
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--yt-bg);
  color: var(--yt-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Top Bar ─── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--yt-bg);
  border-bottom: 1px solid var(--yt-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}

.top-bar-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-bar .logo {
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--yt-text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.top-bar .logo::before {
  content: '▶';
  color: var(--yt-red);
  font-size: 1rem;
}

/* ─── Page Layout ─── */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Homepage: Video Grid ─── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.video-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s ease;
}

.video-card:hover .video-thumb {
  border-radius: 0;
}

.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--yt-thumb-bg);
  transition: border-radius 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb .play-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.video-card:hover .play-icon {
  transform: scale(1.1);
}

.video-thumb .play-icon::after {
  content: '▶';
  color: white;
  font-size: 20px;
  margin-left: 3px;
}

.video-thumb .duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.85);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.video-info {
  padding: 12px 4px 0;
  display: flex;
  gap: 12px;
}

.video-info .channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.video-info .channel-icon.c0 { background: #6c63ff; }
.video-info .channel-icon.c1 { background: #00d4aa; }
.video-info .channel-icon.c2 { background: #ff6b6b; }

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

.video-info .video-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.video-info .video-channel {
  font-size: 0.8rem;
  color: var(--yt-text-secondary);
  margin-bottom: 2px;
}

.video-info .video-stats {
  font-size: 0.8rem;
  color: var(--yt-text-muted);
}

/* ─── Video Detail Page ─── */
.video-detail {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.video-detail-main {
  min-width: 0;
}

.video-detail .video-info-bar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--yt-border);
}

.video-detail .video-info-thumb {
  width: 200px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--yt-thumb-bg);
}

.video-detail .video-info-text {
  flex: 1;
  min-width: 0;
}

.video-detail .video-title-lg {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.video-detail .video-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.video-detail .channel-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.video-detail .channel-badge .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.video-detail .yt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--yt-bg-elevated);
  color: var(--yt-text);
  text-decoration: none;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
  margin-left: auto;
}

.video-detail .yt-link:hover {
  background: var(--yt-bg-hover);
}

.video-detail .yt-link::before {
  content: '▶';
  color: var(--yt-red);
  font-size: 0.75rem;
  margin-right: 4px;
}

/* ─── Blog Post List on Video Page (Card Grid) ─── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--yt-bg-elevated);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--yt-border);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border-color: rgba(62, 166, 255, 0.2);
}

.post-card .post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a3e, #2a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.2s;
}

.post-card:hover .post-thumb {
  transform: scale(1.04);
}

.post-card .post-body {
  padding: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.post-card .post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card:hover .post-title {
  color: var(--yt-blue);
}

.post-card .post-meta {
  font-size: 0.75rem;
  color: var(--yt-text-muted);
  margin-top: auto;
}

.post-card .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.post-card .tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(62, 166, 255, 0.08);
  color: var(--yt-blue);
  border: 1px solid rgba(62, 166, 255, 0.12);
}

/* ─── Sidebar ─── */
.video-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-sidebar .sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yt-text-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--yt-border);
}

.sidebar-card {
  display: flex;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.sidebar-card:hover {
  background: var(--yt-bg-elevated);
}

.sidebar-card .sidebar-thumb {
  width: 168px;
  min-height: 94px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--yt-thumb-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  position: relative;
}

.sidebar-card .sidebar-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-card .sidebar-info {
  flex: 1;
  min-width: 0;
}

.sidebar-card .sidebar-title {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--yt-text);
}

.sidebar-card .sidebar-channel {
  font-size: 0.75rem;
  color: var(--yt-text-secondary);
}

/* ─── Blog Post Article ─── */
.article-page {
  max-width: 900px;
}

.article-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--yt-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.article-page .back-link:hover {
  background: var(--yt-bg-elevated);
  color: var(--yt-text);
}

.article-page .back-link::before {
  content: '←';
}

.article-page article {
  padding-bottom: 64px;
}

.article-page article header.post-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--yt-border);
  margin-bottom: 32px;
}

.article-page .post-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.article-page .post-header .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--yt-text-secondary);
  align-items: center;
}

.article-page .post-header .meta-line a {
  color: var(--yt-blue);
  text-decoration: none;
}

.article-page .post-header .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.article-page .post-header .tag-list .tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(62, 166, 255, 0.08);
  color: var(--yt-blue);
  border: 1px solid rgba(62, 166, 255, 0.12);
}

/* ─── Article Content ─── */
.post-content {
  font-size: 1rem;
  line-height: 1.75;
}

.post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--yt-border);
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content strong {
  font-weight: 700;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid var(--yt-blue);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(62, 166, 255, 0.04);
  border-radius: 0 8px 8px 0;
  color: var(--yt-text-secondary);
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--yt-border);
  margin: 36px 0;
}

.post-content code {
  font-size: 0.9em;
  background: var(--yt-bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ff9900;
}

.post-content a {
  color: var(--yt-blue);
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

/* ─── Footer ─── */
footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--yt-border);
  margin-top: 48px;
  color: var(--yt-text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--yt-blue);
  text-decoration: none;
}

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .video-detail {
    grid-template-columns: 1fr;
  }
  .video-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .video-sidebar .sidebar-title {
    width: 100%;
  }
  .sidebar-card {
    width: calc(50% - 6px);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }
  .top-bar {
    padding: 0 16px;
  }
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .post-card {
    flex-direction: column;
  }
  .post-card .post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: auto;
  }
  .sidebar-card {
    width: 100%;
  }
  .video-detail .video-info-bar {
    flex-direction: column;
  }
  .video-detail .video-info-thumb {
    width: 100%;
  }
  .video-detail .video-title-lg {
    font-size: 1.1rem;
  }
  .article-page .post-header h1 {
    font-size: 1.3rem;
  }
}

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