/* ============================================================
   CineHub Theme — IMDB-Style Dark Homepage CSS
   Font: EB Garamond / Libre Baskerville (Georgia-family)
   No Syne. All new classes prefixed with ch-
   ============================================================ */

/* ── CineHub CSS Variables ─────────────────────────────────── */
:root,
[data-theme="dark"] {
  --ch-bg:         #141414;
  --ch-bg-2:       #1a1a1a;
  --ch-surface:    #1f1f1f;
  --ch-surface-2:  #282828;
  --ch-border:     #2a2a2a;
  --ch-text:       #e8e8e8;
  --ch-text-2:     #a0a0a0;
  --ch-muted:      #555;
  --ch-accent:     #f5a623;
  --ch-accent-dim: rgba(245,166,35,.15);
  --ch-star:       #f5a623;
  --ch-card-bg:    #1a1a1a;
  --ch-card-hover: #222;
  --ch-font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --ch-font-body:    'Lato', 'Libre Baskerville', Georgia, serif;
  --ch-radius:     8px;
}

[data-theme="light"] {
  --ch-bg:         #f0ece4;
  --ch-bg-2:       #e8e2d8;
  --ch-surface:    #fff;
  --ch-surface-2:  #f5f0e8;
  --ch-border:     #ddd5c5;
  --ch-text:       #1a1410;
  --ch-text-2:     #6b5c4a;
  --ch-muted:      #a09080;
  --ch-accent:     #c8860a;
  --ch-accent-dim: rgba(200,134,10,.12);
  --ch-star:       #c8860a;
  --ch-card-bg:    #fff;
  --ch-card-hover: #f5f0e8;
}

/* ── Body ─────────────────────────────────────────────────── */
.cinehub-body {
  font-family: var(--ch-font-body);
  background: var(--ch-bg);
  color: var(--ch-text);
}

.cinehub-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* ── Section Header ───────────────────────────────────────── */
.ch-section {
  margin-bottom: 48px;
}

.ch-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 0;
}

.ch-section-head-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ch-accent-bar {
  display: block;
  width: 4px;
  height: 100%;
  min-height: 40px;
  background: var(--ch-accent);
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ch-section-title {
  font-family: var(--ch-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ch-text);
  line-height: 1.2;
  margin: 0;
  cursor: pointer;
}

.ch-section-title:hover { color: var(--ch-accent); }

.ch-arrow {
  color: var(--ch-accent);
  font-size: 20px;
  font-style: normal;
  margin-left: 4px;
}

.ch-section-sub {
  font-family: var(--ch-font-body);
  font-size: 13px;
  color: var(--ch-text-2);
  margin: 4px 0 0;
  font-style: italic;
}

/* ── Nav Buttons ──────────────────────────────────────────── */
.ch-nav-btns {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.ch-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ch-border);
  background: var(--ch-surface-2);
  color: var(--ch-text-2);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, border-color .2s;
}

.ch-nav-btn:hover {
  background: var(--ch-accent);
  color: #fff;
  border-color: var(--ch-accent);
}

/* ── Scrollable Row ───────────────────────────────────────── */
.ch-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.ch-row::-webkit-scrollbar { display: none; }

/* ── Standard Card ────────────────────────────────────────── */
.ch-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

.ch-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ch-card-poster-wrap {
  position: relative;
  border-radius: var(--ch-radius);
  overflow: hidden;
  aspect-ratio: 2/3;
  background: var(--ch-surface);
}

.ch-card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.ch-card:hover .ch-card-poster { transform: scale(1.06); }

.ch-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
}

.ch-card:hover .ch-card-overlay { opacity: 1; }

.ch-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  transform: scale(.85);
  transition: transform .2s;
}

.ch-card:hover .ch-play-btn { transform: scale(1); }

.ch-card-genre {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--ch-font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  color: var(--ch-accent);
  padding: 3px 8px;
  border-radius: 4px;
}

.ch-card-body {
  padding: 10px 2px 0;
}

.ch-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}

.ch-star {
  color: var(--ch-star);
  font-size: 13px;
}

.ch-rating-val {
  font-family: var(--ch-font-body);
  font-size: 12px;
  color: var(--ch-text-2);
  font-weight: 400;
}

.ch-card-title {
  font-family: var(--ch-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ch-text);
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ch-font-body);
  font-size: 11.5px;
  color: var(--ch-text-2);
  flex-wrap: wrap;
}

.ch-rated-badge {
  background: var(--ch-surface-2);
  border: 1px solid var(--ch-border);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  color: var(--ch-text-2);
}

.ch-meta-sep {
  color: var(--ch-muted);
}

/* ── Wide Card (Releasing Soon style) ────────────────────── */
.ch-row--wide {
  gap: 20px;
}

.ch-card--wide {
  flex: 0 0 260px;
}

.ch-card-poster-wrap--wide {
  aspect-ratio: 16/9;
}

.ch-card-poster--wide {
  object-position: center top;
}

/* ── News Cards ───────────────────────────────────────────── */
.ch-row--news {
  gap: 20px;
}

.ch-news-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

.ch-news-link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  padding: 14px;
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  transition: background .2s, border-color .2s;
}

.ch-news-link:hover {
  background: var(--ch-surface-2);
  border-color: var(--ch-accent);
}

.ch-news-thumb-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ch-surface-2);
}

.ch-news-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch-news-body {
  flex: 1;
  min-width: 0;
}

.ch-news-title {
  font-family: var(--ch-font-display);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ch-text);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-news-meta {
  font-family: var(--ch-font-body);
  font-size: 11px;
  color: var(--ch-text-2);
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ── Actor Cards ──────────────────────────────────────────── */
.ch-row--actors {
  gap: 16px;
}

.ch-actor-card {
  flex: 0 0 110px;
  text-align: center;
  scroll-snap-align: start;
}

.ch-actor-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ch-actor-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 8px;
  background: var(--ch-surface-2);
  border: 2px solid var(--ch-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s;
}

.ch-actor-card:hover .ch-actor-avatar {
  border-color: var(--ch-accent);
}

.ch-actor-initials {
  font-family: var(--ch-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ch-text-2);
}

.ch-actor-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-actor-name {
  font-family: var(--ch-font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ch-text);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-actor-count {
  font-family: var(--ch-font-body);
  font-size: 11px;
  color: var(--ch-text-2);
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .cinehub-wrap {
    padding: 0 16px 48px;
  }

  .ch-card {
    flex: 0 0 130px;
  }

  .ch-card--wide {
    flex: 0 0 220px;
  }

  .ch-news-card {
    flex: 0 0 240px;
  }

  .ch-section-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .ch-card {
    flex: 0 0 110px;
  }
}

/* ── Section top divider ──────────────────────────────────── */
.ch-section + .ch-section {
  padding-top: 0;
}

/* ── Carousel overrides when CineHub body is active ─────────── */
body.cinehub-body #hero-carousel {
  height: clamp(320px, 44vw, 440px);
}

body.cinehub-body .carousel-content {
  max-width: 580px;
  padding: 36px 4% 44px;
  z-index: 2;
}

/* Smaller, tighter title — replaces the oversized default */
body.cinehub-body .carousel-title {
  font-size: clamp(22px, 2.8vw, 36px);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 10px;
}

body.cinehub-body .carousel-synopsis {
  font-size: 13px;
  -webkit-line-clamp: 3;
  max-width: 520px;
  margin-bottom: 16px;
}

body.cinehub-body .carousel-meta-badge {
  font-size: 11px;
}

/* Small poster placed on the right side */
body.cinehub-body .carousel-poster {
  position: absolute;
  right: clamp(24px, 5vw, 64px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(120px, 16vw, 200px);
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
  z-index: 3;
  transition: transform .25s ease, box-shadow .25s ease;
  display: block;
}

body.cinehub-body .carousel-poster:hover {
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .7), 0 0 0 1px var(--ch-accent);
}

body.cinehub-body .carousel-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tweak gradient so poster side remains legible */
body.cinehub-body .carousel-gradient {
  background: linear-gradient(
    90deg,
    rgba(8, 8, 16, .92) 0%,
    rgba(8, 8, 16, .75) 40%,
    rgba(8, 8, 16, .45) 65%,
    rgba(8, 8, 16, .7) 100%
  ),
  linear-gradient(0deg, rgba(8, 8, 16, .8) 0%, transparent 55%);
}

/* Hide poster on mobile (narrow layout gives the text full width) */
@media (max-width: 768px) {
  body.cinehub-body .carousel-poster { display: none; }
  body.cinehub-body .carousel-content { max-width: 100%; }
}

