/*
Theme Name: CartoonsVideo
Theme URI: https://cartoonsvideo.com
Author: CartoonsVideo
Description: Dark premium streaming-style theme for cartoons & anime. Top navigation, featured hero, continue watching, trending rows and accordion download hosts panel.
Version: 2.9.8
License: GNU General Public License v2 or later
Text Domain: cartoonsvideo
Tags: dark, custom-menu, featured-images, entertainment, blog
*/

/* ========== VARIABLES ========== */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1c1c1c;
  --bg-hover: #262626;
  --border: #2a2a2a;
  --orange: #ff5e00;
  --orange-hover: #ff7a33;
  --text: #ffffff;
  --text-2: #a3a3a3;
  --text-3: #737373;
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 64px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
  --shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }

/* ========== HEADER / TOP NAV ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon svg { width: 16px; height: 16px; fill: #fff; }
.logo span { color: var(--orange); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}
.primary-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  position: relative;
  padding: 4px 0;
}
.primary-nav a:hover,
.primary-nav a.active {
  color: var(--text);
}
.primary-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.search-form {
  position: relative;
}
.search-form input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px 9px 40px;
  width: 220px;
  font-size: 0.875rem;
  color: var(--text);
  transition: var(--transition);
}
.search-form input:focus {
  border-color: var(--orange);
  width: 280px;
}
.search-form svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: var(--transition);
  position: relative;
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.header-icon-btn .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--orange);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
}
.user-menu:hover { color: var(--text); }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.btn-upgrade {
  background: var(--orange);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-upgrade:hover { background: var(--orange-hover); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: var(--orange-hover); color: #fff; }
.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); }
.btn-sm { padding: 7px 14px; font-size: 0.825rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ========== MAIN CONTENT ========== */
.site-main { min-height: calc(100vh - var(--header-h)); }
.content-wrap { padding: 0 40px 48px; max-width: 1440px; margin: 0 auto; }

/* ========== HERO / FEATURED ========== */
.hero {
  position: relative;
  height: 480px;
  margin: 0 -40px 32px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,0.97) 25%, rgba(10,10,10,0.7) 55%, rgba(10,10,10,0.25) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  max-width: 560px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--orange);
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 14px;
}
.hero-meta .rating { color: #fbbf24; font-weight: 600; }
.hero p {
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; }

/* ========== SECTIONS ========== */
.section { margin-bottom: 40px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.section-header .view-all {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--orange);
}

/* Horizontal scroll row */
.cards-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { display: none; }

/* Series / Episode Card */
.card-item {
  flex: 0 0 180px;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.card-item.poster img { aspect-ratio: 2/3; }
.card-item .card-body {
  padding: 10px 12px 12px;
}
.card-item .card-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.card-item .card-meta {
  font-size: 0.75rem;
  color: var(--text-3);
}
.card-item .card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Continue Watching specific */
.cw-card {
  flex: 0 0 280px;
}
.cw-card img { aspect-ratio: 16/9; }
.cw-progress {
  height: 3px;
  background: rgba(255,255,255,0.15);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.cw-progress span {
  display: block;
  height: 100%;
  background: var(--orange);
}

/* ========== SINGLE / EPISODE PAGE ========== */
.episode-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  padding-top: 28px;
}

.episode-main { min-width: 0; }

.episode-header { margin-bottom: 20px; }
.episode-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}
.episode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 12px;
}
.episode-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-2);
  transition: var(--transition);
}
.tag:hover { border-color: var(--orange); color: var(--orange); }

.episode-content {
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 24px;
}
.episode-content p { margin-bottom: 12px; }

.episode-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

/* ========== DOWNLOAD PANEL (RIGHT) ========== */
.download-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
}
.download-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.download-panel-header h3 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.download-panel-header h3 svg { color: var(--orange); }
.quality-pills {
  display: flex;
  gap: 4px;
}
.quality-pills button {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}
.quality-pills button.active,
.quality-pills button:hover {
  background: var(--orange);
  color: #fff;
}

/* Host Accordion */
.host-list { max-height: none; }
.host-item { border-bottom: 1px solid var(--border); }
.host-item:last-child { border-bottom: none; }

.host-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.host-trigger:hover { background: var(--bg-hover); }

.host-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.host-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-3);
  width: 18px;
}
.host-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.host-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.host-badge.fast { background: rgba(34,197,94,0.15); color: #22c55e; }
.host-badge.reliable { background: rgba(59,130,246,0.15); color: #3b82f6; }
.host-badge.high { background: rgba(168,85,247,0.15); color: #a855f7; }

.host-trigger .chevron {
  color: var(--text-3);
  transition: transform 0.25s ease;
}
.host-item.open .chevron {
  transform: rotate(180deg);
  color: var(--orange);
}

.host-body {
  display: none;
  padding: 0 18px 16px;
  background: var(--bg);
}
.host-item.open .host-body { display: block; }

.host-file {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 10px;
  word-break: break-all;
}

.dl-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dl-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}
.dl-btn:hover {
  border-color: var(--orange);
  background: rgba(255,94,0,0.08);
}
.dl-btn .size { color: var(--text-3); font-size: 0.8rem; }
.dl-btn .dl-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-weight: 600;
}

.download-note {
  padding: 12px 18px;
  font-size: 0.75rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.download-note svg { flex-shrink: 0; margin-top: 1px; color: var(--orange); }

/* ========== FOOTER ========== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--orange); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .episode-page { grid-template-columns: 1fr; }
  .download-panel { position: static; }
}

@media (max-width: 900px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .primary-nav { display: none; }
  .content-wrap { padding: 0 16px 40px; }
  .hero { margin: 0 -16px 24px; height: 380px; }
  .hero-content { padding: 0 16px; max-width: 100%; }
  .hero h1 { font-size: 1.75rem; }
  .search-form input { width: 140px; }
  .search-form input:focus { width: 160px; }
  .btn-upgrade span { display: none; }
}

@media (max-width: 600px) {
  .hero { height: 320px; }
  .hero-actions { flex-direction: column; }
  .card-item { flex: 0 0 150px; }
  .cw-card { flex: 0 0 240px; }
}
/* ========== CONTENT PARSED STYLES ========== */

/* Cover / screenshots – limited size */
.cv-shot,
.cv-shot-link img,
.episode-content img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  margin: 6px 4px;
  object-fit: contain;
  background: var(--bg-card);
}

.cv-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.cv-gallery .cv-shot,
.cv-gallery .cv-shot-link img {
  max-height: 160px;
  max-width: 280px;
}

/* IMDB Box – dark theme */
.cv-imdb {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
}
.cv-imdb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,94,0,0.08);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--orange);
}
.cv-imdb-body {
  padding: 12px 16px;
}
.cv-imdb-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
}
.cv-imdb-row:last-child { border-bottom: none; }
.cv-imdb-label {
  flex: 0 0 100px;
  font-weight: 600;
  color: var(--text-3);
}
.cv-imdb-value {
  color: var(--text-2);
  flex: 1;
  word-break: break-word;
}
.cv-imdb-value a { color: var(--orange); }

/* Video Info box */
.cv-video-info {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin: 16px 0;
}
.cv-vi-row {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 0.875rem;
}
.cv-vi-label {
  flex: 0 0 110px;
  font-weight: 600;
  color: var(--text-3);
}
.cv-vi-value {
  color: var(--text-2);
  flex: 1;
  word-break: break-all;
}

/* YouTube button */
.cv-youtube {
  margin: 16px 0;
}

/* Spoiler */
.cv-spoiler {
  margin: 16px 0;
}
.cv-spoiler-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}
.cv-spoiler-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.cv-spoiler-body {
  display: none;
  margin-top: 12px;
}
.cv-spoiler.open .cv-spoiler-body {
  display: block;
}

/* Quote fallback */
.cv-quote {
  background: var(--bg-elevated);
  border-left: 3px solid var(--orange);
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* Episode content cleanup */
.episode-content {
  color: var(--text-2);
  line-height: 1.7;
}
.episode-content p { margin-bottom: 10px; }
.episode-content a { color: var(--orange); }
.episode-content strong { color: var(--text); }

/* Featured image on single – limit size */
.episode-thumbnail img,
.episode-main > div > img.wp-post-image {
  max-height: 320px;
  width: auto;
  max-width: 100%;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

/* ========== v2.2 Image visibility fixes ========== */
.episode-content img,
.episode-content .cv-shot,
.cv-gallery img,
img.cv-shot {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 100% !important;
  max-height: 260px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 8px;
  margin: 6px 4px;
  background: #1c1c1c;
}

.cv-gallery {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

/* Featured / post thumbnail smaller */
.episode-main .wp-post-image {
  max-height: 280px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain;
  border-radius: 12px;
}

/* ========== v2.3 Featured image + large spoilers + clean body ========== */

/* Featured image on single */
.episode-featured {
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  max-width: 100%;
}
.episode-featured img,
.cv-featured-img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 420px !important;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Large screenshots inside spoiler – NOT small */
.cv-spoiler-shots .cv-gallery-large {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.cv-spoiler-shots .cv-gallery-large img,
.cv-spoiler-shots .cv-gallery-large .cv-shot {
  max-width: 100% !important;
  max-height: 480px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 10px;
  margin: 0;
  background: #111;
  border: 1px solid var(--border);
}

/* Spoiler button more visible */
.cv-spoiler-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cv-spoiler-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(255,94,0,0.08);
}
.cv-spoiler.open .cv-spoiler-btn {
  border-color: var(--orange);
  color: var(--orange);
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.post-nav a { color: var(--text-2); }
.post-nav a:hover { color: var(--orange); }

/* Hide any leftover naked download anchors that might slip */
.episode-content a[href*="nitroflare.com"],
.episode-content a[href*="turbobit.net"],
.episode-content a[href*="ddownload.com"],
.episode-content a[href*="frdl.io"],
.episode-content a[href*="mega.nz"],
.episode-content a[href*="mediafire.com"],
.episode-content a[href*="pixeldrain.com"] {
  display: none !important;
}

/* Version */
/* v2.3.0 */

/* ========== v2.4 ========== */

/* Featured – always visible */
.episode-featured {
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.episode-featured img,
img.cv-featured-img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 440px !important;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Large gallery – no spoiler */
.cv-gallery-large {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.cv-gallery-large img,
.cv-gallery-large .cv-shot {
  display: block !important;
  max-width: 100% !important;
  max-height: 520px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
}

/* YouTube embed responsive */
.cv-youtube-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 20px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
}
.cv-youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========== v2.5 Card images from external URLs ========== */
.card-item img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  background: var(--bg-hover);
}
.card-item.cw-card img { aspect-ratio: 16/9; }
.card-item.poster img { aspect-ratio: 2/3; }

.card-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1c1c1c 0%, #262626 100%);
}
.card-placeholder.poster-ph {
  aspect-ratio: 2/3;
}

.hero-bg {
  background-size: cover;
  background-position: center center;
}

/* ========== v2.6 ========== */
.related-posts {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Spoiler screenshots – large when open */
.cv-spoiler-shots .cv-gallery-large img,
.cv-spoiler-shots .cv-shot {
  max-height: 520px !important;
  max-width: 100% !important;
}

/* Hide duplicate cover inside content if still present */
.episode-content > p:first-child > img.cv-shot:only-child,
.episode-content > img.cv-shot:first-child {
  /* handled in PHP */
}

/* ========== v2.7 Cover | IMDB + Related under downloads ========== */

.cv-cover-imdb {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}

.cv-cover-col {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.cv-cover-img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 420px;
  object-fit: cover;
}
.cv-cover-placeholder {
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.85rem;
  background: var(--bg-hover);
}

.cv-imdb-col .cv-imdb-side {
  margin: 0;
  height: 100%;
}
.cv-imdb-side .cv-imdb-body {
  max-height: 380px;
  overflow-y: auto;
}

/* Sidebar stack */
.episode-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.episode-sidebar .download-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

/* Related under download box */
.related-sidebar {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.related-sidebar .section-header {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.related-sidebar .section-header h2 {
  font-size: 0.95rem;
}
.related-list {
  display: flex;
  flex-direction: column;
}
.related-item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { background: var(--bg-hover); }
.related-item img,
.related-ph {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-hover);
}
.related-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.related-item-meta {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* Hide duplicate IMDB/video boxes if filter missed them */
.episode-content .cv-imdb,
.episode-content .cv-video-info {
  display: none !important;
}

@media (max-width: 900px) {
  .cv-cover-imdb {
    grid-template-columns: 1fr;
  }
  .cv-cover-img {
    max-height: 280px;
    width: 100%;
    object-fit: contain;
  }
  .episode-sidebar .download-panel {
    position: static;
  }
}

/* v2.8 – clean separation */
.cv-empty-hint {
  color: var(--text-3);
  font-size: 0.875rem;
  margin: 0;
}
.episode-content .cv-imdb,
.episode-content .cv-video-info {
  display: none !important;
}
/* Download panel must stay visible */
.episode-sidebar .download-panel {
  display: block !important;
}

/* ========== v2.9 Polished media boxes ========== */

.cv-youtube-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 20px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.cv-youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cv-yt-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* Spoiler button – theme style */
.cv-spoiler {
  margin: 18px 0;
}
.cv-spoiler-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255,94,0,0.12), rgba(255,94,0,0.04));
  border: 1px solid rgba(255,94,0,0.35);
  color: var(--orange) !important;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
}
.cv-spoiler-btn:hover {
  background: rgba(255,94,0,0.18);
  border-color: var(--orange);
  color: #fff !important;
}
.cv-spoiler.open .cv-spoiler-btn {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff !important;
}
.cv-spoiler-body {
  display: none;
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cv-spoiler.open .cv-spoiler-body {
  display: block;
}

/* Kill light oEmbed / wp-embed white boxes */
.episode-content .wp-block-embed,
.episode-content .wp-embed,
.episode-content figure,
.episode-content .is-type-video {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  max-width: 720px;
}
.episode-content iframe {
  max-width: 100%;
  border-radius: 12px;
}

/* Hide stray plain IMDB links left in content */
.episode-content > a[href*="imdb.com/title/"] {
  display: none !important;
}

/* v2.9.1 */
.cv-yt-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}
/* prevent double badge stacking */
.cv-youtube-embed .cv-yt-badge + .cv-yt-badge { display: none !important; }

.cv-gallery-large {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
}
.cv-gallery-large img,
.cv-gallery-large .cv-shot,
.cv-spoiler-shots .cv-shot {
  max-width: 800px !important;
  width: auto !important;
  max-height: none !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.cv-shot-link {
  display: inline-block;
}

/* v2.9.3 sidebar categories */
.sidebar-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.sidebar-box-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
}
.sidebar-box-body {
  padding: 12px 16px;
}
.sidebar-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sidebar-cat {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-2);
  transition: var(--transition);
}
.sidebar-cat:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Only one trailer badge */
.cv-youtube-embed .cv-yt-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* v2.9.4 – actions row compact */
.episode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
  align-items: center;
}
.episode-actions .btn {
  margin: 0;
}
.episode-actions .cv-spoiler-btn.is-open {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff !important;
}
.cv-shots-panel {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cv-shots-panel[hidden] {
  display: none !important;
}
.episode-content {
  margin-top: 8px;
}

/* v2.9.5 compact spacing */
.episode-header { margin-bottom: 12px; }
.episode-header h1 { margin-bottom: 6px; font-size: 1.45rem; }
.cv-cover-imdb { margin-bottom: 12px; gap: 14px; }
.cv-video-info { margin: 0 0 10px; }
.episode-actions { margin: 8px 0 10px; }
.cv-shots-panel { margin: 0 0 10px; }
.cv-youtube-embed { margin: 0 0 12px; max-width: 100%; }
.episode-content { margin-top: 4px; }
.episode-content:empty { display: none; }
.post-nav { margin-top: 16px; padding-top: 12px; }

/* Related always visible style */
.related-sidebar {
  display: block !important;
}

/* v2.9.6 – sticky download without overlapping main content */
.episode-page {
  align-items: start;
  position: relative;
}
.episode-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.episode-sidebar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Only the download box sticks; stays inside sidebar column */
.episode-sidebar .download-panel,
.download-panel {
  position: sticky !important;
  top: calc(var(--header-h) + 12px) !important;
  z-index: 5;
  width: 100%;
  max-width: 340px;
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
/* Categories + related scroll normally under/after */
.episode-sidebar .sidebar-box,
.episode-sidebar .related-sidebar {
  position: relative;
  z-index: 1;
}

@media (max-width: 1100px) {
  .episode-page {
    grid-template-columns: 1fr;
  }
  .episode-sidebar {
    max-width: 100%;
  }
  .episode-sidebar .download-panel,
  .download-panel {
    position: static !important;
    max-height: none;
    max-width: 100%;
    box-shadow: none;
  }
}

/* ========== v2.9.7 STICKY DOWNLOAD + MOBILE ========== */

/* Ensure no ancestor clips sticky */
.site-main,
.content-wrap {
  overflow: visible !important;
}

.episode-page {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: 24px !important;
  align-items: start !important;
  padding-top: 20px;
}

.episode-main {
  min-width: 0;
  grid-column: 1;
}

.episode-sidebar {
  grid-column: 2;
  width: 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  position: static;
}

/* Sticky only the downloads card */
.episode-sidebar .download-panel {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 80px !important;
  z-index: 20;
  width: 100%;
  max-width: 320px;
  max-height: calc(100vh - 96px);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  -webkit-overflow-scrolling: touch;
}

/* Mobile bottom download bar */
.cv-mobile-dl-bar {
  display: none;
}

/* ----- TABLET / MOBILE ----- */
@media (max-width: 1024px) {
  .episode-page {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .episode-main,
  .episode-sidebar {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .episode-sidebar {
    order: 2;
  }
  .episode-sidebar .download-panel {
    position: static !important;
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none;
  }
  .cv-cover-imdb {
    grid-template-columns: 140px 1fr !important;
    gap: 12px !important;
  }
  .cv-cover-img {
    max-height: 220px !important;
  }
}

@media (max-width: 700px) {
  .content-wrap {
    padding: 0 12px 80px !important;
  }
  .site-header {
    padding: 0 12px !important;
    gap: 8px !important;
  }
  .primary-nav {
    display: none !important;
  }
  .search-form input {
    width: 120px !important;
  }
  .search-form input:focus {
    width: 140px !important;
  }
  .episode-header h1 {
    font-size: 1.15rem !important;
    line-height: 1.3;
  }
  .cv-cover-imdb {
    grid-template-columns: 1fr !important;
  }
  .cv-cover-col {
    max-width: 220px;
    margin: 0 auto;
  }
  .cv-cover-img {
    max-height: 320px !important;
    width: 100%;
    object-fit: contain !important;
  }
  .cv-imdb-side .cv-imdb-body {
    max-height: none !important;
  }
  .episode-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .episode-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .cv-youtube-embed {
    max-width: 100% !important;
    margin: 8px 0 12px !important;
  }
  .cards-row {
    gap: 10px;
  }
  .card-item {
    flex: 0 0 140px;
  }
  .cw-card {
    flex: 0 0 220px;
  }
  .hero {
    height: 300px !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
  }
  .hero h1 {
    font-size: 1.35rem !important;
  }
  .hero-content {
    padding: 0 12px !important;
  }

  /* Fixed bottom bar → jump to downloads */
  .cv-mobile-dl-bar {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(10,10,10,0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    gap: 8px;
  }
  .cv-mobile-dl-bar .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .hero {
    height: 260px !important;
  }
  .card-item {
    flex: 0 0 120px;
  }
}


/* v2.9.8 – remove redundant download CTAs */
.cv-mobile-dl-bar { display: none !important; }
