/* ========================================================
   켈루툰 (KELU TOON) - 공식 웹툰 플랫폼 스타일시트
   테마: 밝고 화사한 모던 라이트 테마 (Bright & Clean Theme)
   ======================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --card-hover-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-sub: #94A3B8;
  
  --brand-gold: #F59E0B;
  --brand-gold-light: #FEF3C7;
  --brand-red: #EF4444;
  --brand-red-light: #FEE2E2;
  --brand-indigo: #4F46E5;
  --brand-indigo-light: #EEF2FF;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --viewer-width: 720px;
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================================
   HEADER & NAVIGATION
   ======================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-badge {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.logo-text {
  background: linear-gradient(135deg, #0F172A 60%, #4F46E5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-indigo);
  background-color: var(--brand-indigo-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--card-border);
  background: #FFFFFF;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* ========================================================
   HERO BANNER
   ======================================================== */
.hero-banner {
  background: linear-gradient(135deg, #FFFBEB 0%, #EFF6FF 50%, #F5F3FF 100%);
  border-bottom: 1px solid var(--card-border);
  padding: 48px 20px 40px;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #FCD34D;
  color: #B45309;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 24px;
}

/* ========================================================
   MAIN CONTAINER & GRIDS
   ======================================================== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  flex: 1;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, #F59E0B, #EF4444);
  border-radius: 2px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.episode-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.episode-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
  border-color: #CBD5E1;
}

.card-thumbnail-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.episode-card:hover .card-thumbnail {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.card-badge.gold {
  background: #F59E0B;
  color: #000;
}

.card-cuts-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-indigo);
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--bg-tertiary);
  padding-top: 14px;
  font-size: 0.82rem;
  color: var(--text-sub);
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-indigo);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-indigo-light);
  transition: background 0.2s;
}

.btn-read:hover {
  background: #E0E7FF;
}

/* ========================================================
   WEBTOON VIEWER (EPISODE PAGE)
   ======================================================== */
.viewer-container {
  max-width: var(--viewer-width);
  margin: 0 auto;
  padding: 24px 16px 80px;
  width: 100%;
}

.viewer-header {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.viewer-tag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pill-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.pill-tag.brand {
  background: var(--brand-gold-light);
  color: #B45309;
}

.pill-tag.genre {
  background: var(--brand-indigo-light);
  color: var(--brand-indigo);
}

.viewer-ep-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 12px;
}

.viewer-ep-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Comic Cut Frames (Seamless Vertical Viewer) */
.viewer-comic-body {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  margin-bottom: 30px;
}

.comic-panel-wrap {
  width: 100%;
  position: relative;
  background-color: #FAFAFA;
  border-bottom: 1px solid #F1F5F9;
}

.comic-panel-wrap:last-child {
  border-bottom: none;
}

.comic-panel-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Shorts Video Box inside viewer */
.viewer-shorts-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.shorts-box-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.shorts-box-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.shorts-video-player {
  max-width: 360px;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background: #000;
}

/* Floating Action Bar */
.floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 99;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--bg-tertiary);
}

.action-btn.active {
  color: var(--brand-red);
}

.nav-episode-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 30px;
}

.nav-ep-btn {
  flex: 1;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

.nav-ep-btn:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
  transform: translateY(-2px);
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--card-border);
  padding: 40px 20px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .episodes-grid {
    grid-template-columns: 1fr;
  }
  .viewer-container {
    padding: 12px 8px 90px;
  }
  .floating-bar {
    width: calc(100% - 32px);
    justify-content: space-around;
  }
}
