/* Forma: every workshop is a ticket. Risograph inks on a cobalt table. */

:root {
  --blue: #2339e8;
  --deep: #171766;
  --paper: #f8f6ef;
  --ink: #1a1566;
  --pink: #ff4fa3;
  --pink-text: #c4156f;
  --sun: #ffd21f;

  --c-baking: #ffd21f;
  --c-ceramics: #ff6a3d;
  --c-floristry: #ff8dc7;
  --c-painting: #5fd6a4;

  --display: "Futura-CondensedExtraBold", "Futura Condensed ExtraBold", "Haettenschweiler", "Impact", "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --text: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --gutter: clamp(1rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--blue);
  color: var(--paper);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

body.has-dialog { overflow: hidden; }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
}
.skip:focus { top: 1rem; }

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

/* Header */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 2px 2px 0 var(--pink);
}

.top__note { font-size: 0.95rem; }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  padding: clamp(1.5rem, 3.5vw, 3rem) var(--gutter) 1.5rem;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 7.4vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.005em;
  text-shadow: 4px 4px 0 var(--pink);
  text-wrap: balance;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 1.25rem;
  font-size: 1.15rem;
}

/* Shortlist pocket */

.pocket {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 3px dashed var(--paper);
  border-radius: 14px;
}

.pocket h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
}

.pocket__sum { font-weight: 700; }
.pocket__hint { font-size: 0.95rem; }

.pocket__stubs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pocket__stubs:not(:has(li:not([hidden]))) { display: none; }

.mini {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  line-height: 1.15;
}
.mini__date {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  padding: 0.25rem 0.3rem;
  border-radius: 4px;
  background: var(--c);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
}
.mini__title { font-weight: 700; font-size: 0.95rem; }

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  justify-self: start;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border: 3px solid var(--paper);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.toggle__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.toggle[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.toggle[aria-pressed="true"] .toggle__count { background: var(--ink); color: var(--sun); }

/* Controls */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem 1.25rem;
  padding: 0.5rem var(--gutter) 1.75rem;
}

.field { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.95rem; }
.field--grow { flex: 1 1 18rem; max-width: 34rem; }

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--deep);
}
.field select { min-width: 13rem; padding-right: 2rem; }
.field input::placeholder { color: #5b5790; opacity: 1; }

.result { margin-left: auto; padding-bottom: 0.7rem; font-weight: 700; }

/* Tickets */

.tickets-wrap { padding: 0 var(--gutter) 3rem; }

.tickets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(1.25rem, 3vw, 2.5rem);
}

.ticket {
  --c: var(--paper);
  --tilt: 0deg;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: clamp(140px, 17vw, 200px) minmax(0, 1fr) 128px;
  min-height: 236px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--deep);
  transform: rotate(var(--tilt));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ticket:nth-child(odd) { --tilt: -0.4deg; }
.ticket:nth-child(even) { --tilt: 0.35deg; }
.ticket:hover { transform: translateY(-4px) rotate(0deg); box-shadow: 6px 10px 0 var(--deep); }
.ticket:has(.open:focus-visible) { outline: 3px solid var(--sun); outline-offset: 3px; }

.ticket[data-category="Baking"] { --c: var(--c-baking); }
.ticket[data-category="Ceramics"] { --c: var(--c-ceramics); }
.ticket[data-category="Floristry"] { --c: var(--c-floristry); }
.ticket[data-category="Painting"] { --c: var(--c-painting); }

.ticket.enter { animation: ticket-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i) * 80ms); }

.ticket__photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 12px 0 0 12px;
  background: var(--c);
}
.ticket__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: multiply;
}

.ticket__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1.25rem 1.5rem 1.25rem 1.4rem;
}

.ticket__kind { font-weight: 700; font-size: 0.95rem; }
.ticket__kind::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.45em;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--c);
}

.ticket h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  line-height: 0.98;
}

.ticket__summary { max-width: 40ch; font-size: 1rem; }

.ticket__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.9rem;
  margin-top: auto;
  font-size: 0.92rem;
  font-weight: 700;
}

.seats { display: inline-flex; align-items: center; gap: 0.5rem; }
.seats__dots { display: flex; flex-wrap: wrap; gap: 3px; max-width: 7.5rem; }
.seats__dots i { width: 8px; height: 8px; border: 2px solid var(--ink); border-radius: 50%; }

.open {
  position: static;
  min-height: 44px;
  padding: 0.35rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.open:focus-visible { box-shadow: none; outline-offset: 2px; }
.ticket:hover .open { background: var(--pink-text); }

.ticket__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 1rem 0.5rem;
  border-left: 3px dashed var(--ink);
  border-radius: 0 12px 12px 0;
  background: var(--c);
  text-align: center;
  line-height: 1.1;
}
.ticket__stub::before,
.ticket__stub::after {
  content: "";
  position: absolute;
  left: -13px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
}
.ticket__stub::before { top: -12px; }
.ticket__stub::after { bottom: -12px; }

.stub__date { display: flex; flex-direction: column; align-items: center; }
.stub__wd { font-weight: 700; font-size: 0.95rem; }
.stub__day { font-family: var(--display); font-weight: 800; font-size: 3.6rem; line-height: 0.95; }
.stub__mon { font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.04em; }
.stub__time { margin-top: 0.4rem; font-weight: 700; font-size: 0.92rem; }
.stub__price { margin-top: 0.15rem; font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.stub__flag { display: none; margin-top: 0.4rem; font-size: 0.82rem; font-weight: 700; }

.ticket.is-saved .ticket__stub {
  background:
    repeating-linear-gradient(135deg, transparent 0 7px, rgb(26 21 102 / 0.14) 7px 9px),
    var(--c);
}
.ticket.is-saved .stub__flag { display: block; }

/* Empty + error */

.empty {
  max-width: 34rem;
  padding: 1.5rem 1.75rem 1.75rem;
  border: 3px dashed var(--paper);
  border-radius: 14px;
}
.empty__title { font-family: var(--display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.empty__text { margin: 0.6rem 0 1.1rem; }

.btn {
  min-height: 44px;
  padding: 0.4rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.linklike { padding: 0; border: 0; background: none; text-decoration: underline; font-weight: 700; }

/* Footer */

.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0 var(--gutter) 3rem;
}
.foot img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  filter: grayscale(1) contrast(1.1);
  background: var(--pink);
  mix-blend-mode: multiply;
}
.foot p { max-width: 40rem; font-size: 0.95rem; }

/* Detail dialog */

dialog.detail {
  width: min(980px, calc(100vw - 2rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
dialog.detail::backdrop { background: var(--deep); }
dialog.detail[open] .d-wrap { animation: unfold 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }

.d-wrap {
  --c: var(--paper);
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper);
}
.d-wrap[data-category="Baking"] { --c: var(--c-baking); }
.d-wrap[data-category="Ceramics"] { --c: var(--c-ceramics); }
.d-wrap[data-category="Floristry"] { --c: var(--c-floristry); }
.d-wrap[data-category="Painting"] { --c: var(--c-painting); }

.d-scroll {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: "photo main" "stub stub";
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}

.close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  min-height: 44px;
  padding: 0.3rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.d-photo {
  grid-area: photo;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 380px;
  background: var(--c);
}
.d-photo .color,
.d-photo .duo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.d-photo .duo {
  position: absolute;
  inset: 0;
  isolation: isolate;
  background: var(--c);
  animation: develop 1.4s ease-in 0.35s forwards;
}
.d-photo .duo img { filter: grayscale(1) contrast(1.15); mix-blend-mode: multiply; }

.stamp {
  position: absolute;
  left: 1.25rem;
  bottom: 1.5rem;
  display: none;
  padding: 0.35rem 0.9rem 0.45rem;
  border: 4px solid var(--pink-text);
  border-radius: 10px;
  background: var(--paper);
  color: var(--pink-text);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 0.95;
  text-align: center;
  transform: rotate(-9deg);
}
.d-wrap.is-saved .stamp { display: block; animation: slam 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }

.d-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 2rem 1.75rem;
}
.d-kind { padding-right: 6rem; font-weight: 700; }
.d-kind::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.45em;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--c);
}
.d-main h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 0.92;
  text-wrap: balance;
}
.d-body { max-width: 38ch; font-size: 1.15rem; line-height: 1.6; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}
.facts dt { font-weight: 400; }
.facts dd { font-weight: 700; }

.d-stub {
  grid-area: stub;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.5rem 2rem 1.75rem;
  border-top: 3px dashed var(--ink);
  background: var(--c);
}
.d-stub::before,
.d-stub::after {
  content: "";
  position: absolute;
  top: -14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--deep);
}
.d-stub::before { left: -13px; }
.d-stub::after { right: -13px; }

.d-date { display: flex; align-items: baseline; gap: 0.75rem; font-family: var(--display); font-weight: 800; line-height: 1; }
.d-date__day { font-size: 4.2rem; }
.d-date__rest { display: grid; font-size: 1.5rem; }
.d-price { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; }

.save {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.5rem 1.4rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-align: left;
}
.save::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid currentColor;
  border-radius: 4px;
}
.save[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.save[aria-pressed="true"]::before { border-color: var(--sun); background: var(--sun); }

.flyer {
  position: absolute;
  right: 2rem;
  bottom: 2.5rem;
  z-index: 2;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: var(--paper);
  border: 3px dashed var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  pointer-events: none;
  animation: tear 0.9s cubic-bezier(0.5, 0, 0.8, 0.4) forwards;
}

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(-36px) rotate(calc(var(--tilt) - 3deg)); }
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
}
@keyframes develop {
  to { opacity: 0; visibility: hidden; }
}
@keyframes slam {
  from { opacity: 0; transform: rotate(-9deg) scale(2.2); }
}
@keyframes tear {
  15% { transform: translate(-6px, 6px) rotate(-6deg); }
  to { transform: translate(60px, -340px) rotate(24deg); opacity: 0; }
}

/* Mobile */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .tickets { grid-template-columns: minmax(0, 1fr); }
  .top__note { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 1rem; }
  .field { flex: 1 1 100%; }
  .field--grow { max-width: none; }
  .field select { min-width: 0; }
  .result { margin-left: 0; padding-bottom: 0; }

  .ticket {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 150px auto auto;
    min-height: 0;
  }
  .ticket__photo { border-radius: 12px 12px 0 0; }
  .ticket__main { padding: 1.1rem 1.25rem 1.25rem; }
  .ticket__stub {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.9rem 1.25rem;
    border-left: 0;
    border-top: 3px dashed var(--ink);
    border-radius: 0 0 12px 12px;
  }
  .ticket__stub::before,
  .ticket__stub::after { top: -14px; bottom: auto; left: auto; }
  .ticket__stub::before { left: -13px; }
  .ticket__stub::after { right: -13px; }
  .stub__wd, .stub__mon, .stub__time, .stub__price { margin: 0; }
  .stub__day { font-size: 2.4rem; }
  .stub__wd, .stub__time { font-size: 1rem; }
  .stub__flag { margin: 0; flex-basis: 100%; }
  .ticket__stub .stub__date { flex-direction: row; align-items: baseline; gap: 0.5rem; }

  dialog.detail { width: 100vw; height: 100dvh; max-height: none; }
  .d-wrap { height: 100%; border-radius: 0; }
  .d-scroll {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "photo" "main" "stub";
    grid-template-rows: auto auto auto;
    align-content: start;
    height: 100%;
    max-height: none;
  }
  .d-photo { min-height: 0; height: 220px; }
  .d-main { padding: 1.4rem 1.25rem 1.5rem; }
  .d-kind { padding-right: 0; }
  .d-stub { padding: 1.25rem 1.25rem 1.5rem; }
  .d-stub .save { width: 100%; }
  .d-date__day { font-size: 3.4rem; }
  .close { top: 0.6rem; right: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticket, .ticket:hover { transition: none; }
  .ticket.enter,
  dialog.detail[open] .d-wrap,
  .d-wrap.is-saved .stamp { animation: none; }
  .d-photo .duo { animation: none; display: none; }
  .flyer { display: none; }
}
