/*
Theme Name: CineHub
Theme URI: https://example.com/cinehub
Author: Triumph
Author URI: https://example.com
Description: A fast, SEO-optimized, mobile-first WordPress theme for movie download/streaming blogs. Organize content into sections (Series, Korean, Nollywood, Bollywood, South African, and more), with movie preview pages, download buttons, ratings, and comments. Sleek black design with a light/dark theme switch.
Version: 1.1.8
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cinehub
Tags: blog, custom-post-type, dark-mode, mobile-friendly, seo, movies
*/

/* ==========================================================================
   Design tokens — monochrome black palette (+ light theme)
   ========================================================================== */
:root {
  --bg:              #0a0a0a;   /* near-black */
  --bg-2:            #141414;   /* card background */
  --bg-3:            #1f1f1f;   /* elevated / hover */
  --accent:          #ffffff;   /* primary accent (white on black) */
  --accent-deep:     #c9c9c9;
  --accent-glow:     rgba(255,255,255,.12);
  --accent-contrast: #0a0a0a;   /* text/icon color on top of accent */
  --text:            #f4f4f5;
  --text-muted:      #9a9a9a;
  --border:          #2a2a2a;
  --danger:          #ff5252;
  --gold:            #ffc107;
  --radius:          14px;
  --radius-sm:       9px;
  --maxw:            1240px;
  --shadow:          0 10px 30px rgba(0,0,0,.55);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Light theme — activated via data-theme="light" on <html> */
[data-theme="light"] {
  --bg:              #ffffff;
  --bg-2:            #f5f5f6;
  --bg-3:            #ebebed;
  --accent:          #111113;
  --accent-deep:     #000000;
  --accent-glow:     rgba(0,0,0,.10);
  --accent-contrast: #ffffff;
  --text:            #15151a;
  --text-muted:      #5c5c66;
  --border:          #e2e2e6;
  --shadow:          0 10px 30px rgba(0,0,0,.12);
}

/* Smooth transition when toggling themes */
body, .site-header, .movie-card, .download-box, .comments-area,
.mobile-nav, .site-footer { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

/* ==========================================================================
   Base / reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: 85%; } /* 15% smaller base — scales all rem sizes down */
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { color: var(--accent); opacity: .8; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 600; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Accessibility focus + nice selection + themed scrollbar */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-contrast); }
html { scrollbar-color: var(--bg-3) var(--bg); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }
.screen-reader-text {
  position: absolute !important; clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px; overflow: hidden; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: var(--accent-contrast); padding: 10px 16px; z-index: 9999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
.site-branding { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.site-logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center; color: var(--accent-contrast); font-weight: 600;
  box-shadow: 0 0 18px var(--accent-glow);
}
.site-title { font-size: 1.25rem; font-weight: 600; letter-spacing: .3px; color: var(--text); margin: 0; }
.site-title a { color: inherit; }
.site-title span { color: var(--accent); }

/* desktop menu */
.primary-menu { display: none; }
.primary-menu ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-menu a {
  color: var(--text-muted); padding: 8px 12px; border-radius: 8px;
  font-weight: 500; font-size: .95rem; transition: .15s;
}
.primary-menu a:hover, .primary-menu .current-menu-item > a { color: var(--text); background: var(--bg-3); }

.header-search { display: none; }
.search-form { display: flex; align-items: center; }
.search-form input[type="search"] {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 999px; min-width: 220px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-form input[type="search"]::placeholder { color: var(--text-muted); }
.search-form input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* hamburger */
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; color: var(--text);
}
.nav-toggle svg { width: 22px; height: 22px; }

/* theme toggle — always visible */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; color: var(--text); flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ==========================================================================
   Mobile drawer nav
   ========================================================================== */
.mobile-nav {
  position: fixed; inset: 0 0 0 auto; width: min(86vw, 360px);
  background: var(--bg-2); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .28s ease;
  z-index: 200; display: flex; flex-direction: column;
  box-shadow: var(--shadow); overflow-y: auto;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transition: .28s; z-index: 150;
}
.mobile-nav-overlay.is-open { opacity: 1; visibility: visible; }
.mobile-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px; border-bottom: 1px solid var(--border);
}
.mobile-nav-head h2 { margin: 0; font-size: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.nav-close { background: none; border: 0; color: var(--text); font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 4px 8px; }
.mobile-nav .search-form { padding: 16px 18px; }
.mobile-nav .search-form input[type="search"] { width: 100%; min-width: 0; }
.mobile-section-list { list-style: none; margin: 0; padding: 8px 0 24px; }
.mobile-section-list li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; color: var(--text); font-weight: 500; font-size: 1.05rem;
  border-bottom: 1px solid var(--border); border-left: 3px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.mobile-section-list li a:hover { background: var(--bg-3); border-left-color: var(--accent); opacity: 1; }
.mobile-section-list .count {
  font-size: .8rem; color: var(--text-muted); background: var(--bg-3);
  padding: 2px 9px; border-radius: 999px;
}
.mobile-section-list .label-muted { padding: 18px 18px 6px; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; padding: 56px 0 40px;
  background:
    radial-gradient(820px 360px at 85% -20%, var(--accent-glow), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 3.1rem); margin-bottom: .35em; }
.hero p { color: var(--text-muted); font-size: 1.08rem; max-width: 640px; margin: 0; }
.section-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.section-chips a {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 15px; border-radius: 999px; font-weight: 500; font-size: .9rem;
  transition: border-color .15s, color .15s, transform .15s, background .15s;
}
.section-chips a:hover { border-color: var(--accent); color: var(--accent); opacity: 1; transform: translateY(-1px); }

/* ==========================================================================
   Section rows / grids
   ========================================================================== */
.movie-section { padding: 32px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.section-head h2 { font-size: 1.45rem; margin: 0; display: flex; align-items: center; }
.section-head h2 .bar { display: none; }
.section-head .see-all { font-size: .9rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.section-head .see-all:hover { color: var(--accent); opacity: 1; }

.movie-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

/* card */
.movie-card {
  position: relative; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.movie-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 16px 34px rgba(0,0,0,.5);
}
.movie-card a.poster-link { display: block; position: relative; aspect-ratio: 2/3; background: var(--bg-3); overflow: hidden; }
.movie-card .poster-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.movie-card:hover .poster-link img { transform: scale(1.06); }
/* gradient at the foot of the poster so badges and edge stay legible */
.movie-card .poster-link::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.45));
  opacity: .85; transition: opacity .22s;
}
.movie-card:hover .poster-link::after { opacity: 1; }
.movie-card .badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(0,0,0,.72);
  color: var(--gold); font-size: .72rem; font-weight: 500; padding: 3px 8px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.movie-card .quality {
  position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--accent);
  color: var(--accent-contrast); font-size: .66rem; font-weight: 600; letter-spacing: .3px;
  padding: 3px 7px; border-radius: 7px; text-transform: uppercase;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.movie-card .card-body { padding: 11px 12px 14px; }
.movie-card .card-title {
  font-size: .96rem; font-weight: 500; margin: 0; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.movie-card .card-title a { color: var(--text); }
.movie-card .card-title a:hover { color: var(--accent); opacity: 1; }
.movie-card .card-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.movie-card .card-meta span:not(:last-child)::after { content: "•"; margin-left: 8px; opacity: .5; }

/* ==========================================================================
   Single movie (preview page)
   ========================================================================== */
.movie-single { padding: 28px 0 60px; }
.movie-backdrop {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 18px;
}
.movie-backdrop::after { content:""; position:absolute; inset:0; pointer-events:none; background: linear-gradient(180deg, transparent 75%, color-mix(in srgb, var(--bg) 55%, transparent) 100%); }
.movie-backdrop img { width: 100%; height: auto; display: block; object-fit: contain; }
.movie-head { position: relative; z-index: 2; }
.movie-head h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-bottom: 16px; }
.movie-info-list { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 0; color: var(--text-muted); font-size: .92rem; }
.movie-info-list strong { color: var(--text); font-weight: 500; }
.rating-stars { color: var(--gold); }
.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.genre-tags a { background: var(--bg-3); border: 1px solid transparent; padding: 5px 13px; border-radius: 999px; font-size: .82rem; font-weight: 500; color: var(--text); transition: border-color .15s, color .15s; }
.genre-tags a:hover { color: var(--accent); opacity: 1; border-color: var(--accent); }

.download-box { position: relative; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; margin: 28px 0; overflow: hidden; }
.download-box::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); }
.download-box h3 { margin: 0 0 14px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: var(--accent-contrast);
  font-weight: 600; font-size: 1.05rem; padding: 15px 22px; border-radius: 12px;
  box-shadow: 0 6px 20px var(--accent-glow); transition: transform .15s, filter .15s, box-shadow .15s;
}
.btn-download:hover { color: var(--accent-contrast); opacity: 1; filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-glow); }
.btn-download:active { transform: translateY(0); }
.btn-download svg { width: 22px; height: 22px; }
.download-options { display: grid; gap: 10px; margin-top: 12px; }
.download-options .btn-download { background: var(--bg-3); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.download-options .btn-download:hover { color: var(--accent); border-color: var(--accent); }
.download-meta { font-size: .82rem; color: var(--text-muted); margin-top: 12px; text-align: center; }

.movie-content { line-height: 1.75; }
.movie-content h2, .movie-content h3 { margin-top: 1.4em; }
.movie-content img { border-radius: var(--radius-sm); margin: 1em 0; }
.section-label { font-size: 1.25rem; margin: 34px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area { margin-top: 40px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.comments-title { font-size: 1.25rem; margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-list .children { list-style: none; margin: 14px 0 0 22px; padding-left: 16px; border-left: 2px solid var(--border); }
.comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-author img { border-radius: 50%; border: 1px solid var(--border); }
.comment-author .fn { font-weight: 500; font-style: normal; color: var(--text); }
.comment-metadata { font-size: .78rem; color: var(--text-muted); }
.comment-body p { margin: .4em 0; }
.comment-form { display: grid; gap: 14px; margin-top: 10px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; outline: none; font-family: inherit; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.form-submit input[type="submit"], .btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: var(--accent-contrast);
  border: 0; font-weight: 600; padding: 12px 26px; border-radius: 10px; cursor: pointer; font-size: 1rem;
  transition: transform .15s, filter .15s;
}
.form-submit input[type="submit"]:hover, .btn:hover { filter: brightness(1.08); transform: translateY(-2px); color: var(--accent-contrast); opacity: 1; }
.form-submit input[type="submit"]:active, .btn:active { transform: translateY(0); }

/* ==========================================================================
   Pagination / archive
   ========================================================================== */
.archive-header { padding: 36px 0 8px; }
.archive-header h1 { font-size: clamp(1.6rem,5vw,2.4rem); }
.archive-header p { color: var(--text-muted); }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 40px 0; }
.pagination a, .pagination span {
  padding: 9px 15px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); font-weight: 500;
}
.pagination .current { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 40px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.footer-grid h3 { font-size: 1rem; color: var(--text); margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; text-align: center; color: var(--text-muted); font-size: .88rem; }

/* On mobile, stack the movie layout and show the Download box FIRST
   (right under the title) so users don't scroll past the whole article. */
.movie-layout { display: flex; flex-direction: column; gap: 8px; }
.movie-sidebar { order: -1; }
/* When there's no download box, let the content use the full width */
.movie-layout.no-sidebar { display: block; }

/* ==========================================================================
   Responsive — small phones first
   ========================================================================== */
@media (max-width: 599px) {
  body { font-size: 1rem; -webkit-tap-highlight-color: transparent; }
  .container { padding: 0 13px; }
  .header-inner { height: 56px; gap: 10px; }
  .site-title { font-size: 1.1rem; }
  .hero { padding: 30px 0 24px; }
  .hero p { font-size: 1rem; }
  .movie-section { padding: 22px 0; }
  .section-head { margin-bottom: 14px; }
  .section-head h2 { font-size: 1.2rem; }
  .movie-grid { gap: 11px; }
  .card-meta { font-size: .76rem; }
  .download-box { padding: 18px 16px; margin: 18px 0; }
  .btn-download { font-size: 1rem; padding: 14px 18px; }
  .comments-area { padding: 18px 15px; }
  .movie-single { padding: 18px 0 44px; }
  /* comfortable tap targets */
  .theme-toggle, .nav-toggle { width: 42px; height: 42px; }
}

/* Slightly larger phones get a 3-up grid */
@media (min-width: 440px) and (max-width: 599px) {
  .movie-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Responsive — tablet & desktop
   ========================================================================== */
@media (min-width: 600px) {
  .movie-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-menu { display: block; }
  .header-search { display: block; }
  .movie-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .movie-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
  .movie-sidebar { order: 0; }
  .download-box { margin-top: 0; position: sticky; top: 84px; }
}
@media (min-width: 1100px) {
  .movie-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ==========================================================================
   Motion polish + accessibility
   ========================================================================== */
.site-main { animation: cinehubFade .45s ease both; }
@keyframes cinehubFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
