/* Forma — October timetable.
   Ink-teal field, one colour per craft taken from the photographs. */

:root {
  --ink: #0f2e38;
  --ink-2: #1b4552;
  --muted: #475d65;
  --paper: #eff3ef;
  --card: #ffffff;
  --line: #d3dcd8;
  --focus: #1456d6;

  --ceramics: #9dbad6;
  --painting: #ff8a7a;
  --floristry: #f5b323;
  --baking: #d8b78a;

  --sans: "Avenir Next", "Avenir", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 4vw, 56px);
  --radius: 18px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-2) var(--paper);
  -webkit-text-size-adjust: 100%;
}
html.has-detail { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  caret-color: var(--focus);
  accent-color: var(--ink);
}

::selection { background: var(--floristry); color: var(--ink); }

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

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hero :focus-visible, .detail-media :focus-visible { outline-color: var(--floristry); }

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

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--floristry); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--pad); }

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

.hero { background: var(--ink); color: #fff; overflow: hidden; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 20px; }
.brand { color: #fff; display: inline-flex; border-radius: 8px; }

.shortlist-link {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px 0 14px;
  background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 999px;
  color: #fff; font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}
.shortlist-link:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }

.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 999px; background: var(--floristry); color: var(--ink);
  font-size: 0.875rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}

.hero-grid {
  display: grid; gap: 40px; align-items: end;
  padding-block: 24px 0;
}

.hero-copy { padding-bottom: 40px; }
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 5rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.03em; text-wrap: balance; max-width: 12ch;
}
.lede { margin-top: 24px; max-width: 46ch; font-size: 1.125rem; color: #c4d8dd; text-wrap: pretty; }

.cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 32px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  background: var(--floristry); color: var(--ink); font-weight: 800; text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.2s;
}
.cta:hover { background: #ffc84a; transform: translateY(-2px); }
.cta svg { transition: transform 0.25s var(--ease); }
.cta:hover svg { transform: translateY(3px); }

.arches {
  display: flex; align-items: flex-end; gap: 8px; height: 190px;
}
.arch {
  --h: 1;
  flex: 1 1 0; min-width: 0; height: calc(var(--h) * 100%);
  display: flex; flex-direction: column; padding: 0; border: 0; text-align: center;
  background: var(--c); color: var(--ink);
  border-radius: 999px 999px 0 0; overflow: hidden;
  animation: rise 1s var(--ease) both;
  transition: transform 0.35s var(--ease);
}
.arch:nth-child(2) { animation-delay: 0.08s; }
.arch:nth-child(3) { animation-delay: 0.16s; }
.arch:nth-child(4) { animation-delay: 0.24s; }
.arch img { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.arch > span:not(.sr) { flex: none; padding: 10px 4px 12px; font-size: 0.75rem; font-weight: 800; }
.arch:hover { transform: translateY(-8px); }
.arch:hover img { transform: scale(1.06); }
.arch:active { transform: translateY(-3px); }

@keyframes rise { from { transform: translateY(60px); opacity: 0; } }

/* ---------- Timetable ---------- */

.timetable { padding-top: 56px; padding-bottom: 72px; scroll-margin-top: 0; }

.section-head { display: grid; gap: 8px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.section-head p { color: var(--muted); max-width: 60ch; }

.controls {
  position: relative; z-index: 10; margin: 0;
  background: var(--paper); border-block: 1px solid var(--line);
}
.controls-inner { display: grid; gap: 14px; padding-block: 16px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label-spacer { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.label-spacer { display: none; visibility: hidden; }

.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }

input[type="search"], select {
  width: 100%; height: 52px; border: 1.5px solid #9fb0ac; border-radius: 14px;
  background: #fff; padding: 0 16px; font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="search"] { padding-left: 44px; appearance: none; }
input[type="search"]::placeholder { color: #5b6e74; opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; height: 18px; width: 18px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2e38' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E") center/contain no-repeat; }
select {
  appearance: none; padding-right: 44px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2e38' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 20px no-repeat;
}
input[type="search"]:hover, select:hover { border-color: var(--ink); }
input[type="search"]:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--ink); }

.saved-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 18px; border-radius: 14px; width: 100%;
  background: #fff; border: 1.5px solid #9fb0ac; font-weight: 700;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.saved-toggle:hover { border-color: var(--ink); }
.saved-toggle .count { background: var(--ink); color: #fff; }
.saved-toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.saved-toggle[aria-pressed="true"] svg path { fill: var(--floristry); stroke: var(--floristry); }
.saved-toggle[aria-pressed="true"] .count { background: var(--floristry); color: var(--ink); }

.status-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-block: 20px 16px; }
.result-count { font-weight: 700; }
.result-count:focus { outline: none; }
.shortlist-total { color: var(--muted); font-variant-numeric: tabular-nums; }
.shortlist-total strong { color: var(--ink); }

.list { display: grid; gap: 20px; }

/* ---------- Workshop row ---------- */

.row {
  --c: var(--ceramics);
  position: relative; display: grid; grid-template-columns: 1fr;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.2s;
}
.row[data-cat="Ceramics"] { --c: var(--ceramics); }
.row[data-cat="Painting"] { --c: var(--painting); }
.row[data-cat="Floristry"] { --c: var(--floristry); }
.row[data-cat="Baking"] { --c: var(--baking); }

.row:hover { border-color: var(--ink); box-shadow: 0 18px 32px -20px rgba(15, 46, 56, 0.5); transform: translateY(-2px); }
.row:has(.open:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

.row .date {
  position: absolute; top: 0; left: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; padding: 10px 0 12px; background: var(--c); color: var(--ink);
  border-bottom-right-radius: var(--radius); font-variant-numeric: tabular-nums;
}
.date .dow, .date .mon { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; }
.date .day { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }

.row .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--c); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.row:hover .thumb img { transform: scale(1.05); }

.row .main { padding: 20px; display: grid; gap: 10px; align-content: start; }
.cat-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.cat-label::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--ink); }
.row h3 { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.open {
  all: unset; cursor: pointer; display: inline; border-radius: 6px;
}
.open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.open:focus-visible { outline: none; }
.row .desc { color: var(--muted); max-width: 56ch; text-wrap: pretty; }

.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.facts li { display: inline-flex; align-items: center; gap: 7px; }
.facts svg { flex: none; color: var(--muted); }

.row .act {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-top: 1px dashed #aab9b5;
}
.price { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.act-right { display: flex; align-items: center; gap: 14px; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9375rem; }
.more svg { transition: transform 0.25s var(--ease); }
.row:hover .more svg { transform: translateX(4px); }

.quick-save {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
  background: #fff; border: 1.5px solid #9fb0ac; border-radius: 999px; font-weight: 700; font-size: 0.9375rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.quick-save:hover { border-color: var(--ink); }
.quick-save[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.quick-save[aria-pressed="true"] svg path, .save-btn[aria-pressed="true"] svg path { fill: var(--floristry); stroke: var(--floristry); }

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

.empty {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 56px 24px; background: var(--card); border: 1.5px dashed #9fb0ac; border-radius: var(--radius);
}
.empty[hidden] { display: none; }
.empty svg { color: var(--ceramics); stroke: var(--ink); }
.empty h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.empty p { color: var(--muted); max-width: 40ch; margin-bottom: 10px; }

.btn {
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ink); color: #fff; font-weight: 700;
  transition: background 0.2s, transform 0.25s var(--ease);
}
.btn:hover { background: var(--ink-2); transform: translateY(-2px); }

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

.detail {
  --c: var(--ceramics);
  position: fixed; inset: 0; margin: auto; padding: 0; border: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: var(--paper); color: var(--ink); overflow: auto; overscroll-behavior: contain;
}
.detail[data-cat="Ceramics"] { --c: var(--ceramics); }
.detail[data-cat="Painting"] { --c: var(--painting); }
.detail[data-cat="Floristry"] { --c: var(--floristry); }
.detail[data-cat="Baking"] { --c: var(--baking); }
.detail::backdrop { background: rgba(10, 30, 38, 0.62); }
.detail[open] { display: block; animation: sheet 0.45s var(--ease); }
.detail[open]::backdrop { animation: fade 0.3s ease-out; }
@keyframes sheet { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }

.detail-close {
  position: fixed; top: 12px; right: 12px; z-index: 5;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  background: #fff; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 50%;
  transition: background 0.2s, transform 0.25s var(--ease);
}
.detail-close:hover { background: var(--floristry); transform: rotate(90deg); }

.detail-media { position: relative; background: var(--c); }
.detail-media img { width: 100%; height: 100%; max-height: 300px; object-fit: cover; aspect-ratio: 16 / 10; }
.detail-date {
  position: absolute; left: 0; bottom: 0; display: flex; align-items: baseline; gap: 10px;
  padding: 10px 18px 10px 20px; background: var(--c); color: var(--ink); border-top-right-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
.detail-date .day { font-size: 2.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.detail-date .rest { font-weight: 800; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; }

.detail-body { padding: 28px var(--pad) 40px; display: grid; gap: 20px; align-content: start; }
.detail-body .cat-label { color: var(--muted); }
.detail-body h2 { font-size: clamp(2.1rem, 8vw, 3.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
.detail-body .when { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-body .text { font-size: 1.1875rem; max-width: 52ch; text-wrap: pretty; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); font-variant-numeric: tabular-nums; }
.specs > div { padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.specs dt { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.specs dd { font-size: 1.0625rem; font-weight: 700; overflow-wrap: anywhere; }
.specs .price-cell dd { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }

.detail-actions { display: grid; gap: 12px; }
.save-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--floristry); color: var(--ink); font-size: 1.0625rem; font-weight: 800;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.save-btn:hover { transform: translateY(-2px); background: #ffc84a; }
.save-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.save-btn[aria-pressed="true"]:hover { background: var(--ink-2); }
.save-btn[aria-pressed="true"] svg { animation: pop 0.45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35) rotate(-6deg); } }
.save-note { min-height: 1.5em; color: var(--muted); font-size: 0.9375rem; }
.back-btn {
  justify-self: start; min-height: 44px; padding: 0 4px; background: none; border: 0;
  font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.back-btn:hover { text-decoration-color: var(--floristry); }

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

.footer { background: var(--ink); color: #c4d8dd; padding-block: 48px; }
.footer-grid { display: grid; gap: 28px; align-items: center; }
.footer img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius); }
.footer-title { color: #fff; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
.footer p + p { margin-top: 12px; }
.footer .fine { font-size: 0.875rem; max-width: 56ch; }

.empty-static { padding: 24px 0; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .controls-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: end; }
  .saved-toggle { width: auto; }
  .row .thumb { aspect-ratio: 21 / 8; }
  .footer-grid { grid-template-columns: 340px 1fr; gap: 48px; }
  .arches { height: 260px; }
  .arch > span:not(.sr) { font-size: 0.9375rem; padding: 12px 6px 14px; }
}

@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 640px); gap: 56px; padding-top: 32px; }
  .hero-copy { padding-bottom: 72px; }
  .arches { height: 440px; gap: 14px; }
  .arch > span:not(.sr) { font-size: 1rem; }
  .timetable { padding-top: 72px; }
  .controls { position: sticky; top: 0; }

  .row { grid-template-columns: 104px 232px minmax(0, 1fr) 176px; }
  .row .date { position: static; width: auto; padding: 16px 8px; border-radius: 0; }
  .date .day { font-size: 3.5rem; margin-block: 2px; }
  .row .thumb { aspect-ratio: auto; min-height: 196px; }
  .row .main { padding: 24px 32px; align-content: center; }
  .row h3 { font-size: 1.875rem; }
  .row .act {
    flex-direction: column; align-items: flex-start; justify-content: space-between;
    padding: 24px; border-top: 0; border-left: 1px dashed #aab9b5;
  }
  .price { font-size: 2.25rem; }
  .act-right { flex-direction: column; align-items: flex-start; gap: 12px; }
  .act-right .more { order: 2; }

  .detail {
    inset: 0; margin: auto; width: min(1080px, calc(100vw - 64px)); height: min(720px, calc(100dvh - 64px));
    border-radius: 24px; overflow: hidden;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  }
  .detail[open] { display: grid; grid-template-columns: 5fr 6fr; grid-template-rows: minmax(0, 1fr); }
  .detail-close { position: absolute; top: 16px; right: 16px; }
  .detail-media img { max-height: none; aspect-ratio: auto; position: absolute; inset: 0; }
  .detail-media { min-height: 0; }
  .detail-body { overflow: auto; padding: 72px 48px 40px; }
  .detail-body h2 { font-size: 3.25rem; }
}

@media (min-width: 1000px) and (max-height: 760px) {
  .detail { height: calc(100dvh - 32px); }
}

@media (max-width: 999px) {
  .detail-media { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .row:hover, .arch:hover, .cta:hover, .btn:hover, .save-btn:hover { transform: none; }
}
