/*
Theme Name: VNFilm Dark
Description: Theme phim tối ưu SEO, responsive, dark mode, hỗ trợ API topxx
Version: 1.0
Author: Custom
*/

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0d0d0d;
  --bg2: #151515;
  --bg3: #1e1e1e;
  --border: #2a2a2a;
  --red: #e50914;
  --red-hover: #c40812;
  --text: #e5e5e5;
  --text-muted: #999;
  --text-dim: #666;
  --white: #fff;
  --radius: 6px;
  --header-h: 56px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: .2s ease;
}

/* ===== 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;
  padding-top: var(--header-h);
  min-height: 100vh;
}
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* ===== CONTAINER ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
.container-full { width: 100%; padding: 0 16px; }

/* ===== HEADER — 2 ROWS ===== */
:root {
  --header-row1-h: 52px;
  --header-nav-h: 38px;
  --header-h: calc(var(--header-row1-h) + var(--header-nav-h));
}
body { padding-top: var(--header-h); }

#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #111;
}

/* ---------- Row 1: Logo + Search ---------- */
.header-row1 {
  height: var(--header-row1-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.header-row1 .container {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.site-logo span { color: var(--white); }

/* Search bar — always visible on PC */
.header-search-bar {
  flex: 1;
  max-width: 820px;
  margin-left: auto;
  position: relative;
}
.header-search-bar form {
  display: flex;
  align-items: center;
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
}
.header-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  padding: 0 14px;
  height: 100%;
}
.header-search-bar input::placeholder { color: var(--text-dim); }
.search-submit-btn {
  flex-shrink: 0;
  width: 44px;
  height: 100%;
  background: var(--red);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--transition);
}
.search-submit-btn:hover { background: var(--red-hover); }
#worddiv {
  position: absolute;
  top: 100%;
  right: 0;
  background: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  z-index: 999;
  overflow: hidden;
  display: none;
}
#worddiv a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
#worddiv a:hover { background: var(--bg3); color: var(--white); }

/* Hamburger — mobile only */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Row 2: Horizontal Nav Menu ---------- */
.header-nav-row {
  height: var(--header-nav-h);
  background: #0d0d0d;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.header-nav-row .container { width: 100%; }
.site-nav-bar { display: flex; align-items: center; }

.nav-bar-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0; padding: 0;
}
.nav-bar-list::-webkit-scrollbar { display: none; }

.nav-bar-list li { flex-shrink: 0; }
.nav-bar-list li a,
.nav-bar-list > li > a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  border-right: 1px solid var(--border);
  line-height: var(--header-nav-h);
  height: var(--header-nav-h);
}
.nav-bar-list li:first-child a { border-left: 1px solid var(--border); }
.nav-bar-list li a:hover,
.nav-bar-list li.current-menu-item > a,
.nav-bar-list li.current_page_item > a {
  color: #fff;
  background: var(--bg3);
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1100;
}
.mobile-overlay.is-open { display: block; }

/* ===== MOBILE PANEL — slide from LEFT ===== */
.mobile-panel {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: #111;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: left .3s ease;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,.6);
}
.mobile-panel.is-open { left: 0; }

/* Close X button — top right of panel */
.mobile-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 4px;
  transition: color var(--transition);
  z-index: 1;
}
.mobile-panel-close:hover { color: #fff; }

/* Mobile search inside panel */
.mobile-search-wrap {
  padding: 54px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.mobile-search-form {
  display: flex;
  align-items: center;
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  height: 40px;
}
.mobile-search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  padding: 0 12px;
  height: 100%;
}
.mobile-search-form input::placeholder { color: var(--text-dim); }
.mobile-search-btn {
  width: 42px;
  height: 100%;
  background: var(--red);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Mobile nav links — large pink text */
.mobile-nav-links { padding: 6px 0; }
.mobile-nav-list { list-style: none; margin: 0; padding: 0; }
.mobile-nav-list li a,
.mobile-nav-list > li > a {
  display: block;
  padding: 13px 24px;
  font-size: 20px;
  font-weight: 600;
  color: #e4003a;
  text-decoration: none;
  border-bottom: 1px solid #1e1e1e;
  transition: color var(--transition), background var(--transition);
  letter-spacing: .2px;
}
.mobile-nav-list li a:hover { color: #ff3366; background: rgba(255,255,255,.03); }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
}
.see-all {
  font-size: 12px;
  color: var(--red);
  transition: color var(--transition);
}
.see-all:hover { color: var(--red-hover); }

/* ===== FILM GRID ===== */
.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* Film Card */
.film-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.film-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.7);
}
.film-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg3);
}
.film-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.film-card:hover .film-card-thumb img { transform: scale(1.05); }

/* Badges */
.badge {
  position: absolute;
  top: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-quality {
  right: 6px;
  background: rgba(229,9,20,.9);
  color: #fff;
}
.badge-country {
  left: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  backdrop-filter: blur(4px);
}
.badge-uncensored {
  left: 6px;
  background: rgba(255,140,0,.85);
  color: #fff;
}
.badge-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.75);
  color: #ddd;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  backdrop-filter: blur(4px);
}

/* Play overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background .2s;
}
.film-card:hover .play-overlay { background: rgba(0,0,0,.35); }
.play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(229,9,20,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
}
.film-card:hover .play-icon { opacity: 1; transform: scale(1); }
.play-icon svg { width: 18px; fill: #fff; margin-left: 3px; }

/* Card info */
.film-card-info {
  padding: 8px 10px;
}
.film-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: color var(--transition);
}
.film-card:hover .film-card-title { color: var(--white); }
.film-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  display: flex;
  gap: 8px;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 20px 0 40px;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* Section spacing */
.section { margin-bottom: 32px; }

/* ===== TAGS BAR ===== */
.tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
  white-space: nowrap;
}
.tag-pill:hover, .tag-pill.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ===== SIDEBAR ===== */
.sidebar-widget { margin-bottom: 24px; }
.sidebar-list a {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.sidebar-list a:hover { color: var(--white); }
.sidebar-list .thumb {
  flex-shrink: 0;
  width: 80px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg3);
}
.sidebar-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-list .info { min-width: 0; }
.sidebar-list .info .title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}
.sidebar-list .info .meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* Categories sidebar */
.cat-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-link {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.cat-link:hover { color: var(--white); border-color: #444; }

/* ===== SINGLE POST - VIDEO PLAYER ===== */
.single-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.video-player-box {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.video-player-box iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}

/* Server tabs */
.server-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.server-btn {
  padding: 8px 20px;
  border-radius: var(--radius);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.server-btn:hover, .server-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Post title area */
.post-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 10px;
}
.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.post-meta-bar span { display: flex; align-items: center; gap: 4px; }
.post-meta-bar .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; }

/* Actors row */
.actors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.actor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}
.actor-chip:hover { color: var(--white); border-color: #555; }

/* Tags */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

/* Post images gallery */
.post-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.post-gallery img {
  border-radius: 4px;
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
  cursor: zoom-in;
  transition: opacity .2s;
}
.post-gallery img:hover { opacity: .85; }

/* Post content */
.post-content {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}
.post-content p { margin-bottom: 12px; }

/* Related */
.related-section { margin-top: 32px; }

/* ===== ARCHIVE/TAXONOMY PAGE ===== */
.archive-header {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.archive-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}
.archive-header .archive-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 700px;
  line-height: 1.6;
}
.archive-header .archive-count {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== PAGINATION ===== */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 30px 0;
  flex-wrap: wrap;
}
.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.page-link:hover, .page-link.current {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.page-link.prev, .page-link.next { width: auto; padding: 0 12px; gap: 4px; }

/* ===== FOOTER ===== */
#site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .logo { font-size: 24px; font-weight: 800; color: var(--red); }
.footer-brand p { font-size: 13px; color: var(--text-dim); margin-top: 8px; line-height: 1.7; }
.footer-col h4 { font-size: 13px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--text); }
.footer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-tags a {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-dim);
  transition: var(--transition);
}
.footer-tags a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-dim); }

/* ===== BACK TO TOP ===== */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  border: none;
  box-shadow: 0 4px 12px rgba(229,9,20,.4);
  transition: transform .2s;
}
#back-to-top:hover { transform: translateY(-2px); }
#back-to-top.show { display: flex; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, #252525 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== LIGHTBOX ===== */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#lightbox.show { display: flex; }
#lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 6px; }
#lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  :root { --header-h: 52px; }
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-search.open input { width: 160px; }
  .film-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .post-title { font-size: 18px; }
  .post-gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-col:not(.footer-brand) { display: none; }
  .archive-header h1 { font-size: 18px; }
  .main-layout { padding: 12px 0 30px; }
}

@media (max-width: 480px) {
  .film-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .server-tabs { gap: 6px; }
  .server-btn { padding: 6px 14px; font-size: 12px; }
  .single-wrap { padding: 12px 12px 30px; }
  .post-gallery { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .actors-row { gap: 6px; }
}

/* ===== 404 PAGE ===== */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-size: 80px; font-weight: 800; color: var(--red); line-height: 1; }
.page-404 p { color: var(--text-muted); margin-top: 12px; }
.page-404 a { display: inline-block; margin-top: 24px; padding: 10px 24px; background: var(--red); color: #fff; border-radius: var(--radius); }

/* ===== COUNTRY PAGE HEADER ===== */
.country-hero {
  background: linear-gradient(135deg, #1a0a0a, #0d0d0d);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
  margin-bottom: 24px;
}
.country-hero .country-flag { font-size: 48px; line-height: 1; margin-bottom: 8px; }
.country-hero h1 { font-size: 26px; font-weight: 800; color: var(--white); }
.country-hero .desc { font-size: 14px; color: var(--text-muted); margin-top: 8px; max-width: 700px; line-height: 1.7; }

/* ===== SEARCH PAGE ===== */
.search-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.search-header h1 { font-size: 20px; font-weight: 700; color: var(--white); }
.search-header p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.no-results svg { width: 60px; height: 60px; opacity: .3; margin: 0 auto 16px; }

/* ============================================================
   VNFilm v5 — New Components
   ============================================================ */

/* ── TAXONOMY HERO ── */
.taxonomy-hero {
  position: relative;
  background: var(--bg2);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  min-height: 160px;
  padding: 0 24px 24px;
  display: flex;
  align-items: flex-end;
}
.taxonomy-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
  z-index: 0;
}
.taxonomy-hero-content {
  position: relative;
  z-index: 1;
  padding: 0 8px;
}
.taxonomy-hero-content h1 {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 800;
  color: #fff;
  margin: 6px 0 6px;
  line-height: 1.2;
}
.taxonomy-hero-content .hero-desc {
  color: rgba(255,255,255,.75);
  font-size: 13px;
  margin: 0 0 8px;
  max-width: 600px;
}
.taxonomy-hero-content .archive-count {
  font-size: 12px;
  color: rgba(255,255,255,.5);
}
.country-code-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* ── SIDEBAR COUNTRY GRID ── */
.country-grid-sidebar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.country-card-sidebar {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  background-size: cover;
  background-position: center;
  min-height: 80px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  transition: transform .2s;
}
.country-card-sidebar:hover { transform: scale(1.03); }
.country-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 100%);
  z-index: 0;
}
.country-card-info {
  position: relative;
  z-index: 1;
  padding: 8px;
  width: 100%;
}
.country-card-info .country-flag { font-size: 16px; display: block; }
.country-card-info .country-name { font-size: 11px; color: #fff; font-weight: 700; display: block; line-height: 1.2; }
.country-card-info .country-count { font-size: 10px; color: rgba(255,255,255,.5); }

/* ── SIDEBAR TAGS (desktop only) ── */
.sidebar-tags-desktop { display: block; }
@media (max-width: 900px) { .sidebar-tags-desktop { display: none; } }

/* ── MOBILE TAGS (single page) ── */
.mobile-tags-section { display: none; }
@media (max-width: 900px) { .mobile-tags-section { display: block !important; } }

/* ── GENRE PAGE ── */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}
@media (min-width: 600px)  { .genre-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .genre-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .genre-grid { grid-template-columns: repeat(5, 1fr); } }

.genre-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg2);
  display: block;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.genre-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.genre-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
  transition: transform .3s;
}
.genre-card:hover .genre-card-bg { transform: scale(1.05); }
.genre-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
  z-index: 1;
}
.genre-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 12px;
}
.genre-name {
  font-size: clamp(12px, 2vw, 15px);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
}
.genre-count { font-size: 11px; color: rgba(255,255,255,.55); font-style: italic; }

/* ── NAV HOVER EFFECT ── */
.site-nav a,
.site-nav .nav-link {
  transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--red) !important; }
.dropdown-menu a:hover {
  background: var(--red) !important;
  color: #fff !important;
}
.nav-dropdown-toggle:hover { color: var(--red); cursor: pointer; }

/* ── SERVER TABS ── */
.server-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg2);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 20px;
}
.server-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .8px; }
.server-btn {
  padding: 6px 16px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.server-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.server-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ── MOBILE SECTION LABEL ── */
.mobile-section-label {
  padding: 14px 16px 8px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── FILM GRID 10 (related) ── */
.film-grid-10 { grid-template-columns: repeat(2,1fr); }
@media (min-width: 500px)  { .film-grid-10 { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 768px)  { .film-grid-10 { grid-template-columns: repeat(4,1fr); } }
@media (min-width: 1100px) { .film-grid-10 { grid-template-columns: repeat(5,1fr); } }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-left: 3px solid var(--red);
  padding-left: 10px;
}
.see-all {
  font-size: 12px;
  color: var(--red);
  text-decoration: none;
  white-space: nowrap;
}
.see-all:hover { text-decoration: underline; }

/* ── CATEGORY PAGE: 16/trang set in pre_get_posts nếu dùng trang WP ── */


/* ===== HEADER RESPONSIVE ===== */
@media (max-width: 900px) {
  :root { --header-h: var(--header-row1-h); } /* only row1 on mobile */
  .header-nav-row { display: none; }
  .menu-toggle { display: flex; }
  .header-search-bar { max-width: none; }
  body { padding-top: var(--header-row1-h); }
}
@media (max-width: 480px) {
  .header-row1 .container { gap: 8px; }
  .site-logo { font-size: 18px; }
}
