/* Forma — October program
   Warm paper, dark ink, a terracotta accent. System fonts only. */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d7;
  --card: #fbf8f2;
  --ink: #1f1b16;
  --ink-2: #3a332b;
  --muted: #655c52;
  --line: #d8cfbf;
  --accent: #a94c24;
  --accent-ink: #fff8f1;

  --c-baking: #b7812a;
  --c-ceramics: #4f7385;
  --c-floristry: #d0761f;
  --c-painting: #7a4e8c;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Georgia", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 10px;
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; text-underline-offset: 3px; }

button, input, select { font: inherit; color: inherit; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

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

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

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark__mark { width: 28px; height: 28px; color: var(--accent); }

.masthead__note { font-size: 14px; color: var(--muted); }

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(32px, 5vw, 56px);
}

.intro h1 {
  margin-top: 14px;
  font-size: clamp(38px, 5.2vw, 68px);
  max-width: 13ch;
}

.intro__lede {
  margin-top: 20px;
  max-width: 50ch;
  font-size: 19px;
  color: var(--ink-2);
}

.intro__facts {
  display: flex;
  gap: 36px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.intro__facts div { display: flex; flex-direction: column-reverse; }
.intro__facts dt { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.intro__facts dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

.intro__figure {
  margin: 0;
  position: relative;
}
.intro__figure img {
  width: 100%;
  height: clamp(300px, 34vw, 420px);
  object-fit: cover;
  object-position: 60% 50%;
  border-radius: 999px 999px var(--radius) var(--radius);
}

/* ---------- Controls ---------- */

.program { outline: none; }

.controls {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
}

.controls__inner {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-block: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.field--search { flex: 1 1 auto; }
.field--select { flex: 0 0 220px; }

.field__control { position: relative; }
.field__control > svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  border: 1px solid #b9ad9a;
  border-radius: 8px;
  background: var(--card);
  padding: 0 14px;
  font-size: 16px;
}
.field input { padding-left: 42px; }
.field input::placeholder { color: #8a7f72; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23655c52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.field input:hover, .field select:hover { border-color: var(--ink-2); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--accent); outline-offset: 1px; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px 0 16px;
  border: 1px solid #b9ad9a;
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 15px;
}
.toggle svg { width: 18px; height: 18px; }
.toggle:hover { border-color: var(--ink-2); }
.toggle__count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.toggle[aria-pressed="true"] svg path { fill: currentColor; }
.toggle[aria-pressed="true"] .toggle__count { background: var(--accent); color: var(--accent-ink); }

/* ---------- Program list ---------- */

.program__body { padding-block: 32px 80px; }

.program__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.program__head h2 { font-size: clamp(28px, 3vw, 36px); }
.program__status { color: var(--muted); font-size: 15px; }

.shortlist-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  align-items: baseline;
  margin: 16px 0 8px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
}
.shortlist-summary strong { font-family: var(--serif); font-weight: 500; font-size: 20px; }

.weekend {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  padding-top: 28px;
  margin-top: 20px;
  border-top: 2px solid var(--ink);
}
.weekend__head { position: relative; }
.weekend__head > div { position: sticky; top: 104px; }
.weekend__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.weekend__dates {
  margin-top: 4px;
  font-size: 30px;
}

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

.item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 176px minmax(0, 1fr) 176px;
  grid-template-areas: "date thumb text aside";
  gap: 24px;
  padding: 0 0 28px;
  border-radius: var(--radius);
}
.item + .item { padding-top: 28px; border-top: 1px solid var(--line); }

.item__date {
  grid-area: date;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-variant-numeric: lining-nums tabular-nums;
}
.item__dow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.item__day {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
  margin-top: 2px;
}
.item__mon { font-size: 14px; color: var(--muted); margin-top: 2px; }

.item__thumb {
  grid-area: thumb;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-2);
}
.item__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.item:hover .item__thumb img { transform: scale(1.04); }

.item__text { grid-area: text; min-width: 0; }

.cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cat::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cat, var(--accent));
}
[data-category="Baking"] { --cat: var(--c-baking); }
[data-category="Ceramics"] { --cat: var(--c-ceramics); }
[data-category="Floristry"] { --cat: var(--c-floristry); }
[data-category="Painting"] { --cat: var(--c-painting); }

.item__title {
  margin-top: 6px;
  font-size: 30px;
}
.item__summary {
  margin-top: 8px;
  color: var(--ink-2);
  max-width: 56ch;
}
.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--muted);
}
.item__meta li { display: inline-flex; align-items: center; gap: 6px; }
.item__meta svg { width: 15px; height: 15px; flex: none; }

.item__aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  text-align: right;
}
.item__price {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: lining-nums;
}
.item__seats { font-size: 14px; color: var(--muted); margin-top: 6px; }

.badge-saved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}
.badge-saved svg { width: 13px; height: 13px; }
.item__aside .badge-saved { margin-top: 10px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.button svg { width: 18px; height: 18px; }
.button--primary { background: var(--ink); color: var(--paper); }
.button--primary:hover { background: var(--accent); border-color: var(--accent); }

.button--open { position: static; }
.button--open:hover { background: var(--ink); color: var(--paper); }
/* Make the whole row a click target for the details button. */
.button--open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.item:hover .button--open { background: var(--ink); color: var(--paper); }
.item:hover .item__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

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

.empty {
  margin-top: 24px;
  padding: 48px 24px;
  border: 1px dashed #b9ad9a;
  border-radius: var(--radius);
  text-align: center;
}
.empty[hidden] { display: none; }
.empty__art { width: 120px; height: 80px; color: var(--muted); margin: 0 auto 12px; }
.empty h3 { font-size: 28px; }
.empty p { margin: 8px auto 20px; color: var(--muted); max-width: 44ch; }

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

.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 14px;
  color: var(--muted);
}
.footer__inner { display: grid; gap: 6px; padding-block: 28px; }
.footer strong { color: var(--ink); }

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

.detail {
  width: min(980px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 14, 8, .35);
  overflow: hidden;
}
.detail::backdrop {
  background: rgba(31, 27, 22, .6);
}
.detail[open] { animation: detail-in .28s cubic-bezier(.2, .7, .2, 1); }
.detail[open]::backdrop { animation: fade-in .28s ease-out; }

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

.detail__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  max-height: calc(100vh - 48px);
}

.detail__media { position: relative; min-height: 560px; background: var(--paper-2); }
.detail__media img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.detail__tag {
  position: absolute;
  left: 20px; bottom: 20px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
}

.detail__content {
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 44px 44px 32px;
  overscroll-behavior: contain;
}

.detail__close {
  position: absolute;
  top: 16px; right: 16px;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
}
.detail__close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.detail__close svg { width: 20px; height: 20px; }

.detail h2 {
  margin-top: 10px;
  padding-right: 48px;
  font-size: clamp(34px, 4vw, 48px);
}
.detail__body {
  margin-top: 16px;
  font-size: 19px;
  color: var(--ink-2);
}

.detail__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}
.detail__facts > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.detail__facts > div:nth-child(odd) { padding-right: 16px; }
.detail__facts > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.detail__facts dt { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.detail__facts dd { margin: 2px 0 0; font-size: 17px; font-variant-numeric: lining-nums; }

.detail__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.detail__price {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.button--save {
  min-height: 52px;
  padding: 0 22px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
}
.button--save svg path { fill: none; }
.button--save:hover { background: #8e3d1a; border-color: #8e3d1a; }
.button--save[aria-pressed="true"] {
  background: var(--card);
  border-color: var(--ink);
  color: var(--ink);
}
.button--save[aria-pressed="true"] svg path { fill: var(--accent); stroke: var(--accent); }
.button--save[aria-pressed="true"]:hover { background: var(--paper-2); }

.detail__note { margin-top: 14px; font-size: 14px; color: var(--muted); }

body.is-locked { overflow: hidden; }

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

@media (max-width: 1100px) {
  .weekend { grid-template-columns: 1fr; gap: 16px; }
  .weekend__head > div { position: static; display: flex; align-items: baseline; gap: 14px; }
  .weekend__dates { font-size: 26px; margin: 0; }

  .item {
    grid-template-columns: 64px 176px minmax(0, 1fr);
    grid-template-areas:
      "date thumb text"
      "date thumb aside";
    row-gap: 14px;
  }
  .item__aside {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  .item__aside > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .item__seats { margin: 0; }
  .item__aside .badge-saved { margin-top: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .masthead__inner { min-height: 58px; }
  .masthead__note { font-size: 13px; text-align: right; }
  .wordmark { font-size: 23px; }

  .intro { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .intro h1 { font-size: 38px; }
  .intro__lede { font-size: 17px; margin-top: 14px; }
  .intro__facts { gap: 28px; margin-top: 20px; padding-top: 14px; }
  .intro__facts dd { font-size: 26px; }
  .intro__figure { order: -1; }
  .intro__figure img { height: 150px; border-radius: 999px 999px var(--radius) var(--radius); }

  .controls { position: static; }
  .controls__inner { flex-wrap: wrap; gap: 12px; padding-block: 16px; }
  .field--search { flex: 1 1 100%; }
  .field--select { flex: 1 1 0; min-width: 0; }
  .field--toggle { flex: 0 0 auto; }

  .program__body { padding-top: 24px; }

  .weekend { margin-top: 16px; padding-top: 18px; }

  .item {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas:
      "thumb thumb"
      "date text"
      "aside aside";
    gap: 14px 14px;
    padding-bottom: 24px;
  }
  .item + .item { padding-top: 24px; }
  .item__thumb { aspect-ratio: 16 / 9; }
  .item__day { font-size: 38px; }
  .item__title { font-size: 26px; }
  .item__aside {
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }
  .item__price { font-size: 26px; }

  /* Full-screen sheet on small screens */
  .detail {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .detail__inner {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .detail__media { min-height: 0; height: 34vh; flex: none; }
  .detail__content { max-height: none; overflow: visible; padding: 24px 20px 0; flex: 1 0 auto; display: flex; flex-direction: column; }
  .detail__close {
    position: fixed;
    top: 12px; right: 12px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
  }
  .detail h2 { padding-right: 0; font-size: 34px; }
  .detail__body { font-size: 17px; }
  .detail__facts { grid-template-columns: 1fr; }
  .detail__facts > div:nth-child(odd),
  .detail__facts > div:nth-child(even) { padding: 12px 0; border-left: 0; }
  .detail__facts > div { display: flex; justify-content: space-between; gap: 16px; }
  .detail__facts dd { margin: 0; text-align: right; }
  .detail__actions {
    position: sticky;
    bottom: 0;
    margin: 24px -20px 0;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    order: 10;
  }
  .detail__note { margin-top: 12px; }
  .detail__price { font-size: 30px; }
  .button--save { flex: 1 1 auto; max-width: 260px; }
}

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

@media (forced-colors: active) {
  .toggle[aria-pressed="true"], .button--save[aria-pressed="true"] { outline: 2px solid CanvasText; }
}
