/* ──────────────────────────────────────────────────────────────────
   Forma — The Studio Programme
   A seasonal workshop prospectus: paper ground, ink, and four craft
   colours that own whole regions. Bricolage Grotesque for display,
   Schibsted Grotesk for the reading voice.
   ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Bricolage';
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.2--impeccable--2026-09-17T06-18-44-795Z/assets/BricolageGrotesque.ttf') format('truetype');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted';
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.2--impeccable--2026-09-17T06-18-44-795Z/assets/SchibstedGrotesk.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted';
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.2--impeccable--2026-09-17T06-18-44-795Z/assets/SchibstedGrotesk-Italic.ttf') format('truetype');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f1ece1;
  --paper-2: #e8e2d3;
  --paper-3: #ddd5c2;
  --ink: #1a1612;
  --ink-2: #5d564b;
  --ink-3: #6b6457;
  --line: rgba(26, 22, 18, 0.16);
  --line-2: rgba(26, 22, 18, 0.08);

  --cat-Baking: #e0a416;
  --cat-Ceramics: #2a4d9e;
  --cat-Floristry: #22663c;
  --cat-Painting: #b0351e;
  --on-Baking: var(--ink);
  --on-Ceramics: #f4efe4;
  --on-Floristry: #f4efe4;
  --on-Painting: #f4efe4;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1240px;
  --gut: clamp(16px, 4vw, 40px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

/* Per-category tokens bound to .cat-<Category> elements. --c/--on drive
   solid fills; --text is the accessible-on-paper shade for small text. */
.cat-Baking    { --c: var(--cat-Baking);    --on: var(--on-Baking);    --text: #8a6300; }
.cat-Ceramics  { --c: var(--cat-Ceramics);  --on: var(--on-Ceramics);  --text: var(--cat-Ceramics); }
.cat-Floristry { --c: var(--cat-Floristry); --on: var(--on-Floristry); --text: var(--cat-Floristry); }
.cat-Painting  { --c: var(--cat-Painting);  --on: var(--on-Painting);  --text: var(--cat-Painting); }

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(26, 22, 18, 0.04), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.07  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Schibsted', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 450;
  font-size: clamp(16px, 1.05vw + 13px, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

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

:focus-visible {
  outline: 2.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

a { color: inherit; }

/* ── Skip link ── */
.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
  transition: top .18s var(--ease);
  font-weight: 600;
}
.skip:focus { top: 16px; }

/* ── Masthead ── */
.mast {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) var(--gut) clamp(14px, 2.5vw, 24px);
}
.mast-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 96, 'wdth' 82, 'wght' 700;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.brand .dot {
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--cat-Painting);
  display: inline-block;
  margin-left: 1px;
  transform: translateY(-0.05em);
}
.mast-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-transform: uppercase;
  font-weight: 600;
}
.mast-meta .pipe { width: 1px; height: 14px; background: var(--line); }
.mast-meta strong { color: var(--ink); font-weight: 700; }
.saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-variant-numeric: tabular-nums;
}
.saved-pill .n {
  font-family: 'Bricolage';
  font-variation-settings: 'wght' 700, 'opsz' 24;
  color: var(--ink);
  font-size: 13px;
}

.mast-lead {
  padding: clamp(20px, 3.4vw, 34px) 0 clamp(4px, 1vw, 10px);
  max-width: 30ch;
}
@media (min-width: 640px) {
  .mast-lead { max-width: 64ch; }
}
.lede {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 96, 'wdth' 100, 'wght' 700;
  font-weight: 700;
  font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
}
.lede em {
  font-style: normal;
  font-variation-settings: 'opsz' 96, 'wdth' 78, 'wght' 800;
  letter-spacing: -0.045em;
}
.sub {
  margin: 16px 0 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
  color: var(--ink-2);
}

/* ── Programme section ── */
.programme {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px) var(--gut) clamp(48px, 7vw, 80px);
}
.prog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.prog-title {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 64, 'wdth' 92, 'wght' 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0;
}
.prog-count {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  font-weight: 600;
}
.prog-count b {
  font-family: 'Bricolage';
  font-variation-settings: 'wght' 700, 'opsz' 24;
  color: var(--ink);
  font-size: 15px;
  margin-right: 3px;
}

/* ── Tools bar ── */
.tools {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin: clamp(18px, 2.4vw, 26px) 0 clamp(22px, 3vw, 30px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-2);
  padding-left: 2px;
}
#search, #filter {
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  min-height: 46px;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.search-field { flex: 1 1 280px; max-width: 420px; position: relative; }
.search-ico {
  position: absolute;
  left: 14px;
  bottom: 13px;
  width: 18px;
  height: 18px;
  color: var(--ink-2);
  pointer-events: none;
}
#search {
  width: 100%;
  padding-left: 42px;
}
#search::placeholder { color: var(--ink-3); }
#search:focus, #filter:focus { border-color: var(--ink); background: var(--paper); outline: none; }

.filter-field { flex: 0 1 auto; }
#filter {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5l5 5 5-5' stroke='%231a1612' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
  font-weight: 500;
}

.saved-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  min-height: 46px;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  font-variant-numeric: tabular-nums;
}
.saved-toggle .mark {
  width: 16px; height: 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: background-color .15s var(--ease);
}
.saved-toggle .count {
  font-family: 'Bricolage';
  font-variation-settings: 'wght' 700, 'opsz' 20;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 1px 8px 0;
  font-size: 13px;
  line-height: 1.4;
  min-width: 22px;
  text-align: center;
}
.saved-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.saved-toggle[aria-pressed="true"] .mark {
  background: var(--paper);
  border-color: var(--paper);
}
.saved-toggle[aria-pressed="true"] .mark::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.saved-toggle[aria-pressed="true"] .count {
  background: var(--paper);
  color: var(--ink);
}
.saved-toggle:disabled { opacity: .45; cursor: not-allowed; }

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 26px);
}

.card {
  position: relative;
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card.saved { border-color: var(--ink); }
.card .open {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: inherit;
}
.card .open:focus-visible { outline-offset: -2px; }
.card .media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-3);
}
.card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(26, 22, 18, 0.5); }
  .card:hover .media img { transform: scale(1.04); }
}
.tag {
  position: absolute;
  left: 14px;
  top: 14px;
  background: var(--c);
  color: var(--on);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--on);
  opacity: .8;
}
.saved-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 5px 9px 5px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.saved-badge svg { width: 11px; height: 11px; }

.body {
  display: block;
  padding: 16px 18px 18px;
}
.c-date {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}
.title {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 48, 'wdth' 92, 'wght' 650;
  font-size: clamp(1.4rem, 2vw, 1.7rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.by {
  display: block;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}
.by em { font-style: italic; color: var(--ink); font-weight: 500; }
.foot {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.price {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 32, 'wdth' 90, 'wght' 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}
.meta {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.go svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
@media (hover: hover) {
  .card:hover .go svg { transform: translateX(3px); }
}

/* ── Empty state ── */
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: clamp(34px, 6vw, 64px) 24px;
  text-align: center;
  background: var(--paper-2);
}
.empty h3 {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 48, 'wdth' 92, 'wght' 600;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.empty p { margin: 0 0 20px; color: var(--ink-2); }
.recover {
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.recover:hover { transform: translateY(-1px); }

/* ── Footer ── */
.foot-note {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut) clamp(36px, 5vw, 60px);
}
.foot-rule { height: 1px; background: var(--line); margin-bottom: 22px; }
.foot-note p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
}
.foot-note p + p { margin-top: 4px; }

/* ── Detail dialog ── */
dialog#detail {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  background: transparent;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
dialog#detail::backdrop {
  background: rgba(26, 22, 18, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
dialog#detail[open] { animation: fade .25s var(--ease); }

.spread {
  position: relative;
  width: min(960px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -40px rgba(26, 22, 18, 0.7);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  animation: rise .34s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 11px;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.close svg { width: 15px; height: 15px; }
.close:hover { background: var(--ink); color: var(--paper); }

.spread-media {
  position: relative;
  margin: 0;
  min-height: 240px;
  background: var(--c);
  overflow: hidden;
}
.spread-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.spread-media .tag {
  left: 18px;
  top: 18px;
  background: var(--paper);
  color: var(--ink);
}
.spread-media .tag::before { background: var(--c); }

.spread-body {
  padding: clamp(26px, 4vw, 44px) clamp(24px, 3.5vw, 40px) clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
}
.d-date {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
  font-variant-numeric: tabular-nums;
}
.d-title {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 72, 'wdth' 94, 'wght' 700;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}
.d-body {
  margin: 18px 0 0;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42ch;
}
.d-body::first-letter {
  font-family: 'Bricolage';
  font-variation-settings: 'opsz' 96, 'wdth' 80, 'wght' 800;
  font-size: 3.2em;
  line-height: 0.82;
  float: left;
  margin: 4px 8px 0 -2px;
  color: var(--text);
  letter-spacing: -0.04em;
}
.d-facts {
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.d-facts > div {
  background: var(--paper);
  padding: 12px 14px;
}
.d-facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-3);
  margin: 0 0 4px;
}
.d-facts dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.d-facts dd .accent {
  display: inline-block;
  background: var(--c);
  color: var(--on);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.save {
  margin-top: 26px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 12px 22px 12px 14px;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.save .save-ico {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill .15s var(--ease);
}
.save[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.save[aria-pressed="true"] .save-ico { fill: var(--paper); }
.save:hover { transform: translateY(-1px); }
.save .pulse { animation: pulse .5s var(--ease); }
@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .spread { grid-template-columns: 1fr; max-height: 92vh; }
  .spread-media { min-height: 0; aspect-ratio: 16 / 10; }
  .close { top: 12px; right: 12px; }
  .tools { gap: 10px; }
  .saved-toggle { margin-left: 0; width: 100%; justify-content: center; }
  .search-field { max-width: none; flex-basis: 100%; }
  .filter-field { flex-basis: calc(50% - 6px); flex-grow: 1; }
  .mast-meta { font-size: 11px; gap: 10px; }
  .mast-meta .pipe { display: none; }
}

@media (max-width: 480px) {
  .d-facts { grid-template-columns: 1fr; }
  .filter-field { flex-basis: 100%; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .media img { transform: none; }
}

/* ── Scrollbar ── */
.spread::-webkit-scrollbar { width: 10px; }
.spread::-webkit-scrollbar-track { background: var(--paper-2); }
.spread::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 999px; border: 3px solid var(--paper-2); }
