/*
Theme Name: TVBoxFixer
Theme URI: https://tvboxfixer.com
Author: TVBoxFixer
Description: SEO-optimized WordPress theme for TVBoxFixer - Android TV Box & Kodi guides
Version: 2.0.9
License: GNU General Public License v2 or later
Text Domain: tvboxfixer
*/

/* ─── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --color-primary:    #1a73e8;
  --color-primary-dk: #1558b0;
  --color-bg:         #f5f5f5;
  --color-surface:    #ffffff;
  --color-border:     rgba(0,0,0,0.1);
  --color-text:       #111827;
  --color-muted:      #6b7280;
  --color-subtle:     #9ca3af;
  --color-trouble:    #fef2f2;
  --color-trouble-t:  #991b1b;
  --color-kodi:       #eff6ff;
  --color-kodi-t:     #1e40af;
  --color-guide:      #f0fdf4;
  --color-guide-t:    #166534;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --max-width:  1140px;
  --content-w:  760px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: #f0f2f5;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: 58px;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo svg { width: 44px; height: 20px; }
.site-logo .logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.site-logo .logo-text span { color: var(--color-primary); }

/* Nav */
.primary-nav { display: flex; align-items: center; }

.primary-nav ul.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.primary-nav ul.nav-menu > li {
  list-style: none !important;
  list-style-type: none !important;
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
}
.primary-nav ul.nav-menu > li::before,
.primary-nav ul.nav-menu > li::marker { display: none !important; content: none !important; }

.primary-nav ul.nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.primary-nav ul.nav-menu > li > a:hover,
.primary-nav ul.nav-menu > li.current-menu-item > a,
.primary-nav ul.nav-menu > li.current-menu-ancestor > a {
  background: #eff6ff;
  color: var(--color-primary);
  text-decoration: none;
}

.primary-nav ul.nav-menu > li.menu-item-has-children > a::after {
  content: '▾';
  font-size: 9px;
  margin-left: 2px;
  display: inline-block;
  transition: transform 0.2s;
}
.primary-nav ul.nav-menu > li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* Dropdown */
.primary-nav .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 220px;
  padding: 6px;
  list-style: none !important;
  margin: 0 !important;
  z-index: 200;
}
.no-hover .primary-nav ul.nav-menu > li:hover > .sub-menu { display: none !important; }

.primary-nav ul.nav-menu > li:hover > .sub-menu { display: block; }

.primary-nav .sub-menu li {
  list-style: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
.primary-nav .sub-menu li a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.primary-nav .sub-menu li a:hover {
  background: #eff6ff;
  color: var(--color-primary);
  text-decoration: none;
}

/* Search */
.header-search { display: flex; align-items: center; gap: 8px; }
.header-search form {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 34px;
}
.header-search input {
  border: none;
  background: transparent;
  padding: 0 10px;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
  width: 180px;
}
.header-search button {
  background: none;
  border: none;
  padding: 0 10px;
  cursor: pointer;
  color: var(--color-muted);
  display: flex;
  align-items: center;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav.open { display: block; }

.mobile-nav .nav-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 2px;
  list-style: none !important;
  margin: 0;
  padding: 0;
}
.mobile-nav .nav-menu > li {
  width: 100%;
}
.mobile-nav .nav-menu > li > a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  padding: 10px 12px;
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}
.mobile-nav .nav-menu > li > a:hover { background: #f3f4f6; text-decoration: none; }

.mobile-nav .sub-menu {
  display: none;
  position: static !important;
  box-shadow: none !important;
  border: none !important;
  border-left: 3px solid #bfdbfe !important;
  border-radius: 0 !important;
  margin-left: 20px !important;
  padding: 4px 0 !important;
  background: transparent !important;
  min-width: unset !important;
  flex-direction: column !important;
}
.mobile-nav .submenu-open > .sub-menu { display: block !important; }
.mobile-nav .menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 10px;
  color: #9ca3af;
}
.mobile-nav .submenu-open > a { background: #eff6ff; color: #1a73e8; }
.mobile-nav .submenu-open > a::after { color: #1a73e8; }
.mobile-nav .sub-menu li a {
  font-size: 14px;
  color: var(--color-muted);
  padding: 7px 12px;
  white-space: normal;
}
.mobile-nav .sub-menu li a:hover {
  background: #eff6ff;
  color: var(--color-primary);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.site-main { max-width: var(--max-width); margin: 0 auto; padding: 24px 20px; }
.content-sidebar-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }

/* ─── Hero Section ───────────────────────────────────────────────────────── */
.hero-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 36px 20px;
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; }
.hero-inner h1 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-inner p {
  font-size: 15px;
  color: var(--color-muted);
  max-width: 520px;
  margin-bottom: 16px;
}
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-tags a {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.hero-tags a:hover { opacity: 0.8; text-decoration: none; }
.tag-blue   { background: #dbeafe; color: #1e40af; }
.tag-green  { background: #dcfce7; color: #166534; }
.tag-amber  { background: #fef3c7; color: #92400e; }
.tag-gray   { background: #f3f4f6; color: #374151; }

/* ─── Section Title ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin-bottom: 14px;
}

/* ─── Post Cards ─────────────────────────────────────────────────────────── */
.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  overflow: hidden;
  margin-bottom: 12px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.post-card-thumb {
  width: 160px;
  min-width: 160px;
  height: 110px;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.post-card-meta { display: flex; align-items: center; gap: 8px; }
.cat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.cat-trouble { background: var(--color-trouble); color: var(--color-trouble-t); }
.cat-kodi    { background: var(--color-kodi);    color: var(--color-kodi-t); }
.cat-guide   { background: var(--color-guide);   color: var(--color-guide-t); }
.post-date   { font-size: 12px; color: var(--color-subtle); }
.post-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--color-primary); }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 78px; }
.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}
.widget-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-subtle);
  margin-bottom: 14px;
}
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.popular-list li { display: flex; gap: 10px; align-items: flex-start; }
.popular-num { font-size: 13px; font-weight: 700; color: var(--color-primary); min-width: 18px; flex-shrink: 0; }
.popular-list a { font-size: 13px; font-weight: 500; color: var(--color-text); line-height: 1.4; }
.popular-list a:hover { color: var(--color-primary); text-decoration: none; }
.cat-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 13px;
}
.cat-list a { color: var(--color-text); text-decoration: none; }
.cat-list a:hover { color: var(--color-primary); }
.cat-count { font-size: 12px; color: var(--color-subtle); }

/* ─── Single Article ─────────────────────────────────────────────────────── */
.single .hentry {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.article-header { margin-bottom: 24px; }
.article-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.article-title {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.article-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 24px;
}
.article-info span { display: flex; align-items: center; gap: 4px; }

/* Info box */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  color: #1e40af;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Step boxes */
.step-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}
.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid var(--color-border);
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-title { font-size: 14px; font-weight: 600; color: var(--color-text); }
.step-body { padding: 14px 16px; font-size: 14px; color: #374151; line-height: 1.7; }

/* Article content */
.entry-content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--color-text); }
.entry-content h3 { font-size: 17px; font-weight: 600; margin: 20px 0 10px; color: var(--color-text); }
.entry-content p  { margin-bottom: 14px; font-size: 15px; line-height: 1.75; }
.entry-content ul, .entry-content ol { padding-left: 24px; margin-bottom: 14px; }
.entry-content li { margin-bottom: 6px; font-size: 15px; line-height: 1.7; }
.entry-content img { border-radius: var(--radius-md); margin: 20px 0; }
.entry-content a { color: var(--color-primary); }

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--color-subtle);
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 4px;
}
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Related posts */
.related-posts { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--color-border); }
.related-posts h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.related-card:hover { box-shadow: var(--shadow-md); }
.related-thumb { height: 100px; background: #e5e7eb; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 10px 12px; }
.related-info .cat-badge { margin-bottom: 6px; display: inline-block; }
.related-title { font-size: 13px; font-weight: 600; color: var(--color-text); line-height: 1.4; }
.related-title a { color: inherit; text-decoration: none; }
.related-title a:hover { color: var(--color-primary); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 24px 20px;
  margin-top: 48px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy { font-size: 13px; color: var(--color-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--color-muted); text-decoration: none; }
.footer-links a:hover { color: var(--color-primary); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .primary-nav, .header-search { display: none; }
  .menu-toggle { display: flex; }
}
@media (max-width: 600px) {
  .post-card { flex-direction: column; }
  .post-card-thumb { width: 100%; height: 180px; min-width: unset; }
  .related-grid { grid-template-columns: 1fr; }
  .hero-inner h1 { font-size: 20px; }
  .single .hentry {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  .site-main { padding: 12px; }
  .content-sidebar-wrap { gap: 16px; }
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 8px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all 0.15s;
}
.pagination .page-numbers:hover {
  background: #eff6ff;
  color: var(--color-primary);
  border-color: #bfdbfe;
  text-decoration: none;
}
.pagination .page-numbers.current {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}
.pagination .page-numbers.dots {
  border: none;
  background: none;
  color: var(--color-subtle);
}
.pagination .prev.page-numbers,
.pagination .next.page-numbers {
  padding: 0 14px;
  color: var(--color-primary);
  border-color: #bfdbfe;
  background: #eff6ff;
}
.pagination .prev.page-numbers:hover,
.pagination .next.page-numbers:hover {
  background: var(--color-primary);
  color: #ffffff;
}
.page .entry-content { background: #ffffff; padding: 32px 36px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

