:root {
  --ink: #10262e;
  --ink-soft: #46606b;
  --chalk: #e9eeef;
  --paper: #f8fafa;
  --line: #c2cfd3;
  --poppy: #f4b63f;
  --focus: #0a62a0;

  --c-ceramics: #a9bdd0;
  --c-painting: #5ec0d6;
  --c-floristry: #f4b63f;
  --c-baking: #d9a06b;

  --sans: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --pad: clamp(16px, 4vw, 56px);
}

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

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

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

body.modal-open { overflow: hidden; }

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

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

.sr-only {
  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(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 100;
  background: var(--poppy);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700;
  border-radius: 4px;
}
.skip:focus { top: 8px; }

/* ---------- Hero ---------- */

.hero {
  background: var(--ink);
  color: var(--chalk);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  min-height: 340px;
}

.hero-copy {
  padding: 26px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: auto;
}
.brand-mark { color: var(--poppy); }

.hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 4.9rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 12ch;
  text-wrap: balance;
}

.lede {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 46ch;
  color: #cfdadd;
}

.hero-media { position: relative; min-height: 0; }

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 50%;
}

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

main {
  padding: 0 var(--pad) 56px;
  max-width: 1440px;
  margin: 0 auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px auto;
  gap: 16px;
  align-items: end;
  padding: 28px 0 8px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.875rem; font-weight: 700; }

.field input,
.field select {
  height: 50px;
  width: 100%;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 6px;
}
.field input::placeholder { color: var(--ink-soft); opacity: 1; }

.saved-toggle {
  height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.saved-toggle .bm { fill: none; stroke: currentColor; }
.saved-toggle .count {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  font-size: 0.875rem;
  border-radius: 13px;
  background: var(--ink);
  color: var(--chalk);
}
.saved-toggle[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.saved-toggle[aria-pressed="true"] .bm { fill: var(--poppy); stroke: var(--poppy); }
.saved-toggle[aria-pressed="true"] .count { background: var(--poppy); color: var(--ink); }

.results-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 12px;
}
.results-bar h2 { font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 800; }
.results-bar p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Workshop rows ---------- */

.list { display: grid; gap: 14px; outline: none; }
.list[hidden] { display: none; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 112px 250px minmax(0, 1fr) auto;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  min-height: 176px;
}
.row:hover { box-shadow: 5px 5px 0 var(--ink); }

.tile {
  background: var(--tone, var(--c-ceramics));
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  text-align: center;
  line-height: 1;
}
.tile .wd { font-size: 0.95rem; font-weight: 700; }
.tile .day { font-size: 3.6rem; font-weight: 800; letter-spacing: -0.05em; margin: 6px 0 4px; }
.tile .mon { font-size: 0.95rem; font-weight: 700; }

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--line);
}

.main {
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.cat::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--tone);
  border: 1.5px solid var(--ink);
}

.main h3 { font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.025em; font-weight: 800; }

.open {
  all: unset;
  cursor: pointer;
}
.open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.open:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 8px; }

.desc {
  font-family: var(--serif);
  line-height: 1.55;
  max-width: 58ch;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.side {
  padding: 20px 24px 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-width: 130px;
}
.price { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-align: right; }
.seats { font-size: 0.875rem; color: var(--ink-soft); text-align: right; margin-top: 4px; }

.quick-save {
  position: relative;
  z-index: 2;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}
.quick-save svg { fill: none; stroke: currentColor; }
.quick-save[aria-pressed="true"] { background: var(--ink); }
.quick-save[aria-pressed="true"] svg { fill: var(--poppy); stroke: var(--poppy); }

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

.empty {
  margin-top: 8px;
  padding: 40px 28px;
  border: 2px dashed var(--ink);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.empty[hidden] { display: none; }
.empty h3 { font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 800; }
.empty p { font-family: var(--serif); max-width: 52ch; margin-bottom: 8px; }

.btn {
  height: 50px;
  padding: 0 22px;
  font: inherit;
  font-weight: 700;
  color: var(--chalk);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.btn:hover { background: #1c3d49; }

.site-foot {
  padding: 24px var(--pad) 40px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  border-top: 1.5px solid var(--line);
  max-width: 1440px;
  margin: 0 auto;
}

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

.dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: min(960px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  overflow: visible;
}
.dialog:not([open]) { display: none; }
.dialog::backdrop { background: rgba(16, 38, 46, 0.72); }

.detail {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  background: var(--chalk);
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
}

.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 24px;
  background: var(--tone);
  border-bottom: 2px solid var(--ink);
}
.detail-bar .cat { color: var(--ink); font-size: 1rem; }
.detail-bar .cat::before { background: var(--paper); }

.close {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  color: var(--chalk);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.close svg { stroke: currentColor; fill: none; }

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.detail-photo {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  background: var(--line);
}

.detail-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-body h2 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1; letter-spacing: -0.035em; font-weight: 800; }

.detail-text { font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; max-width: 56ch; }

.spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1.5px solid var(--ink);
}
.spec div { padding: 12px 12px 12px 0; border-bottom: 1.5px solid var(--line); }
.spec .wide { grid-column: 1 / -1; }
.spec dt { font-size: 0.875rem; color: var(--ink-soft); }
.spec dd { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }

.detail-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
}
.detail-foot .note { flex: 1; font-size: 0.95rem; color: var(--ink-soft); }

.save-btn {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: var(--poppy);
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.save-btn svg { fill: none; stroke: currentColor; }
.save-btn[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.save-btn[aria-pressed="true"] svg { fill: var(--poppy); stroke: var(--poppy); }

@media (hover: hover) {
  .save-btn:hover, .saved-toggle:hover, .close:hover { filter: brightness(1.08); }
  .saved-toggle[aria-pressed="false"]:hover { background: var(--paper); }
}

@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: rise 0.22s ease-out; }
  .dialog[open]::backdrop { animation: fade 0.22s ease-out; }
  .row { transition: box-shadow 0.15s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
  @keyframes fade { from { opacity: 0; } }
}

/* ---------- Tablet ---------- */

@media (max-width: 1080px) {
  .row { grid-template-columns: 96px 190px minmax(0, 1fr) auto; }
  .tile .day { font-size: 3rem; }
  .main h3 { font-size: 1.5rem; }
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 20px var(--pad) 24px; gap: 16px; }
  .brand { margin-bottom: 4px; }
  .hero h1 { font-size: 2.4rem; max-width: 11ch; }
  .lede { font-size: 1.05rem; }
  .hero-media { height: 120px; }
  .hero-photo { object-position: 50% 60%; }

  .toolbar { grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 20px; }
  .field-search { grid-column: 1 / -1; }
  .saved-toggle { justify-content: center; padding: 0 12px; }

  .results-bar { padding-top: 20px; }

  .row {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      "photo photo"
      "tile main"
      "tile side";
    min-height: 0;
  }
  .thumb { grid-area: photo; height: 170px; }
  .tile { grid-area: tile; padding: 12px 4px; }
  .tile .day { font-size: 2.5rem; }
  .main { grid-area: main; padding: 16px 16px 8px; }
  .main h3 { font-size: 1.5rem; }
  .side {
    grid-area: side;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 16px;
  }
  .side .price-wrap { display: flex; align-items: baseline; gap: 10px; }
  .price { font-size: 1.6rem; }
  .seats { margin-top: 0; }

  .dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  .detail { height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .detail-bar { padding-left: 16px; }
  .detail-scroll { display: block; }
  .detail-photo { height: 200px; min-height: 0; }
  .detail-body { padding: 20px 16px 24px; }
  .detail-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; gap: 8px; }
  .detail-foot .note { order: 2; text-align: center; font-size: 0.875rem; }
  .detail-foot .note:empty { display: none; }
}
