/* Two Days — weekend programme
   World: the printed programme sheet. Condensed display, mono data,
   warm newsprint, seven functional category colors. */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f4f1e9;
  --paper-deep: #ece8dc;
  --ink: #211e17;
  --ink-2: #6e6754;
  --line: #d9d2bf;
  --line-strong: #211e17;

  --c-art: #c24322;
  --c-film: #3a4fa6;
  --c-food: #8a6410;
  --c-lit: #6e3e8e;
  --c-music: #176875;
  --c-out: #3f6f2b;
  --c-walks: #a83a62;

  --display: "Oswald", "Arial Narrow", sans-serif;
  --sans: "Work Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad-x: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.icon { width: 18px; height: 18px; flex: none; display: block; }

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Masthead ---------- */

.masthead { border-bottom: 2px solid var(--line-strong); }
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 44px) var(--pad-x) clamp(20px, 2.6vw, 34px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(52px, 7.2vw, 92px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.masthead-sub {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.masthead-dates { text-align: right; flex: none; }
.dates-line {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.dates-note {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.colorstrip {
  display: flex;
  height: 7px;
}
.colorstrip span { flex: 1 1 0; }

/* ---------- Controls ---------- */

.controls-wrap { border-bottom: 1px solid var(--line-strong); }
.controls {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px var(--pad-x);
  display: flex;
  align-items: flex-end;
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field-search { flex: 1 1 380px; max-width: 480px; }
.search-box { position: relative; display: block; }
.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-2);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  font: inherit;
  color: var(--ink);
  background: #fbf9f2;
  border: 1px solid var(--line-strong);
  border-radius: 0;
}
.search-box input::placeholder { color: #8d8672; opacity: 1; }
.search-box input:focus-visible { outline-offset: 0; }

.select-box { position: relative; display: block; min-width: 190px; }
.select-box select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 40px 0 14px;
  font: inherit;
  color: var(--ink);
  background: #fbf9f2;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  cursor: pointer;
}
.select-box select:focus-visible { outline-offset: 0; }
.select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  color: var(--ink);
}

.saved-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 16px;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.saved-toggle .bm-fill { display: none; }
.saved-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.saved-toggle[aria-pressed="true"] .bm-outline { display: none; }
.saved-toggle[aria-pressed="true"] .bm-fill { display: block; }
.saved-toggle-label { font-weight: 600; font-size: 14.5px; }
.saved-count {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  min-width: 26px;
  text-align: center;
}

/* Category chips */
.chips {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad-x) 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background 160ms var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip .n { color: #8d8672; }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip[aria-pressed="true"] .n { color: #b8b19d; }
.chip[aria-pressed="true"]:focus-visible { outline-color: var(--paper); }
.saved-toggle[aria-pressed="true"]:focus-visible,
.btn-solid:focus-visible,
.save-btn:focus-visible,
.detail-close:focus-visible { outline-color: var(--paper); }

/* ---------- Board (the timetable) ---------- */

.board {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 30px) var(--pad-x) 40px;
}
.result-line {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: right;
}
.days {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(32px, 4vw, 64px);
}
.day + .day { border-left: 1px solid var(--line); padding-left: clamp(32px, 4vw, 64px); }

.day-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 6px;
  padding: 14px 0 10px;
  background: var(--paper);
  border-bottom: 2px solid var(--line-strong);
}
.day-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.day-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.day-list { list-style: none; margin: 0; padding: 0; }
.day-empty {
  padding: 22px 0 30px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

/* Event rows */
.ev { border-bottom: 1px solid var(--line); }
.ev-btn {
  display: grid;
  width: 100%;
  grid-template-columns: 58px 1fr auto auto;
  grid-template-areas: "time main tag price";
  gap: 4px 16px;
  align-items: baseline;
  text-align: left;
  padding: 17px 10px 17px 0;
  background: transparent;
  border: 0;
  transition: background 180ms var(--ease);
}
.ev-btn:hover { background: var(--paper-deep); }
.ev-btn:focus-visible { outline-offset: -2px; }

.ev-time {
  grid-area: time;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  padding-top: 2px;
}
.ev-time::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cat);
  margin-right: 9px;
  vertical-align: 1px;
}
.ev-main { grid-area: main; display: block; min-width: 0; }
.ev-title {
  display: block;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.28;
  text-wrap: balance;
}
.ev-btn:hover .ev-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.ev-saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cat);
  font-weight: 700;
}
.ev-saved::before {
  content: "";
  width: 8px; height: 10px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}
.ev-tag {
  grid-area: tag;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 11%, var(--paper));
  padding: 4px 9px;
  align-self: center;
  white-space: nowrap;
}
.ev-price {
  grid-area: price;
  font-family: var(--mono);
  font-size: 13px;
  align-self: center;
  white-space: nowrap;
}

/* Entrance motion: one authored moment, on first paint only */
@media (prefers-reduced-motion: no-preference) {
  .ev-btn.enter { opacity: 0; translate: 0 10px; animation: rise 520ms var(--ease) forwards; animation-delay: var(--d, 0ms); }
  .day-head.enter { opacity: 0; animation: fade 480ms var(--ease) forwards; }
  @keyframes rise { to { opacity: 1; translate: 0 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* ---------- Empty state ---------- */

.empty {
  padding: clamp(48px, 8vw, 96px) 0;
  text-align: center;
}
.empty-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 46px);
  text-transform: uppercase;
  line-height: 1;
}
.empty-body {
  max-width: 44ch;
  margin: 14px auto 24px;
  color: var(--ink-2);
}
.btn-solid {
  height: 46px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-weight: 600;
  transition: background 160ms var(--ease);
}
.btn-solid:hover { background: #3a362b; }

/* ---------- Detail sheet ---------- */

.detail {
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  position: fixed;
  inset: 0;
  width: min(500px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: none;
  max-width: none;
  margin: 0 0 0 auto;
  box-shadow: -24px 0 60px rgba(24, 21, 14, 0.28);
}
.detail::backdrop { background: rgba(24, 21, 14, 0.45); }
@media (prefers-reduced-motion: no-preference) {
  .detail[open] { animation: sheet-in 340ms var(--ease); }
  .detail[open]::backdrop { animation: backdrop-in 340ms var(--ease); }
  @keyframes sheet-in { from { translate: 40px 0; opacity: 0.4; } }
  @keyframes backdrop-in { from { opacity: 0; } }
}
.detail-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-photo {
  position: relative;
  margin: 0;
  height: clamp(170px, 24vh, 220px);
  flex: none;
  overflow: hidden;
  background: var(--paper-deep);
}
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat, var(--ink));
  opacity: 0.22;
  mix-blend-mode: color;
  pointer-events: none;
}
.photo-tag {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4f1e9;
  background: rgba(24, 21, 14, 0.62);
  padding: 4px 8px;
}
.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 50%;
  transition: rotate 200ms var(--ease), background 160ms var(--ease);
}
.detail-close:hover { rotate: 90deg; background: #3a362b; }
.detail-close .icon { width: 20px; height: 20px; }

.detail-body { padding: 24px 28px 8px; }
.detail-chip {
  display: inline-block;
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cat, var(--ink));
  background: color-mix(in srgb, var(--cat, var(--ink)) 11%, var(--paper));
  padding: 5px 10px;
}
.detail-title {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.04;
  text-transform: uppercase;
  text-wrap: balance;
}
.detail-facts {
  margin: 0 0 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 22px;
  row-gap: 9px;
}
.detail-facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 3px;
}
.detail-facts dd { margin: 0; font-weight: 500; font-size: 15px; }
.detail-facts .fact-time { font-family: var(--mono); font-size: 13.5px; }

.detail-text p { margin: 0 0 14px; max-width: 62ch; }
.detail-text p:first-child { font-size: 18px; line-height: 1.55; font-weight: 500; }

.detail-access {
  margin: 22px 0 24px;
  padding: 16px 18px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}
.access-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.detail-access p { margin: 0; font-size: 14.5px; color: #4c473a; }

.detail-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 28px calc(16px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line-strong);
}
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.save-btn .bm-fill { display: none; }
.save-btn:hover { background: #3a362b; }
.save-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
}
.save-btn[aria-pressed="true"] .bm-outline { display: none; }
.save-btn[aria-pressed="true"] .bm-fill { display: block; }
.save-btn[aria-pressed="true"]:hover { background: var(--paper-deep); }

/* ---------- Colophon ---------- */

.colophon {
  border-top: 1px solid var(--line-strong);
  padding: 18px var(--pad-x) 26px;
}
.colophon p {
  max-width: 1240px;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .masthead-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .masthead-dates { text-align: left; }
  .controls { flex-wrap: wrap; gap: 14px; }
  .field-search { flex: 1 1 100%; max-width: none; }
  .field-cat { flex: 1 1 auto; }
  .select-box { min-width: 0; width: 100%; }
  .saved-toggle { margin-left: 0; }
  .result-line { text-align: left; }
  .days { grid-template-columns: 1fr; }
  .day + .day { border-left: 0; padding-left: 0; border-top: 2px solid var(--line-strong); margin-top: 26px; }
  .ev-btn {
    grid-template-columns: 54px 1fr auto;
    grid-template-areas:
      "time main price"
      "time tag tag";
    align-items: start;
    padding: 15px 6px 15px 0;
  }
  .ev-tag { justify-self: start; margin-top: 2px; }
  .ev-title { font-size: 16.5px; }
}

@media (max-width: 560px) {
  .detail { width: 100vw; border: 0; }
  .detail-body { padding: 20px 20px 8px; }
  .detail-foot { padding-left: 20px; padding-right: 20px; }
}
