/* cinemelb — static SPA theme.
   Dark by default: a cinema listing is read at night, and the amber accent
   reads as a marquee bulb rather than a spreadsheet. Light mode is a real
   second theme, not an inverted afterthought. */

:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --bg-2: #101017;
  --panel: #14141d;
  --card: #171722;
  --card-2: #1d1d2b;
  --line: #26263a;
  --line-2: #343450;
  --text: #ececf3;
  --text-2: #a9a9be;
  --text-3: #75758c;
  --accent: #e8b04b;
  --accent-2: #f3c876;
  --accent-ink: #14110a;
  --accent-dim: #2b2313;
  --good: #63c9a0;
  --warn: #e08a4e;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -18px rgba(0,0,0,.9);
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
  --wrap: 980px;
  --header-h: 65px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f4f1ea;
  --line: #e0dbcf;
  --line-2: #cbc4b3;
  --text: #17150f;
  --text-2: #57503f;
  --text-3: #8a8170;
  --accent: #9a6b12;
  --accent-2: #7d560d;
  --accent-ink: #fff8e9;
  --accent-dim: #f2e6cb;
  --good: #1d7a5c;
  --warn: #a3561f;
  --shadow: 0 1px 2px rgba(60,50,20,.08), 0 10px 30px -20px rgba(60,50,20,.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); }
a:hover { color: var(--accent); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100; font-weight: 600;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */

.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; flex: 0 0 auto;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.02em; }

.search {
  position: relative; flex: 1 1 auto; min-width: 0; margin: 0;
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-3); pointer-events: none;
}
#q {
  width: 100%; height: var(--tap);
  padding: 0 40px 0 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  /* 16px exactly: iOS Safari zooms the page for focused inputs below it. */
  font-size: 16px;
  appearance: none;
}
#q::placeholder { color: var(--text-3); }
#q:focus { outline: none; border-color: var(--accent); background: var(--card); }
#q::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; pointer-events: none;
}

.top-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.icon-btn {
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------ suggestions */

.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; z-index: 60;
}
.suggest[hidden] { display: none; }
.sug {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.sug:last-child { border-bottom: 0; }
.sug:hover, .sug[aria-selected="true"] { background: var(--card-2); }
.sug-thumb {
  width: 34px; height: 50px; flex: 0 0 auto;
  border-radius: 6px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.sug-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sug-body { display: block; min-width: 0; }
.sug-title {
  display: block; font-size: 14px; font-weight: 560; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sug-meta { display: block; font-size: 12px; color: var(--text-3); }
.sug-empty { padding: 14px; font-size: 13.5px; color: var(--text-3); text-align: center; }

/* -------------------------------------------------------------- day rail */

.rail {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(16px, calc((100vw - var(--wrap)) / 2));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.rail::-webkit-scrollbar { display: none; }

.rail-day {
  flex: 0 0 auto;
  min-width: 54px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.rail-day:hover { border-color: var(--line-2); color: var(--text); }
.rail-day.is-active,
.rail-day[aria-current="date"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.rail-dow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.rail-num { font-size: 16px; font-weight: 650; line-height: 1.15; }
.rail-mon { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }

/* --------------------------------------------------------------- filters */

.filters {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px 16px 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
}

.chip {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text-2);
  font: inherit; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.is-on,
.chip[aria-pressed="true"] {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2);
}

.select {
  height: 32px; padding: 0 30px 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2375758c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  color: var(--text-2);
  font: inherit; font-size: 13px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  max-width: 16rem;
}

/* ---------------------------------------------------------- view switcher */

.view-bar {
  display: flex;
  width: 100%; max-width: 340px;
  margin: 0 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--panel);
}
.seg-btn {
  flex: 1 1 auto; height: 36px; padding: 0 12px;
  border: 0; background: none; color: var(--text-3);
  font: inherit; font-size: 13px; font-weight: 540;
  white-space: nowrap; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--text); background: var(--card); }
.seg-btn.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 620; }
.seg-btn.is-on:hover { background: var(--accent); color: var(--accent-ink); }

.chip-clear { border-style: dashed; color: var(--text-3); }
.chip-clear:hover { color: var(--text); }

/* ------------------------------------------------------------ location bar */

.nearbar {
  max-width: var(--wrap); margin: 0 auto;
  padding: 9px 16px 0;
}
.near-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.near-me {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text-2);
  font: inherit; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.near-me:hover { border-color: var(--line-2); color: var(--text); }
.near-me.is-on {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2);
}
.near-me[disabled] { opacity: .6; cursor: progress; }
.near-icon { width: 15px; height: 15px; }

.near-form { flex: 1 1 240px; max-width: 340px; margin: 0; }
#near-q {
  width: 100%; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text);
  font: inherit;
  /* 16px exactly: iOS Safari zooms the page for focused inputs below it. */
  font-size: 16px;
  appearance: none;
}
#near-q::placeholder { color: var(--text-3); }
#near-q:focus { outline: none; border-color: var(--accent); background: var(--card); }

.near-status { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
.near-status:empty { display: none; }
.near-status.is-on { color: var(--text-2); }
.near-status.is-error { color: var(--warn); }
.near-status strong { color: var(--text); font-weight: 620; }
.near-clear {
  margin-left: 2px; padding: 0; border: 0; background: none;
  color: var(--accent-2); font: inherit; font-size: 12.5px;
  text-decoration: underline; cursor: pointer;
}
.near-clear:hover { color: var(--accent); }

/* ------------------------------------------------------------------ main */

.main {
  max-width: var(--wrap); margin: 0 auto;
  padding: 16px 16px 64px;
  min-height: 60vh;
}
.main:focus { outline: none; }

.loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 80px 0; color: var(--text-3);
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* ------------------------------------------------------------- day header */

.day-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 14px;
}
.day-head h1 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.02em; }

.badge {
  font-size: 11px; font-weight: 620; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-2); background: var(--accent-dim);
  border-radius: 999px; padding: 3px 9px;
}
.count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- film cards */

.films { display: grid; gap: 9px; }

.film {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.film:hover { border-color: var(--line-2); }
.film[open] { border-color: var(--line-2); }
.film > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; min-height: 56px;
  cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.film > summary::-webkit-details-marker { display: none; }
.film > summary:focus-visible { outline-offset: -2px; }

.poster {
  width: 38px; height: 56px; flex: 0 0 auto;
  display: block; object-fit: cover;
  border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.poster-none {
  display: grid; place-items: center;
  font-size: 15px; font-weight: 650; color: var(--text-3);
  background: var(--bg-2);
}
.poster-lg { width: 96px; height: 142px; border-radius: 10px; }

.film-main { flex: 1 1 auto; min-width: 0; }
.film-title {
  margin: 0;
  font-size: 15px; font-weight: 620; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.film-meta {
  margin: 1px 0 0;
  font-size: 12.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.film-times { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.film-times .time {
  font-size: 11.5px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 5px; background: var(--bg-2);
}
.film-times .time.is-soon {
  color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-dim);
}
.more { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- expanded sessions */

.film-body {
  border-top: 1px solid var(--line);
  padding: 12px; background: var(--bg-2);
}
.synopsis {
  margin: 0 0 12px; max-width: 70ch;
  font-size: 13.5px; color: var(--text-2);
}

.venue { margin-bottom: 12px; }
.venue:last-child { margin-bottom: 0; }
.venue-head {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  margin-bottom: 5px;
}
.venue-name { font-size: 13.5px; font-weight: 620; }
.venue-sub { font-size: 12px; color: var(--text-3); }
.venue-dist {
  margin-left: auto;
  font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.sessions { display: flex; flex-wrap: wrap; gap: 5px; }
.session {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 1px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--text);
  text-decoration: none; font: inherit;
  font-variant-numeric: tabular-nums;
}
.session:hover { border-color: var(--line-2); color: var(--text); }
a.session:hover { border-color: var(--accent); background: var(--accent-dim); }
.session .time { font-size: 13px; font-weight: 560; }
.notes { font-size: 10.5px; color: var(--text-3); line-height: 1.25; }
a.session:hover .notes { color: var(--text-2); }
.session.is-soon { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.session.is-soon .time { color: var(--accent-2); }
.session.is-sold { opacity: .6; border-style: dashed; }
.session.is-sold .time { text-decoration: line-through; }
.sold-tag {
  font-size: 10px; font-weight: 620; text-transform: uppercase;
  letter-spacing: .05em; color: var(--warn);
}

.film-link { margin: 14px 0 0; font-size: 13px; }
.film-link a { text-decoration: none; }
.film-link a:hover { text-decoration: underline; }

/* ------------------------------------------------------------- film view */

.film-hero { display: flex; gap: 16px; margin-bottom: 4px; }
.hero-main { min-width: 0; flex: 1 1 auto; }
.film-hero h1 {
  margin: 0 0 6px; font-size: 24px; font-weight: 700;
  letter-spacing: -.025em; line-height: 1.2;
}
.film-hero .film-meta { font-size: 13px; white-space: normal; }
.film-hero .synopsis { margin: 8px 0 0; }
.trailer {
  display: inline-block; margin: 10px 0 0;
  font-size: 13px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 11px; color: var(--text-2);
}
.trailer:hover { border-color: var(--accent); color: var(--accent); }

.section-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 22px 0 12px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  margin: 0; font-size: 12px; font-weight: 660;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
}
.section-head .count { font-size: 12.5px; }

.day-block { margin-bottom: 20px; }
.day-block:last-child { margin-bottom: 0; }
.day-block h3 {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 9px; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
}
.day-block .venue { margin-bottom: 10px; }
.day-block .venue:last-child { margin-bottom: 0; }

/* -------------------------------------------------------- grouped by time */

.time-block { margin-bottom: 26px; }
.time-block:last-child { margin-bottom: 0; }
.time-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
}
.time-head .count { font-weight: 400; }

/* ------------------------------------------------------ grouped by cinema */

.cinema-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cinema-block:first-child { padding-top: 2px; }
.cinema-block:last-child { border-bottom: 0; padding-bottom: 0; }
.cinema-block .venue-head { margin-bottom: 6px; }
.day-sub { margin-top: 9px; }
.day-sub h4 {
  margin: 0 0 5px;
  font-size: 11px; font-weight: 620;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3);
}

/* ------------------------------------------------------------- empty/error */

.empty {
  text-align: center; padding: 56px 20px;
  color: var(--text-3);
}
.empty h2 { margin: 0 0 6px; font-size: 17px; font-weight: 620; color: var(--text-2); }
.empty p { margin: 0 auto; font-size: 14px; max-width: 52ch; }
.empty .btn { margin-top: 14px; }

.error {
  border: 1px solid var(--warn); border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 8%, var(--card));
  padding: 16px 18px; margin: 24px 0;
}
.error h2 { margin: 0 0 8px; font-size: 16px; color: var(--warn); }
.error p { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.error p:last-child { margin-bottom: 0; }
.error code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text);
  font: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------------ footer */

.foot {
  max-width: var(--wrap); margin: 0 auto;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-3);
}
.foot p { margin: 0 0 6px; }
.foot .dot { opacity: .5; margin: 0 4px; }
.foot-note { max-width: 60ch; line-height: 1.45; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 640px) {
  :root { --header-h: 61px; }
  .top-inner { padding: 8px 12px; gap: 8px; }
  .brand-name { display: none; }
  .clock { display: none; }
  .rail { padding: 7px 12px; }
  /* One scrollable row instead of three wrapped ones: the filter bar sits above
     every listing, and every wrapped row costs a film card's worth of space. */
  .filters {
    padding: 9px 12px 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex: 0 0 auto; }
  .chip, .select { height: 36px; }
  .nearbar { padding: 9px 12px 0; }
  .near-form { max-width: none; }
  .near-me, #near-q { height: 38px; }
  .near-me { font-size: 14px; }
  .near-icon { width: 16px; height: 16px; }
  .main { padding: 14px 12px 56px; }
  .film-times { display: none; }
  .day-head h1 { font-size: 18px; }
  .view-bar { max-width: none; }
  .seg-btn { height: 40px; font-size: 13.5px; }
  .film-hero { gap: 12px; }
  .film-hero h1 { font-size: 20px; }
  .poster-lg { width: 72px; height: 106px; }
  .foot { padding: 18px 12px 32px; }
}
