/* ── Base ─────────────────────────────────────────── */

:root {
  --bg: #16181d;
  --bg-raised: #1d2027;
  --drawer-bg: #101219;
  --accent: #7c5cbf;
  --accent-bright: #9d82d6;
  --text: #f2f2f5;
  --text-muted: #9aa0ae;
  --radius: 10px;
  --font-display: "Tinos", "Times New Roman", Times, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark; /* native controls (date pickers) match the theme */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must win over any explicit display value below. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  /* Soft accent glow anchored near the top of every page. */
  background:
    radial-gradient(1200px 480px at 50% -120px, rgba(124, 92, 191, 0.16), transparent 65%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100dvh;
}

/* Classic Times-style serif matching the society logo ("Film Society"
   wordmark); body text stays a plain sans so the two voices stay distinct. */
h1, h2, .home-title, .film-title, .film-card-title, .info-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

body.no-scroll { overflow: hidden; }

a { color: var(--accent-bright); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── Top bar / hamburger ──────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px;
  z-index: 40;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.drawer-open .topbar { opacity: 0; pointer-events: none; }

.menu-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.menu-btn .bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background 0.2s ease;
}
.menu-btn:hover .bar { background: var(--accent-bright); }

/* ── Side drawer ──────────────────────────────────── */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.visible { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 85vw);
  background: var(--drawer-bg);
  z-index: 35;
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.3s ease;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-block;
  border-radius: 12px;
  line-height: 0;
  transition: transform 0.2s ease;
}
.brand:hover { transform: scale(1.05); }
.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.drawer-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.drawer-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.drawer-links {
  list-style: none;
  padding: 14px 0;
  flex: 1;
}
.drawer-links a {
  display: block;
  padding: 14px 24px;
  color: var(--text);
  font-size: 17px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.drawer-links a:hover {
  background: rgba(124, 92, 191, 0.15);
  color: var(--accent-bright);
}
.drawer-links a.active {
  color: var(--accent-bright);
  border-left-color: var(--accent);
  background: rgba(124, 92, 191, 0.1);
}

.drawer-foot {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 14px;
}
.drawer-foot p { margin-bottom: 4px; }
.drawer-foot-sub { opacity: 0.75; }

/* Discreet committee link at the bottom of the drawer. */
.drawer-admin-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  text-decoration: none;
}
.drawer-admin-link:hover,
.drawer-admin-link:focus-visible { color: var(--accent-bright); opacity: 1; }

/* ── Home carousel ────────────────────────────────── */

.home-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px 48px;
}

.carousel {
  --card-w: clamp(120px, 22vw, 240px);
  --gap: clamp(12px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 26px);
  position: relative;
  width: 100%;
}

.stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Vertical padding is sized so the centred poster's glow paints fully
     inside the stage and isn't cut off by overflow: hidden. */
  padding: 40px 0 26px;
}

/* Fade the outermost posters into the page so the carousel feels endless. */
.stage::before,
.stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(28px, 8vw, 110px);
  pointer-events: none;
}
.stage::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.stage::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* Screening date heading travels with each card. */
.card-date {
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-muted);
  margin-bottom: 24px; /* clears the centred card's scale-up and the hover lift below */
  text-align: center;
  transition: color 0.5s ease;
}
.card[data-dist="0"] .card-date { color: var(--text); }
.week-tag {
  font-size: 0.85em;
  color: var(--accent-bright);
  white-space: nowrap;
}

.track {
  position: relative;
  left: 50%;
  display: flex;
  gap: var(--gap);
  width: max-content;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.track.no-transition { transition: none; }

.card {
  flex: none;
  width: var(--card-w);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poster-link {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transform: translateY(var(--lift, 0px)) scale(var(--s, 1));
  opacity: var(--o, 1);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.5s ease, outline-color 0.25s ease;
}
.poster-link:hover,
.poster-link:focus-visible {
  --lift: -6px;
  outline-color: var(--accent);
}

.poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.5s ease;
}

/* The centred card gets a soft accent glow so the current film stands out. */
.card[data-dist="0"] .poster {
  box-shadow: 0 0 26px 4px rgba(157, 130, 214, 0.5),
              0 0 70px 12px rgba(124, 92, 191, 0.28),
              0 14px 34px rgba(0, 0, 0, 0.55);
}

/* Emphasis by distance from the centred card. */
.card[data-dist="0"] { --s: 1.06; --o: 1; }
.card[data-dist="1"], .card[data-dist="-1"] { --s: 0.86; --o: 0.6; }
.card[data-dist="2"], .card[data-dist="-2"] { --s: 0.74; --o: 0.25; }
.card[data-far] .poster-link { --o: 0; pointer-events: none; }

.card-title {
  margin-top: 24px; /* clears the centred card's scale-up above it */
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.5s ease;
}
.card[data-dist="0"] .film-title { font-size: 20px; }
.film-title {
  font-size: 17px;
  color: #cfd2dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.card[data-dist="0"] .film-title { color: var(--text); }
.film-year {
  font-size: 13px;
  color: var(--text-muted);
}

.arrow {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  margin-top: 30px;
  box-shadow: 0 8px 22px rgba(124, 92, 191, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}
.arrow svg { display: block; }
.arrow:hover,
.arrow:focus-visible { background: var(--accent-bright); transform: scale(1.07); }
.arrow:active { transform: scale(0.96); }

.arrow:disabled,
.arrow:disabled:hover,
.arrow:disabled:focus-visible {
  background: #3a3f4b;
  box-shadow: none;
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.hint {
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Home hero heading & info below the carousel ──── */

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.home-logo {
  width: clamp(76px, 14vw, 112px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22%;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
.home-title {
  font-size: clamp(38px, 8vw, 62px);
  line-height: 1.08;
}
.home-sub {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 46ch;
}

/* "Next screening" callout under the hero, filled in by script.js. */
.next-screening {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 20px;
  border: 1px solid rgba(157, 130, 214, 0.35);
  border-radius: 999px;
  background: rgba(124, 92, 191, 0.12);
  font-size: 14px;
  color: var(--text-muted);
}
.next-label {
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.next-screening a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.next-screening a:hover,
.next-screening a:focus-visible { color: var(--accent-bright); }

.home-info {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 24px 64px;
}
.home-info h2 {
  font-size: 20px;
  color: var(--accent-bright);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.info-grid .info-card { margin: 0; }

/* ── Content pages ────────────────────────────────── */

.page {
  position: relative; /* keeps page content above the film page's backdrop */
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 64px;
}

.page h1 {
  font-size: clamp(32px, 5.5vw, 46px);
  margin-bottom: 10px;
}

.page .lede {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 34px;
}

.page h2 {
  font-size: 24px;
  margin: 30px 0 12px;
  color: var(--accent-bright);
}

.page p { line-height: 1.65; margin-bottom: 14px; color: #d4d7de; }

.info-card {
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
}
.info-card h3 { font-size: 18px; margin-bottom: 6px; }
.info-card p { margin: 0; font-size: 15px; }

/* Programme list on admin.html (the public films page uses .film-grid) */

.programme { list-style: none; margin-top: 10px; }

.programme li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.programme li:hover { background: rgba(255, 255, 255, 0.04); }

.programme img {
  width: 46px;
  border-radius: 6px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  flex: none;
}

.programme .film-meta { flex: 1; min-width: 0; }
.programme .film-meta a {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.programme .film-meta a:hover { color: var(--accent-bright); text-decoration: underline; }
.programme .film-date { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Poster card grid (films page) ─────────────────── */

.film-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 30px 20px;
  margin-top: 22px;
}

.film-card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}

.film-card-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transform: translateY(var(--lift, 0px));
  transition: transform 0.25s ease, box-shadow 0.25s ease, outline-color 0.25s ease;
}
.film-card-link:hover .film-card-poster,
.film-card-link:focus-visible .film-card-poster {
  --lift: -5px;
  outline-color: var(--accent);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
}

.film-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 0 2px;
}
.film-card-title {
  font-size: 19px;
  line-height: 1.2;
  color: var(--text);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.film-card-meta { font-size: 13px; color: var(--text-muted); }
.film-grid .chip { margin-top: 4px; }

.chip {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(124, 92, 191, 0.16);
  color: var(--accent-bright);
}
.chip.dim { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

/* ── Entrance animations ───────────────────────────── */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.home-hero > *,
.page > *,
.home-info > * {
  animation: rise-in 0.5s ease backwards;
}
.home-hero > *:nth-child(2),
.page > *:nth-child(2),
.home-info > *:nth-child(2) { animation-delay: 0.06s; }
.home-hero > *:nth-child(3),
.page > *:nth-child(3),
.home-info > *:nth-child(3) { animation-delay: 0.12s; }
.home-hero > *:nth-child(4),
.page > *:nth-child(4) { animation-delay: 0.18s; }
.page > *:nth-child(5) { animation-delay: 0.24s; }

.film-grid > li { animation: rise-in 0.5s ease backwards; }
.film-grid > li:nth-child(2) { animation-delay: 0.06s; }
.film-grid > li:nth-child(3) { animation-delay: 0.12s; }
.film-grid > li:nth-child(4) { animation-delay: 0.18s; }
.film-grid > li:nth-child(5) { animation-delay: 0.24s; }
.film-grid > li:nth-child(6) { animation-delay: 0.3s; }
.film-grid > li:nth-child(7) { animation-delay: 0.36s; }
.film-grid > li:nth-child(8) { animation-delay: 0.42s; }

/* ── Embedded map (find-us page) ───────────────────── */

/* Inverting the iframe turns the standard bright map into one that matches
   the dark theme. */
.map-embed {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0 18px;
}
.map-embed iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  filter: invert(0.92) hue-rotate(180deg) grayscale(0.25) contrast(0.9);
}

/* ── Footer ───────────────────────────────────────── */

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 26px 16px 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 620px) {
  .carousel { padding: 0 26px; }
  .arrow {
    position: absolute;
    top: 50%;
    margin-top: 30px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    z-index: 2; /* above the stage's edge fades */
  }
  #prevBtn { left: 0; }
  #nextBtn { right: 0; }
  .card-date { font-size: 13px; }
  .card[data-dist="0"] .film-title { font-size: 18px; }
  .film-title { font-size: 15px; }
}

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

/* ── Film detail page ─────────────────────────────── */

/* Full-bleed backdrop banner behind the hero. Sits before <main> in the
   DOM and stays beneath it (script.js fills the image; without a stored
   backdrop the poster is reused, blurred and zoomed). */
.backdrop-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: min(58vh, 500px);
  overflow: hidden;
  pointer-events: none;
}
.backdrop-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.04);
  animation: backdrop-in 0.8s ease both;
}
.backdrop-img.is-poster {
  transform: scale(1.3);
  filter: blur(26px) saturate(1.15);
}
.backdrop-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(22, 24, 29, 0.55),
    rgba(22, 24, 29, 0.72) 55%,
    var(--bg) 97%);
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--accent-bright); }

.film-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 30px;
  align-items: start;
  margin-bottom: 34px;
}

.film-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.film-head h1 { margin-bottom: 4px; }

.film-facts {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 14px;
}

.film-synopsis {
  line-height: 1.65;
  color: #d4d7de;
  margin-bottom: 20px;
}

/* Average rating: dim stars underneath, gold stars clipped to width. */
.stars {
  position: relative;
  display: inline-block;
  font-size: 21px;
  letter-spacing: 3px;
  line-height: 1;
  color: #3a3f4b;
  white-space: nowrap;
}
.stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #f5c518;
  width: 0;
}
.avg-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.avg-text { color: var(--text-muted); font-size: 14px; }

.lb-button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lb-button:hover,
.lb-button:focus-visible { background: var(--accent-bright); transform: scale(1.04); }

/* ── Review form ───────────────────────────────────── */

.review-form {
  display: grid;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 14px 0 30px;
}

.form-row { display: grid; gap: 6px; }

.review-form label,
.form-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.review-form input[type="text"],
.review-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.review-form input[type="text"]:focus,
.review-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Half-star picker: dim star per cell, gold fill clipped by width, two
   invisible click zones per star (left half / right half). */
.star-picker { display: flex; }

.pick-star {
  position: relative;
  display: inline-block;
  font-size: 30px;
  line-height: 1;
  color: #3a3f4b;
}
.pick-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #f5c518;
  width: 0;
}
.half-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.half-left { left: 0; }
.half-right { right: 0; }
.half-btn:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }

.submit-btn {
  justify-self: start;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.submit-btn:hover:not(:disabled),
.submit-btn:focus-visible:not(:disabled) { background: var(--accent-bright); transform: scale(1.04); }
.submit-btn:disabled { opacity: 0.6; cursor: default; }

.form-error { color: #ff9b9b; font-size: 14px; }

.reviews-note {
  color: var(--text-muted);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  padding: 14px 16px;
}

/* ── Reviews list ──────────────────────────────────── */

.reviews-list { list-style: none; display: grid; gap: 14px; }

.review {
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.review-name { font-weight: 600; font-size: 15px; }
.review-stars { font-size: 14px; letter-spacing: 2px; }
.review-date { margin-left: auto; color: var(--text-muted); font-size: 13px; }

.review-text {
  line-height: 1.6;
  color: #d4d7de;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.no-reviews { color: var(--text-muted); }

/* ── Admin controls (film page) ────────────────────── */

.admin-area {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-toggle {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--text-muted);
  opacity: 0.65;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
}
.admin-toggle:hover,
.admin-toggle:focus-visible { color: var(--accent-bright); opacity: 1; }

.admin-panel {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  max-width: 460px;
}

.admin-hint { font-size: 13px; color: var(--text-muted); }

.admin-login { display: flex; gap: 8px; }
.admin-login input {
  flex: 1;
  min-width: 0;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
}
.admin-login input:focus { outline: none; border-color: var(--accent); }

.admin-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.admin-btn:hover,
.admin-btn:focus-visible { background: var(--accent-bright); }

.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-status { font-size: 14px; }

.admin-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.admin-link:hover { color: var(--text); }

.admin-error { color: #ff9b9b; font-size: 13px; }

/* Delete buttons shown on reviews while signed in as admin. */
.review-delete {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 11px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.review-delete:hover,
.review-delete:focus-visible { color: #ff9b9b; border-color: rgba(255, 130, 130, 0.45); }

/* Poster thumbnails in the admin line-up list are links to the public page. */
.programme .poster-thumb {
  display: block;
  flex: none;
  border-radius: 6px;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.programme .poster-thumb:focus-visible { outline-color: var(--accent); }

@media (max-width: 620px) {
  .film-hero { grid-template-columns: 1fr; }
  .film-poster { max-width: 200px; margin: 0 auto; }
  .film-head { text-align: center; }
  .avg-block { justify-content: center; }
  .review-date { margin-left: 0; width: 100%; }
}

/* ── Line-up manager (admin.html) ──────────────────── */

.admin-gate {
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.tmdb-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.tmdb-search input {
  flex: 1;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.tmdb-search input:focus { outline: none; border-color: var(--accent); }

.form-hint { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.tmdb-results { list-style: none; display: grid; gap: 10px; margin: 12px 0 4px; }
.tmdb-results li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.tmdb-results img {
  width: 54px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  flex: none;
}
.tmdb-result-body { flex: 1; min-width: 0; }
.tmdb-result-title { font-weight: 600; font-size: 15px; }
.tmdb-result-year { color: var(--text-muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.tmdb-result-overview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.film-form {
  display: grid;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 14px 0 10px;
}
.film-form-grid { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; }
.poster-preview {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg);
}
.film-form-fields { display: grid; gap: 14px; align-content: start; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.film-form .form-row { display: grid; gap: 6px; }
.film-form label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.film-form input,
.film-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.film-form input:focus,
.film-form textarea:focus { outline: none; border-color: var(--accent); }
.film-form input:disabled { opacity: 0.65; }

.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.save-status { color: #9bd4a0; font-size: 14px; }

.lineup-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }

.mini-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.mini-btn:hover,
.mini-btn:focus-visible { color: var(--text); border-color: var(--accent); }
.mini-btn.danger:hover,
.mini-btn.danger:focus-visible { color: #ff9b9b; border-color: rgba(255, 130, 130, 0.45); }

@media (max-width: 620px) {
  .film-form-grid { grid-template-columns: 1fr; }
  .poster-preview { max-width: 150px; }
  .form-pair { grid-template-columns: 1fr; }
  .lineup-actions { margin-left: 0; }
}
