/*
Theme Name: CinemaX
Theme URI: https://example.com/cinemax
Author: CinemaX Studio
Description: A movie streaming theme styled like faanproj.com — pink header, yellow genre bar, dark background, poster grid.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cinemax
Tags: entertainment, movies, dark, full-width-template, custom-header, custom-menu, featured-images
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --cx-pink:        #e8005a;
  --cx-pink-dark:   #c4004d;
  --cx-yellow:      #f5c400;
  --cx-yellow-dark: #d4a900;
  --cx-black:       #111111;
  --cx-dark:        #1a1a1a;
  --cx-card:        #222222;
  --cx-border:      #333333;
  --cx-white:       #ffffff;
  --cx-muted:       #aaaaaa;
  --cx-text:        #dddddd;

  --cx-font: 'Segoe UI', Arial, sans-serif;
  --cx-radius: 6px;
  --cx-transition: 0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cx-black);
  color: var(--cx-text);
  font-family: var(--cx-font);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   TOP BAR — PINK (Logo + Search)
   ============================================================ */
.cx-topbar {
  background: var(--cx-pink);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cx-logo {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--cx-white);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.cx-logo-box {
  background: var(--cx-white);
  color: var(--cx-pink);
  padding: 2px 10px 4px;
  border-radius: 4px;
  display: inline-block;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.cx-search-form {
  display: flex;
  align-items: center;
  max-width: 420px;
  width: 100%;
}

.cx-search-form input[type="search"] {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: var(--cx-radius) 0 0 var(--cx-radius);
  font-size: 0.9rem;
  background: #fff;
  color: #333;
  outline: none;
}

.cx-search-form input[type="search"]::placeholder { color: #999; }

.cx-search-form button {
  background: #fff;
  border: none;
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 0 var(--cx-radius) var(--cx-radius) 0;
  border-left: 1px solid #ddd;
  color: #555;
  font-size: 1rem;
}

/* ============================================================
   PRIMARY NAV — DARK PINK / CRIMSON
   ============================================================ */
.cx-nav-primary {
  background: #c8004e;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.cx-nav-primary a {
  display: inline-block;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cx-white);
  transition: background var(--cx-transition);
  white-space: nowrap;
}

.cx-nav-primary a:hover,
.cx-nav-primary a.current-menu-item {
  background: rgba(255,255,255,0.15);
}

.cx-nav-primary a.cx-nav-active {
  background: var(--cx-pink-dark);
}

/* Mobile toggle */
.cx-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--cx-white);
}
.cx-menu-toggle svg { display: block; }

/* ============================================================
   GENRE BAR — YELLOW
   ============================================================ */
.cx-genre-bar {
  background: var(--cx-yellow);
  padding: 7px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.cx-genre-bar::-webkit-scrollbar { display: none; }

.cx-genre-bar a {
  font-size: 0.75rem;
  font-weight: 800;
  color: #222;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  transition: background var(--cx-transition);
}

.cx-genre-bar a:hover {
  background: rgba(0,0,0,0.12);
}

/* ============================================================
   SOCIAL SHARE BAR
   ============================================================ */
.cx-social-bar {
  background: var(--cx-dark);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--cx-border);
}

.cx-social-bar__left {
  display: flex;
  gap: 8px;
}

.cx-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--cx-radius);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity var(--cx-transition);
}
.cx-social-btn:hover { opacity: 0.85; }
.cx-social-btn--fb       { background: #1877f2; }
.cx-social-btn--tw       { background: #1da1f2; }
.cx-social-btn--wa       { background: #25d366; }
.cx-social-btn--tg       { background: #0088cc; }
.cx-social-btn--tg-icon  { background: #0088cc; }
.cx-social-btn--rss      { background: #f26522; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.cx-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.cx-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cx-white);
  padding: 8px 0 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--cx-pink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cx-section-title a {
  font-size: 0.78rem;
  color: var(--cx-yellow);
  font-weight: 600;
}

/* ============================================================
   CAROUSEL (poster slider)
   ============================================================ */
.cx-slider-wrap {
  position: relative;
  margin-bottom: 28px;
}

.cx-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.cx-slider::-webkit-scrollbar { display: none; }

.cx-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.3);
  color: var(--cx-white);
  width: 36px;
  height: 56px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--cx-transition);
}
.cx-slider-btn:hover { background: rgba(0,0,0,0.95); }
.cx-slider-btn--prev { left: -4px; }
.cx-slider-btn--next { right: -4px; }

/* ============================================================
   POSTER CARD (2:3 ratio, like the screenshot)
   ============================================================ */
.cx-poster {
  flex: 0 0 160px;
  width: 160px;
  border-radius: var(--cx-radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--cx-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 2px solid transparent;
}

.cx-poster:hover {
  transform: scale(1.04);
  border-color: var(--cx-pink);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}

.cx-poster__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #2a2a2a;
}

.cx-poster__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.cx-poster__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2a2a2a 0%, #1a1a1a 100%);
  color: var(--cx-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem;
  line-height: 1.4;
}

.cx-poster__caption {
  padding: 7px 8px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cx-text);
  line-height: 1.3;
  text-align: center;
  background: var(--cx-card);
}

/* ============================================================
   GRID (4-column, used for latest movies below slider)
   ============================================================ */
.cx-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

/* Grid card — landscape 16:9 thumbnail style (like bottom of screenshot) */
.cx-grid-card {
  border-radius: var(--cx-radius);
  overflow: hidden;
  background: var(--cx-card);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.cx-grid-card:hover {
  transform: translateY(-3px);
  border-color: var(--cx-pink);
}

.cx-grid-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #2a2a2a;
}

.cx-grid-card__placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cx-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
}

.cx-grid-card__body {
  padding: 8px 10px 10px;
}

.cx-grid-card__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cx-white);
  margin-bottom: 4px;
  line-height: 1.3;
}

.cx-grid-card__meta {
  font-size: 0.72rem;
  color: var(--cx-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cx-grid-card__rating { color: #f5c518; font-weight: 700; }

/* ============================================================
   FOOTER
   ============================================================ */
.cx-footer {
  background: #0d0d0d;
  border-top: 3px solid var(--cx-pink);
  padding: 24px 20px 16px;
}

.cx-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.cx-footer__logo { font-size: 1.5rem; margin-bottom: 8px; }

.cx-footer__desc {
  font-size: 0.82rem;
  color: var(--cx-muted);
  line-height: 1.6;
}

.cx-footer__col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cx-yellow);
  margin-bottom: 10px;
}

.cx-footer__links { display: flex; flex-direction: column; gap: 6px; }
.cx-footer__links a {
  font-size: 0.82rem;
  color: var(--cx-muted);
  transition: color var(--cx-transition);
}
.cx-footer__links a:hover { color: var(--cx-pink); }

.cx-footer__bottom {
  border-top: 1px solid var(--cx-border);
  padding-top: 14px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .cx-grid { grid-template-columns: repeat(3, 1fr); }
  .cx-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .cx-topbar { flex-direction: column; align-items: flex-start; }
  .cx-search-form { max-width: 100%; }

  .cx-nav-primary { display: none; }
  .cx-nav-primary.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(180,0,60,0.98);
    z-index: 999;
    padding: 60px 20px 20px;
    gap: 4px;
    overflow-y: auto;
  }
  .cx-nav-primary.open a { padding: 12px 10px; font-size: 1rem; }

  .cx-menu-toggle { display: block; }

  .cx-poster { flex: 0 0 130px; width: 130px; }

  .cx-grid { grid-template-columns: repeat(2, 1fr); }

  .cx-footer__top { grid-template-columns: 1fr; }
  .cx-footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .cx-poster { flex: 0 0 110px; width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
