:root {
  --ink: #2b2420;
  --ink-soft: #5a5148;
  --cream: #faf5eb;
  --cream-deep: #f1e8d8;
  --paper: #fffdf9;
  --clay: #b3542b;
  --clay-dark: #8f3f1e;
  --line: #e3d8c4;
  --focus: #1c4fd6;

  --cat-ceramics: #7c7263;
  --cat-ceramics-bg: #eae5da;
  --cat-painting: #57608f;
  --cat-painting-bg: #e4e6f2;
  --cat-floristry: #4f7a4f;
  --cat-floristry-bg: #e3ecdd;
  --cat-baking: #a15b26;
  --cat-baking-bg: #f3e3d1;

  --radius: 14px;
  --shadow: 0 12px 30px -14px rgba(43, 36, 32, 0.35);
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: normal;
  margin: 0;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}

.wordmark-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--clay);
  color: var(--paper);
  font-size: 1.1rem;
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

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

.hero {
  background:
    linear-gradient(100deg, rgba(250, 245, 235, 0.96) 0%, rgba(250, 245, 235, 0.86) 42%, rgba(250, 245, 235, 0.55) 100%),
    url('assets/studio.jpg') right center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3.25rem;
}

.hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  max-width: 34ch;
  margin-bottom: 0.75rem;
}

.hero p {
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Main / toolbar ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

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

.field-filter {
  flex: 0 0 200px;
}

input[type="search"],
select {
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

input[type="search"]:focus,
select:focus {
  border-color: var(--clay);
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill-toggle .heart-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.pill-toggle[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--paper);
}

.pill-toggle[aria-pressed="true"] .heart-icon {
  fill: var(--paper);
  stroke: var(--paper);
}

.result-count {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

/* ---------- Item grid ---------- */

.item-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.item-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.item-card-open {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.item-card-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-deep);
}

.item-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.item-card-open:hover .item-card-image img {
  transform: scale(1.04);
}

.item-card-body {
  display: block;
  padding: 1rem 1.1rem 1.2rem;
}

.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.category-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.category-chip[data-category="Ceramics"] { background: var(--cat-ceramics-bg); color: var(--cat-ceramics); }
.category-chip[data-category="Painting"] { background: var(--cat-painting-bg); color: var(--cat-painting); }
.category-chip[data-category="Floristry"] { background: var(--cat-floristry-bg); color: var(--cat-floristry); }
.category-chip[data-category="Baking"] { background: var(--cat-baking-bg); color: var(--cat-baking); }

.item-price {
  font-weight: 700;
  color: var(--clay-dark);
}

.item-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.item-meta {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
}

.item-open-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clay);
  border-bottom: 1px solid transparent;
}

.item-card-open:hover .item-open-label,
.item-card-open:focus-visible .item-open-label {
  border-bottom-color: var(--clay);
}

.item-quick-save {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 253, 249, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(43, 36, 32, 0.25);
  color: var(--ink-soft);
}

.item-quick-save .heart-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.item-quick-save[aria-pressed="true"] {
  color: var(--clay);
}

.item-quick-save[aria-pressed="true"] .heart-icon {
  fill: var(--clay);
  stroke: var(--clay);
}

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

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.empty-state h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.empty-state button {
  border: 1px solid var(--clay);
  background: var(--clay);
  color: var(--paper);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.empty-state button:hover {
  background: var(--clay-dark);
  border-color: var(--clay-dark);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

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

.detail-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(640px, 92vw);
  max-height: 88vh;
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}

.detail-dialog::backdrop {
  background: rgba(24, 19, 15, 0.55);
}

.detail-dialog-inner {
  overflow-y: auto;
  max-height: 88vh;
  position: relative;
}

.close-detail {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.close-detail svg {
  width: 1.1rem;
  height: 1.1rem;
}

.detail-figure {
  margin: 0;
}

.detail-figure img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: var(--cream-deep);
}

.detail-category {
  padding: 0.7rem 1.5rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--clay);
}

.detail-content {
  padding: 0.5rem 1.5rem 1.75rem;
}

.detail-content h2 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.detail-instructor {
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.9rem 1.2rem;
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--cream);
  border-radius: 10px;
}

.detail-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.detail-facts dd {
  margin: 0;
  font-weight: 600;
}

.detail-body {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--clay);
  background: var(--paper);
  color: var(--clay-dark);
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.save-toggle .heart-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.save-toggle[aria-pressed="true"] {
  background: var(--clay);
  color: var(--paper);
}

.save-toggle[aria-pressed="true"] .heart-icon {
  fill: var(--paper);
  stroke: var(--paper);
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .site-header-inner {
    padding: 1rem;
  }

  .hero-inner {
    padding: 2rem 1rem;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .field-filter {
    flex: 1 1 auto;
  }

  .pill-toggle {
    justify-content: center;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    inset: 0;
  }

  .detail-dialog-inner {
    max-height: 100vh;
  }

  .detail-figure img {
    max-height: 220px;
  }
}
