/* Now Playing Toronto. Tokens from the Figma style guide (V2): UE Red + Floral White,
   Analogue Reduced (55 Regular / 65 Medium / 75 Bold). The font is commercial: drop the .woff2
   files into public/fonts/ and add @font-face rules here; until then the stack falls back. */

:root {
  --red: #c10000;
  --cream: #fef8ef;
  --red-soft: rgba(193, 0, 0, 0.08);
  --red-line: rgba(193, 0, 0, 0.25);
  --font: "Analogue Reduced", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --sidebar-w: 340px;
  --radius-pill: 10px;
  --radius-poster: 5px;
  --poster-w: 191px;
  --poster-h: 286px;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  color: var(--red);
  font: 400 16px/1.3 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }

/* ---- Sidebar ---- */

.sidebar {
  background: var(--red);
  color: var(--cream);
  padding: 12px 24px 32px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: block;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  max-width: 260px;
}
.brand:hover { text-decoration: none; }

.nav { display: flex; flex-direction: column; gap: 14px; padding-left: 14px; }
.nav__item { font-size: 24px; font-weight: 700; line-height: 28px; }
.nav__link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* A sidebar row: label on the left, control (pill / dropdown) on the right */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row__control { flex: 0 1 190px; min-width: 150px; }

.divider {
  border: 0;
  border-top: 2px dashed var(--cream);
  margin: 0 8px 0 0;
  width: 301px;
  max-width: 100%;
}

.filters { display: flex; flex-direction: column; gap: 18px; padding-left: 14px; }
.filter__label { font-size: 20px; font-weight: 500; }

.sidebar__note { margin-top: auto; font-size: 12px; opacity: 0.75; max-width: 280px; }

/* ---- Pills: cream capsule, red text (the wireframe's "Label") ---- */

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--red);
  font: 400 15px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
input.pill { text-align: center; }
input.pill::placeholder { color: var(--red); opacity: 0.75; }
:is(.pill, .dropdown__trigger, .menu__item):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
input[type="date"].pill { font-variant-numeric: tabular-nums; }
input[type="date"].pill::-webkit-calendar-picker-indicator { opacity: 0.7; cursor: pointer; }
input[type="search"].pill::-webkit-search-cancel-button { cursor: pointer; }

/* ---- Dropdown (<details>) + menu ---- */

.dropdown { position: relative; }
.dropdown__trigger { list-style: none; user-select: none; }
.dropdown__trigger::-webkit-details-marker { display: none; }
.dropdown__label { overflow: hidden; text-overflow: ellipsis; }
.caret { flex: none; }
.dropdown[open] > .dropdown__trigger .caret { transform: rotate(180deg); }

.menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: var(--cream);
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: 400 15px/1.2 var(--font);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.menu__item:hover { background: var(--red-soft); text-decoration: none; }
.menu__item.is-selected { font-weight: 700; }
.menu__item.is-muted { opacity: 0.7; cursor: default; }
.menu__item--check input { accent-color: var(--red); margin: 0; }

/* Heading-sized dropdown triggers (date picker in the main column) */
.dropdown--h1 .dropdown__trigger, .dropdown--h2 .dropdown__trigger {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 700; line-height: 1.3;
}
.dropdown--h1 .dropdown__trigger { font-size: 36px; }
.dropdown--h2 .dropdown__trigger { font-size: 24px; }
.dropdown--h1 .menu, .dropdown--h2 .menu { min-width: 260px; }

/* Sidebar menus hang from the control's right edge and never exceed the sidebar, which clips
   horizontal overflow (it is a scroll container). */
.sidebar .menu { left: auto; right: 0; width: max-content; max-width: calc(var(--sidebar-w) - 40px); }
.search { position: relative; }
.menu--search { min-width: 260px; }
.search__result { justify-content: space-between; gap: 12px; }
.search__result > span { white-space: normal; }
.search__result small { flex: none; opacity: 0.7; font-size: 12px; }

/* ---- Main column ---- */

.main { padding: 34px 48px 72px 60px; min-width: 0; }
#app > .dropdown { margin-bottom: 24px; }
.page-head { margin-bottom: 20px; }
.page-head__title { font-size: 36px; font-weight: 700; line-height: 1.3; }
.meta { font-size: 16px; line-height: 1.4; }
.meta a { text-decoration: underline; }
.empty { font-size: 16px; opacity: 0.8; }

/* ---- Posters ---- */

.poster {
  display: block;
  width: var(--poster-w);
  height: var(--poster-h);
  border: 2px solid var(--red);
  border-radius: var(--radius-poster);
  overflow: hidden;
  background: #fff;
  color: var(--red);
}
a.poster:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--red-line); }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster__fallback {
  display: flex; align-items: center; justify-content: center; text-align: center;
  height: 100%; padding: 16px; font-size: 18px; font-weight: 700; line-height: 1.2;
  overflow-wrap: anywhere;
}
.poster--lg { width: 354px; height: 532px; }
.poster--lg .poster__fallback { font-size: 28px; }

/* ---- Film grid (homepage, theatre page) ---- */

.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--poster-w));
  gap: 36px 32px;
}
.film-card { display: flex; flex-direction: column; min-width: 0; }
.film-card__title { margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.25; }

.venue-times { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.venue-times__name { font-size: 11px; font-weight: 400; line-height: 1.3; }
.series { opacity: 0.7; }
.series::before { content: "· "; }
.times { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.time { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time.is-past { opacity: 0.4; }
.time.is-on { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
a.time:hover { text-decoration: underline; }

/* ---- Film page ---- */

.film-page { display: grid; grid-template-columns: 354px minmax(0, 1fr); gap: 36px; align-items: start; }
.film-page__title { font-size: 36px; font-weight: 700; line-height: 1.3; }
.film-page__meta { margin-top: 20px; display: flex; flex-direction: column; gap: 2px; }
.film-page__body > .dropdown { margin-top: 36px; margin-bottom: 20px; }
.film-page__none { margin-top: 36px; font-size: 24px; font-weight: 700; }
.film-page__none + .meta, .film-page__none + .notify { margin-top: 6px; }

/* "Notify me" signup (the wireframe's red "Type Email" pill) */
.pill--red { background: var(--red); color: var(--cream); }
input.pill--red::placeholder { color: var(--cream); opacity: 0.85; } /* outranks input.pill::placeholder */
.notify__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; max-width: 420px; }
.notify__row > .pill { width: auto; min-height: 32px; }
.notify__row > input { flex: 1 1 266px; }
.notify__submit { font-weight: 700; }
.notify__submit:disabled { opacity: 0.6; cursor: wait; }
.notify__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.notify__status { margin-top: 10px; min-height: 1.4em; }
.notice { margin: 0 0 20px; padding: 10px 14px; border: 2px solid var(--red); border-radius: var(--radius-pill); font-size: 16px; }

.venue-list { display: flex; flex-direction: column; gap: 18px; }
.venue-times--lg { display: grid; grid-template-columns: 265px minmax(0, 1fr); gap: 6px 24px; margin: 0; align-items: baseline; }
.venue-times--lg .venue-times__name { font-size: 24px; line-height: 1.2; }
.time-groups { display: flex; flex-direction: column; gap: 10px; }
.time-group__format { display: block; font-size: 12px; opacity: 0.75; margin-bottom: 2px; }
.venue-times--lg .times { gap: 4px 24px; }
.venue-times--lg .time { font-size: 24px; line-height: 1.2; }

/* ---- Small screens: sidebar becomes a header ---- */

@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px 16px 20px; gap: 16px; }
  .brand { font-size: 28px; }
  .nav, .filters { padding-left: 0; }
  .nav { gap: 10px; }
  .nav__item { font-size: 20px; }
  .filter__label { font-size: 17px; }
  .row__control, .row > .pill { flex: 1 1 auto; }
  .divider { width: 100%; }
  .sidebar__note { display: none; }
  .sidebar .menu { max-width: calc(100vw - 32px); }

  .main { padding: 24px 16px 48px; }
  .dropdown--h1 .dropdown__trigger { font-size: 28px; }
  .film-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 16px; }
  .poster { width: 100%; height: auto; aspect-ratio: 2 / 3; }
  .film-page { grid-template-columns: 1fr; gap: 20px; }
  .poster--lg { width: min(100%, 300px); margin: 0 auto; }
  .film-page__title { font-size: 28px; }
  .venue-times--lg { grid-template-columns: 1fr; gap: 4px; }
  .venue-times--lg .venue-times__name { font-size: 20px; }
  .venue-times--lg .time { font-size: 20px; }
}
