/* ==========================================================================
   Weekender, a weekend listings guide
   Print-inspired: bone paper, near-black ink, one vermilion accent.
   Theme lock: light. Radius system: sharp (0) everywhere.
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/space-grotesk.ttf') format('truetype');
  font-weight: 300 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;
  font-display: swap;
}

:root {
  --paper: #F4F3EE;
  --panel: #FFFEF8;
  --ink: #1B1B17;
  --muted: #57564F;
  --hairline: #D9D7CC;
  --accent: #BC341A;
  --accent-deep: #942910;
  --display: 'Space Grotesk', 'Work Sans', sans-serif;
  --body: 'Work Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.ic { display: inline-block; flex: none; }

.skip-link {
  position: fixed; top: -100px; left: 8px; z-index: 100;
  background: var(--ink); color: var(--paper);
  font: 600 14px var(--display); padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------- masthead ---------- */

.masthead { padding: clamp(28px, 5vh, 52px) 0 20px; }
.mast-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px 28px; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 9vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.mast-facts { text-align: right; padding-bottom: 10px; }
.mast-days { font: 600 clamp(17px, 2vw, 21px)/1.2 var(--display); }
.mast-dates { font: 400 13px/1.4 var(--mono); color: var(--muted); margin-top: 5px; }
.mast-note { font: 400 14px/1.5 var(--body); color: var(--muted); margin-top: 10px; max-width: 32ch; margin-left: auto; }

.rules {
  margin-top: 22px; height: 6px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 0;
}
.toolbar-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 190px auto 1fr;
  gap: 14px 18px;
  align-items: end;
}
.field label {
  display: block;
  font: 400 12px/1 var(--mono);
  color: var(--muted);
  margin-bottom: 7px;
}
input[type="search"],
select {
  width: 100%;
  min-height: 42px;
  font: 400 15px var(--body);
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 9px 12px;
  appearance: none;
  -webkit-appearance: none;
}
input[type="search"]::placeholder { color: #6E6C64; }
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231B1B17' stroke-width='1.75'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.count {
  justify-self: end;
  font: 400 12.5px/1 var(--mono);
  color: var(--muted);
  padding-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font: 600 14px/1 var(--display);
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 11px 18px;
  min-height: 42px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-accent[aria-pressed="true"] { background: var(--panel); color: var(--accent); }

.saved-toggle { justify-content: flex-start; }
.saved-toggle .count-pill {
  font: 400 12px/1 var(--mono);
  border: 1px solid currentColor;
  padding: 2px 7px 3px;
  margin-left: 2px;
}
.saved-toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.saved-toggle[aria-pressed="true"]:hover { background: var(--ink); color: var(--paper); }

/* ---------- day groups and rows ---------- */

.day { margin-top: 46px; }
.day:first-child { margin-top: 30px; }
.day-head {
  display: flex; align-items: baseline; gap: 14px;
  border-top: 2px solid var(--ink);
  padding-top: 13px;
}
.day-head h2 { font: 600 21px/1.1 var(--display); letter-spacing: -0.01em; }
.day-count { font: 400 12.5px/1 var(--mono); color: var(--muted); }

.row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 6px 24px;
  padding: 21px 8px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.row:hover, .row:focus-within { background: var(--panel); }

.row-time { font: 400 13px/1.5 var(--mono); color: var(--muted); padding-top: 5px; }
.row-title { font: 600 20px/1.25 var(--display); letter-spacing: -0.01em; }
.row:hover .row-title, .row:focus-within .row-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.row-summary { margin-top: 7px; max-width: 62ch; font-size: 15px; color: var(--muted); }
.row-meta {
  margin-top: 11px;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font: 400 12.5px/1.6 var(--mono);
  color: var(--muted);
}
.row-meta .price { color: var(--ink); }

.row-side {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px; padding-top: 2px;
}
.tag {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--hairline);
  background: var(--paper);
  padding: 6px 9px;
}
.saved-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 400 12px/1 var(--mono);
  color: var(--accent);
}
.row-side .btn { margin-top: auto; }

/* ---------- empty state ---------- */

.empty {
  margin-top: 44px;
  padding: 72px 24px;
  text-align: center;
  border: 1.5px dashed var(--hairline);
}
.empty h2 { font: 600 24px/1.15 var(--display); }
.empty p { color: var(--muted); max-width: 46ch; margin: 12px auto 24px; }

/* ---------- detail dialog ---------- */

dialog.detail {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  margin: auto;
  background: var(--panel);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: clamp(20px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(27, 27, 23, 0.25);
}
dialog.detail::backdrop { background: rgba(27, 27, 23, 0.5); }

.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-kicker {
  font: 400 12px/1.6 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 7px;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: none; border: 1.5px solid transparent;
  border-radius: 0; cursor: pointer; color: var(--ink);
  transition: background-color 0.16s ease, color 0.16s ease;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); }

.detail-title {
  font: 700 clamp(26px, 4.5vw, 36px)/1.1 var(--display);
  letter-spacing: -0.02em;
  margin-top: 14px;
}
.detail-lede { margin-top: 14px; font-size: 16.5px; line-height: 1.6; max-width: 60ch; }
.detail-access {
  margin-top: 18px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  padding: 15px 18px;
  max-width: 60ch;
}
.detail-access h3 { font: 600 13px/1 var(--display); margin-bottom: 7px; }
.detail-access p { font-size: 15px; color: var(--muted); }

.detail-grid {
  margin-top: 28px;
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 24px;
}
.detail-grid dt {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.detail-grid dd { font: 500 15px/1.35 var(--display); }

.detail-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- footer ---------- */

.footer {
  margin: 68px auto 40px;
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  font: 400 12.5px/1.6 var(--mono);
  color: var(--muted);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  dialog.detail[open] { animation: detail-in 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes detail-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- mobile ---------- */

@media (max-width: 700px) {
  .mast-row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .mast-facts { text-align: left; padding-bottom: 0; }
  .mast-note { margin-left: 0; }

  .toolbar-row { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .field-cat { grid-column: 1; }
  .saved-toggle { grid-column: 2; justify-self: stretch; }
  .count { grid-column: 1 / -1; justify-self: start; padding-bottom: 0; }

  .day { margin-top: 36px; }
  .row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 18px 2px;
  }
  .row-time { padding-top: 0; font-size: 12px; }
  .row-title { font-size: 18px; }
  .row-side {
    flex-direction: row; align-items: center; justify-content: flex-start;
    flex-wrap: wrap; gap: 10px;
    padding-top: 0;
  }
  .row-side .btn { margin-top: 0; margin-left: auto; }

  .detail-grid { grid-template-columns: repeat(2, 1fr); }

  .footer { flex-direction: column; gap: 4px; }
}
