@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  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;
}

:root {
  --ink: #111713;
  --ink-soft: #1a221c;
  --ink-line: #2e3931;
  --chalk: #f4f0e4;
  --chalk-dim: #b9baae;
  --chalk-mute: #8e9389;
  --sun: #f1c64b;
  --sun-deep: #d8aa2f;
  --tomato: #df5c3f;
  --tomato-ink: #9e341f;
  --paper: #f8f4e8;
  --line: rgba(244, 240, 228, 0.18);
  --line-strong: rgba(244, 240, 228, 0.36);
  --focus: var(--sun);
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --header-h: 74px;
  --pad: clamp(24px, 4.2vw, 64px);
}

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

html {
  background: var(--ink);
  scrollbar-color: #596057 var(--ink);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

::selection {
  background: var(--tomato);
  color: var(--paper);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 clamp(20px, 3vw, 40px);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  color: var(--sun);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-edition {
  align-self: flex-start;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--sun);
  border: 1px solid rgba(241, 198, 75, 0.55);
  padding: 3px 4px;
  border-radius: 1px;
}

.edition {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  white-space: nowrap;
}

.edition span {
  margin: 0 7px;
  color: var(--sun);
}

.shortlist-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}

.shortlist-btn svg {
  width: 17px;
  height: 17px;
  color: var(--sun);
  transition: color 160ms ease-out;
}

.shortlist-btn:hover {
  border-color: var(--sun);
}

.shortlist-btn[aria-pressed="true"] {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
}

.shortlist-btn[aria-pressed="true"] svg {
  color: var(--ink);
}

.shortlist-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 1px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(244, 240, 228, 0.12);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.shortlist-btn[aria-pressed="true"] .shortlist-count {
  background: var(--ink);
  color: var(--sun);
}

/* Main split */

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 29vw) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--header-h));
}

.desk {
  --focus: var(--ink);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--sun);
  color: var(--ink);
  border-right: 1px solid rgba(17, 23, 19, 0.4);
  scrollbar-color: var(--ink) var(--sun);
}

.desk::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.desk-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(34px, 4.2vw, 60px) clamp(24px, 3.2vw, 46px) 24px;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.15rem, 4.25vw, 4.1rem);
  font-weight: 470;
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-wrap: balance;
}

.title-dot {
  color: var(--tomato);
}

.desk-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.75);
}

.desk-date span {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--tomato);
}

.dek {
  max-width: 33ch;
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(17, 23, 19, 0.8);
  text-wrap: pretty;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 19px;
  margin-top: clamp(30px, 4vh, 46px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  padding: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.72);
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: rgba(17, 23, 19, 0.55);
  transform: translateY(-50%);
  pointer-events: none;
}

input[type="search"] {
  width: 100%;
  height: 49px;
  margin: 0;
  padding: 0 42px 0 41px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  caret-color: var(--tomato);
  appearance: none;
  -webkit-appearance: none;
  transition: background 160ms ease-out, box-shadow 160ms ease-out;
}

input[type="search"]::placeholder {
  color: #686752;
  opacity: 1;
}

input[type="search"]:hover {
  background: #fffdf4;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  transform: translateY(-50%);
}

.search-clear:hover {
  background: rgba(17, 23, 19, 0.1);
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

.select-wrap {
  position: relative;
}

select {
  width: 100%;
  height: 49px;
  margin: 0;
  padding: 0 42px 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  appearance: none;
  -webkit-appearance: none;
  transition: background 160ms ease-out;
}

select:hover {
  background: #fffdf4;
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 14px;
  height: 14px;
  color: var(--ink);
  transform: translateY(-50%);
  pointer-events: none;
}

.field-day {
  display: block;
}

.field-day legend {
  margin-bottom: 7px;
}

.day-tabs {
  display: grid;
  grid-template-columns: 1.35fr 0.825fr 0.825fr;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper);
}

.day-tab {
  min-height: 44px;
  padding: 8px 8px;
  border: 0;
  border-right: 1px solid rgba(17, 23, 19, 0.34);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.15;
  transition: background 160ms ease-out, color 160ms ease-out;
}

.day-tab:last-child {
  border-right: 0;
}

.day-tab span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(17, 23, 19, 0.62);
}

.day-tab:hover {
  background: rgba(17, 23, 19, 0.08);
}

.day-tab[aria-pressed="true"] {
  background: var(--ink);
  color: var(--sun);
}

.day-tab[aria-pressed="true"] span {
  color: var(--sun);
}

.rail-shortlist {
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid rgba(17, 23, 19, 0.28);
}

.rail-shortlist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rail-shortlist h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.72);
}

.rail-shortlist-count {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  color: rgba(17, 23, 19, 0.62);
  font-variant-numeric: tabular-nums;
}

.rail-shortlist-empty {
  max-width: 33ch;
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: rgba(17, 23, 19, 0.72);
}

.rail-saved-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.rail-saved-list button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.25;
  text-align: left;
}

.rail-saved-list button:hover .rail-saved-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.rail-saved-title {
  min-width: 0;
}

.rail-cat {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.64);
}

.rail-more {
  margin: 9px 0 0;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: rgba(17, 23, 19, 0.66);
}

.desk-foot {
  margin-top: auto;
  padding-top: 24px;
}

.desk-note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 23, 19, 0.28);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.7);
}

.desk-note span {
  margin: 0 3px;
  color: var(--tomato);
}

.desk-note-small {
  margin-top: 7px;
  padding-top: 0;
  border-top: 0;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 10px;
}

/* Programme */

.programme {
  min-width: 0;
  padding: clamp(30px, 3.6vw, 52px) var(--pad) 44px;
}

.programme-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line-strong);
}

.programme-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.programme-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 2px;
}

.result-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.clear-filters {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--sun);
  background: transparent;
  color: var(--sun);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
}

.clear-filters:hover {
  color: var(--paper);
  border-color: var(--paper);
}

.day-group {
  border-bottom: 1px solid var(--line);
}

.day-head {
  position: sticky;
  top: var(--header-h);
  z-index: 4;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 0 11px;
  background: var(--ink);
}

.day-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 520;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.day-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  white-space: nowrap;
}

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

.event {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 148px 22px;
  gap: clamp(16px, 2.2vw, 32px);
  align-items: start;
  padding: 22px 0 24px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 180ms ease-out;
}

.event:first-child {
  border-top: 0;
}

.event::after {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -0.18);
  z-index: 0;
  background: rgba(241, 198, 75, 0.055);
  opacity: 0;
  transition: opacity 180ms ease-out;
  pointer-events: none;
}

.event:hover::after,
.event:focus-within::after {
  opacity: 1;
}

.when {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.time-start {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--sun);
}

.time-end {
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--chalk-mute);
  white-space: nowrap;
}

.event-copy {
  z-index: 1;
  min-width: 0;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-mute);
}

.category {
  color: var(--sun);
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--chalk-mute);
}

.saved-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  color: var(--tomato);
}

.saved-tag svg {
  width: 12px;
  height: 12px;
}

.event-title {
  margin: 0;
}

.open-item {
  position: static;
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  font-weight: 580;
  line-height: 1.19;
  letter-spacing: -0.025em;
  text-align: left;
  transition: color 160ms ease-out;
}

.open-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}

.open-item:hover {
  color: var(--sun);
}

.open-item:focus-visible {
  outline-offset: 5px;
}

.event-summary {
  max-width: 56ch;
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.53;
  color: var(--chalk-dim);
  text-wrap: pretty;
}

.event-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 11px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--chalk-mute);
}

.foot-sep {
  color: var(--ink-line);
}

.event-thumb {
  position: relative;
  z-index: 1;
  height: 103px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-soft);
}

.event-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sun);
  mix-blend-mode: color;
  opacity: 0.14;
  pointer-events: none;
}

.event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) sepia(0.3) contrast(1.06) brightness(0.78);
  transition: filter 220ms ease-out, transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.event:hover .event-thumb img {
  filter: grayscale(0.7) sepia(0.18) contrast(1.03) brightness(0.88);
  transform: scale(1.025);
}

.event-arrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 4px;
  color: var(--chalk-mute);
  transition: color 160ms ease-out, transform 200ms ease-out;
}

.event-arrow svg {
  width: 17px;
  height: 17px;
}

.event:hover .event-arrow {
  color: var(--sun);
  transform: translate(2px, -2px);
}

/* Empty state */

.empty-state {
  max-width: 590px;
  margin: 44px 0 20px;
  padding: 44px 38px 40px;
  border: 1px solid var(--line-strong);
  background: rgba(244, 240, 228, 0.03);
}

.empty-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--sun);
}

.empty-mark svg {
  width: 22px;
  height: 22px;
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.empty-state p {
  max-width: 48ch;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--chalk-dim);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.empty-btn {
  min-height: 43px;
  padding: 9px 16px;
  border: 1px solid var(--sun);
  border-radius: 2px;
  background: var(--sun);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease-out, color 160ms ease-out;
}

.empty-btn:hover {
  background: var(--paper);
  border-color: var(--paper);
}

.empty-btn.secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--paper);
}

.empty-btn.secondary:hover {
  border-color: var(--sun);
  color: var(--sun);
}

/* Footer */

.programme-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--chalk-mute);
}

.foot-mark {
  width: 22px;
  height: 22px;
  color: var(--sun);
}

.programme-foot p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
}

.foot-meta {
  margin-left: auto !important;
  font-family: var(--font-mono);
  font-size: 9.5px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot-meta span {
  margin: 0 5px;
  color: var(--sun);
}

/* Detail dialog */

.detail {
  --focus: var(--ink);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(610px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.detail[open] {
  display: block;
  animation: detail-in 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.detail::backdrop {
  background: rgba(8, 11, 9, 0.74);
  animation: backdrop-in 280ms ease-out both;
}

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

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-panel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  color: var(--ink);
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.28);
  scrollbar-color: #b9b29e var(--paper);
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 11px 22px 11px 28px;
  background: rgba(248, 244, 232, 0.97);
  border-bottom: 1px solid rgba(17, 23, 19, 0.22);
}

.detail-cat {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.7);
}

.detail-cat strong {
  font-weight: 500;
  color: var(--tomato-ink);
}

.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(17, 23, 19, 0.55);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  transition: background 150ms ease-out, color 150ms ease-out;
}

.detail-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.detail-close svg {
  width: 16px;
  height: 16px;
}

.detail-content {
  padding: 29px clamp(22px, 4vw, 42px) 54px;
}

.detail-date {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tomato-ink);
}

.detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  font-weight: 580;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-wrap: balance;
}

.detail-venue {
  margin: 13px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(17, 23, 19, 0.78);
}

.detail-venue strong {
  font-weight: 600;
  color: var(--ink);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 23px;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 150ms ease-out, color 150ms ease-out;
}

.save-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.save-btn[aria-pressed="true"] {
  background: var(--sun);
  border-color: var(--ink);
  color: var(--ink);
}

.save-btn[aria-pressed="true"]:hover {
  background: var(--sun-deep);
}

.save-icon {
  display: inline-flex;
  color: var(--tomato-ink);
}

.save-btn[aria-pressed="true"] .save-icon {
  color: var(--ink);
}

.save-icon svg {
  width: 16px;
  height: 16px;
}

.saved-stamp {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px 2px;
  border: 1px solid var(--tomato-ink);
  border-radius: 2px;
  color: var(--tomato-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.detail-figure {
  margin: 27px 0 0;
}

.detail-figure .figure-frame {
  position: relative;
  height: clamp(165px, 23vh, 230px);
  overflow: hidden;
  background: #ded8c7;
}

.detail-figure .figure-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sun);
  mix-blend-mode: color;
  opacity: 0.16;
  pointer-events: none;
}

.detail-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.95) sepia(0.24) contrast(1.04) brightness(0.88);
}

.detail-figure figcaption {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.7);
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 27px 0 0;
  border-top: 1px solid rgba(17, 23, 19, 0.24);
  border-bottom: 1px solid rgba(17, 23, 19, 0.24);
}

.detail-facts > div {
  padding: 13px 0 14px;
}

.detail-facts > div:nth-child(odd) {
  padding-right: 18px;
  border-right: 1px solid rgba(17, 23, 19, 0.18);
}

.detail-facts > div:nth-child(even) {
  padding-left: 18px;
}

.detail-facts > div:nth-child(n + 3) {
  border-top: 1px solid rgba(17, 23, 19, 0.18);
}

.detail-facts dt {
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.66);
}

.detail-facts dd {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 550;
  color: var(--ink);
}

.detail-body {
  margin-top: 27px;
  max-width: 59ch;
}

.detail-body > p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.68;
  color: #1c241e;
  text-wrap: pretty;
}

.detail-notes {
  margin-top: 26px;
  padding: 17px 18px 18px;
  background: #ebe5d5;
}

.detail-notes::before {
  content: "Access & practical notes";
  display: block;
  margin: 0 0 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.68);
}

.detail-notes p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.58;
  color: rgba(17, 23, 19, 0.83);
}

.detail-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 23, 19, 0.2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17, 23, 19, 0.7);
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 90;
  max-width: 500px;
  padding: 16px 20px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 550;
}

/* Tablet and mobile */

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .desk {
    position: relative;
    top: 0;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(17, 23, 19, 0.45);
  }

  .desk-inner {
    padding: 38px clamp(24px, 4.5vw, 44px) 28px;
  }

  h1 {
    font-size: clamp(3.25rem, 8vw, 4.4rem);
  }

  .dek {
    max-width: 46ch;
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr);
    gap: 17px 16px;
    margin-top: 30px;
  }

  .field-search {
    grid-column: 1 / -1;
  }

  .field-day {
    grid-column: 1 / -1;
    max-width: none;
  }

  .desk-foot,
  .rail-shortlist {
    display: none;
  }

  .day-head {
    top: var(--header-h);
  }

  .detail-title {
    font-size: clamp(2.1rem, 5.2vw, 2.7rem);
  }
}

@media (max-width: 780px) {
  :root {
    --header-h: 64px;
  }

  .masthead {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 0 18px;
  }

  .edition {
    display: none;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .shortlist-btn {
    min-height: 40px;
    padding: 7px 11px;
  }

  .desk-inner {
    padding: 30px 20px 25px;
  }

  h1 {
    font-size: clamp(3rem, 12.4vw, 4rem);
  }

  .dek {
    margin-top: 17px;
    font-size: 14px;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 26px;
  }

  .field-search,
  .field-day {
    grid-column: auto;
  }

  .field-category {
    max-width: none;
  }

  .day-tabs {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
  }

  .programme {
    padding: 26px 20px 36px;
  }

  .programme-head {
    padding-bottom: 14px;
  }

  .programme-tools {
    gap: 12px;
  }

  .day-head {
    padding-top: 21px;
    padding-bottom: 9px;
  }

  .event {
    grid-template-columns: 69px minmax(0, 1fr);
    gap: 13px;
    padding: 18px 0 19px;
  }

  .event-thumb,
  .event-arrow {
    display: none;
  }

  .when {
    padding-top: 2px;
  }

  .time-start {
    font-size: 13.5px;
  }

  .time-end {
    font-size: 9.5px;
  }

  .event-meta {
    margin-bottom: 6px;
  }

  .open-item {
    font-size: clamp(1.18rem, 5vw, 1.42rem);
  }

  .event-summary {
    margin-top: 7px;
    font-size: 13px;
  }

  .event-foot {
    margin-top: 9px;
  }

  .event::after {
    inset: 0 -10px;
  }

  .empty-state {
    margin-top: 30px;
    padding: 32px 24px 30px;
  }

  .programme-foot {
    margin-top: 34px;
  }

  .foot-meta {
    margin-left: 0 !important;
    width: 100%;
  }

  .detail {
    width: 100vw;
  }

  .detail-head {
    padding: 10px 16px 10px 20px;
    min-height: 62px;
  }

  .detail-content {
    padding: 23px 20px 46px;
  }

  .detail-figure .figure-frame {
    height: 190px;
  }
}

@media (max-width: 430px) {
  .shortlist-label {
    font-size: 12px;
  }

  .brand-edition {
    display: none;
  }

  .programme-head {
    align-items: center;
  }

  .programme-head h2 {
    font-size: 1.65rem;
  }

  .programme-tools {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .result-count {
    font-size: 9.5px;
  }

  .detail-title {
    font-size: 1.95rem;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .detail-facts > div:nth-child(odd) {
    padding-right: 0;
    border-right: 0;
  }

  .detail-facts > div:nth-child(even) {
    padding-left: 0;
  }

  .detail-facts > div:nth-child(n + 2) {
    border-top: 1px solid rgba(17, 23, 19, 0.18);
  }
}

@media (max-width: 370px) {
  .shortlist-label {
    display: none;
  }

  .masthead {
    gap: 8px;
    padding: 0 14px;
  }

  .programme {
    padding-inline: 16px;
  }

  .desk-inner {
    padding-inline: 16px;
  }
}

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