:root {
  --paper: #f5eee3;
  --paper-2: #ece2d2;
  --card: #fffaf2;
  --ink: #231f1a;
  --ink-2: #5b5247;
  --line: #d9ccb8;
  --clay: #a8431f;
  --clay-dark: #86320f;
  --moss: #2f3d2e;
  --c-ceramics: #a8431f;
  --c-painting: #28507a;
  --c-floristry: #8a3358;
  --c-baking: #845608;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --pad: clamp(18px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--text);
}
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

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

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50;
}
.skip:focus { top: 12px; }

/* Masthead */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font: 700 28px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark span { color: var(--clay); }
.masthead-note { font-size: 14px; color: var(--ink-2); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 4vw, 52px) var(--pad);
  max-width: 1440px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--clay-dark); font-weight: 600; margin-bottom: 14px;
}
.hero h1 {
  font: 600 clamp(32px, 4.6vw, 62px)/1.04 var(--display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.lede { margin-top: 18px; max-width: 52ch; color: var(--ink-2); font-size: 17px; }
.hero-link {
  display: inline-block; margin-top: 18px; font-weight: 600;
  text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--clay);
}
.hero-figure {
  margin: 0; aspect-ratio: 5 / 3.2; overflow: hidden;
  border-radius: 200px 200px var(--radius) var(--radius);
  background: var(--paper-2);
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; object-position: 35% 50%; }

/* Workshops section */
.workshops {
  max-width: 1440px; margin: 0 auto;
  padding: 12px var(--pad) 64px;
  scroll-margin-top: 8px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font: 600 clamp(26px, 3vw, 36px)/1.1 var(--display); letter-spacing: -0.02em; }
.count { font-size: 14px; color: var(--ink-2); }

.tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 14px; align-items: end;
  padding: 14px 0 22px;
  border-top: 2px solid var(--ink);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type="search"], select {
  width: 100%; height: 46px;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink-2);
  border-radius: 10px;
  padding: 0 14px;
}
select { appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23231f1a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input::placeholder { color: #8a7f70; }

.saved-toggle {
  height: 46px; display: inline-flex; align-items: center; gap: 9px;
  font: 600 15px var(--text); color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 0 16px; cursor: pointer;
}
.saved-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.saved-toggle .badge {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--paper-2); font-size: 13px;
}
.saved-toggle[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: #fff; }
.saved-toggle[aria-pressed="true"] svg { fill: currentColor; }
.saved-toggle[aria-pressed="true"] .badge { background: #fff; color: var(--moss); }

/* Cards */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 26px clamp(18px, 2vw, 30px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid[hidden] { display: none; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(35,31,26,.5); }
.card:focus-within { box-shadow: 0 0 0 3px var(--moss); }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.date-chip {
  position: absolute; left: 14px; top: 14px;
  background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 6px 12px 7px; text-align: center; line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.date-chip .m { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--clay-dark); }
.date-chip .d { display: block; font: 700 26px/1.1 var(--display); }
.saved-flag {
  position: absolute; right: 14px; top: 14px;
  background: var(--moss); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 99px;
}
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.cat {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cat, var(--clay));
}
.card h3 { font: 600 24px/1.15 var(--display); letter-spacing: -0.01em; }
.card-desc {
  color: var(--ink-2); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px dashed var(--line);
  font-size: 14px; color: var(--ink-2);
}
.price { font: 700 22px/1 var(--display); color: var(--ink); }
.open-btn {
  font: 600 14px var(--text); color: var(--ink);
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  text-decoration-color: var(--cat, var(--clay));
}
.open-btn::after { content: ""; position: absolute; inset: 0; }
.open-btn:focus-visible { outline: none; }

[data-cat="Ceramics"] { --cat: var(--c-ceramics); }
[data-cat="Painting"] { --cat: var(--c-painting); }
[data-cat="Floristry"] { --cat: var(--c-floristry); }
[data-cat="Baking"] { --cat: var(--c-baking); }

/* Empty */
.empty {
  text-align: center; padding: 56px 20px;
  border: 1.5px dashed var(--ink-2); border-radius: var(--radius);
}
.empty[hidden] { display: none; }
.empty h3 { font: 600 28px/1.2 var(--display); }
.empty p { margin: 8px auto 20px; color: var(--ink-2); max-width: 44ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font: 600 15px var(--text); cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
}
.btn-ghost { background: transparent; color: var(--ink); }
.btn-save[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); }
.btn-save svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn-save[aria-pressed="true"] svg { fill: currentColor; }

/* Detail dialog */
dialog.detail {
  padding: 0; border: 0; color: var(--ink);
  background: var(--card);
  width: min(960px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
dialog.detail::backdrop { background: rgba(35, 31, 26, .62); }
.detail-shell { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); max-height: calc(100dvh - 48px); }
.detail-media { position: relative; background: var(--paper-2); min-height: 100%; }
.detail-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-main { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 48px); }
.detail-scroll { padding: 32px 32px 16px; overflow-y: auto; flex: 1; }
.detail-close {
  position: absolute; right: 14px; top: 14px; z-index: 2;
  height: 42px; padding: 0 16px 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font: 600 14px var(--text); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 99px; cursor: pointer;
}
.detail-main .cat { margin-bottom: 8px; display: block; }
.detail-main h2 { font: 600 clamp(30px, 3.4vw, 42px)/1.08 var(--display); letter-spacing: -0.02em; padding-right: 100px; }
.detail-body { margin-top: 16px; font-size: 18px; line-height: 1.6; max-width: 56ch; }
.facts { margin: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.facts div { padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.detail-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 32px 20px; border-top: 1px solid var(--line); background: var(--card);
}
.detail-foot .price { font-size: 30px; }
.detail-foot small { display: block; font: 400 13px var(--text); color: var(--ink-2); margin-top: 3px; }

.foot {
  border-top: 1px solid var(--line); padding: 24px var(--pad) 40px;
  font-size: 13px; color: var(--ink-2); max-width: 1440px; margin: 0 auto;
}
.foot p { max-width: 80ch; }

/* Tablet */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile */
@media (max-width: 700px) {
  .masthead-note { display: none; }
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 22px; padding-bottom: 20px; }
  .hero-figure { order: -1; aspect-ratio: 16 / 8; border-radius: 120px 120px 12px 12px; }
  .lede { font-size: 16px; }
  .tools { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .saved-toggle { justify-content: center; padding: 0 12px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }

  dialog.detail {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
  }
  .detail-shell { display: flex; flex-direction: column; max-height: 100dvh; height: 100dvh; }
  .detail-media { min-height: 0; height: 190px; flex: none; }
  .detail-main { flex: 1; max-height: none; min-height: 0; }
  .detail-scroll { padding: 22px 20px 12px; }
  .detail-main h2 { padding-right: 0; }
  .detail-body { font-size: 17px; }
  .detail-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
  .detail-foot .price { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.detail[open] { animation: rise .22s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
