/* ============================================================
   Forma — warm, editorial "nature distilled" design system
   ============================================================ */

:root {
  /* color tokens */
  --bg: #f6f1e7;
  --bg-deep: #efe7d8;
  --surface: #fffdf8;
  --ink: #2b2118;
  --ink-soft: #63523f;
  --ink-faint: #7e6e5a;
  --clay: #b5651d;
  --clay-deep: #8f4a12;
  --terracotta: #c67b5c;
  --border: #e4d9c6;
  --border-strong: #d3c3a8;
  --shadow-soft: 0 10px 30px rgba(63, 45, 24, 0.10);
  --shadow-lift: 0 18px 44px rgba(63, 45, 24, 0.16);
  --scrim: rgba(43, 33, 24, 0.55);

  /* type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* rhythm */
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.container {
  width: min(1160px, 100% - 48px);
  margin-inline: auto;
}

/* ---------- a11y helpers ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2.5px solid var(--clay-deep);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 26px; height: 26px;
  color: var(--clay-deep);
  align-self: center;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.header-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration-color: var(--terracotta);
  text-underline-offset: 4px;
}
.header-link:hover { color: var(--clay-deep); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--clay-deep); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }

.btn .heart { width: 18px; height: 18px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding-block: 72px 56px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-deep);
}

.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4rem);
  margin: 0 0 20px;
}

.hero h1 em {
  font-style: italic;
  color: var(--clay-deep);
  position: relative;
  white-space: nowrap;
}

.squiggle {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -0.18em;
  color: var(--terracotta);
  pointer-events: none;
}
.squiggle svg { width: 100%; height: 0.28em; display: block; }

.lede {
  margin: 0 0 26px;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: flex;
  gap: 28px;
  margin: 34px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.hero-media { margin: 0; position: relative; }
.hero-media img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1.5px solid var(--terracotta);
  border-radius: var(--radius-l);
  z-index: -1;
}
.hero-media figcaption {
  margin-top: 14px;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-faint);
}

.rule { color: var(--border-strong); padding-block: 8px; }
.rule svg { width: 100%; height: 24px; display: block; }

/* ---------- browse section ---------- */

.browse { padding-block: 24px 72px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 28px;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { margin: 0; color: var(--ink-soft); }

/* toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label,
.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field-label { line-height: 1.35; }

.field-search { flex: 1 1 280px; }

.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 13px; top: 50%;
  translate: 0 -50%;
  width: 18px; height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  min-height: 44px;
  padding: 9px 14px 9px 40px;
  font: 400 1rem var(--font-body);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-s);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap input::placeholder { color: var(--ink-faint); }
.input-wrap input:hover { border-color: var(--ink-faint); }
.input-wrap input:focus {
  outline: none;
  border-color: var(--clay-deep);
  box-shadow: 0 0 0 3px rgba(181, 101, 29, 0.22);
}

.field-filter select {
  min-height: 44px;
  min-width: 170px;
  padding: 9px 36px 9px 12px;
  font: 500 1rem var(--font-body);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-s);
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2363523f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px 18px;
}
.field-filter select:hover { border-color: var(--ink-faint); }
.field-filter select:focus {
  outline: none;
  border-color: var(--clay-deep);
  box-shadow: 0 0 0 3px rgba(181, 101, 29, 0.22);
}

.field-saved .btn-saved {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--ink);
}
.field-saved .btn-saved:hover { border-color: var(--ink-faint); }

.btn-saved[aria-pressed="true"] {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
  color: #fff;
}
.btn-saved[aria-pressed="true"] .heart path { fill: currentColor; }

.saved-count {
  min-width: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--clay-deep);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}
.btn-saved[aria-pressed="true"] .saved-count { background: #fff; color: var(--clay-deep); }

.result-count {
  margin: 18px 2px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- workshop cards ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(63, 45, 24, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}

.card-media { position: relative; margin: 0; }
.card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(43, 33, 24, 0.28));
  pointer-events: none;
}

.saved-flag {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.95);
  color: var(--clay-deep);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}
.saved-flag svg { width: 13px; height: 13px; }
.saved-flag .heart path { fill: currentColor; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 18px 18px 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.chip-ceramics { background: #f3e0d3; color: #7c4415; }
.chip-painting { background: #f5ecd2; color: #6e5a10; }
.chip-floristry { background: #e9edda; color: #46511a; }
.chip-baking { background: #f7e6cf; color: #7a4a10; }

.card-title { font-size: 1.35rem; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-meta svg { width: 15px; height: 15px; color: var(--ink-faint); flex: none; }

.card-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.price small {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.btn-open {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 600 0.88rem var(--font-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.btn-open svg { width: 15px; height: 15px; transition: translate 0.18s ease; }
.btn-open:hover { background: var(--ink); color: #fff; }
.btn-open:hover svg { translate: 3px 0; }

/* ---------- empty state ---------- */

.empty-state {
  padding: 56px 24px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.empty-state svg { width: 52px; height: 52px; color: var(--terracotta); margin-bottom: 12px; }
.empty-state h3 { font-size: 1.4rem; margin-bottom: 8px; }
.empty-state p { margin: 0 auto 20px; max-width: 42ch; color: var(--ink-soft); }

/* ---------- good to know ---------- */

.know { padding-block: 8px 72px; }
.know h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 20px; }

.know-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.know-grid li {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.know-grid h3 { font-size: 1.15rem; margin-bottom: 6px; }
.know-grid p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
@media (max-width: 800px) { .know-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */

.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
}
.footer-bar {
  padding-block: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
}
.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.footer-brand span { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink-soft); }
.footer-note { margin: 0; font-size: 0.82rem; color: var(--ink-faint); max-width: 52ch; }

/* ---------- detail dialog ---------- */

html.dialog-open { overflow: hidden; }

.detail {
  width: min(880px, calc(100% - 32px));
  max-height: min(860px, calc(100% - 48px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  overflow: visible;
}
.detail::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(3px);
}
.detail[open] { animation: detail-in 0.25s ease; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.detail-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  max-height: min(860px, calc(100vh - 48px));
  overflow-y: auto;
  border-radius: inherit;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(43, 33, 24, 0.08); }

.detail-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.detail-close:hover { background: #fff; }

.detail-media { margin: 0; flex: none; }
.detail-media img {
  width: 100%;
  height: clamp(180px, 32vh, 300px);
  object-fit: cover;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

.detail-body {
  padding: 26px clamp(20px, 5vw, 44px) 30px;
}

.detail-head .chip { margin-bottom: 12px; }
.detail-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 6px; }
.detail-instructor { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.98rem; }
.detail-instructor strong { color: var(--ink); font-weight: 600; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin: 0 0 20px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.detail-facts > div { background: var(--surface); padding: 12px 14px; }
.detail-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.detail-facts dd { margin: 0; font-weight: 600; font-size: 0.98rem; }

.detail-text p {
  margin: 0 0 12px;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.detail-text p:last-child { margin-bottom: 0; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.save-btn[aria-pressed="true"] {
  background: var(--clay-deep);
}
.save-btn[aria-pressed="true"] .heart path { fill: currentColor; }

.save-hint { margin: 0; font-size: 0.85rem; color: var(--ink-faint); }

/* mobile detail sheet */
@media (max-width: 640px) {
  .detail {
    width: 100%;
    max-width: 100%;
    max-height: calc(100% - 24px);
    margin: auto 0 0;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    align-self: end;
  }
  .detail[open] { animation: sheet-in 0.28s ease; }
  .detail-inner { max-height: calc(100vh - 24px); }
  .detail-media img { height: 200px; border-radius: var(--radius-l) var(--radius-l) 0 0; }
  .detail::backdrop { backdrop-filter: none; }
}
@keyframes sheet-in {
  from { opacity: 0.6; transform: translateY(48px); }
  to { opacity: 1; transform: none; }
}

/* ---------- responsive: header, hero, toolbar ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 44px 40px; }
  .hero-media { order: -1; max-width: 560px; }
  .hero-media::after { display: none; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 40px); }
  .brand-sub, .header-link { display: none; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .section-head { flex-direction: column; gap: 6px; }
  .toolbar { gap: 14px; }
  .field-search, .field-filter, .field-saved { flex: 1 1 100%; }
  .field-filter select { width: 100%; }
  .field-saved .btn-saved { width: 100%; justify-content: center; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
  .detail[open] { animation: none; }
}
