/* ===========================================================================
   JUST CREATE — the site
   ---------------------------------------------------------------------------
   Structure, header, footer and every component shared across pages.
   Colour lives in tokens.css and nowhere else: there is not one hex code
   below this line.
   ========================================================================= */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--body);
  font-size: 17px;          /* a shade larger than usual — see the note below */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* ⚠ 17px, NOT 16. The people booking a craft class are not all twenty-five,
   and a monthly class has regulars. A point of body size costs nothing and is
   the single cheapest accessibility decision on the whole site. */

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }

a { color: inherit; text-decoration: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- headings ----------------------------------------------------------
   Quicksand, rounded and warm. NOT the script: see fonts.css for why a
   handwriting face never sets anything longer than the shop's own name. */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: var(--track-mid);
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
h4 { font-size: .95rem; font-weight: 700; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.kicker {
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--ocean);
  margin: 0 0 .9rem;
  display: block;
}

.lede { font-size: 1.12rem; color: var(--ink-body); max-width: 58ch; }
.muted { color: var(--ink-muted); }
.small { font-size: .9rem; }

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

/* ---- layout ------------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.band { padding-block: var(--rhythm); }
.band--tight { padding-block: calc(var(--rhythm) * .55); }
.band--edge { border-top: 1px solid var(--hairline); }
.band--tint { background: var(--paper-2); }
.band--wash { background: var(--sky-wash); }

.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* =========================================================================
   THE HEADER
   ========================================================================= */

/* ⚠ THIS ONE LINE IS LOAD-BEARING.
   `position: sticky` sticks inside its own PARENT'S box and no further, and
   site.js mounts the header into <div data-header>, whose box is exactly as
   tall as the header itself. Without `display: contents` the header holds for
   about forty pixels and then scrolls away with the page — on every page, at
   every width — taking the basket and the menu with it, and it looks entirely
   deliberate while it does it. */
[data-header] { display: contents; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
@supports not (backdrop-filter: blur(2px)) {
  .site-header { background: var(--paper); }
}

.announce {
  background: var(--ocean);
  color: var(--on-ocean);
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  padding: .55rem 1rem;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
  padding-block: .5rem;
}

/* ---- the lockup -------------------------------------------------------- */
.lockup {
  display: flex;
  align-items: center;
  gap: .6rem;
  /* ⚠ THE ARTWORK IS NOT THE TAP TARGET. A 46px globe is a 46px tap target,
     which is only just enough; the artwork keeps its size and the LINK grows
     around it with padding. */
  padding: .35rem .4rem;
  margin-left: -.4rem;
  flex: 0 0 auto;
}
.lockup img {
  width: 46px;
  height: 46px;
  /* ⚠ An <img> with height:100% inside an auto-height box falls back to its
     intrinsic height and silently makes the box taller. Fixed, both ways. */
  flex: 0 0 auto;
}
.lockup-name b {
  font-family: var(--script);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  /* A script sits high in its em box; this drops it back onto the optical
     centre of the globe beside it. */
  display: block;
  padding-top: .12em;
}

/* ---- navigation -------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  margin-inline: auto;
}
.nav a {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-body);
  padding: .5rem 0;
  position: relative;
  white-space: nowrap;
  transition: color var(--quick);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: .1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--leaf);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--quick);
}
.nav a:hover, .nav a[aria-current] { color: var(--ocean-deep); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }

.header-tools {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  background: none;
  color: var(--ink-body);
  cursor: pointer;
  position: relative;
  border-radius: var(--radius-pill);
  transition: color var(--quick), background var(--quick);
}
.icon-btn:hover { color: var(--ocean-deep); background: var(--paper-3); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor;
                stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.bag-count {
  position: absolute;
  top: 5px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--leaf-deep);
  color: var(--white);
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.menu-btn { display: none; }

/* ---- the mobile drawer ------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto 1fr;
  /* Opaque, and it must stay opaque: a translucent full-screen menu over a
     page of pictures is unreadable at exactly the moment it matters. */
  background: var(--paper);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem var(--gutter);
  border-bottom: 1px solid var(--hairline);
  min-height: 72px;
}
.drawer-body {
  padding: 1.4rem var(--gutter) 3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer-body a {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  padding: .62rem 0;
  border-bottom: 1px solid var(--hairline);
}
.drawer-body .drawer-sub {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
}
body.is-locked { overflow: hidden; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 1rem 1.7rem;
  min-height: 50px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--quick), color var(--quick),
              border-color var(--quick), transform var(--quick),
              box-shadow var(--quick);
  text-align: center;
}
.btn:active { transform: translateY(1px); }

/* ⚠ TEXT ON --ocean IS --on-ocean (white). The mirror of the mistake a dark
   site makes: on a light palette the temptation is dark text on a mid-tone,
   and #1F2A2E on #1E648C is 2.6:1. There is a test that reads this rule. */
.btn--primary {
  background: var(--ocean);
  color: var(--on-ocean);
  box-shadow: var(--shadow);
}
.btn--primary:hover { background: var(--ocean-deep); box-shadow: var(--shadow-lift); }

.btn--leaf { background: var(--leaf-deep); color: var(--white); }
.btn--leaf:hover { background: var(--leaf); }

.btn--ghost {
  background: transparent;
  color: var(--ocean-deep);
  border-color: var(--ocean-mid);
}
.btn--ghost:hover { background: var(--sky-wash); border-color: var(--ocean); }

.btn--quiet {
  background: var(--paper-3);
  color: var(--ink);
  border-color: transparent;
}
.btn--quiet:hover { background: var(--hairline); }

.btn--block { width: 100%; }
.btn--sm { padding: .65rem 1.15rem; min-height: 42px; font-size: .9rem; }

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.link-more {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ocean-deep);
  border-bottom: 2px solid var(--sky);
  padding-bottom: .1rem;
  display: inline-block;
  transition: border-color var(--quick);
}
.link-more:hover { border-color: var(--ocean); }

/* =========================================================================
   CARDS AND GRIDS
   ========================================================================= */
.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.9rem);
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
}
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }

/* ---- the kit card -------------------------------------------------------
   ⚠ THE SAME OBJECT AS THE CLASS CARD, NOT A THUMBNAIL WITH WORDS UNDER IT.
   The first version framed the picture and then let the name, price and
   meta sit loose on the paper beneath it. Next to a class card — white,
   bordered, lifted — the kits read as unfinished: the eye takes the class
   cards for products and the kits for a contact sheet. They are the same
   kind of thing and they are now the same kind of card. See .class-card in
   home.css, which is this card with a flyer ratio and a date chip on it. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--quick), transform var(--quick),
              border-color var(--quick);
}
.card:hover,
.card:focus-within {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  border-color: var(--hairline-2);
}

.card-media {
  position: relative;
  display: block;
  background: var(--paper-2);
  /* No border and no radius of its own: it is now the top of a card that
     already has both, and a second rounded rectangle inside the first is
     the thing that made the old tile look like a sticker. */
  border: 0;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--slow);
}
.card:hover .card-media img { transform: scale(1.035); }

/* The card carries the padding now, so nothing sits against the paper's edge.
   The body grows to fill the card, which is what keeps a row of cards the
   same height when one name wraps to two lines and its neighbours do not. */
.card-body {
  padding: .95rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1 1 auto;
}

@media (prefers-reduced-motion: reduce) {
  .card:hover, .card:focus-within { transform: none; }
}
.card-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.card-meta { font-size: .88rem; color: var(--ink-muted); }
.price { font-family: var(--display); font-weight: 700; font-size: 1.05rem;
         color: var(--ocean-deep); }
.price s { color: var(--ink-faint); font-weight: 400; margin-right: .4rem; }
.price .now { color: var(--danger); }

/* ---- badges ------------------------------------------------------------
   ⚠ EVERY BADGE HERE IS DRIVEN BY A REAL NUMBER — her own stock count, her
   own spaces. Inventing scarcity is a banned commercial practice under UK
   consumer law, not a growth tactic. */
.badges {
  position: absolute;
  top: .6rem; left: .6rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  z-index: 2;
}
.badge {
  font-family: var(--display);
  font-size: .74rem;
  font-weight: 700;
  padding: .3rem .65rem;
  border-radius: var(--radius-pill);
  line-height: 1.3;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.badge--new  { background: var(--leaf-deep); color: var(--white); }
.badge--sale { background: var(--danger); color: var(--white); }
.badge--low  { background: var(--warn); color: var(--white); }
/* ⚠ --ink-body, NOT --ink-muted. Muted grey on the raised paper is 4.22:1 —
   just under the 4.5:1 small text needs, and "Fully booked" is precisely the
   badge somebody has to be able to read before they get their hopes up. The
   pixels were measured; it was not visible by eye. */
.badge--out  { background: var(--paper-3); color: var(--ink-body); }

.sample-note { font-size: .8rem; color: var(--ink-faint); }

/* =========================================================================
   FORMS
   ========================================================================= */
label { display: block; font-size: .9rem; color: var(--ink-body);
        font-weight: 600; margin-bottom: .35rem; }

input[type=text], input[type=email], input[type=search], input[type=number],
input[type=tel], input[type=password], input[type=date], input[type=time],
select, textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm);
  padding: .8rem .95rem;
  /* 16px minimum or iOS Safari zooms the whole page on focus. */
  min-height: 48px;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  border-color: var(--ocean-mid);
  box-shadow: 0 0 0 3px var(--sky-wash);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
                    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.field + .field { margin-top: 1.1rem; }
.form-note { font-size: .88rem; color: var(--ink-muted); margin-top: .5rem; }
.form-note.is-bad { color: var(--danger); }

/* ⚠ A SOLID RULE, NOT A DASHED BOX. A dashed border is the universal sign for
   scaffolding, and six pages of dashed "still to confirm" boxes made a
   finished site read as a half-built one on a sibling build. A solid rule
   down the side reads as a considered aside — which is what it is. */
.notice {
  border-left: 3px solid var(--sky);
  background: var(--sky-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.2rem;
  color: var(--ink-body);
  font-size: .95rem;
}
.notice--warn { border-color: var(--warn); background: var(--paper-2); }
.notice--good { border-color: var(--good); background: var(--leaf-wash); }
.notice strong { color: var(--ink); }

/* =========================================================================
   THE FOOTER
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--paper-2);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  margin-top: var(--rhythm);
}
.footer-top {
  display: grid;
  gap: 2.4rem;
  grid-template-columns: minmax(220px, 1.3fr) repeat(auto-fit, minmax(150px, 1fr));
  padding-bottom: 2.4rem;
  border-bottom: 1px solid var(--hairline);
}
.footer-brand img { height: 84px; width: auto; margin-bottom: .9rem; }
.footer-brand p { font-size: .95rem; color: var(--ink-muted); max-width: 34ch; }
.footer-col h4 { color: var(--ink); margin-bottom: .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: .5rem; }
.footer-col a { font-size: .95rem; color: var(--ink-body); }
.footer-col a:hover { color: var(--ocean-deep); text-decoration: underline; }

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-muted);
}
.socials { display: flex; gap: .4rem; }
.socials a {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-pill);
  color: var(--ink-body);
  transition: all var(--quick);
}
.socials a:hover { border-color: var(--ocean); color: var(--ocean-deep);
                   background: var(--white); }
.socials svg { width: 18px; height: 18px; }

/* =========================================================================
   THE BROWSE-MODE BANNER
   Shown while shop.live is false. It talks to the VISITOR about what they can
   do right now — it is not a note to the owner about unfinished work, which
   is the wrong person to address on a public page.
   ========================================================================= */
.browse-banner {
  background: var(--leaf-wash);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
  padding: .75rem 1rem;
  font-size: .95rem;
  color: var(--ink-body);
}

/* =========================================================================
   MODAL
   ========================================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(31, 42, 46, .55);
}
.modal-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  width: min(640px, 100%);
  max-height: min(84vh, 720px);
  overflow-y: auto;
  padding: clamp(1.4rem, 3vw, 2.2rem);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.2rem;
}
.modal-head h3 { margin: 0; }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td {
  text-align: left;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--hairline);
}
table.data th { font-family: var(--display); font-weight: 700; color: var(--ink); }
table.data tbody tr:nth-child(even) { background: var(--paper-2); }
/* A table is the one thing that legitimately needs to scroll sideways, and it
   must do it INSIDE its own box rather than moving the page. */
.table-scroll { overflow-x: auto; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 940px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .header-bar { gap: .5rem; }
}

/* ⚠ TWO UP ON A PHONE, NOT ONE. `minmax(min(250px, 100%), 1fr)` collapses to
   a single column below about 540px, which is technically correct and
   horrible: a sibling build's home page ran to 17,000 pixels of scrolling.
   Nobody browses a shop that way. */
@media (max-width: 620px) {
  .grid, .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem .7rem;
  }
  .card-body { padding-top: .55rem; }
  .card-name { font-size: .95rem; }
  .price { font-size: .95rem; }
  .card-meta { font-size: .8rem; }
  /* Classes stay ONE up. A class card carries a date, a time, a price and
     how many places are left — squeezed into half a phone screen none of it
     is readable, and the date is the whole point of the card. */
  .grid--3 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  /* ⚠ BELOW ABOUT 560px THE NAME IS DROPPED AND THE GLOBE CARRIES THE HEADER.
     A wordmark beside a mark on a 390px screen is what put a shop's own name
     underneath its own basket icon on a sibling build — and the name is in
     the tab title anyway. */
  .lockup-name { display: none; }
  .header-bar { min-height: 64px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  /* At the narrowest widths the container gives up its gutter before any tap
     target gives up its size — nobody notices a narrower margin; everybody
     notices a button they cannot hit. */
  :root { --gutter: .85rem; }
  .header-tools { gap: 0; }
}
