/* Saturnday — weekend almanac */

@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: 'DM Sans';
  src: url('assets/dm-sans.ttf') format('truetype');
  font-weight: 100 1000;
  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;
}

:root {
  --paper: #f4eee3;
  --paper-2: #ebe3d4;
  --card: #fbf8f2;
  --ink: #1e1b16;
  --ink-2: #413b33;
  --muted: #625a4f;
  --rule: #d8ceba;
  --accent: #c2411c;
  --accent-ink: #a3360f;
  --accent-soft: #f6d9c9;
  --sun: #e9a93b;
  --night-muted: #bfb5a4;

  --c-art: #a63a64;
  --c-film: #3b4c8c;
  --c-food: #9a4a14;
  --c-literature: #6a4a24;
  --c-music: #1d6a65;
  --c-outdoors: #3d6a23;
  --c-walks: #7a4a8e;

  --serif: 'DM Serif Display', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 14px;
  --shadow: 0 1px 0 rgba(30, 27, 22, .06), 0 18px 40px -24px rgba(30, 27, 22, .35);
}

.cat-art { --cat: var(--c-art); }
.cat-film { --cat: var(--c-film); }
.cat-food { --cat: var(--c-food); }
.cat-literature { --cat: var(--c-literature); }
.cat-music { --cat: var(--c-music); }
.cat-outdoors { --cat: var(--c-outdoors); }
.cat-walks { --cat: var(--c-walks); }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 128px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) { overflow: hidden; }

[hidden] { display: none !important; }

img { max-width: 100%; display: block; }

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { background: var(--paper-2); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #38322a; }
.btn--light { border-color: var(--night-muted); color: var(--paper); }
.btn--light:hover { background: rgba(255, 255, 255, .08); }
.btn--light:focus-visible { outline-color: var(--sun); }

.icon-bookmark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
[aria-pressed="true"] .icon-bookmark path { fill: currentColor; }

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 .45em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 .75rem/1 var(--mono);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 16px;
}
.masthead { border-bottom: 2px solid var(--ink); }
.masthead .topbar { border-bottom: 1px solid var(--rule); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -.01em;
}
.brand__mark { width: 38px; height: 38px; }

.topnav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.topnav a:hover { background: var(--paper-2); }
.topnav__shortlist { border: 1.5px solid var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  padding-top: 40px;
  padding-bottom: 36px;
}

.kicker {
  margin: 0 0 16px;
  font: 400 .8125rem/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.9vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.accent { color: var(--accent); }

.lede {
  max-width: 36em;
  margin: 18px 0 0;
  font-size: 1.125rem;
  color: var(--ink-2);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 26px 0 0;
}
.stats div { min-width: 0; }
.stats dt {
  font: 400 .75rem/1.3 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats dd {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1;
}

/* Weekend at a glance */

.glance {
  margin: 0;
  padding: 18px 20px 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.glance__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 400 .75rem/1.3 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.glance__head span:first-child { color: var(--ink); }
.glance__rows { margin-top: 14px; }
.glance__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.glance__day {
  font: 400 .8125rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.glance__track {
  position: relative;
  height: calc(var(--lanes, 1) * 20px + (var(--lanes, 1) - 1) * 5px);
  background-image: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px calc(100% / 14));
  background-size: 100% 100%;
  border-right: 1px solid var(--rule);
}
.glance__bar {
  position: absolute;
  top: calc(var(--lane) * 25px);
  left: var(--l);
  width: var(--w);
  height: 20px;
  border-radius: 6px;
  background: var(--cat);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}
.glance__bar:hover { transform: translateY(-1px); filter: brightness(1.15); }
.glance__bar.is-saved { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.glance__bar.is-dim { opacity: .16; }
.glance__axis {
  position: relative;
  height: 16px;
  margin-left: 50px;
  font: 400 .6875rem/1 var(--mono);
  color: var(--muted);
}
.glance__axis span { position: absolute; transform: translateX(-50%); }
.glance__note {
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--rule);
  list-style: none;
  font-size: .8125rem;
  color: var(--ink-2);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--cat);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
  padding-bottom: 96px;
}

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) auto;
  gap: 12px;
  align-items: end;
  padding: 18px 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 600;
}
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

input[type="search"],
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: 400 1rem/1 var(--sans);
}
input[type="search"] { padding-left: 44px; }
input[type="search"]::placeholder { color: #7b7266; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231e1b16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}
input[type="search"]:focus-visible,
select:focus-visible { outline-offset: 2px; border-radius: 12px; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.toggle svg { width: 20px; height: 20px; flex: none; }
.toggle:hover { background: var(--paper-2); }
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toggle[aria-pressed="true"] .count-pill { background: var(--accent); color: #fff; }

.results-status {
  margin: 14px 0 0;
  font: 400 .8125rem/1.4 var(--mono);
  letter-spacing: .02em;
  color: var(--muted);
}
.results-status:focus { outline: none; }
.results-status:focus-visible { outline: 3px solid var(--accent); }

/* ---------- Days & events ---------- */

.day { margin-top: 30px; }
.day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.day__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.01em;
}
.day__date {
  margin-left: 10px;
  font: 500 1rem/1 var(--sans);
  letter-spacing: 0;
  color: var(--muted);
}
.day__count {
  margin: 0;
  font: 400 .8125rem/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.day__none {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

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

.event {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  grid-template-areas: "time main save";
  gap: 4px 20px;
  padding: 22px 12px 22px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--rule);
  border-radius: 12px;
  transition: background-color .15s ease;
}
.event:hover { background: var(--paper-2); }

.event__time { grid-area: time; padding-top: 2px; }
.event__time time {
  display: block;
  font: 400 1.3rem/1.1 var(--mono);
  letter-spacing: -.02em;
}
.event__end {
  display: block;
  margin-top: 4px;
  font: 400 .8125rem/1.2 var(--mono);
  color: var(--muted);
}
.event.is-saved .event__time time { color: var(--accent-ink); }

.event__main { grid-area: main; min-width: 0; }

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 6px;
  font-size: .875rem;
  color: var(--muted);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cat);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cat);
}
.saved-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .75rem;
  font-weight: 600;
}

.event__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.event__open {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}
.event__open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
}
.event__open:focus-visible { outline: none; }
.event__open:focus-visible::after {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.event:hover .event__open,
.event__open:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.event__summary {
  margin: 8px 0 12px;
  max-width: 62ch;
  color: var(--ink-2);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .875rem;
  color: var(--muted);
}
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; flex: none; }
.meta .is-free { color: var(--c-outdoors); font-weight: 700; }

.event__save {
  grid-area: save;
  position: relative;
  z-index: 1;
  align-self: start;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.event__save svg { width: 20px; height: 20px; }
.event__save:hover { border-color: var(--ink); }
.event__save[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.event__save:focus-visible { border-radius: 50%; }

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

.empty {
  margin-top: 28px;
  padding: 40px 28px;
  text-align: center;
  border: 1.5px dashed var(--muted);
  border-radius: 20px;
  background: var(--card);
}
.empty__mark { width: 64px; height: 64px; color: var(--accent); }
.empty h3 {
  margin: 10px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.1;
}
.empty p { margin: 0 auto 20px; max-width: 42ch; color: var(--ink-2); }

/* ---------- Shortlist ---------- */

.shortlist {
  position: sticky;
  top: 24px;
  margin-top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}
.shortlist :focus-visible { outline-color: var(--sun); }
.shortlist__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(244, 238, 227, .22);
}
.shortlist__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
}
.shortlist__head h2:focus { outline: none; }
.shortlist__count {
  font: 400 .8125rem/1 var(--mono);
  color: var(--night-muted);
  white-space: nowrap;
}

.shortlist__empty { padding: 18px 0 4px; color: var(--night-muted); }
.shortlist__empty p { margin: 0 0 10px; }
.shortlist__empty strong { color: var(--paper); font-weight: 600; }

.shortlist__day { margin-top: 18px; }
.shortlist__day h3 {
  margin: 0 0 6px;
  font: 400 .75rem/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sun);
}
.shortlist__day ol { margin: 0; padding: 0; list-style: none; }

.pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 2px 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(244, 238, 227, .14);
}
.pick__time {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 .8125rem/1.3 var(--mono);
  color: var(--night-muted);
}
.pick__time::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cat);
  box-shadow: 0 0 0 2px rgba(244, 238, 227, .85);
}
.pick__open {
  grid-column: 1;
  grid-row: 2;
  appearance: none;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: 400 1.2rem/1.2 var(--serif);
  text-align: left;
  cursor: pointer;
}
.pick__open:hover { text-decoration: underline; text-underline-offset: 4px; }
.pick__where { grid-column: 1; grid-row: 3; font-size: .8125rem; color: var(--night-muted); }
.pick__remove {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(244, 238, 227, .3);
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.pick__remove svg { width: 16px; height: 16px; }
.pick__remove:hover { background: rgba(255, 255, 255, .1); }
.pick__remove:focus-visible { border-radius: 50%; }

.clash {
  display: flex;
  gap: 8px;
  margin: 6px 0 0;
  font-size: .8125rem;
  line-height: 1.4;
}
.clash svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.pick .clash { grid-column: 1 / -1; grid-row: 4; color: #f3cf8f; }

.shortlist__foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(244, 238, 227, .22);
}
.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 16px;
}
.totals dt {
  font: 400 .6875rem/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--night-muted);
}
.totals dd { margin: 2px 0 0; font: 400 1.6rem/1.1 var(--serif); }
.shortlist__foot .btn { width: 100%; }

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

.detail {
  width: min(780px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(20, 16, 10, .6);
  overflow: hidden;
}
.detail[open] {
  display: flex;
  flex-direction: column;
  animation: detail-in .28s cubic-bezier(.2, .8, .2, 1);
}
.detail::backdrop {
  background: rgba(30, 27, 22, .58);
  backdrop-filter: blur(3px);
}
.detail[open]::backdrop { animation: fade-in .2s ease; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail__media {
  position: relative;
  flex: none;
  height: 210px;
  background: var(--cat);
}
.detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85);
}
.detail__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 16, 10, .7), rgba(20, 16, 10, 0) 55%);
  pointer-events: none;
}
.detail__credit {
  position: absolute;
  left: 20px;
  bottom: 12px;
  z-index: 1;
  margin: 0;
  font: 400 .75rem/1.3 var(--mono);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.detail__close svg { width: 20px; height: 20px; }
.detail__close:hover { background: #fff; }
.detail__close:focus-visible { outline-color: var(--sun); outline-offset: 3px; border-radius: 50%; }

.detail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 26px 32px 8px;
  overscroll-behavior: contain;
}
.detail__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 22px 0 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.facts > div { padding: 12px 14px 14px 0; }
.facts > div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.facts dt {
  font: 400 .6875rem/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: 4px 0 0; font-weight: 600; line-height: 1.35; }
.facts .sub { display: block; font-weight: 400; color: var(--ink-2); font-size: .9375rem; }
.facts .mono { font-family: var(--mono); font-weight: 400; }

.detail__body { margin-top: 20px; }
.detail__lead {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
}
.notes {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--paper);
  border-left: 4px solid var(--cat);
}
.notes h3 {
  margin: 0 0 4px;
  font: 400 .75rem/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.notes p { margin: 0; }
.notes p + p { margin-top: 8px; }

.detail .clash {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fbecc9;
  color: #5b3d06;
  font-size: .9375rem;
}

.detail__actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 16px 32px 20px;
  border-top: 1px solid var(--rule);
  background: var(--card);
}
.detail__actions .saved-note {
  margin: 0 0 0 auto;
  font-size: .875rem;
  color: var(--muted);
}
.save-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.save-btn[aria-pressed="true"]:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Footer ---------- */

.footer {
  border-top: 2px solid var(--ink);
  padding: 28px 0 40px;
  font-size: .875rem;
  color: var(--muted);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 48px;
}
.footer p { margin: 0; }
.footer strong { color: var(--ink); }

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
}

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

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .shortlist {
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 8px;
  }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 16px; }
  .topbar { padding-top: 12px; padding-bottom: 12px; }
  .brand { font-size: 1.5rem; gap: 8px; }
  .brand__mark { width: 32px; height: 32px; }
  .topnav__day { display: none; }
  .topnav a { padding: 0 14px; }

  .hero { padding-top: 24px; padding-bottom: 24px; gap: 24px; }
  .hero h1 { font-size: 2.35rem; }
  .lede { font-size: 1.0625rem; margin-top: 14px; }
  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }
  .stats dd { font-size: 1.8rem; }
  .glance { padding: 16px 14px 14px; }
  .glance__row { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
  .glance__axis { margin-left: 42px; }

  .toolbar {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-top: 16px;
  }
  .field--search { grid-column: 1 / -1; }
  .toggle { padding: 0 12px; gap: 6px; }
  .toggle svg { display: none; }
  select { padding-left: 12px; padding-right: 36px; background-position: right 10px center; }

  .event {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas:
      "time save"
      "main main";
    gap: 6px 12px;
    padding: 18px 12px;
  }
  .event__time {
    display: flex;
    align-items: baseline;
    gap: 8px;
    align-self: center;
  }
  .event__time time { font-size: 1.1rem; }
  .event__end { margin: 0; }
  .event__summary { margin: 6px 0 10px; }

  .day__date { display: block; margin: 6px 0 0; }

  .shortlist { padding: 20px 18px; border-radius: 18px; }

  .detail {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
  .detail__media { height: 150px; }
  .detail__scroll { padding: 20px 18px 8px; }
  .detail__actions { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .detail__actions .btn { flex: 1 1 auto; }
  .detail__actions .saved-note { margin: 0; width: 100%; order: -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }

  .footer__inner { grid-template-columns: 1fr; }

  @keyframes detail-in {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

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

@media (forced-colors: active) {
  .glance__bar, .tag::before, .legend li::before { forced-color-adjust: none; }
  .event__save[aria-pressed="true"], .toggle[aria-pressed="true"], .save-btn[aria-pressed="true"] { border-width: 3px; }
}
