/* ============================================================
   Meander - a city weekend listings product.
   Editorial print-listings language: masthead, program rows,
   hairlines, mono metadata. One accent (masthead red), locked.
   ============================================================ */

@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: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 800;
  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: #f3f3f0;
  --card: #fbfbf9;
  --ink: #1a1b1f;
  --muted: #5a5c65;
  --placeholder: #6b6d75;
  --hairline: #d9d9d3;
  --accent: #b32c17;
  --accent-soft: rgba(179, 44, 23, 0.07);
  --scrim: rgba(23, 24, 28, 0.45);
  --shadow: -16px 0 48px rgba(23, 24, 28, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141519;
    --card: #1c1d22;
    --ink: #ecebe5;
    --muted: #a0a2aa;
    --placeholder: #8f9199;
    --hairline: #2d2f36;
    --accent: #f06043;
    --accent-soft: rgba(240, 96, 67, 0.12);
    --scrim: rgba(8, 9, 12, 0.6);
    --shadow: -16px 0 48px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Literata", Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.detail-open { overflow: hidden; }

/* ---------- shared bits ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 8px; }

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

.btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.1s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.rule-top {
  height: 6px;
  background: var(--accent);
}

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

.masthead {
  border-bottom: 2px solid var(--ink);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 28px 30px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 24px 48px;
}

.masthead-left { justify-self: start; }

.kicker {
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 8vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.masthead-right {
  justify-self: end;
  text-align: right;
  max-width: 34ch;
}

.weekend-dates {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

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

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.toolbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) auto 1fr;
  align-items: end;
  gap: 16px 20px;
}

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

.control-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  font-family: "Literata", Georgia, serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--hairline);
  padding: 9px 12px;
  border-radius: 0;
  width: 100%;
}
.input:hover { border-color: var(--muted); }
.input:focus {
  border-color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.input::placeholder { color: var(--placeholder); }

.select { appearance: none; cursor: pointer; }

.saved-toggle { white-space: nowrap; }

.saved-count { font-family: "IBM Plex Mono", monospace; font-weight: 400; font-size: 13px; }

.saved-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.saved-toggle[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); }

.count {
  margin: 0;
  justify-self: end;
  align-self: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- listings ---------- */

.listings {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 40px;
}

.day { padding-top: 30px; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.day-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.day-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 8px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}

.row-time {
  display: flex;
  flex-direction: column;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  padding-top: 4px;
}
.t-start { color: var(--ink); }
.t-end { color: var(--muted); }
.t-end::before { content: "to "; }

.row-main { min-width: 0; }

.row-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 6px;
  text-align: left;
  cursor: pointer;
}
.row-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.row-title:active { transform: translateY(1px); }

.row-meta {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  white-space: nowrap;
  padding-top: 5px;
}

.cat {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.price {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--ink);
}

.saved-flag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.saved-flag::before { content: "In shortlist"; }

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

.empty {
  max-width: 46ch;
  margin: 0 auto;
  padding: 90px 0 60px;
  text-align: center;
}

.empty-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.empty-copy {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- detail panel ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--scrim);
}

.detail {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(560px, 100%);
  height: 100dvh;
  overflow-y: auto;
  background: var(--card);
  border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}

.detail:not([hidden]) { animation: panel-in 0.26s cubic-bezier(0.16, 1, 0.3, 1); }

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

.detail-media {
  position: relative;
  margin: 0;
}

.detail-media img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 13px;
  background: #fff;
  color: #1a1b1f;
  border: 1.5px solid #1a1b1f;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.detail-close:hover { background: #1a1b1f; color: #fff; }

.detail-body { padding: 26px 30px 30px; }

.detail-kicker {
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-title {
  margin: 0 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.detail-lead {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.6;
}

.facts {
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 18px 0;
}

.fact dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.fact dd {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 15.5px;
  line-height: 1.4;
}

.detail-notes-h {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.detail-notes {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.detail-footer {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--hairline);
  padding: 16px 30px;
}

.detail-footer .btn { width: 100%; }

.detail-save[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.detail-save[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); }

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

.footer {
  border-top: 2px solid var(--ink);
}

.footer p {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 28px 26px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .masthead-inner {
    grid-template-columns: 1fr;
    padding: 26px 20px 22px;
    gap: 14px;
  }
  .masthead-right { justify-self: start; text-align: left; }
  .tagline { max-width: 40ch; }

  .toolbar {
    position: static;
  }
  .toolbar-inner {
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    padding: 14px 20px 18px;
  }
  .saved-toggle { grid-column: 1; justify-self: start; }
  .count { grid-column: 2; justify-self: end; }

  .listings { padding: 0 20px 32px; }

  .row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "time side"
      "main main";
    gap: 2px 12px;
    padding: 16px 0;
  }
  .row-time {
    grid-area: time;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
  }
  .t-end::before { content: "- "; }
  .row-side { grid-area: side; flex-direction: row; align-items: baseline; gap: 10px; padding-top: 1px; }
  .row-main { grid-area: main; margin-top: 6px; }
  .row-title { font-size: 18px; }
  .saved-flag::before { content: "Shortlisted"; }

  .facts { grid-template-columns: 1fr; gap: 12px; }
  .detail-body { padding: 22px 20px 24px; }
  .detail-footer { padding: 14px 20px; }
  .detail-media img { height: 170px; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .detail:not([hidden]) { animation: none; }
  .btn, .row-title, .detail-close { transition: none; }
  .row-title:active, .btn:active { transform: none; }
}
