/* ============================================================
   Fortyeight — a weekend guide
   Editorial print-zine identity: warm paper, deep ink, vermilion.
   ============================================================ */

/* ---------- Fonts (local only) ---------- */
@font-face {
  font-family: 'DM Serif Display';
  src: url('assets/dm-serif.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('assets/work-sans.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #faf6ef;
  --paper-2: #f2eadd;
  --paper-3: #e9dfcf;
  --card: #fffdfa;
  --ink: #17160f;
  --ink-2: #4b473d;
  --ink-3: #7c7569;
  --rule: #ddd2bf;
  --rule-soft: #ebe2d3;
  --accent: #bd3c20;
  --accent-dark: #8d2b13;
  --accent-soft: #fbeae4;
  --gold: #a8761c;
  --teal: #17524b;

  --serif: 'DM Serif Display', 'Iowan Old Style', Georgia, serif;
  --sans: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;

  --shell: 1240px;
  --radius: 4px;
  --shadow-1: 0 1px 2px rgba(23, 22, 15, .05), 0 6px 18px -10px rgba(23, 22, 15, .22);
  --shadow-2: 0 2px 6px rgba(23, 22, 15, .07), 0 22px 44px -18px rgba(23, 22, 15, .32);
}

/* Category accents */
[data-cat='Art']        { --cat: #6f3a8e; --cat-soft: #f3ecf7; }
[data-cat='Film']       { --cat: #2a4c8a; --cat-soft: #eaeff8; }
[data-cat='Food']       { --cat: #a0501a; --cat-soft: #f9eee5; }
[data-cat='Literature'] { --cat: #17524b; --cat-soft: #e7f1ef; }
[data-cat='Music']      { --cat: #bd3c20; --cat-soft: #fbeae4; }
[data-cat='Outdoors']   { --cat: #3c6a2a; --cat-soft: #ebf2e6; }
[data-cat='Walks']      { --cat: #6a5523; --cat-soft: #f4efe1; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  /* faint paper tooth */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(189, 60, 32, .045), transparent 42%),
    radial-gradient(circle at 86% 4%, rgba(23, 82, 75, .05), transparent 38%);
  background-attachment: fixed;
}
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.12; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
code { font-family: var(--mono); font-size: .9em; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 32px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 0 0 var(--radius) var(--radius);
  font-size: .85rem; font-weight: 600; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Shared bits ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .dot { padding-inline: .3em; }

.btn {
  display: inline-flex; align-items: center; gap: .5em;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn--solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--ghost { background: transparent; }

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.masthead__bar {
  display: flex; align-items: center; gap: 24px;
  min-height: 72px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  margin-right: auto;
}
.wordmark__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--ink); color: var(--paper);
  border-radius: 7px;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1;
  padding-top: 2px;
}
.wordmark__name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -.015em;
}
.masthead__nav { display: flex; gap: 26px; }
.masthead__nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
}
.masthead__nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.shortlist-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.shortlist-chip svg { width: 15px; height: 15px; stroke-width: 1.6; }
.shortlist-chip:hover { border-color: var(--ink); }
.shortlist-chip__count {
  display: grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px;
  background: var(--paper-3); color: var(--ink);
  font-family: var(--mono); font-size: .76rem;
}
.shortlist-chip.is-active { border-color: var(--accent); }
.shortlist-chip.is-active .shortlist-chip__count { background: var(--accent); color: #fff; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}
.hero__text h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.4vw, 4rem);
  margin: 18px 0 20px;
  letter-spacing: -.022em;
}
.hero__text h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero__lede {
  max-width: 44ch;
  font-size: 1.05rem;
  color: var(--ink-2);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0 28px;
  justify-content: start;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.stats > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dt {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stats dd {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink);
}

.hero__frame { position: relative; }
.hero__media img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 3.1;
  object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(.86) contrast(1.03);
  box-shadow: var(--shadow-2);
}
/* offset frame, visible along the lower-right edge */
.hero__frame::after {
  content: '';
  position: absolute; inset: 14px -14px -14px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  pointer-events: none;
}
.hero__caption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-align: right;
}

/* ============================================================
   Controls
   ============================================================ */
.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  background: rgba(250, 246, 239, .93);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 0;
}
.controls__inner {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 170px 160px auto auto;
  gap: 16px;
  align-items: end;
  padding-top: 14px;
  padding-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 2px;
}
.field__wrap { position: relative; display: flex; align-items: center; }
.field__icon {
  position: absolute; left: 12px;
  width: 15px; height: 15px;
  color: var(--ink-3);
  pointer-events: none;
}
.field input[type='search'],
.field select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--ink);
}
.field input[type='search'] { padding-left: 35px; padding-right: 34px; }
.field input[type='search']::-webkit-search-cancel-button { display: none; }
.field input::placeholder { color: var(--ink-3); opacity: .75; }
.field select { padding-right: 32px; cursor: pointer; }
.field__chev {
  position: absolute; right: 11px;
  width: 15px; height: 15px; color: var(--ink-3);
  pointer-events: none;
}
.field input:hover, .field select:hover { border-color: var(--ink-3); }
.field__clear {
  position: absolute; right: 7px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: var(--paper-3); color: var(--ink-2);
}
.field__clear svg { width: 12px; height: 12px; stroke-width: 2.1; }
.field__clear:hover { background: var(--ink); color: var(--paper); }
/* class-level `display` must not beat the hidden attribute */
.field__clear[hidden] { display: none; }

.days legend {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 2px 5px;
}
.days__group {
  display: flex;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.days input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.days label {
  padding: 6px 13px;
  border-radius: 2px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.days label:hover { color: var(--ink); background: var(--paper-2); }
.days input:checked + label {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.days input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.saved-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.saved-toggle svg { width: 15px; height: 15px; }
.saved-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.saved-toggle[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.saved-toggle[aria-pressed='true'] svg { fill: currentColor; }

/* ============================================================
   Layout: results + plan
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 72px;
}
#plan, #colophon { scroll-margin-top: 104px; }
#resultsHeading:focus-visible { outline-offset: 6px; }
.results__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.results__head h2 { font-family: var(--serif); font-size: 1.9rem; }
.results__count {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Day groups ---------- */
.daygroup { margin-top: 34px; }
.daygroup:first-child { margin-top: 22px; }
.daygroup__head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 4px;
}
.daygroup__head h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
}
.daygroup__head h3 span { color: var(--ink-3); }
.daygroup__rule { flex: 1; height: 1px; background: var(--rule); }
.daygroup__n {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Event row ---------- */
.event {
  display: grid;
  grid-template-columns: 92px 128px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .event { transition: background-color .16s ease, box-shadow .16s ease; }
  .event__thumb img { transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
}
.event:hover {
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--cat, var(--accent));
}
.event:hover .event__thumb img { transform: scale(1.04); }
.event.is-saved { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }

.event__time { padding-top: 2px; }
.event__time .t {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: -.02em;
  color: var(--ink);
  font-feature-settings: 'tnum';
}
.event__time .t--end { color: var(--ink-3); font-size: .86rem; }
.event__time .dur {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.event__thumb {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-3);
}
.event__thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(.8) contrast(1.02);
}

.event__main { min-width: 0; }
.event__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--cat, var(--ink-3));
  color: var(--cat, var(--ink-2));
  background: var(--cat-soft, transparent);
  border-radius: 999px;
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tag--plain {
  border-color: var(--rule);
  background: transparent;
  color: var(--ink-3);
}
.event__title { margin: 0 0 7px; }
.open-item {
  display: inline-block;
  max-width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.18;
  letter-spacing: -.015em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.event:hover .open-item, .open-item:hover { text-decoration-color: var(--accent); }
.event__summary {
  font-size: .92rem;
  color: var(--ink-2);
  max-width: 58ch;
  margin-bottom: 9px;
}
.event__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: .8rem;
  color: var(--ink-3);
}
.event__meta svg { width: 13px; height: 13px; }
.event__meta b { font-weight: 600; color: var(--ink-2); }
.event__meta span { display: inline-flex; align-items: center; gap: 5px; }

.event__aside {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  padding-top: 2px;
}
.price {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -.02em;
}
.price--free { color: var(--teal); font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }

.quick-save {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-2);
}
.quick-save svg { width: 13px; height: 13px; }
.quick-save:hover { border-color: var(--ink); color: var(--ink); }
.quick-save[aria-pressed='true'] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.quick-save[aria-pressed='true'] svg { fill: currentColor; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 64px 24px 72px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  margin-top: 26px;
  background: var(--card);
}
.empty__mark {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--paper-3);
  margin-bottom: 12px;
}
.empty h3 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 8px; }
.empty p { color: var(--ink-2); max-width: 46ch; margin-inline: auto; }
.empty .btn { margin-top: 22px; }

/* ============================================================
   Plan sidebar
   ============================================================ */
.plan__sticky {
  position: sticky;
  top: 96px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.plan__head {
  padding: 18px 20px 16px;
  background: var(--ink);
  color: var(--paper);
}
.plan__head h2 { font-family: var(--serif); font-size: 1.35rem; }
.plan__sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, .6);
}
.plan__empty { padding: 22px 20px 24px; }
.plan__empty p { font-size: .88rem; color: var(--ink-2); }
.plan__empty svg { width: 22px; height: 22px; color: var(--rule); margin-bottom: 8px; }

.plan__day {
  padding: 14px 20px 6px;
  border-top: 1px solid var(--rule-soft);
}
.plan__day:first-child { border-top: 0; }
.plan__dayname {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.plan__item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px dotted var(--rule);
}
.plan__day > ul > .plan__item:first-child { border-top: 0; }
.plan__time {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-2);
  padding-top: 2px;
}
.plan__open {
  border: 0; background: none; padding: 0;
  text-align: left;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.plan__open:hover { text-decoration-color: var(--accent); color: var(--accent-dark); }
.plan__where {
  display: block;
  font-size: .74rem;
  color: var(--ink-3);
  margin-top: 2px;
}
.plan__clash {
  display: block;
  margin-top: 4px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.plan__remove {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
}
.plan__remove svg { width: 11px; height: 11px; stroke-width: 2.2; }
.plan__remove:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.plan__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.plan__total {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.plan__total b {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-weight: 400;
}
.plan__clearall {
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-2);
}
.plan__clearall:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ============================================================
   Detail dialog
   ============================================================ */
.detail {
  width: min(720px, calc(100vw - 48px));
  max-width: none;
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(23, 22, 15, .55);
  overflow: hidden;
}
/* Only when open, so the closed dialog keeps the UA's display:none. */
.detail[open] { display: flex; flex-direction: column; }
.detail::backdrop {
  background: rgba(23, 22, 15, .55);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  .detail[open] { animation: detail-in .24s cubic-bezier(.2, .8, .2, 1); }
  @keyframes detail-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
  }
}
.detail__inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail__media { position: relative; background: var(--paper-3); }
.detail__media img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  filter: saturate(.84) contrast(1.03);
}
.detail__imgnote {
  position: absolute; left: 0; bottom: 0;
  background: rgba(23, 22, 15, .72);
  color: rgba(250, 246, 239, .9);
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 0 var(--radius) 0 0;
}
.detail__close {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(250, 246, 239, .35);
  border-radius: 50%;
  background: rgba(23, 22, 15, .68);
  color: #fff;
  backdrop-filter: blur(4px);
}
.detail__close svg { width: 16px; height: 16px; stroke-width: 2; }
.detail__close:hover { background: var(--accent); border-color: var(--accent); }
.detail__close:focus-visible { outline-color: #fff; }

.detail__content { padding: 26px 32px 32px; }
.detail__content h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin: 10px 0 20px;
  letter-spacing: -.02em;
}

.facts {
  display: grid;
  /* eight facts: 2 tidy rows of 4 on desktop, 4 rows of 2 on small screens */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 26px;
}
.facts > div {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--paper);
  padding: 12px 14px;
}
.facts dt {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts dd { font-size: .92rem; font-weight: 500; color: var(--ink); }

.detail__bodyhead {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.detail__body {
  white-space: pre-line;
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 62ch;
}
.detail__actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
}
.btn--save[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}
.btn--save[aria-pressed='true'] svg { fill: currentColor; }
.detail__clash {
  margin-top: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: #fdf6e8;
  font-size: .85rem;
  color: var(--ink-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ============================================================
   Colophon
   ============================================================ */
.colophon {
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 44px 0 56px;
}
.colophon__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 40px;
}
.colophon h2 {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.colophon p { font-size: .85rem; color: var(--ink-2); max-width: 42ch; }
.wordmark--footer { margin-bottom: 12px; }
.wordmark--footer .wordmark__name { font-size: 1.35rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .plan__sticky { position: static; }
  .controls__inner { grid-template-columns: minmax(200px, 1fr) 1fr 1fr; }
  .days, .saved-toggle { grid-column: span 1; }
  .saved-toggle { align-self: end; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 36px;
    padding-bottom: 40px;
  }
  .hero__media { order: -1; }
  .hero__frame::after { display: none; }
  .hero__media img { aspect-ratio: 16 / 9; }
  .hero__caption { text-align: left; }
  .colophon__grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 760px) {
  .shell { padding-inline: 20px; }
  .masthead__bar { min-height: 60px; gap: 12px; flex-wrap: wrap; }
  .masthead__nav { display: none; }

  .hero__text h1 { font-size: clamp(2.1rem, 9vw, 2.9rem); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 18px 20px; margin-top: 30px; }
  .stats dd { font-size: 1.5rem; }

  .controls__inner {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .field--search { grid-column: 1 / -1; }
  .days { grid-column: 1 / -1; }
  .days__group { justify-content: space-between; }
  .days label { flex: 1; text-align: center; padding: 8px 6px; }
  .saved-toggle { grid-column: 1 / -1; justify-content: center; }

  .layout { padding-top: 28px; padding-bottom: 48px; }
  .results__head h2 { font-size: 1.6rem; }

  /* Event rows: left rail of time + thumbnail, content on the right */
  .event {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      'time  main'
      'thumb main'
      'aside aside';
    gap: 8px 16px;
    padding: 18px 0;
  }
  .event:hover { box-shadow: none; background: transparent; }
  .event__time { grid-area: time; }
  .event__time .dur { margin-top: 2px; }
  .event__thumb { grid-area: thumb; align-self: start; }
  .event__thumb img { aspect-ratio: 1 / 1; }
  .event__main { grid-area: main; }
  .event__aside {
    grid-area: aside;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    padding-left: 92px;
  }
  .open-item { font-size: 1.15rem; }
  .event__summary { font-size: .88rem; }

  .detail {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 10px 10px 0 0;
    border-bottom: 0;
  }
  .detail__media img { height: 160px; }
  .detail__content { padding: 20px 20px 28px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail__actions { flex-direction: column; align-items: stretch; }
  .detail__actions .btn { justify-content: center; }
  .empty { padding: 44px 18px 48px; }
}

@media (max-width: 420px) {
  .event { grid-template-columns: 68px minmax(0, 1fr); }
  .event__aside { padding-left: 84px; }
  .shortlist-chip { padding-left: 11px; font-size: .78rem; }
}

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

@media print {
  .controls, .hero__media, .masthead__nav, .quick-save, .shortlist-chip { display: none; }
}
