/* Film Festivals AU: deliberately minimal. Native controls, system colours
   (light and dark follow the browser), no decoration. Add to it as needed. */

:root {
  color-scheme: light dark;
  --line: color-mix(in srgb, CanvasText 20%, Canvas);
  --muted: color-mix(in srgb, CanvasText 68%, Canvas);
  --open: light-dark(#116329, #4ac26b);
  --warn: light-dark(#8a4b00, #e3a33b);
}

* { box-sizing: border-box; }

body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: Canvas;
  color: CanvasText;
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 2rem; margin: 24px 0 8px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
h3 { font-size: 1.1rem; margin: 0; }
img { max-width: 100%; height: auto; }
pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; }

.muted, .meta, .hint, .note, .kicker, .lede { color: var(--muted); }
.lede { max-width: 70ch; margin-top: 0; }
.kicker { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header & footer */
header.site {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 8px 24px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
header.site nav { display: flex; gap: 16px; }
.brand { font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
footer.site { margin-top: 48px; padding: 16px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

/* Submission calendar: native scrolling, shared month axis and plain whiskers. */
#submission-calendar { margin-bottom: 24px; }
#submission-calendar[aria-busy="true"] { opacity: 0.6; }
.calendar-key { font-size: 0.85rem; margin: 8px 0; }
.calendar-key span { display: inline-block; margin-right: 16px; }
.calendar-export { margin: 12px 0; }
#calendar-export-options { max-width: 70ch; border: 1px solid var(--line); padding: 0 12px; margin-top: 8px; }
.calendar-export button { cursor: pointer; }
.calendar-scroll { overflow: auto; max-height: 390px; border: 1px solid var(--line); }
.calendar-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; min-width: 1120px; font-size: 0.85rem; }
.calendar-table th, .calendar-table td { padding: 3px 8px; border-bottom: 1px solid var(--line); }
.calendar-table th { text-align: left; font-weight: 400; }
.calendar-table th:first-child { position: sticky; left: 0; width: 200px; background: Canvas; z-index: 1; }
.calendar-table thead th { position: sticky; top: 0; background: Canvas; z-index: 2; }
.calendar-table thead th:first-child { z-index: 3; }
.calendar-table tbody th { overflow-wrap: anywhere; }
.calendar-table tbody tr:hover { background: color-mix(in srgb, CanvasText 4%, Canvas); }
.calendar-axis, .calendar-track { display: block; width: 100%; height: 28px; overflow: visible; }
.calendar-axis text, .calendar-unknown { fill: var(--muted); font: 12px system-ui, sans-serif; }
.calendar-grid { stroke: var(--line); }
.calendar-today { stroke: var(--warn); stroke-width: 1.5; }
.calendar-window, .calendar-cap { stroke: CanvasText; stroke-width: 2; }
.calendar-gap { stroke: var(--muted); stroke-dasharray: 2 4; }
.calendar-event { fill: CanvasText; }
.calendar-estimate { fill: Canvas; stroke: CanvasText; stroke-dasharray: 3 2; }
.calendar-track line, .calendar-track rect { vector-effect: non-scaling-stroke; }
@media (max-width: 600px) {
  .calendar-table th:first-child { width: 140px; }
}

/* Filters */
fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
fieldset label { display: inline-block; margin: 0 14px 4px 0; }
.panel fieldset label { display: block; margin: 0 0 2px; }
input, select, button { font: inherit; }
input[type="search"], input[type="number"], select { padding: 6px 8px; }
input[type="number"] { width: 6em; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 8px 0 16px; }
.search { flex: 1 1 280px; }
.search input { width: 100%; }
.panel { border: 1px solid var(--line); padding: 8px 12px; }
.panel summary { cursor: pointer; font-weight: 700; }
.panel[open] summary { margin-bottom: 8px; }
.js .panel-actions button { display: none; }

.layout { display: grid; gap: 24px; }
@media (min-width: 960px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
}
#results[aria-busy="true"] { opacity: 0.6; }
.results-head { margin-top: 0; }

/* Cards */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card { height: 100%; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); padding: 12px; }
.card p, .card dl, .card ul { margin: 0; }

.thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 1200 / 630; overflow: hidden;
  border: 1px solid var(--line); color: var(--muted); font-weight: 700; text-align: center; text-decoration: none;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: Canvas; }
.thumb.logo img, .hero.logo img { object-fit: contain; padding: clamp(16px, 4vw, 48px); }
.thumb.logo-light img, .hero.logo-light img { background: #fff; }
.thumb.logo-dark img, .hero.logo-dark img { background: #26312d; }
.image-credit { color: var(--muted); font-size: 0.75rem; }

.status { font-weight: 700; }
.status-open { color: var(--open); }
.status-warn { color: var(--warn); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.9rem; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card .actions { margin-top: auto; padding-top: 4px; }
.btn { display: inline-block; padding: 6px 12px; border: 1px solid currentColor; text-decoration: none; }
.btn-primary { font-weight: 700; }

/* Detail page */
.crumbs { margin-top: 16px; color: var(--muted); }
.hero { margin: 16px 0 12px; }
.hero img { display: block; width: 100%; max-height: 440px; object-fit: contain; border: 1px solid var(--line); }
.hero figcaption { font-size: 0.85rem; color: var(--muted); }
.detail h1 { margin-top: 4px; }
.detail-cols { display: grid; gap: 0 32px; }
@media (min-width: 900px) {
  .detail-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
.sources { overflow-wrap: anywhere; }

/* Agent brief */
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); padding: 12px; }


/* Landing pages and the browse links */
.intro { max-width: 70ch; }
.intro p:first-child { margin-top: 0; }
.faq { max-width: 70ch; }
.faq h3 { margin-top: 16px; }
.faq p { margin: 4px 0 0; }
.browse { margin-top: 40px; border-top: 1px solid var(--line); }
.browse-groups { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.browse-groups h3 { font-size: 0.95rem; margin: 16px 0 4px; }
.browse-groups ul { list-style: none; margin: 0; padding: 0; }
.browse-groups li { margin: 2px 0; }
.browse [aria-current="page"] { font-weight: 700; }
