/* ————————————————————————————————————————————————
   Forma — the studio ledger
   Pigments drawn from the crafts: celadon glaze,
   ultramarine paint, rose madder, loaf ochre.
   ———————————————————————————————————————————————— */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/artifacts/forma-frontend--v1--s1--glm-5.3--frontend-design--2026-09-17T06-04-18-816Z/assets/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --ground: #edeee7;
  --surface: #f7f7f0;
  --ink: #232722;
  --ink-soft: #575e55;
  --line: #d3d6c9;
  --pig-ceramics: #3e6f68;
  --pig-painting: #3d51c4;
  --pig-floristry: #c6486d;
  --pig-baking: #a0691a;
  --pig-legend: #8a9084;
  --radius: 18px;
  --focus: 2px solid var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

/* ————— shared ————— */

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 60;
  background: var(--ink);
  color: var(--ground);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--ink); color: var(--ground); }
.btn-solid { background: var(--ink); color: var(--ground); }
.btn-solid:hover { background: #3a3f39; }

.icon { flex: none; }

/* ————— top bar ————— */

.topbar {
  border-bottom: 1.5px solid var(--ink);
  background: var(--ground);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.wordmark {
  font-size: 1.6rem;
  font-weight: 800;
  font-stretch: 92%;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.1;
}
.wordmark-dot { color: var(--pig-painting); }
.wordmark-tag {
  margin: 0 0 0 2px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  align-self: center;
}
.shortlist-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  align-self: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.shortlist-btn:hover { background: var(--ink); color: var(--ground); }
.shortlist-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
}
.shortlist-btn .count {
  background: var(--pig-painting);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 1.4em;
  text-align: center;
  padding: 0.05em 0.4em;
  border-radius: 999px;
  line-height: 1.4;
}
.shortlist-btn[aria-pressed="true"] .count { background: var(--ground); color: var(--ink); }

/* ————— controls ————— */

.controls {
  position: sticky;
  top: var(--topbar-h, 0);
  z-index: 25;
  border-bottom: 1px solid var(--line);
  background: rgba(237, 238, 231, 0.92);
  backdrop-filter: blur(6px);
}
.controls-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input,
.field select {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  max-width: 100%;
}
.field input { width: clamp(11rem, 22vw, 19rem); }
.field select { cursor: pointer; }
.field input::placeholder { color: var(--pig-legend); }

.result-count {
  margin: 0 0 0 auto;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding-bottom: 0.55rem;
  white-space: nowrap;
}

/* ————— hero ————— */

main { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: center;
  padding: 3.5rem 0 3rem;
}
.hero-copy h1 {
  font-size: clamp(2.7rem, 5.4vw, 4.4rem);
  font-weight: 800;
  font-stretch: 88%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}
.hero-copy > p {
  max-width: 34ch;
  font-size: 1.08rem;
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
}
.hero-facts {
  margin: 0;
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-facts dt {
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 3px solid var(--pig-ceramics);
  display: inline-block;
  padding-bottom: 0.15rem;
}
.hero-facts > div:nth-child(2) dt { border-color: var(--pig-floristry); }
.hero-facts dd {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.hero-figure {
  margin: 0;
  border-radius: 200px 200px var(--radius) var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--ink);
  max-height: 420px;
}
.hero-figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* ————— ledger ————— */

.ledger { padding: 0.5rem 0 3rem; }
.ledger-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.5rem;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 0.7rem;
}
.ledger-head h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  font-stretch: 92%;
  letter-spacing: -0.01em;
}
.ledger-note { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

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

.row {
  display: grid;
  grid-template-columns: 6.2rem 13.5rem minmax(0, 1fr) 13rem;
  gap: 1.6rem;
  align-items: center;
  padding: 1.4rem 0.9rem;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.15s ease;
}
.row:hover { background: var(--surface); }
.row:focus-within { background: var(--surface); }

.row-date { text-align: left; }
.row-month { font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); }
.row-day {
  font-size: 3.1rem;
  font-weight: 800;
  font-stretch: 85%;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.row[data-cat="Ceramics"] .row-day { color: var(--pig-ceramics); }
.row[data-cat="Painting"] .row-day { color: var(--pig-painting); }
.row[data-cat="Floristry"] .row-day { color: var(--pig-floristry); }
.row[data-cat="Baking"] .row-day { color: var(--pig-baking); }
.row-weekday { font-size: 0.85rem; color: var(--ink-soft); }

.row-photo {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 90px 90px 12px 12px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
}
.row-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.row-body { min-width: 0; }
.row-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.swatch {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  background: var(--pig-legend);
  display: inline-block;
}
.row[data-cat="Ceramics"] .swatch { background: var(--pig-ceramics); }
.row[data-cat="Painting"] .swatch { background: var(--pig-painting); }
.row[data-cat="Floristry"] .swatch { background: var(--pig-floristry); }
.row[data-cat="Baking"] .swatch { background: var(--pig-baking); }

.row-body h3 {
  margin: 0.3rem 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  font-stretch: 92%;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.row-body .instructor { margin: 0 0 0.45rem; font-size: 0.9rem; color: var(--ink-soft); }
.row-body .desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 52ch;
}
.row-body .open-btn {
  margin-top: 0.8rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
}
.row-body .open-btn:hover { text-decoration-color: var(--ink); }

.saved-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pig-ceramics);
  vertical-align: middle;
}
.saved-flag .swatch { background: var(--pig-ceramics); width: 0.55rem; height: 0.55rem; }

.row-facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.3rem 1.6rem;
  font-size: 0.95rem;
}
.row-facts div { display: contents; }
.row-facts dt { color: var(--ink-soft); }
.row-facts dd { margin: 0; font-weight: 700; }
.row-price { font-size: 1.15rem; }

/* ————— empty state ————— */

.empty {
  padding: 3.5rem 1rem;
  text-align: center;
}
.empty-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.4rem; }
.empty p { margin: 0 0 1.4rem; color: var(--ink-soft); }
.empty .btn { margin: 0 auto; }

/* ————— footer ————— */

.footer {
  border-top: 1.5px solid var(--ink);
  margin-top: 2rem;
}
.footer p {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem 2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.footer a { color: var(--ink); }

/* ————— detail drawer ————— */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(35 39 34 / 0.45);
  z-index: 40;
  animation: fade-in 0.25s ease both;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(34rem, 100%);
  background: var(--surface);
  border-left: 1.5px solid var(--ink);
  z-index: 50;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: drawer-in 0.32s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}
@keyframes drawer-in { from { transform: translateX(4rem); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes stamp { 0% { transform: scale(0.86); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }

.drawer-top {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0.9rem 1.2rem 0.9rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.close-btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.close-btn:hover { background: var(--ink); color: var(--ground); }

.drawer-photo {
  margin: 0 1.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 130px 130px 14px 14px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
}
.drawer-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.drawer-content { padding: 1.6rem 1.7rem 2.5rem; }
.drawer-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.drawer-content h2 {
  margin: 0.5rem 0 0.8rem;
  font-size: 2.1rem;
  font-weight: 800;
  font-stretch: 90%;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.drawer-body-text { margin: 0 0 1.6rem; font-size: 1.05rem; max-width: 46ch; }

.fact-grid {
  margin: 0 0 1.8rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.fact-grid > div {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.fact-grid > div:nth-last-child(-n + 2) { border-bottom: none; }
.fact-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.fact-grid dt { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.fact-grid dd { margin: 0.15rem 0 0; font-weight: 700; font-size: 1.02rem; }

.save-btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  background: var(--ink);
  color: var(--ground);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.save-btn:hover { background: #3a3f39; }
.save-btn[aria-pressed="true"] {
  background: var(--pig-ceramics);
  border-color: var(--pig-ceramics);
  color: #fff;
}
.save-btn[aria-pressed="true"]:hover { background: #35625b; }
.save-btn.stamp { animation: stamp 0.3s ease both; }
.save-btn .icon-filled { fill: currentColor; stroke: none; }

.drawer-dismiss-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ————— responsive ————— */

@media (max-width: 900px) {
  .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-areas:
      "date date"
      "photo body"
      "facts body";
    gap: 1rem 1.3rem;
  }
  .row-date { grid-area: date; display: flex; align-items: baseline; gap: 0.7rem; }
  .row-day { font-size: 2.4rem; }
  .row-photo { grid-area: photo; border-radius: 70px 70px 10px 10px; }
  .row-body { grid-area: body; }
  .row-facts { grid-area: facts; }
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 1.8rem; padding: 2.4rem 0 2.2rem; }
  .hero-figure { border-radius: 130px 130px var(--radius) var(--radius); max-height: 280px; }
  .hero-figure img { max-height: 280px; }
  .topbar-inner { padding: 0.7rem 1rem; }
  .wordmark-tag { flex-basis: 100%; order: 3; }
  .controls-inner { padding: 0.6rem 1rem; gap: 0.8rem; }
  .field input { width: 100%; }
  .field-search { flex: 1 1 100%; }
  .result-count { margin-left: 0; padding-bottom: 0.2rem; }
  main { padding: 0 1rem; }
  .row { grid-template-columns: 1fr; grid-template-areas: "date" "photo" "body" "facts"; padding: 1.3rem 0.5rem; }
  .row-photo { max-width: 21rem; }
  .drawer-photo { margin: 0 1rem; }
  .drawer-content { padding: 1.3rem 1.2rem 2rem; }
  .footer p { padding: 1.1rem 1rem 1.8rem; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact-grid > div { border-right: none; }
  .fact-grid > div:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .fact-grid > div:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer, .drawer-backdrop, .save-btn.stamp { animation: none; }
  .row, .btn, .save-btn, .shortlist-btn, .close-btn, .skip-link { transition: none; }
}
