*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  color: #1c1a17;
  background: #f7f5f1;
  line-height: 1.5;
  margin: 0;
}

a { color: #1c1a17; text-decoration-color: #b8b2a8; }
a:visited { color: #6c6760; }
a:hover { color: #b51800; text-decoration-color: #b51800; }

.wrap { max-width: 760px; margin: 0 auto; padding: 8px 16px; }

/* header */
#hd { background: #1c1a17; }
#hd .wrap { display: flex; align-items: baseline; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
#hd h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
#hd h1 a { color: #f7f5f1; text-decoration: none; font-family: "Syne", system-ui, sans-serif; }
#hd small { color: #8a8479; font-size: 13px; font-style: italic; }

/* filters */
#filters { padding: 6px 0 8px; border-bottom: 1px solid #d8d4ca; font-size: 13px; }
.frow { margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.frow:first-child { margin-top: 0; }

#filters input[type="search"] {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #d8d4ca;
  padding: 4px 8px;
  width: 100%;
  background: #f7f5f1;
  color: #1c1a17;
}
#filters input[type="search"]:focus { outline: 1px solid #1c1a17; border-color: #1c1a17; }

/* filter text-link buttons */
#quick button, #scenes button, #areas button {
  font-family: inherit;
  font-size: 13px;
  background: none;
  border: none;
  padding: 1px 3px;
  color: #1c1a17;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #b8b2a8;
  line-height: 1.4;
}
#quick button:hover, #scenes button:hover, #areas button:hover { color: #b51800; text-decoration-color: #b51800; }
#quick button.on, #scenes button.on, #areas button.on {
  color: #1c1a17;
  text-decoration: none;
  font-weight: 700;
}
#quick button:focus-visible, #scenes button:focus-visible, #areas button:focus-visible {
  outline: 1px solid #1c1a17;
  outline-offset: 1px;
}

/* free checkbox label */
#filters label { color: #6c6760; margin-left: 6px; white-space: nowrap; cursor: pointer; }
#filters label input[type="checkbox"] { margin-right: 3px; }

/* date picker trigger + range */
#date-trigger {
  font-family: inherit; font-size: 13px; background: none; border: none;
  padding: 1px 3px; color: #1c1a17; text-decoration: underline; text-decoration-color: #b8b2a8;
  cursor: pointer; margin-left: 2px; line-height: 1.4;
}
#date-trigger.hidden { display: none; }
#date-range { display: none; align-items: center; gap: 4px; margin-left: 2px; }
#date-range.open { display: inline-flex; }
#date-sep { color: #6c6760; display: none; }
#date-range.has-from #date-sep,
#date-range.has-from #f-date-to { display: inline-block; }
#f-date-to { display: none; }
#f-date-from, #f-date-to {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #d8d4ca;
  padding: 2px 6px;
  color: #6c6760;
  background: #f7f5f1;
}

/* mobile filter toggle — hidden on desktop */
#filter-toggle { display: none; }

/* info line */
#info { color: #6c6760; font-size: 12px; padding: 6px 0 2px; font-style: italic; }

/* event list */
#events { list-style: none; padding: 0; margin: 0; }
#events li:not(.date-header):not(.msg) { padding: 4px 0; }
#events li:not(.date-header):not(.msg) + li:not(.date-header) { border-top: 1px solid #e8e4de; }

/* date group headers */
.date-header { padding: 12px 0 2px; font-size: 13px; font-weight: 700; color: #1c1a17; }
.date-header + li:not(.date-header) { border-top: none; }
#events li:first-child.date-header { padding-top: 6px; }

.ev-date { color: #6c6760; font-size: 12px; font-variant-numeric: tabular-nums; }
.ev-title { font-size: 15px; font-weight: 400; text-decoration: underline; text-decoration-color: #b8b2a8; color: #1c1a17; overflow-wrap: break-word; }
.ev-title:visited { color: #6c6760; }
.ev-title:hover { color: #b51800; text-decoration-color: #b51800; }
.ev-venue { color: #6c6760; font-size: 13px; font-style: italic; overflow-wrap: break-word; }
.ev-venue-link { color: #6c6760; text-decoration: none; }
.ev-venue-link:hover { color: #b51800; text-decoration: underline; }
.ev-free { color: #1a6b3c; font-size: 12px; font-weight: 700; font-style: normal; }


/* film view */
.film-item { padding: 6px 0; }
.film-item + .film-item { border-top: 1px solid #e8e4de; }
.film-desc { color: #6c6760; font-size: 13px; font-style: italic; margin: 2px 0; }
.film-times { margin-top: 3px; }
.film-showtime { display: inline-block; font-size: 12px; color: #6c6760; margin-right: 14px; margin-bottom: 2px; }
.film-showtime::before { content: "\25b8 "; color: #d8d4ca; }

/* pagination */
#pag { padding: 10px 0; font-size: 13px; }
#pag a { margin-right: 14px; }

/* detail page */
#detail { padding: 12px 0; }
#detail h1 { font-size: 22px; margin: 0 0 6px; font-weight: 700; }
#detail .meta { color: #6c6760; font-size: 14px; margin-bottom: 10px; font-style: italic; }
#detail .desc { margin: 12px 0; max-width: 580px; line-height: 1.75; }
#detail dt { color: #6c6760; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; }
#detail dd { margin: 2px 0 0 0; }
#detail .back { font-size: 13px; margin-bottom: 12px; display: block; }
#detail .ts { color: #6c6760; font-size: 11px; margin-top: 20px; font-style: italic; }
#detail .price-free { color: #1a6b3c; font-weight: 700; }
#detail .actions { margin-top: 14px; font-size: 13px; }

/* footer */
#ft { margin-top: 16px; padding: 8px 0; border-top: 1px solid #d8d4ca; font-size: 12px; color: #6c6760; }
#ft strong { color: #1c1a17; }
#ft a { color: #6c6760; }
#ft a:hover { color: #b51800; }

/* empty / loading */
.msg { color: #6c6760; padding: 24px 0; text-align: center; font-style: italic; }
.msg a { font-style: normal; }

/* mobile */
@media (max-width: 600px) {
  .wrap { padding: 4px 12px; }

  /* header */
  #hd .wrap { padding-top: 8px; padding-bottom: 8px; }
  #hd h1 { font-size: 22px; }
  #hd small { font-size: 12px; }

  /* filters */
  #filters { padding: 2px 0 6px; }
  .frow { margin-top: 2px; gap: 2px; }
  .frow:first-child { margin-top: 0; }

  /* search + toggle on the same row */
  #filters input[type="search"] {
    flex: 1; width: auto; min-width: 0;
    font-size: 16px; padding: 7px 8px; min-height: 44px;
  }
  #filter-toggle {
    display: inline-flex; align-items: center; flex-shrink: 0;
    font-family: inherit; font-size: 13px; background: none;
    border: none; padding: 0 2px 0 8px; min-height: 44px;
    cursor: pointer; color: #1c1a17; text-decoration: underline;
    text-decoration-color: #b8b2a8;
  }
  #filter-toggle.has-active { font-weight: 700; color: #1c1a17; text-decoration: none; }
  #filter-more { display: none; }
  #filter-more.open { display: block; }

  /* pill rows: horizontally scrollable with fade hint */
  #quick button, #scenes button, #areas button {
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 5px; font-size: 13px;
  }
  #quick, #scenes, #areas {
    display: block; width: 100%;
    white-space: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }
  #quick::-webkit-scrollbar, #scenes::-webkit-scrollbar, #areas::-webkit-scrollbar { display: none; }

  /* free checkbox */
  #filters label {
    min-height: 40px; display: inline-flex; align-items: center;
    gap: 6px; font-size: 13px; margin-left: 0;
  }
  #filters label input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }

  /* hide date picker on mobile — quick buttons are enough */
  #date-trigger, #date-range { display: none !important; }

  /* info line */
  #info { padding: 4px 0 0; }

  /* event rows */
  #events li:not(.date-header):not(.msg) { padding: 5px 0; }
  .ev-date { display: block; margin-bottom: 1px; font-size: 11px; }
  .ev-title { font-size: 15px; }
  .ev-sep { display: none; }
  .ev-venue { display: block; margin-top: 1px; }

  /* detail page */
  #detail h1 { font-size: 18px; }
  #detail .desc { font-size: 15px; }
}

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -100%; left: 0;
  padding: 8px 16px; background: #1c1a17; color: #f7f5f1;
  font-size: 14px; z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* submit form */
#submit-form { margin: 16px 0; }
#submit-form input[type="url"] {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #d8d4ca;
  padding: 6px 8px;
  width: 100%;
  background: #f7f5f1;
  color: #1c1a17;
}
#submit-form input[type="url"]:focus { outline: 1px solid #1c1a17; border-color: #1c1a17; }
#submit-form .submit-row { margin-top: 8px; }
#submit-form button[type="submit"] {
  font-family: inherit;
  font-size: 13px;
  background: none;
  border: none;
  padding: 1px 0;
  color: #1c1a17;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #b8b2a8;
}
#submit-form button[type="submit"]:hover { color: #b51800; text-decoration-color: #b51800; }
#submit-result { margin-top: 16px; font-size: 13px; color: #6c6760; }

#ug-bridge { border: 1px solid #ddd; padding: 8px 10px; margin: 10px 0; font-size: 14px; }
#ug-bridge .ug-head { font-weight: bold; margin-bottom: 4px; }
#ug-bridge ul { list-style: none; margin: 0; padding: 0; }
#ug-bridge li { padding: 1px 0; }
