@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f2efe6;
  --paper-bright: #faf8f1;
  --ink: #182b27;
  --muted: #52635d;
  --rule: #a7aaa0;
  --soft-rule: #d3d2c8;
  --accent: #c43b24;
  --acid: #dbea60;
  --focus: #006f80;
  --shadow: 0 18px 50px rgba(24, 43, 39, 0.18), 0 3px 10px rgba(24, 43, 39, 0.09);
  --display: "Literata", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

body.detail-open {
  overflow: hidden;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 17px clamp(24px, 4vw, 68px);
  border-bottom: 1px solid var(--ink);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.brand-mark i {
  position: absolute;
  top: 5px;
  width: 6px;
  height: 16px;
  background: var(--accent);
  border-radius: 5px;
  transform: rotate(25deg);
}

.brand-mark i:first-child { left: 7px; }
.brand-mark i:last-child { right: 6px; }

.issue {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.saved-toggle {
  justify-self: end;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 8px 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-weight: 700;
}

.saved-toggle svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.saved-toggle[aria-pressed="true"] {
  color: var(--paper-bright);
  background: var(--ink);
}

.saved-toggle[aria-pressed="true"] svg { fill: var(--acid); }

.saved-count {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  border-radius: 50%;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.intro {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: clamp(32px, 8vw, 140px);
  align-items: end;
  padding: clamp(54px, 7vw, 96px) clamp(24px, 6.5vw, 108px) 58px;
  overflow: hidden;
}

.intro-copy {
  max-width: 820px;
}

.intro h1 {
  max-width: 780px;
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: clamp(3.3rem, 6.8vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}

.intro-copy > p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  line-height: 1.5;
}

.date-stamp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.date-stamp > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 4px;
}

.date-stamp > div + div { border-left: 1px solid var(--ink); }

.date-stamp span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.date-stamp strong {
  font-family: var(--display);
  font-size: clamp(3.4rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.date-stamp p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  color: var(--paper-bright);
  background: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
}

.browse {
  padding: 42px clamp(24px, 4vw, 68px) 96px;
  background: var(--paper-bright);
  border-top: 1px solid var(--ink);
}

.browse-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.browse-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(210px, 0.7fr);
  gap: 14px;
  margin-bottom: 48px;
}

.controls label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 54px;
  color: var(--ink);
  background-color: var(--paper-bright);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

input {
  padding: 11px 16px 11px 49px;
  caret-color: var(--accent);
}

select {
  padding: 11px 42px 11px 16px;
}

input::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover { border-color: var(--ink); }

.event-list {
  border-top: 1px solid var(--ink);
}

.day-divider {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--ink);
}

.day-divider span {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.day-divider h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.event-item {
  --category: var(--acid);
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(250px, 1.05fr) minmax(260px, 1.5fr) 190px 44px;
  gap: 24px;
  align-items: start;
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--soft-rule);
  transition: background-color 180ms ease-out;
}

.event-item:hover {
  background: #f3f0e7;
}

.event-time {
  font-family: var(--display);
  font-size: 1.13rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.event-time span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
}

.event-primary { min-width: 0; }

.category-label {
  display: inline-block;
  margin-bottom: 9px;
  padding: 3px 8px;
  background: var(--category);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-item {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.14;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 180ms ease-out;
}

.event-item:hover .open-item,
.open-item:focus-visible { text-decoration-color: var(--accent); }

.event-summary {
  max-width: 54ch;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.event-place {
  margin: 1px 0 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.event-place span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.event-price {
  margin-top: 13px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row-arrow {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  transition: color 180ms ease-out, background-color 180ms ease-out;
}

.row-arrow svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.event-item:hover .row-arrow {
  color: var(--paper-bright);
  background: var(--ink);
}

.empty-state {
  max-width: 620px;
  margin: 50px auto 0;
  padding: 52px 32px;
  text-align: center;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.empty-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  color: var(--paper-bright);
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.8rem;
}

.empty-state p { margin: 0 auto 24px; color: var(--muted); }

.button {
  min-height: 48px;
  padding: 11px 17px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-weight: 750;
}

.button-dark { color: var(--paper-bright); background: var(--ink); }

footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 40px clamp(24px, 4vw, 68px) 44px;
  color: var(--paper-bright);
  background: var(--ink);
}

footer p, footer a { margin: 0; }
footer p:first-child { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
footer p:nth-child(2) { color: #ccd4ce; font-size: 0.86rem; }
footer a { font-size: 0.84rem; font-weight: 700; }

.detail-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr minmax(560px, 46vw);
}

.detail-layer[hidden] { display: none; }

.detail-scrim {
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(24, 43, 39, 0.58);
  border: 0;
  cursor: default;
  animation: scrim-in 260ms ease-out both;
}

.detail-panel {
  height: 100%;
  overflow-y: auto;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
  animation: panel-in 360ms cubic-bezier(.2,.75,.2,1) both;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--ink);
}

.detail-top p {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.close-detail {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.close-detail svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.close-detail:hover { color: var(--paper-bright); background: var(--ink); }

.detail-hero {
  --category: var(--acid);
  padding: clamp(38px, 6vw, 72px) clamp(30px, 5vw, 68px) 46px;
  background: var(--category);
  border-bottom: 1px solid var(--ink);
}

.detail-category {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-hero h2 {
  max-width: 12ch;
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 4.5vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
}

.detail-date {
  margin: 0;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 650;
}

.detail-body {
  padding: 38px clamp(30px, 5vw, 68px) 64px;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 42px;
  border-top: 1px solid var(--ink);
}

.detail-facts div {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--soft-rule);
}

.detail-facts div:nth-child(odd) { padding-right: 20px; }

.detail-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-facts dd { margin: 0; font-weight: 650; }

.detail-copy {
  max-width: 65ch;
  margin-bottom: 38px;
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.65;
}

.detail-copy p { margin: 0 0 1.15em; }

.detail-copy p:last-child {
  padding-top: 20px;
  border-top: 1px solid var(--soft-rule);
}

.save-item {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  color: var(--paper-bright);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-weight: 800;
}

.save-item svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.save-item[aria-pressed="true"] { color: var(--ink); background: var(--acid); }
.save-item[aria-pressed="true"] svg { fill: currentColor; }

noscript {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 100;
  padding: 16px;
  color: #fff;
  background: var(--ink);
}

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

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

@media (max-width: 1120px) {
  .event-item {
    grid-template-columns: 95px minmax(220px, 1fr) minmax(240px, 1.2fr) 150px 42px;
    gap: 18px;
  }
  .day-divider { grid-template-columns: 95px 1fr; gap: 18px; }
}

@media (max-width: 860px) {
  .masthead { grid-template-columns: 1fr auto; }
  .issue { display: none; }
  .intro { grid-template-columns: 1fr; gap: 42px; }
  .date-stamp { max-width: 400px; }
  .event-item {
    grid-template-columns: 85px minmax(0, 1fr) 42px;
  }
  .event-summary { grid-column: 2 / 3; }
  .event-place { grid-column: 2 / 3; }
  .row-arrow { grid-column: 3; grid-row: 1; }
  .detail-layer { grid-template-columns: minmax(0, 1fr); }
  .detail-scrim { display: none; }
}

@media (max-width: 560px) {
  .masthead {
    min-height: 74px;
    gap: 10px;
    padding: 12px 16px;
  }
  .brand { gap: 9px; font-size: 1.05rem; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-mark i { top: 4px; height: 15px; }
  .saved-toggle { min-height: 42px; padding: 7px 8px; }
  .saved-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .intro {
    min-height: auto;
    gap: 24px;
    padding: 34px 20px 30px;
  }
  .intro h1 { margin-bottom: 18px; font-size: clamp(3.1rem, 15vw, 4.2rem); }
  .intro-copy > p { font-size: 1.04rem; }
  .date-stamp { width: 100%; grid-template-columns: 1fr 1fr 0.9fr; }
  .date-stamp > div { padding: 7px 9px 3px; }
  .date-stamp strong { font-size: 2.65rem; }
  .date-stamp p {
    grid-column: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px;
  }
  .browse { padding: 26px 16px 66px; }
  .browse-heading { display: block; margin-bottom: 20px; }
  .browse-heading h2 { margin-bottom: 8px; font-size: 2.25rem; }
  .controls { grid-template-columns: minmax(0, 1.6fr) minmax(120px, 1fr); gap: 8px; margin-bottom: 24px; }
  .controls label > span:first-child { font-size: 0.64rem; letter-spacing: 0.05em; }
  .input-wrap svg { left: 12px; width: 18px; }
  input { padding-left: 40px; }
  input, select { min-height: 50px; }
  .day-divider { grid-template-columns: 65px 1fr; gap: 12px; padding-top: 20px; }
  .day-divider h3 { font-size: 1.28rem; }
  .event-item {
    grid-template-columns: 65px minmax(0, 1fr) 36px;
    gap: 12px;
    padding: 20px 0 23px;
  }
  .event-time { font-size: 1rem; }
  .open-item { font-size: 1.23rem; }
  .event-summary { grid-column: 2 / 4; margin-top: 0; font-size: 0.88rem; }
  .event-place { grid-column: 2 / 4; font-size: 0.8rem; }
  .row-arrow { width: 34px; height: 34px; }
  footer { grid-template-columns: 1fr auto; padding: 32px 20px; }
  footer p:nth-child(2) { display: none; }
  .detail-top { padding: 15px 16px; }
  .detail-hero { padding: 36px 20px 32px; }
  .detail-hero h2 { font-size: clamp(2.55rem, 13vw, 3.8rem); }
  .detail-body { padding: 30px 20px 46px; }
  .detail-copy { font-size: 1.08rem; }
  .detail-facts { margin-bottom: 32px; }
}

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