/* Forma — workshops for hands and minds.
   Palette: warm off-white, deep ink, cobalt, mustard. */

:root {
  --bg: #F5F1EA;
  --bg-2: #EFE9DF;
  --ink: #15140F;
  --ink-soft: #4A4639;
  --ink-faint: #8A8472;
  --line: #D8D0C2;
  --cobalt: #1B3E92;
  --cobalt-deep: #142C66;
  --mustard: #E0A526;
  --mustard-deep: #B58016;
  --white: #FFFFFF;
  --radius: 3px;
  --shadow: 0 1px 0 rgba(21,20,15,0.04), 0 8px 24px -12px rgba(21,20,15,0.18);
  --maxw: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

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

a { color: var(--cobalt); }

button { font: inherit; color: inherit; }

.skip-link {
  position: absolute;
  left: 0; top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
  transform: translateY(-120%);
  transition: transform 0.18s ease;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { color: var(--cobalt); display: inline-flex; }
.brand-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.site-nav { display: flex; align-items: center; }

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.saved-toggle svg { transition: transform 0.15s ease; }
.saved-toggle:hover { background: var(--ink); color: var(--white); }
.saved-toggle[aria-pressed="true"] {
  background: var(--mustard);
  border-color: var(--mustard-deep);
  color: var(--ink);
}
.saved-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--ink);
  color: var(--white);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.saved-toggle[aria-pressed="true"] .saved-count {
  background: var(--ink);
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
  background: var(--cobalt);
  color: var(--white);
  overflow: hidden;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) 24px clamp(36px, 6vw, 64px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero-eyebrow {
  margin: 0 0 18px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
}
.hero-title {
  margin: 0 0 22px;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero-lede {
  margin: 0 0 28px;
  max-width: 42ch;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 36px;
  border-top: 1px solid rgba(255,255,255,0.22);
  padding-top: 22px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.72); }

.hero-media { position: relative; }
.hero-img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(1.05);
}

/* Controls */
.controls {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.controls-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.control { display: flex; flex-direction: column; gap: 6px; }
.search-control { flex: 1 1 340px; }
.filter-control { flex: 0 0 auto; min-width: 220px; }
.control-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute;
  left: 13px;
  color: var(--ink-faint);
  pointer-events: none;
}
#search {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s ease;
}
#search:focus-visible { border-color: var(--cobalt); }
#search::placeholder { color: var(--ink-faint); }
.control-hint { font-size: 0.74rem; color: var(--ink-faint); }

#filter {
  font: inherit;
  font-size: 0.98rem;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315140F' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* List */
.list-section { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 64px; }
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.list-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.list-count {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

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

.item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.item-media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--bg-2);
  overflow: hidden;
}
.item-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.item-saved-flag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--mustard);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  display: none;
}
.item.is-saved .item-saved-flag { display: block; }

.item-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.item-cat {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cobalt);
  letter-spacing: 0.01em;
}
.item-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.item-meta span { white-space: nowrap; }
.item-meta .sep { color: var(--line); }
.item-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.item-price {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.open-item {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.open-item:hover { background: var(--cobalt); }

/* Empty state */
.empty-state {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  background: var(--bg-2);
}
.empty-title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; }
.empty-body { margin: 0 0 18px; color: var(--ink-soft); }
.empty-action {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
.empty-action:hover { background: var(--cobalt); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-brand { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.footer-note { margin: 0; font-size: 0.8rem; color: var(--ink-faint); }

/* Detail overlay */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(0px, 0px, 0px);
}
.detail-scrim {
  position: absolute;
  inset: 0;
  background: rgba(21,20,15,0.55);
  animation: fade-in 0.18s ease;
}
.detail-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  max-height: 100dvh;
  overflow-y: auto;
  background: var(--bg);
  margin-top: 0;
  animation: panel-in 0.22s ease;
}
.close-detail {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 0;
  padding: 10px 14px;
  margin: 16px 0 0 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
}
.close-detail:hover { background: var(--bg-2); }
.close-label { line-height: 1; }

.detail-body { padding: 0 16px 40px; }
.detail-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }

.detail-head {
  padding: 22px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-cat {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--cobalt);
}
.detail-title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.detail-body-text {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
  padding: 4px 4px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0 0;
  background: var(--white);
}
.detail-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-cell-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: none;
  margin-bottom: 4px;
}
.detail-cell-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.detail-cell:last-child { border-right: none; }

.detail-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 4px 0;
  align-items: center;
}
.save-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  font-size: 0.96rem;
  font-weight: 800;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.save-item svg { transition: fill 0.15s ease; }
.save-item:hover { background: var(--ink); color: var(--white); }
.save-item:hover svg { fill: var(--white); }
.save-item[aria-pressed="true"] {
  background: var(--mustard);
  border-color: var(--mustard-deep);
  color: var(--ink);
}
.save-item[aria-pressed="true"]:hover {
  background: var(--mustard-deep);
  border-color: var(--mustard-deep);
  color: var(--white);
}
.save-item[aria-pressed="true"]:hover svg { fill: var(--white); }

.save-icon { fill: transparent; stroke: currentColor; stroke-width: 1.8; }

/* Animations */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Responsive */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-img { max-height: 320px; }
  .workshop-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .header-inner { padding: 12px 16px; }
  .controls-inner { padding: 20px 16px; gap: 14px; }
  .list-section { padding: 28px 16px 48px; }
  .workshop-list { grid-template-columns: 1fr; gap: 18px; }
  .hero-stats { gap: 16px 22px; }
  .detail-body { padding: 0 16px 40px; }
  .footer-inner { padding: 22px 16px; }
}
