/* ---------------------------------------------------------------
   Now Boarding — a weekend events board styled like a departures
   board: dark ink surface, amber for the things you can act on,
   and a muted "transit line" colour per category.
   --------------------------------------------------------------- */

:root {
  --ink-0: #0f131a;
  --ink-1: #171d26;
  --ink-2: #1f2733;
  --ink-3: #29323f;
  --line: #2c3543;

  --text-0: #edf0f4;
  --text-1: #a7b2c4;
  --text-2: #8996ab;

  --amber: #e8a33d;
  --amber-strong: #c98429;
  --amber-ink: #2a1c05;

  --cat-music: #5c86c9;
  --cat-art: #b15fa0;
  --cat-film: #7a72c9;
  --cat-food: #a6862f;
  --cat-literature: #4c9a8b;
  --cat-outdoors: #5e9c4d;
  --cat-walks: #c1554f;

  --radius-s: 3px;
  --radius-m: 6px;

  --font-display: "SFMono-Regular", "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
  --font-body: Helvetica, Arial, "Helvetica Neue", sans-serif;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: no-preference) {
  .row {
    animation: flap-in 420ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
}

@keyframes flap-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

button {
  font-family: inherit;
}

/* ---------------- Header ---------------- */

.board-header {
  background: var(--ink-1);
  border-bottom: 1px solid var(--line);
  padding: 28px clamp(20px, 4vw, 56px) 22px;
}

.board-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.01em;
  color: var(--text-0);
}

.board-header__tagline {
  margin: 0;
  max-width: 46ch;
  color: var(--text-1);
  font-size: 15px;
}

.board-header__dates {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.board-header__sep {
  color: var(--text-2);
}

.board-header__month {
  color: var(--text-1);
  font-weight: 400;
}

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

.controls {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 56px) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.controls__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controls__group--search {
  flex: 1 1 260px;
  min-width: 200px;
}

.controls__label {
  font-size: 12.5px;
  color: var(--text-1);
}

.controls__input,
.controls__select {
  background: var(--ink-1);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}

.controls__input {
  width: 100%;
}

.controls__input::placeholder {
  color: var(--text-2);
}

.controls__select {
  min-width: 170px;
}

.controls__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  color: var(--text-1);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  height: 41px;
}

.controls__toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-2);
  transition: background 120ms ease;
}

.controls__toggle[aria-pressed="true"] {
  background: var(--amber-ink);
  border-color: var(--amber-strong);
  color: var(--amber);
}

.controls__toggle[aria-pressed="true"] .controls__toggle-dot {
  background: var(--amber);
}

.controls__toggle-count {
  font-family: var(--font-display);
  color: inherit;
  opacity: 0.8;
}

.controls__toggle:hover {
  border-color: var(--text-2);
}

/* ---------------- Board ---------------- */

.board-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 56px) 64px;
}

.board__head {
  display: grid;
  grid-template-columns: 118px minmax(0, 2.2fr) 150px 1fr 84px 40px;
  gap: 14px;
  padding: 0 18px 8px;
  color: var(--text-2);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.board__head-cell--price {
  text-align: right;
}

.row {
  display: grid;
  grid-template-columns: 118px minmax(0, 2.2fr) 150px 1fr 84px 40px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.row__open {
  all: unset;
  display: grid;
  grid-template-columns: 118px minmax(0, 2.2fr) 150px 1fr 84px 40px;
  grid-column: 1 / -1;
  align-items: center;
  width: 100%;
  padding: 16px 18px;
  cursor: pointer;
  color: inherit;
  border-radius: var(--radius-s);
}

.row__open:hover {
  background: var(--ink-1);
}

.row__open:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}

.row__time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-0);
  white-space: nowrap;
}

.row__event {
  min-width: 0;
}

.row__title {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__day {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.row__category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-1);
  white-space: nowrap;
}

.row__category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.row__where {
  font-size: 14px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__where-hood {
  color: var(--text-2);
}

.row__price {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-0);
  text-align: right;
}

.row__chevron {
  color: var(--text-2);
  justify-self: end;
}

.row__saved-mark {
  color: var(--amber);
}

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

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-1);
}

.empty-state__title {
  font-size: 18px;
  color: var(--text-0);
  margin: 0 0 6px;
  font-weight: 700;
}

.empty-state__body {
  margin: 0 0 18px;
  font-size: 15px;
}

.empty-state__reset {
  background: var(--amber);
  color: var(--amber-ink);
  border: none;
  border-radius: var(--radius-s);
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.empty-state__reset:hover {
  background: var(--amber-strong);
}

/* ---------------- Detail dialog ---------------- */

.detail {
  border: none;
  padding: 0;
  margin: 0;
  position: fixed;
  inset: 0 0 0 auto;
  height: 100%;
  width: min(440px, 100vw);
  max-width: 100vw;
  max-height: 100vh;
  background: var(--ink-1);
  color: var(--text-0);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
}

.detail::backdrop {
  background: rgba(6, 8, 12, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  .detail[open] {
    animation: slide-in 260ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.detail__close {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-1);
  font-size: 14px;
  padding: 20px clamp(20px, 4vw, 32px) 0;
}

.detail__close:hover {
  color: var(--text-0);
}

.detail__content {
  padding: 12px clamp(20px, 4vw, 32px) 40px;
}

.detail__time {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--amber);
  margin: 8px 0 2px;
}

.detail__date {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 14px;
}

.detail__title {
  margin: 0 0 20px;
  font-size: 24px;
  line-height: 1.25;
  color: var(--text-0);
}

.detail__perforation {
  height: 0;
  border-top: 2px dashed var(--line);
  position: relative;
  margin: 0 -32px 20px;
}

.detail__perforation::before,
.detail__perforation::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink-0);
}

.detail__perforation::before {
  left: -10px;
}

.detail__perforation::after {
  right: -10px;
}

.detail__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0 0 24px;
  font-size: 14.5px;
}

.detail__meta dt {
  color: var(--text-2);
}

.detail__meta dd {
  margin: 0;
  color: var(--text-0);
}

.detail__body {
  white-space: pre-line;
  color: var(--text-1);
  font-size: 15px;
  margin: 0 0 24px;
}

.detail__access {
  background: var(--ink-2);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin: 0 0 28px;
}

.detail__access h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-1);
  font-weight: 700;
}

.detail__access p {
  margin: 0;
  font-size: 14px;
  color: var(--text-0);
}

.detail__save {
  width: 100%;
  border: 1px solid var(--amber);
  background: transparent;
  color: var(--amber);
  border-radius: var(--radius-s);
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.detail__save:hover {
  background: var(--amber-ink);
}

.detail__save[aria-pressed="true"] {
  background: var(--amber);
  color: var(--amber-ink);
}

/* ---------------- Responsive: mobile ---------------- */

@media (max-width: 720px) {
  .board-header__inner {
    align-items: flex-start;
  }

  .board-header__dates {
    font-size: 13px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls__select,
  .controls__toggle {
    width: 100%;
  }

  .board__head {
    display: none;
  }

  .row,
  .row__open {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "event"
      "meta";
  }

  .row__open {
    row-gap: 6px;
    padding: 14px 14px;
  }

  .row__time {
    grid-area: time;
    font-size: 13px;
    color: var(--text-1);
  }

  .row__event {
    grid-area: event;
  }

  .row__title {
    white-space: normal;
  }

  .row__category,
  .row__where,
  .row__price,
  .row__chevron {
    display: none;
  }

  .row__meta-mobile {
    display: flex !important;
    grid-area: meta;
    gap: 0;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-1);
  }

  .row__meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-left: 1px solid var(--line);
  }

  .row__meta-chip:first-child {
    padding-left: 0;
    border-left: none;
  }

  .detail {
    width: 100vw;
  }
}

.row__meta-mobile {
  display: none;
  align-items: center;
}
