/* =========================================================
   Part2 Content — Premium Facebook-style design
   Dark + light modes, mobile-first, fast perceived load.
   ========================================================= */

:root {
  --bg: #0b0f14;
  --surface: #141b22;
  --surface-2: #1c242d;
  --surface-3: #253040;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #e7edf3;
  --text-muted: #9aa5b1;
  --text-dim: #6b7684;
  --brand: #1877f2;              /* FB blue */
  --brand-hover: #166fe5;
  --brand-soft: rgba(24,119,242,0.14);
  --accent: #42b72a;             /* FB green */
  --accent-hover: #36a420;
  --danger: #e03e3e;
  --warning: #f0ad4e;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Layout ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand__logo {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1877f2 0%, #0066d6 100%);
  color: #fff;
  border-radius: 10px;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(24,119,242,0.45);
}
.nav-primary {
  display: none;
  margin-left: 12px;
  gap: 2px;
}
.nav-primary a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.nav-primary a:hover { color: var(--text); background: var(--surface-2); }
.nav-primary a.active { color: #fff; background: var(--brand-soft); }

.search-pill {
  margin-left: auto;
  flex: 1;
  max-width: 420px;
  position: relative;
  display: none;
}
.search-pill input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px 10px 40px;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
  transition: border 0.15s, background 0.15s;
}
.search-pill input:focus { border-color: var(--brand); background: var(--surface-2); }
.search-pill i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 14px;
}

.menu-btn {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.mobile-sheet {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mobile-sheet.open { display: block; }
.mobile-sheet a, .mobile-sheet form {
  display: block;
  padding: 14px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.mobile-sheet form input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
}

@media (min-width: 820px) {
  .nav-primary, .search-pill { display: inline-flex; }
  .search-pill { display: block; }
  .menu-btn { display: none; }
}

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.content { padding: 20px 0 48px; }
.content--narrow { max-width: 880px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 16px 0 24px;
  padding: 32px 24px;
  background:
    radial-gradient(1200px 400px at 10% 0%, rgba(24,119,242,0.25), transparent 60%),
    radial-gradient(1000px 400px at 100% 100%, rgba(66,183,42,0.18), transparent 60%),
    linear-gradient(135deg, #0f1724 0%, #0b111a 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4.5vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero p { color: var(--text-muted); max-width: 640px; margin: 0 0 18px; font-size: 15px; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }

/* ---------- Section ---------- */
.section { margin: 32px 0; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}
.section__link {
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
}
.section__link:hover { text-decoration: underline; }

/* ---------- Video grid / cards ---------- */
.video-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 540px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }

.vcard {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  color: inherit;
}
.vcard:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.vcard__thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a2535 0%, #0f1724 100%);
  overflow: hidden;
}
.vcard__thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.vcard__thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); font-size: 36px;
}
.vcard__play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(4px);
}
.vcard:hover .vcard__play { opacity: 1; }
.vcard__badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.vcard__body { padding: 12px 14px 14px; }
.vcard__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vcard__meta {
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.vcard__meta i { font-size: 10px; }
.vcard__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

/* Series cards (compact) */
.series-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 540px) { .series-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px) { .series-grid { grid-template-columns: repeat(3, 1fr); } }

.scard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.15s, border-color 0.15s;
  color: inherit;
  display: block;
}
.scard:hover { transform: translateY(-2px); border-color: var(--brand); }
.scard__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
}
.scard__title { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.scard__desc {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scard__count {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 10px;
  font-weight: 600;
}

/* ---------- Breadcrumb ---------- */
.crumbs {
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--text-dim); }

/* ---------- Video detail page ---------- */
.vhero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.vhero__title {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 16px 20px 8px;
  margin: 0;
}
.vhero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--brand { background: var(--brand-soft); color: #4a9eff; border-color: transparent; }
.badge--success { background: rgba(66,183,42,0.14); color: #5fd142; border-color: transparent; }

.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
/* Click-to-play poster for instant perceived load */
.video-poster {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  background-color: #000;
}
.video-poster::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
}
.video-poster__play {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 0 8px rgba(255,255,255,0.1);
  transition: transform 0.15s, background 0.15s;
}
.video-poster:hover .video-poster__play { transform: scale(1.07); background: var(--brand-hover); }
.video-poster__label {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 8px;
}
.video-poster__label i { color: #1877f2; font-size: 18px; }

/* Series/parts navigation */
.part-nav {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}
@media (min-width: 640px) { .part-nav { grid-template-columns: 1fr 1fr; } }
.part-nav__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  min-height: 64px;
}
.part-nav__btn:hover { border-color: var(--brand); background: var(--surface-2); }
.part-nav__btn.disabled { opacity: 0.4; pointer-events: none; }
.part-nav__btn--next { justify-content: flex-end; text-align: right; }
.part-nav__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.part-nav__label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }
.part-nav__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Description + share */
.vmeta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}
.vmeta__desc { color: var(--text); font-size: 15px; line-height: 1.6; }
.vmeta__share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- Series detail list ---------- */
.part-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.part-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}
.part-item:last-child { border-bottom: none; }
.part-item:hover { background: var(--surface-2); }
.part-item__num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.part-item__title { font-weight: 600; flex: 1; }
.part-item__arrow { color: var(--text-dim); }

/* ---------- Ads ---------- */
.ad-slot {
  margin: 16px 0;
  text-align: center;
  display: block;
}
.ad-slot .ad-label {
  display: inline-block;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}
.ad-slot__inner { display: inline-block; max-width: 100%; }
.ad-slot--popunder, .ad-slot--social_bar { display: none; }
.ad-smartlink-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f0ad4e, #d98424);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(240,173,78,0.3);
}
.ad-smartlink-cta:hover { opacity: 0.95; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer__grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 16px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: var(--text); font-size: 14px; margin: 0 0 10px; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a:hover { color: var(--brand); }
.site-footer__bottom {
  text-align: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

/* ---------- Static page prose ---------- */
.prose { color: var(--text); font-size: 15px; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose h2 { margin: 1.5em 0 0.5em; font-size: 20px; font-weight: 700; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.hidden { display: none !important; }

/* Loading state */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty__icon {
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.empty__title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.empty__text { font-size: 14px; margin: 0 auto; max-width: 400px; }

/* Pagination */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.pager span { color: var(--text-muted); font-size: 13px; }

/* Search page */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 560px;
}
.search-form input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.search-form input:focus { border-color: var(--brand); background: var(--surface-2); }

/* Toasts (if used elsewhere) */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  padding: 12px 18px; border-radius: 10px;
  color: #fff; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14px;
}
