/* ==========================================================================
   films.lk — Design System
   Five-color system: black (backdrop), white (structure & text), gold
   (primary highlight — hero, CTAs, labels), blue (secondary actions &
   links), green (status badges & tags). Gold and blue share top billing
   as the two "pop" colors; green is reserved for status.
   Type: Fraunces (display, titles/credits feel) + Inter (UI/body) +
         Noto Sans Sinhala (native script fallback).
   Signature: the sprocket-edged "filmstrip" rail used for film carousels.
   ========================================================================== */

:root {
  /* Color tokens — five-color system: black / white / gold / blue / green */
  --ink:        #000000;   /* black — page backdrop */
  --surface:    #141414;   /* lifted panel tone so cards read against pure black */
  --surface-deep:#0A0A0A;
  --white:      #FFFFFF;   /* white — structural lines, strong text, logo area */
  --gold:       #D4A537;   /* gold — primary highlight: hero, CTAs, labels */
  --gold-soft:  #E8C778;
  --accent:     #4098D5;   /* blue — secondary actions, links */
  --accent-soft:#7BBCE8;
  --brand-green:#369900;   /* green — status badges, tags */
  --green-soft: #5CC22A;
  --paper:      #F2F4F6;   /* off-white body text (near --white, easier on the eyes) */
  --muted:      #9AA3AC;   /* muted secondary text on dark */
  --line:       rgba(255, 255, 255, 0.14);

  /* Type */
  --font-display: 'Fraunces', 'Noto Sans Sinhala', serif;
  --font-body: 'Inter', 'Noto Sans Sinhala', system-ui, sans-serif;

  /* Layout */
  --container-w: 1240px;
  --radius: 6px;
  --gap: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Signature device: sprocket filmstrip border ---------- */
.filmstrip-border {
  height: 14px;
  width: 100%;
  background-color: var(--surface-deep);
  background-image: radial-gradient(circle, var(--ink) 3.5px, transparent 3.6px);
  background-size: 22px 14px;
  background-position: 11px 0;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
}
.brand__logo { height: 38px; width: auto; }

.main-nav {
  display: flex;
  gap: 22px;
  flex: 1;
}
.main-nav__link {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.main-nav__link:hover,
.main-nav__link.is-active {
  color: var(--accent-soft);
  border-bottom-color: var(--accent);
}

.header-search {
  display: flex;
  align-items: center;
  background: rgba(242,244,246,0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
}
.header-search input {
  background: transparent;
  border: none;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  width: 170px;
  outline: none;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  background: var(--accent);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--surface-deep);
  cursor: pointer;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--paper);
  border-radius: 2px;
}

/* ---------- Hero Slideshow ---------- */
.hero-slideshow {
  position: relative;
  height: min(440px, 82vh);
  min-height: 440px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.hero-slides { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .9s ease;
  display: flex;
  align-items: center;
}
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

.hero-slide__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  background-color: var(--surface);
}
.hero-slide__bg.bg-failed {
  /* Applied by JS if the banner image 404s, so the slide still reads intentionally */
  background-image: linear-gradient(135deg, var(--surface) 0%, var(--surface-deep) 100%) !important;
}
.hero-slide__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.25) 75%, rgba(0,0,0,0.15) 100%),
    linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 35%);
}

.hero-slide__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}
.hero-slide__title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  color: var(--white);
}
.hero-slide__meta {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero-slide__tag {
  position: absolute;
  top: 24px; right: 24px;
  z-index: 2;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero__eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__eyebrow::before {
  content: '';
  width: 28px; height: 2px;
  background: var(--gold);
}
.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease;
  background-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--gold); color: #1a1306; border-color: var(--gold); }
.btn--outline { border-color: rgba(255,255,255,0.4); color: var(--white); }
.btn--outline:hover { border-color: var(--white); }
.btn--movie { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--movie:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

/* Dot navigation */
.hero-slideshow__nav {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.hero-slideshow__dot {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s ease;
}
.hero-slideshow__dot.is-active { background: var(--gold); }
.hero-slideshow__dot:hover { background: var(--gold-soft); }

/* Prev/next arrows */
.hero-slideshow__arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line);
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.hero-slideshow__arrow:hover { background: rgba(0,0,0,0.65); border-color: var(--gold); }
.hero-slideshow__arrow--prev { left: 20px; }
.hero-slideshow__arrow--next { right: 20px; }

/* Trailer player overlay */
.hero-slideshow__player {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.hero-slideshow__player[hidden] {
  display: none; /* override display:flex above when the hidden attribute is set */
}
.hero-slideshow__player-frame {
  width: min(960px, 100%);
  aspect-ratio: 16/9;
  background: #000;
}
.hero-slideshow__player-frame iframe { width: 100%; height: 100%; border: 0; }
.hero-slideshow__close {
  position: absolute;
  top: 22px; right: 26px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hero-slideshow__close:hover { background: rgba(255,255,255,0.16); }

/* ---------- Section scaffolding ---------- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  gap: 20px;
}
.section__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  display: block;
}
.section__head h2 {
  font-size: 30px;
  color: var(--white);
}
.section__more {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}
.section__more:hover { color: var(--accent-soft); border-color: var(--accent-soft); }

/* ---------- Filmstrip rail (signature element) ---------- */
.reel {
  position: relative;
  background: var(--surface-deep);
  border-radius: 12px;
  padding: 18px 18px 22px;
}
.reel__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.reel__track::-webkit-scrollbar { height: 6px; }
.reel__track::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.film-card {
  scroll-snap-align: start;
  flex: 0 0 200px;
  position: relative;
}
.film-card__frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 300/500; /* matches film_films.image upload size (300x500px) */
  background: #1a1a1a;
  border: 6px solid var(--ink);
  outline: 1px solid var(--line);
}
.film-card__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.film-card:hover .film-card__frame img { transform: scale(1.06); }
.film-card__badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.film-card__badge--released {
  background: var(--brand-green);
  color: #fff;
}
.film-card__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.film-card__meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Homepage film showcase panels */
.section--film-showcase {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent);
}
.now-showing__summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}
.now-showing__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: -12px 0 18px;
}
.now-showing__filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.now-showing__filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
  font-size: 12px;
  font-weight: 700;
}
.now-showing__filter.is-active {
  color: var(--surface-deep);
  background: var(--gold);
  border-color: var(--gold);
}
.now-showing__count {
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 700;
}
.section--film-showcase .reel {
  background: rgba(242,244,246,0.035);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.section--film-showcase .reel::before,
.section--film-showcase .reel::after {
  display: none;
}
.section--film-showcase .reel__track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  overflow: visible;
  padding-bottom: 0;
}
.section--film-showcase .film-card {
  flex: none;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.section--film-showcase .film-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212,165,55,0.45);
  background: rgba(0,0,0,0.38);
}
.section--film-showcase .film-card__frame {
  border: 0;
  outline: 1px solid var(--line);
  border-radius: 6px;
}
.section--film-showcase .film-card__badge {
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}
.section--film-showcase .film-card__title {
  font-size: 15px;
}
.film-card__sinhala {
  margin-top: 4px;
  color: var(--paper);
  font-size: 13px;
  line-height: 1.35;
}
.film-card__date {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--gold-soft);
}
.section--film-showcase .film-card__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--gold-soft);
}
.film-card__film-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 17px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(54,153,0,0.2);
  border: 1px solid rgba(54,153,0,0.55);
  color: #c6f5b0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* sprocket holes along the reel edges */
.reel::before, .reel::after {
  content: '';
  position: absolute;
  left: 18px; right: 18px;
  height: 8px;
  background-image: radial-gradient(circle, var(--ink) 2.6px, transparent 2.8px);
  background-size: 18px 8px;
  opacity: 0.7;
}
.reel::before { top: 6px; }
.reel::after { bottom: 6px; }

/* ---------- Artist grid ---------- */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}
.artist-card {
  text-align: center;
}
.artist-card__photo {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1/1;
  border: 3px solid var(--surface);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  transition: outline-color .2s ease;
}
.artist-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.artist-card:hover .artist-card__photo { outline-color: var(--accent-soft); }
.artist-card__name {
  margin-top: 14px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--white);
}
.artist-card__role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Cast strip (artists from latest films) ---------- */
.cast-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.cast-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(242,244,246,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
}
.cast-chip__photo {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-deep);
}
.cast-chip__photo img { width: 100%; height: 100%; object-fit: cover; }
.cast-chip__text { min-width: 0; }
.cast-chip__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cast-chip__role {
  font-size: 11px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- News grid ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.news-grid--film { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.news-card {
  background: rgba(242,244,246,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.news-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.news-card__img {
  aspect-ratio: 16/9;
  background: var(--surface-deep);
  overflow: hidden;
}
.news-card__img img { width: 100%; height: 100%; object-fit: cover; }
.news-card__body { padding: 18px 20px 20px; }
.news-card__date {
  font-size: 12px;
  color: var(--accent-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.news-card__title {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--white);
}
.news-card__tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(54,153,0,0.14);
  color: var(--green-soft);
  border: 1px solid rgba(54,153,0,0.3);
}
.tag--film { background: rgba(154,163,172,0.12); color: var(--muted); border-color: var(--line); }

/* ---------- Empty state ---------- */
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-deep); }
.site-footer__inner {
  padding: 44px 24px 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.site-footer__logo { height: 32px; }
.site-footer__brand p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.site-footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer__links a { font-size: 13px; color: var(--muted); }
.site-footer__links a:hover { color: var(--accent-soft); }
.site-footer__copy { width: 100%; font-size: 12px; color: rgba(154,163,172,0.7); margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-slideshow { height: min(560px, 78vh); }
  .section--film-showcase .reel__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .artist-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 10px 24px 18px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .header-search { display: none; }
  .now-showing__tools { align-items: flex-start; flex-direction: column; }
  .section--film-showcase .reel__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artist-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .section__head { flex-direction: column; align-items: flex-start; }

  .hero-slideshow { height: min(520px, 86vh); min-height: 420px; }
  .hero-slide__overlay {
    background:
      linear-gradient(0deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.35) 100%);
  }
  .hero-slide { align-items: flex-end; padding-bottom: 64px; }
  .hero-slide__content { max-width: 100%; }
  .hero__actions { flex-wrap: wrap; }
  .hero-slideshow__arrow { display: none; } /* swipe/dots are enough on small screens */
  .hero-slide__tag { top: 16px; right: 16px; }
}

@media (max-width: 460px) {
  .section--film-showcase .reel__track { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Film Detail Page (film.php)
   ========================================================================== */

.film-hero {
  position: relative;
  padding: 40px 0;
  background-size: cover;
  background-position: center 20%;
  background-color: var(--surface);
  border-bottom: 1px solid #333333;
  overflow: hidden;
}
.film-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.4) 100%),
    linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 40%);
}
.film-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: end;
}
.film-hero__poster {
  aspect-ratio: 300/500;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,0.7);
}
.film-hero__poster img { width: 100%; height: 100%; object-fit: cover; }
.film-hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 42px);
  color: var(--white);
  line-height: 1.1;
}
.film-hero__sinhala { margin-top: 6px; font-size: 17px; color: var(--gold-soft); }
.film-hero__tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag--meta {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag--status { color: var(--gold-soft); border-color: rgba(212,165,55,0.35); }
.film-hero__meta { margin-top: 14px; font-size: 14px; color: var(--muted); }
.film-hero__meta strong { color: var(--paper); }

.film-rating { margin-top: 20px; max-width: 360px; }
.film-rating__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.film-rating__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--green-soft));
  border-radius: 999px;
}
.film-rating__text { margin-top: 8px; font-size: 13px; color: var(--muted); }

.film-body { padding: 0 24px 0; }
.film-body > .film-section:first-of-type { padding-top: 0; }

.film-special-message {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(212,165,55,0.38);
  border-left: 4px solid var(--gold);
  background: rgba(212,165,55,0.08);
  border-radius: 8px;
}
.film-special-message__label {
  display: block;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.film-special-message p {
  margin: 0;
  color: var(--white);
  font-size: 16px;
  line-height: 1.75;
}
.film-section--ad {
  padding: 24px 0;
}
.google-ad-slot {
  min-height: 90px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  border: 0;
}
.google-ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
}

.film-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.film-section:last-of-type { border-bottom: none; }
.film-section__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
}
.film-section__subtitle {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 24px 0 12px;
}
.film-section__subtitle:first-of-type { margin-top: 0; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
}
.summary-grid__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.summary-grid__row span { color: var(--muted); }
.summary-grid__row strong { color: var(--paper); text-align: right; font-weight: 600; }

.summary-headline {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.summary-headline__item { font-size: 14px; color: var(--muted); }
.summary-headline__role { color: var(--muted); margin-right: 4px; }
.summary-headline__item a { color: var(--accent-soft); font-weight: 600; }
.summary-headline__item a:hover { color: var(--accent); }

.film-trailer {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.film-trailer iframe { width: 100%; height: 100%; border: 0; }

.awards-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}
.awards-table tr { border-bottom: 1px solid var(--line); }
.awards-table tr:last-child { border-bottom: none; }
.awards-table td { padding: 12px 10px; font-size: 14px; vertical-align: top; }
.awards-table__num {
  width: 28px;
  color: var(--muted);
  font-weight: 600;
}
.awards-table strong { color: var(--paper); font-weight: 600; }
.awards-table__ceremony {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--accent-soft);
}
a.awards-table__ceremony:hover { color: var(--accent); }
.awards-table--international strong a,
.awards-table--international span.awards-table__ceremony {
  color: var(--paper);
}
.awards-table--international strong a:hover {
  color: var(--paper);
}
.awards-table__winner { color: var(--gold-soft); font-weight: 600; text-align: right; white-space: nowrap; }

.film-description {
  font-size: 15px;
  line-height: 1.8;
  color: var(--paper);
  max-width: 760px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 22px;
}
.people-card { text-align: center; }
.people-card__photo {
  aspect-ratio: 1/1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  outline: 2px solid var(--line);
  outline-offset: 2px;
  transition: outline-color .15s ease;
}
.people-card:hover .people-card__photo { outline-color: var(--accent); }
.people-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.people-card__name { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--white); }
.people-card__role { font-size: 12px; color: var(--muted); margin-top: 2px; }

.crew-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.crew-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  transition: border-color .15s ease;
}
.crew-row:hover { border-color: var(--accent); }
.crew-row__photo {
  width: 46px; height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}
.crew-row__photo img { width: 100%; height: 100%; object-fit: cover; }
.crew-row__text { min-width: 0; display: flex; flex-direction: column; }
.crew-row__role {
  font-size: 11px;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.crew-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Expandable text (Description / Plot "show more") */
.expandable-text { position: relative; }
.expandable-text .film-description {
  max-height: 8.6em; /* roughly 5 lines at line-height 1.8 */
  overflow: hidden;
  position: relative;
  margin-bottom: 0;
}
.expandable-text.is-expanded .film-description { max-height: none; }
.expandable-text:not(.is-expanded) .film-description::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 48px;
  background: linear-gradient(180deg, transparent, var(--ink));
}
.expandable-text__toggle {
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft);
  cursor: pointer;
}
.expandable-text__toggle:hover { color: var(--accent); }
/* If the text never overflows, hide the toggle entirely (JS adds this class) */
.expandable-text.no-overflow .expandable-text__toggle { display: none; }
.expandable-text.no-overflow .film-description::after { display: none; }

/* Tabs (Plot / Photos / Songs) */
.tabs__nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tabs__btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
  flex: 0 0 auto;
}
.tabs__btn:hover { color: var(--paper); }
.tabs__btn.is-active { color: var(--gold); border-bottom-color: var(--gold); }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.photo-grid__item {
  display: block;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.photo-grid__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.photo-grid__item:hover img { transform: scale(1.05); }

.song-list { list-style: none; margin: 0; padding: 0; }
.song-list__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.song-list__row:last-child { border-bottom: none; }
.song-list__num {
  width: 22px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.song-list__title {
  flex: 1;
  font-size: 14.5px;
  color: var(--white);
  font-weight: 500;
}
.song-list__sinhala { display: block; font-size: 12.5px; color: var(--gold-soft); margin-top: 2px; }
.song-list__artists {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 500;
}
.song-list__artists a { color: var(--accent-soft); }
.song-list__artists a:hover { color: var(--accent); }
.song-list__artists span { color: var(--muted); }
.song-list__play {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s ease;
}
.song-list__play:hover { background: var(--accent-soft); }
.song-list__play--disabled {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  cursor: default;
}
.song-list__play--disabled:hover { background: rgba(255,255,255,0.06); }

.film-card__badge--not-ready { background: var(--gold); color: #1a1306; }

/* Photo sub-tabs (one per films_films_photos_type.name) */
.subtabs__nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.subtabs__btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.subtabs__btn:hover { color: var(--paper); border-color: var(--accent); }
.subtabs__btn.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.subtabs__panel { display: none; }
.subtabs__panel.is-active { display: block; }

/* Photo grid items are now buttons (for the lightbox), reset default button look */
.photo-grid__item {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: none;
  padding: 0;
  cursor: zoom-in;
}
.photo-grid__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.photo-grid__item:hover img { transform: scale(1.05); }

/* Lightbox overlay for enlarged photos */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.7);
}
.lightbox__caption {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.lightbox__close {
  position: absolute;
  top: 22px; right: 26px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,0.16); }

@media (max-width: 760px) {
  .film-hero__inner { grid-template-columns: 110px 1fr; gap: 18px; align-items: center; }
  .film-hero__title { font-size: 24px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid__row strong { text-align: left; }
  .awards-table__winner { text-align: left; white-space: normal; }
  .crew-list { grid-template-columns: 1fr; }
  .tabs__nav { gap: 8px; border-bottom: none; padding-bottom: 8px; margin-bottom: 18px; }
  .tabs__btn {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    margin-bottom: 0;
    padding: 8px 14px;
  }
  .tabs__btn.is-active {
    color: #1a1306;
    background: var(--gold);
    border-color: var(--gold);
  }
  .subtabs__nav { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 6px; }
  .subtabs__btn { white-space: nowrap; flex: 0 0 auto; }
}

/* ========================================================================== 
   Artist Detail Page (artist.php)
   ========================================================================== */
.artist-hero__inner {
  grid-template-columns: 190px 1fr;
  align-items: center;
}
.artist-hero__photo {
  aspect-ratio: 1/1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.12);
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  background: var(--surface-deep);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,0.75);
}
.artist-hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artist-body .summary-grid__row a {
  color: var(--accent-soft);
}
.artist-body .summary-grid__row a:hover {
  color: var(--accent);
}
.artist-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.artist-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.artist-table th,
.artist-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.artist-table th {
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.035);
}
.artist-table tr:last-child td {
  border-bottom: none;
}
.artist-table td:first-child {
  width: 84px;
  color: var(--muted);
  font-weight: 700;
}
.artist-table a {
  color: var(--accent-soft);
  font-weight: 600;
}
.artist-table a:hover {
  color: var(--accent);
}
.artist-table span {
  display: block;
  margin-top: 2px;
  color: var(--gold-soft);
  font-size: 12.5px;
}
.relation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.relation-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  transition: border-color .15s ease, transform .15s ease;
}
.relation-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.relation-card__photo {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}
.relation-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.relation-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.relation-card__body span {
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.relation-card__body strong {
  color: var(--white);
  font-size: 14.5px;
}
.relation-card__body em {
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
}
.relation-card__body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .artist-hero__inner {
    grid-template-columns: 108px 1fr;
    gap: 18px;
  }
  .artist-hero__photo {
    outline-width: 2px;
    outline-offset: 3px;
  }
  .artist-table {
    min-width: 640px;
  }
}

/* Rating + compact detail tables */
.rating-widget {
  margin-top: 20px;
  max-width: 430px;
}
.rating-widget .film-rating {
  margin-top: 0;
}
.rating-widget__form {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.rating-widget__choice {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.rating-widget__choice:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1306;
  transform: translateY(-1px);
}
.rating-widget__message {
  margin-top: 10px;
  color: var(--gold-soft);
  font-size: 12.5px;
  font-weight: 600;
}
.song-film-context {
  margin-bottom: 14px;
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.artist-social-actions {
  flex-wrap: wrap;
}
.artist-work-table {
  min-width: 920px;
}
.artist-song-table {
  min-width: 860px;
}
.artist-song-table td[rowspan] {
  background: rgba(255,255,255,0.025);
}
.awards-table__winner a,
.awards-table strong a,
.song-list__title a {
  color: var(--accent-soft);
}
.awards-table__winner a:hover,
.awards-table strong a:hover,
.song-list__title a:hover {
  color: var(--accent);
}
.artist-song-table__film-no { width: 86px; }
.artist-song-table__year { width: 64px; }
.artist-song-table__film { width: 28%; }
.artist-song-table__song { width: 46%; }
.artist-song-table__role { width: 120px; }
.artist-song-table th:nth-child(2),
.artist-song-table td:nth-child(2) {
  white-space: nowrap;
}
.artist-role-group-title{margin-top:22px;color:var(--gold-soft);font-size:17px}
