/* Forma — studio timetable */

:root {
  --paper: #F4EFE7;
  --paper-2: #ECE4D7;
  --card: #FBF8F3;
  --ink: #1D1A17;
  --ink-2: #564F48;
  --line: #D6CCBC;
  --line-strong: #1D1A17;
  --clay: #A3401D;
  --clay-dark: #86331A;
  --focus: #1A5FD0;

  --c-baking: #9A6326;
  --c-ceramics: #4F7A94;
  --c-floristry: #D29000;
  --c-painting: #C23B2A;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "P052", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1240px;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 4px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

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

.site-head { border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; border-radius: 4px; }
.brand-mark { width: 28px; height: 28px; }
.brand-word { font-family: var(--serif); font-size: 26px; letter-spacing: -0.01em; font-weight: 600; }
.brand-word.small { font-size: 20px; }
.head-note { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 64px;
}

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lede { margin-top: 22px; max-width: 34em; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

.hero-stats { display: flex; flex-wrap: wrap; margin-top: 32px; border-top: 1px solid var(--line-strong); }
.hero-stats li { padding: 14px 22px 0 0; margin-right: 22px; border-right: 1px solid var(--line); }
.hero-stats li:last-child { border-right: 0; margin-right: 0; }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.2; }
.hero-stats span { font-size: 13px; color: var(--ink-2); }

.hero-arches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: start; }

.arch {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 0; border: 0; background: none; text-align: left;
  border-radius: 999px 999px 8px 8px;
}
.arch:nth-child(even) { margin-top: 40px; }
.arch-img {
  display: block; aspect-ratio: 3 / 4.3; overflow: hidden;
  border-radius: 999px 999px 6px 6px;
  background: var(--paper-2);
  box-shadow: 0 0 0 0 var(--ink);
  transition: box-shadow .2s ease;
}
.arch-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.arch-label { font-family: var(--serif); font-size: 19px; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.arch-count { font-size: 13px; color: var(--ink-2); margin-top: -6px; }
.arch:hover .arch-img img { transform: scale(1.04); }
.arch[aria-pressed="true"] .arch-img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.arch[aria-pressed="true"] .arch-label { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.arch:focus-visible { outline-offset: 4px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--ink-2)); flex: none; }
[data-cat="Baking"] { --dot: var(--c-baking); }
[data-cat="Ceramics"] { --dot: var(--c-ceramics); }
[data-cat="Floristry"] { --dot: var(--c-floristry); }
[data-cat="Painting"] { --dot: var(--c-painting); }

/* ---------- Browse ---------- */

.browse { border-top: 1px solid var(--line-strong); padding-top: 40px; }
.browse-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.browse-head h2 { font-family: var(--serif); font-weight: 500; font-size: 40px; letter-spacing: -0.015em; line-height: 1.1; border-radius: 4px; }
.browse-head h2:focus { outline: none; }
.browse-head h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.browse-sub { color: var(--ink-2); }

.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244, 239, 231, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin-top: 24px;
}
.toolbar-row { display: flex; align-items: flex-end; gap: 16px; padding-top: 14px; padding-bottom: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.field-search { flex: 1 1 auto; max-width: 440px; }
.field-filter { flex: 0 0 210px; }
.field-saved { margin-left: auto; }

.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }

input[type="search"], select {
  width: 100%; height: 46px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 16px;
}
input[type="search"] { padding: 0 16px 0 42px; }
input[type="search"]::placeholder { color: #857C72; }
input[type="search"]:focus-visible, select:focus-visible { outline-offset: 1px; }

select {
  appearance: none; -webkit-appearance: none;
  padding: 0 44px 0 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%231D1A17' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

.saved-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 8px 0 18px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--card);
  font-weight: 600; white-space: nowrap;
}
.saved-toggle svg { width: 18px; height: 18px; }
.saved-toggle .bm { fill: none; }
.saved-toggle .count {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--paper-2); font-variant-numeric: tabular-nums; font-size: 14px;
}
.saved-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.saved-toggle[aria-pressed="true"] .bm { fill: currentColor; }
.saved-toggle[aria-pressed="true"] .count { background: var(--clay); color: #fff; }
.saved-toggle:hover { background: var(--paper-2); }
.saved-toggle[aria-pressed="true"]:hover { background: #3a3530; }

.results-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 18px 0 6px;
  font-size: 14px; color: var(--ink-2);
}
#status { font-weight: 600; color: var(--ink); }
.shortlist-summary strong { color: var(--ink); }

/* ---------- Weekend groups & rows ---------- */

.group { padding-top: 26px; }
.group-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line-strong);
}
.group-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clay); }
.group-title { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.2; }
.group-count { margin-left: auto; font-size: 13px; color: var(--ink-2); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 76px 176px minmax(0, 1fr) 220px 96px 48px;
  grid-template-areas: "date media main facts price save";
  gap: 0 28px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s ease;
}
.row:hover { background: var(--paper-2); }
.row:hover .row-media img { transform: scale(1.03); }

.row-date { grid-area: date; display: flex; flex-direction: column; align-items: center; line-height: 1; padding-left: 8px; }
.row-date .dow, .row-date .mon { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.row-date .dom { font-family: var(--serif); font-size: 44px; font-weight: 500; margin: 4px 0 2px; font-variant-numeric: lining-nums; }

.row-media { grid-area: media; aspect-ratio: 16 / 11; overflow: hidden; border-radius: 4px; background: var(--paper-2); }
.row-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }

.row-main { grid-area: main; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; }
.row-title { font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.15; margin-top: 4px; letter-spacing: -0.01em; }
.row-open {
  padding: 0; border: 0; background: none; text-align: left;
  font: inherit; letter-spacing: inherit; color: inherit;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; text-decoration-thickness: 1.5px;
  transition: text-decoration-color .15s ease;
}
.row-open::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: 4px; }
.row-open:hover, .row:hover .row-open { text-decoration-color: currentColor; }
.row-open:focus-visible { outline: none; }
.row-open:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -1px; }
.row-desc {
  margin-top: 6px; color: var(--ink-2); font-size: 15px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.row-facts { grid-area: facts; font-size: 14px; line-height: 1.45; }
.row-facts div + div { margin-top: 6px; }
.row-facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.row-facts dd { font-variant-numeric: tabular-nums; }
.row-facts .f-date { display: none; }

.row-price { grid-area: price; text-align: right; }
.row-price .price { display: block; font-family: var(--serif); font-size: 28px; line-height: 1; font-variant-numeric: lining-nums; }
.row-price .seats { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-2); }

.row-save {
  grid-area: save; position: relative; z-index: 1;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease;
}
.row-save svg { width: 18px; height: 18px; }
.row-save .bm { fill: none; }
.row-save:hover { border-color: var(--ink); }
.row-save[aria-pressed="true"] { background: var(--clay); border-color: var(--clay); color: #fff; }
.row-save[aria-pressed="true"] .bm { fill: currentColor; }

.row.is-saved .row-date::after {
  content: "Saved"; margin-top: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: var(--clay); padding: 3px 6px; border-radius: 3px;
}

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

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 56px 20px 72px; margin-top: 24px;
  border: 1.5px dashed var(--line); border-radius: 8px;
}
.empty[hidden] { display: none; }
.empty-art { width: 110px; color: var(--clay); margin-bottom: 18px; }
.empty h3 { font-family: var(--serif); font-size: 28px; font-weight: 500; }
.empty p { margin-top: 8px; color: var(--ink-2); max-width: 32em; }
.empty .btn { margin-top: 22px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #3a3530; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }

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

.site-foot { margin-top: 96px; border-top: 1px solid var(--line-strong); }
.foot-row { display: flex; gap: 32px; align-items: baseline; justify-content: space-between; padding-top: 28px; padding-bottom: 40px; font-size: 13px; color: var(--ink-2); }
.foot-row p:last-child { max-width: 44em; text-align: right; }

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

.detail {
  padding: 0; border: 0;
  width: min(980px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  background: var(--paper); color: var(--ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(29, 26, 23, 0.35);
}
.detail::backdrop { background: rgba(29, 26, 23, 0.55); }
.detail[open] { display: flex; }

.d-inner {
  display: grid; grid-template-columns: 42% minmax(0, 1fr); width: 100%;
  min-height: min(600px, calc(100vh - 64px));
}

.d-media { position: relative; background: var(--paper-2); min-height: 100%; }
.d-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-media figcaption {
  position: absolute; left: 12px; bottom: 12px;
  font-size: 11px; color: #fff; background: rgba(29, 26, 23, 0.6); padding: 3px 8px; border-radius: 3px;
}

.d-content { overflow-y: auto; padding: 44px 48px 40px; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
.d-title { font-family: var(--serif); font-size: 44px; font-weight: 500; line-height: 1.05; letter-spacing: -0.015em; margin-top: 10px; padding-right: 40px; }
.d-body { margin-top: 16px; font-size: 18px; line-height: 1.6; color: var(--ink); max-width: 34em; }

.d-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px; border-top: 1.5px solid var(--ink);
}
.d-facts div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.d-facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.d-facts div:nth-child(even) { padding-left: 16px; }
.d-facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.d-facts dd { margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.d-facts .big { font-family: var(--serif); font-size: 26px; line-height: 1.2; }

.d-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.save-btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.save-btn .bm { fill: none; }
.save-btn:hover { background: #3a3530; }
.save-btn[aria-pressed="true"] { background: var(--clay); border-color: var(--clay); color: #fff; }
.save-btn[aria-pressed="true"]:hover { background: var(--clay-dark); }
.save-btn[aria-pressed="true"] .bm { fill: currentColor; }

.d-note { margin-top: 12px; font-size: 13px; color: var(--ink-2); min-height: 1.5em; }

.d-more { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.d-more h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.d-more ul { margin-top: 8px; }
.d-more button {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.d-more button:hover .m-title { text-decoration: underline; text-underline-offset: 4px; }
.d-more .m-title { font-family: var(--serif); font-size: 19px; }
.d-more .m-meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

.d-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
}
.d-close svg { width: 18px; height: 18px; }
.d-close:hover { background: var(--paper-2); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .detail[open] { animation: rise .28s cubic-bezier(.2, .8, .2, 1); }
  .detail[open]::backdrop { animation: fade .28s ease; }
  .row.flash { animation: flash .9s ease; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash { 0% { background: #EFD9C9; } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .row {
    grid-template-columns: 64px 150px minmax(0, 1fr) 88px 48px;
    grid-template-areas:
      "date media main price save"
      "date media facts price save";
    gap: 8px 22px;
  }
  .row-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .row-facts div + div { margin-top: 0; }
  .row-facts dt { display: none; }
  .row-desc { -webkit-line-clamp: 1; }
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  html { scroll-padding-top: 16px; }

  .head-row { min-height: 58px; }
  .brand-word { font-size: 23px; }
  .head-note { font-size: 11px; }

  .hero { padding-top: 32px; padding-bottom: 40px; gap: 28px; }
  .hero h1 { font-size: 40px; }
  .lede { font-size: 16px; margin-top: 16px; }
  .hero-stats { margin-top: 24px; }
  .hero-stats li { padding-right: 14px; margin-right: 14px; }
  .hero-stats strong { font-size: 20px; }
  .hero-stats span { font-size: 12px; }

  .hero-arches { gap: 10px; }
  .arch:nth-child(even) { margin-top: 18px; }
  .arch { gap: 6px; }
  .arch-label { font-size: 15px; gap: 6px; }
  .arch-label .dot { width: 7px; height: 7px; }
  .arch-count { font-size: 11px; margin-top: -3px; }

  .browse { padding-top: 28px; }
  .browse-head h2 { font-size: 32px; }
  .browse-sub { font-size: 14px; }

  .toolbar { position: static; margin-top: 16px; background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .toolbar-row { flex-wrap: wrap; gap: 12px; padding-top: 4px; padding-bottom: 16px; }
  .field-search { flex: 1 1 100%; max-width: none; }
  .field-filter { flex: 1 1 0; min-width: 0; }
  .field-saved { margin-left: 0; }
  .saved-toggle { padding-left: 14px; }

  .group { padding-top: 22px; }
  .group-title { font-size: 20px; }
  .group-head { flex-wrap: wrap; gap: 4px 10px; }

  .row {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "media main"
      "media facts"
      "media price";
    gap: 4px 14px;
    align-items: start;
    padding: 16px 0;
  }
  .row:hover { background: none; }
  .row-date { display: none; }
  .row-media { aspect-ratio: 1; }
  .row-main { padding-right: 52px; }
  .row-title { font-size: 21px; margin-top: 2px; }
  .tag { font-size: 12px; }
  .row-desc { display: none; }
  .row-facts { font-size: 13px; gap: 0 12px; color: var(--ink-2); }
  .row-facts .f-date { display: block; color: var(--ink); font-weight: 600; }
  .row-facts .f-who { display: none; }
  .row-price { display: flex; align-items: baseline; gap: 10px; text-align: left; margin-top: 2px; }
  .row-price .price { font-size: 20px; }
  .row-price .seats { margin: 0; font-size: 12px; }
  .row-save { position: absolute; top: 12px; right: 0; }
  .row.is-saved .row-media { outline: 3px solid var(--clay); outline-offset: 2px; }

  .empty { padding: 40px 16px 48px; }

  .site-foot { margin-top: 64px; }
  .foot-row { flex-direction: column; gap: 8px; }
  .foot-row p:last-child { text-align: left; }

  /* Full-screen sheet */
  .detail {
    width: 100vw; height: 100vh; height: 100dvh;
    max-width: none; max-height: none;
    margin: 0; border-radius: 0;
  }
  .d-inner { grid-template-columns: 1fr; grid-template-rows: auto; align-content: start; overflow-y: auto; height: 100%; min-height: 0; }
  .d-media { min-height: 0; height: 230px; }
  .d-content { max-height: none; overflow: visible; padding: 22px 20px 32px; }
  .d-title { font-size: 34px; padding-right: 0; }
  .d-body { font-size: 17px; }
  .d-facts dd { font-size: 15px; }
  .d-facts .big { font-size: 22px; }
  .d-actions {
    position: sticky; bottom: 0; z-index: 1;
    margin: 24px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
  }
  .d-actions .btn { flex: 1 1 auto; }
  .d-close { top: 12px; right: 12px; }
}
