/* What every layout shares. Every colour is a token: the light set is on :root, the dark set under
   [data-dark="true"], and the shop's own colour comes in as --accent / --on-accent (written on <html> by
   functions/_lib/page.js). The type comes from one of three pairings of system fonts; nothing is fetched.
   looks/counter.css, looks/gallery.css and looks/poster.css only arrange and dress what is here.

   Rules the tokens keep: --ink, --dim, --open, --closed and --error read at 4.5:1 on --ground and --panel in both
   modes; --focus and --edge reach 3:1; --accent is only ever a fill, a border or large type (it is promised 3:1, not
   4.5:1); words on the accent are --on-accent; words on a photo sit on --scrim in --scrim-ink. */
:root {
  --ground: #ffffff;
  --panel: #f3f5f3;
  --ink: #17201c;
  --dim: #5d6863;
  --rule: #d5dcd8;
  --edge: #7a8580;
  --open: #1d7a3e;
  --closed: #a3361f;
  --error: #b42318;
  --focus: #1f4fb4;
  --scrim-ink: #ffffff;
  --scrim: rgba(0, 0, 0, .66);
  --shade: rgba(16, 22, 19, .55);
  --accent: #0f6b4f;
  --on-accent: #ffffff;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: var(--sans);
  --text: var(--sans);
  --head-weight: 700;
  --head-case: none;
  --head-space: -.01em;
  --radius: 12px;
  color-scheme: light;
}
:root[data-dark="true"] {
  --ground: #121715;
  --panel: #1c2320;
  --ink: #eef2ef;
  --dim: #a2aca7;
  --rule: #2f3934;
  --edge: #6b7671;
  --open: #5fd38d;
  --closed: #ff9b85;
  --error: #ff9b8f;
  --focus: #8ab4ff;
  --shade: rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* The three type pairings: headings change, body text stays an easy system face. */
:root[data-type="classic"] { --head: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif; --head-space: 0; }
:root[data-type="bold"] { --head: "Arial Black", "Segoe UI Black", "Helvetica Neue", Impact, system-ui, sans-serif; --head-weight: 900; --head-case: uppercase; --head-space: .01em; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.55; overflow-wrap: break-word; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: .15em; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); letter-spacing: var(--head-space); line-height: 1.15; margin: 0; text-wrap: balance; overflow-wrap: anywhere; max-width: 100%; }
/* overflow-wrap: anywhere (not break-word) lowers a heading's narrowest size too, so one long word in a shop's or a
   product's name breaks instead of pushing the page sideways where a heading is sized to its words (justify-items: start). */
h2 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: .6em; }
p { margin: 0 0 1em; max-width: 65ch; }
.muted { color: var(--dim); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--ground); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
.inner { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); min-width: 0; }

/* buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--accent); background: transparent; color: var(--ink); font: 700 1rem/1.2 var(--text); text-decoration: none; text-align: center; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: var(--edge); }
.btn:hover { box-shadow: 0 0 0 3px var(--rule); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: .92rem; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }

/* photo tiles: a real photo when one is posted, the shop's colour (darkened, so white words read) until then */
.ph { position: relative; overflow: hidden; border-radius: var(--radius); max-width: 100%; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--scrim-ink); background: #2b3430; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 50%, #000), color-mix(in srgb, var(--accent) 25%, #000)); font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); }
.ph > span { position: relative; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph::after { content: attr(data-label); position: absolute; inset: auto 10px 10px; font-family: var(--text); font-weight: 600; text-transform: none; font-size: .85rem; color: var(--scrim-ink); background: var(--scrim); border-radius: 999px; padding: 5px 12px; }
.ph[data-label=""]::after { display: none; }
.ph.has-img > span { display: none; }
/* The gallery's "Photo coming" tiles (its stand-ins until the shop posts photos): the title and the pill stack in the
   middle, the pill under the title. min-width: 0 and the .ph's own overflow: hidden keep a tile from widening its column;
   the title wraps inside it; min-height: min-content lets a tile grow taller (never wider) when a title wraps, and
   align-self: stretch keeps the tiles in a row the same height. Only these tiles: picture boxes and shelf tiles keep
   the plain .ph rules. */
.gallery > .ph:not(.has-img) { min-width: 0; min-height: min-content; align-self: stretch; align-content: center; gap: 6px; }
.gallery > .ph:not(.has-img) > span { max-width: 100%; overflow-wrap: anywhere; }
.gallery > .ph:not(.has-img)::after { position: static; inset: auto; max-width: 100%; }

/* announcement */
.banner { background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; padding: 10px 16px; }

/* top bar: the shop's name, the menu and the cart. On a phone the menu folds into one button, Menu (a label for a
   tick box, so it needs no script), and unfolds as its own column under the other two; from 760px it is always shown
   and the button is not. Shop has the Categories beside it: a <details>, which opens with no script; from 760px its
   list hangs under the menu. Every link wraps a long word rather than pushing the page sideways. */
.top { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.top .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: 10px; }
.brand { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); letter-spacing: var(--head-space); font-size: 1.15rem; line-height: 1.2; }
.brand span { min-width: 0; overflow-wrap: anywhere; }
.brand img { height: 40px; width: auto; max-width: 40vw; border-radius: 8px; object-fit: contain; flex: none; }
.brand.has-logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#nav { order: 3; flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 2px 0 6px; }
#nav a { flex: 0 1 auto; min-width: 0; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 999px; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
#nav a:hover, #nav a.on { text-decoration: underline; text-decoration-thickness: 2px; }
.nav-btn { order: 2; flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; border: 2px solid var(--edge); border-radius: 999px; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
#nav-toggle:focus-visible + .nav-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.nav-shop { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.nav-cats { min-width: 0; }
.nav-cats summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.nav-cats summary::-webkit-details-marker { display: none; }
.nav-sub, .nav-sub ul { list-style: none; margin: 0; padding: 0; }
.nav-sub ul { padding-left: 14px; }
#nav .nav-sub a { display: block; border-radius: 8px; }
.cart-btn { flex: none; order: 2; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cart-btn .n { background: var(--on-accent); color: var(--accent); border-radius: 999px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; font-size: .85rem; }
/* A phone: the top bar stays stuck to the top of the screen, open or folded, wherever the page is scrolled. While the
   menu is open the whole top bar is never taller than the screen and scrolls inside itself, so every link can be
   reached however tall the bar's own row is (a browser that knows :has). A browser that does not gets the menu's own
   limit instead: never taller than the screen less a top bar of about 72px, scrolling inside itself. Either way one box
   scrolls, not one inside another. Shop and the Categories' arrow share one row (Shop floats), the list of shelves
   under them. 759.98px leaves no width (a zoomed one) where both rules miss. */
@media (max-width: 759.98px) {
  #nav { display: none; }
  #nav-toggle:checked ~ #nav { display: flex; max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
  @supports selector(:has(a)) {
    .top:has(#nav-toggle:checked) { max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
    #nav-toggle:checked ~ #nav { max-height: none; overflow-y: visible; }
  }
  .nav-shop { display: flow-root; }
  .nav-shop > a { float: left; }
  .nav-cats { display: block; }
  .nav-sub { clear: left; }
}
/* From 760px the brand, the menu and the cart stay on one row: the menu wraps inside itself, never pushing the cart
   down; the Categories list is never taller than the screen under the top bar, and scrolls inside itself. */
@media (min-width: 760px) {
  .top .inner { flex-wrap: nowrap; }
  .brand { flex: 0 1 auto; }
  .nav-btn, #nav-toggle { display: none; }
  #nav { order: 0; flex: 0 1 auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; position: relative; margin: 0 0 0 auto; padding: 2px; }
  /* The list hangs from the menu's left edge (Shop is the menu's first link), never wider than the menu or 13rem,
     whichever is more, so it always stays on the screen. */
  .nav-sub { position: absolute; top: 100%; left: 0; z-index: 20; width: max-content; min-width: 12rem; max-width: max(100%, 13rem); max-height: min(70vh, calc(100vh - 90px)); max-height: min(70vh, calc(100dvh - 90px)); overflow-y: auto; overscroll-behavior: contain; padding: 8px; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 10px 28px var(--shade); }
}

/* the shop front: name, open sign, address and phone */
.hero { padding-block: 28px 20px; }
.hero-inner { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.hero-text { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); }
.hero .tag { font-size: 1.1rem; color: var(--dim); margin: 0; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; font-size: 1.1rem; }
.sign { display: grid; gap: 2px; width: 100%; max-width: 34rem; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
.status { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: var(--head-weight); font-size: 1.15rem; color: var(--open); }
.sign:has(.dot.closed) .status { color: var(--closed); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--open); flex: none; }
.dot.closed { background: var(--closed); }
.status-sub { color: var(--dim); font-variant-numeric: tabular-nums; }
.status-note { font-weight: 700; }
.facts { display: grid; gap: 4px; }
.facts p { margin: 0; }
.addr { color: var(--dim); }
.phone a { color: var(--ink); font-weight: 700; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* search, on the front: it opens the shop with what was typed */
.find { padding-block: 4px 12px; }
.find-form { display: flex; flex-wrap: wrap; gap: 10px; }
.find-form input { flex: 1 1 14rem; min-width: 0; }

/* form fields everywhere on the storefront */
input, select, textarea { font: inherit; color: var(--ink); background: var(--ground); border: 1px solid var(--edge); border-radius: 10px; padding: 10px 14px; min-height: 44px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }

section.block { padding-block: 36px; }
section.alt { background: var(--panel); }

/* shelves on the front */
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.shelf { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); overflow: hidden; background: var(--ground); border: 1px solid var(--rule); color: var(--ink); }
.shelf[data-shelf] { cursor: pointer; }
a.shelf { text-decoration: none; } /* a shelf card is a link to its shelf; its "Browse" line keeps the underline */
.shelf .ph { border-radius: 0; aspect-ratio: 16 / 10; font-size: .95rem; }
.shelf .txt { padding: 14px 16px 16px; min-width: 0; }
.shelf h3 { font-size: 1.1rem; margin-bottom: 6px; }
.shelf p { font-size: .95rem; color: var(--dim); margin: 0; }
.shelf .more { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .92rem; text-decoration: underline; }
.shop-all { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

/* photos of the shop. Six tracks: a card takes two, a "big" card three, so a count that is not a multiple of three
   never leaves one card alone on the last row. Two across on a phone; an odd count makes the first card full width. */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gallery > .mbig { grid-column: span 2; }
.gallery > .ph { aspect-ratio: 16 / 10; }
.gallery .ph { cursor: zoom-in; }
.gallery .shot { min-width: 0; }
.gallery .shot .ph { aspect-ratio: 4 / 3; }
.gallery .shot .txt { padding: 8px 2px 0; }
.gallery .shot h3 { font-size: .95rem; }
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .gallery > *, .gallery > .mbig { grid-column: span 2; }
  .gallery > .big { grid-column: span 3; }
}

/* hours */
.hours { display: grid; gap: 24px; align-items: start; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td { padding: 10px 0; border-bottom: 1px solid var(--rule); }
td:last-child { text-align: right; color: var(--dim); padding-left: 12px; }
tr.today td { font-weight: 700; color: var(--ink); }
tr.today td:first-child::after { content: " (today)"; font-weight: 400; color: var(--dim); font-size: .85rem; }
.closures { margin: 14px 0 0; padding: 0; list-style: none; font-weight: 600; }
.late { background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.late h3 { font-size: 1.2rem; margin-bottom: 4px; }
.late .big { font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); line-height: 1; margin: 6px 0 10px; }
.late .small { color: var(--dim); font-size: .95rem; }
/* When the shop is closed for the day the big line is a sentence ("Opens Friday at 10:00 AM"), not two words. */
.late .big.says { font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.8rem); line-height: 1.15; }
@media (min-width: 760px) { .hours { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; } }

/* the shop on its own page (/shop): search, shelf chips, sort, the products */
body.view-shop .home-only { display: none !important; }
body:not(.view-shop) #shop { display: none; }
#shop { min-height: 70vh; }
#shop .back { display: inline-block; margin-bottom: 14px; font-size: .95rem; }
/* /shop is a page of its own: its heading is the page's h1, sized as the section heading it was. */
#shop h1 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: .6em; }
.shop-tools { margin: 16px 0 6px; }
.shop-tools .bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.shop-tools input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.shop-tools .chk { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; white-space: nowrap; min-height: 44px; }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
/* A flex box drops the space between the shelf's name and its count: the gap puts back about one space. */
.chip { flex: none; display: inline-flex; align-items: center; gap: .3em; text-decoration: none; min-height: 40px; background: var(--ground); color: var(--ink); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.chip span { color: var(--dim); font-size: .88em; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.chip.on span { color: var(--on-accent); }
.shop-count { min-height: 1.4em; margin-top: 6px; font-size: .95rem; }
.shop-group { margin-top: 26px; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.ghead h3 { font-size: 1.25rem; }
.more-row { margin-top: 18px; text-align: center; }
.shop-empty { background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }

/* a category's own page (/c/<slug>): its photo across the top, the crumb, its heading and blurb, the shelves inside it;
   its list below is the shop list's (#shop) */
.cat-head { padding-bottom: 24px; }
.cat-photo { margin: 0 0 18px; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cat-photo img { display: block; width: 100%; aspect-ratio: 16 / 6; object-fit: cover; }
.cat-head .crumb { margin: 0 0 8px; font-size: .95rem; color: var(--dim); }
.cat-head h1 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: .4em; }
#cat-lead { color: var(--dim); margin: 0 0 6px; max-width: 46rem; }
#cat-children { margin-top: 18px; }
@media (max-width: 700px) { .cat-photo img { aspect-ratio: 16 / 9; } }

/* a product card */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.item { display: flex; flex-direction: column; min-width: 0; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.item .ph { border-radius: 0; aspect-ratio: 4 / 3; font-size: .9rem; }
.item .ph[data-open] { cursor: pointer; }
.item .txt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.item h4 { font-size: 1.02rem; }
.item .pname { color: var(--ink); text-decoration: none; }
.item .pname:hover { text-decoration: underline; }
.item .blurb { color: var(--dim); font-size: .9rem; margin: 0; flex: 1; }
.item .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.item .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.item .soldout { color: var(--dim); font-size: .9rem; font-style: italic; }
.item .low { display: block; color: var(--closed); font-weight: 700; font-size: .85rem; }
.item.plain .row { min-height: 44px; }
/* A product's badges ("New", "Sale") and its was-price, struck through just after its price: on a card and on the
   product's own page. A badge is the accent as a fill, its words --on-accent. */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badges[hidden] { display: none; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 700; line-height: 1.5; }
.was { color: var(--dim); font-weight: 400; font-size: .9em; }
.item .row .was { margin-right: auto; }

/* mystery boxes */
.mystery { display: grid; gap: 24px; align-items: center; }
.mbox { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--ink); justify-self: center; }
.mbox .crate { display: block; position: relative; width: 62%; aspect-ratio: 1 / .8; border-radius: 16px; background: var(--panel); border: 3px solid var(--accent); }
.mbox .lid { position: absolute; left: -3%; right: -3%; top: -10%; height: 26%; border-radius: 12px; background: var(--accent); transform-origin: left bottom; }
.mbox .q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-weight: var(--head-weight); font-size: clamp(2.6rem, 8vw, 4.4rem); line-height: 1; }
.mbox .prize { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-weight: 700; font-size: .95rem; opacity: 0; }
.mbox .hint { position: absolute; bottom: 2%; color: var(--dim); font-size: .92rem; }
.mbox.open .lid { transform: rotate(-110deg); }
.mbox.open .q { opacity: 0; }
.mbox.open .prize { opacity: 1; }
.tiers { display: grid; gap: 10px; margin-top: 10px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--radius); padding: 12px 14px; }
.tier > div { min-width: 0; }
.tier small { display: block; color: var(--dim); }
@media (min-width: 760px) { .mystery { grid-template-columns: 1fr 1fr; gap: 36px; } }

/* find us */
.visit { display: grid; gap: 24px; }
.visit dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
/* Each fact's row is wrapped so a shop without that fact leaves it out whole; the wrapper takes no part in the grid. */
.visit dl > div { display: contents; }
.visit dt { color: var(--dim); }
.visit dd { margin: 0; min-width: 0; }
.copy { background: none; border: 1px solid var(--edge); color: var(--ink); border-radius: 999px; padding: 2px 10px; min-height: 30px; font-size: .82rem; margin-left: 6px; }
.map { display: grid; place-items: center; align-content: center; gap: 8px; aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--rule); color: var(--ink); text-align: center; padding: 16px; text-decoration: none; }
.map b { display: block; font-family: var(--head); font-weight: var(--head-weight); font-size: 1.2rem; text-decoration: underline; }
.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ground); box-shadow: 0 0 0 2px var(--accent); }
@media (min-width: 760px) { .visit { grid-template-columns: 1fr 1fr; gap: 36px; } }

/* footer, and the credit on its own line */
footer { padding-block: 26px calc(26px + env(safe-area-inset-bottom, 0px)); color: var(--dim); font-size: .92rem; background: var(--ground); border-top: 1px solid var(--rule); }
footer .inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer a { color: var(--ink); }
/* The menu's links again, then the pages not in the menu, then News: a row that wraps, each word breaking if it must. */
.foot-links { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.foot-links li { min-width: 0; }
.foot-links a { display: inline-block; padding: 6px 0; overflow-wrap: anywhere; }
footer .credit { flex: 1 1 100%; text-align: center; padding-top: 14px; border-top: 1px solid var(--rule); }
footer .credit:only-child { padding-top: 0; border-top: 0; }
footer .credit a { color: var(--ink); font-weight: 700; }

/* product pop-up */
.pd { position: fixed; inset: 0; z-index: 26; background: var(--shade); display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; }
.pd.open { opacity: 1; visibility: visible; pointer-events: auto; }
.pd .sheet { position: relative; width: min(980px, 100%); max-height: 100%; overflow-y: auto; background: var(--ground); color: var(--ink); border-radius: var(--radius); padding: 20px; }
.pd .x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); font-size: 1.2rem; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pd-media .ph { aspect-ratio: 1 / 1; font-size: 1.2rem; }
.pd-media .ph img { object-fit: contain; background: #000; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs .th { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--panel); }
.thumbs .th.on { border-color: var(--accent); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pd-info h3 { font-size: 1.6rem; }
.pd .crumb { margin: 0; font-size: .95rem; }
.pd-info .price { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-info p { margin: 0; }
.pd-stock { color: var(--dim); font-size: .95rem; }
.pd-stock.low { color: var(--closed); font-weight: 700; }
.pd-stock.out { font-style: italic; }
.pd-buy { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.pd-buy .qty { background: var(--panel); border-radius: 999px; padding: 4px; }
.pd-buy .qty button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--edge); background: var(--ground); color: var(--ink); font-size: 1.2rem; }
.pd-buy .qty span { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.pd-note { font-size: .88rem; }
#pd-related { margin-top: 24px; }
#pd-related > h4 { font-size: 1.15rem; margin: 0 0 12px; }
.pd-grid.nopic .pd-media { display: none; }
.pd-grid.nopic .pd-info { padding-right: 52px; }
.pd .sheet:has(.pd-grid.nopic) { width: min(640px, 100%); }
@media (min-width: 701px) {
  .pd-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; }
  .pd-grid.nopic { grid-template-columns: minmax(0, 1fr); }
  .pd-info { padding-top: 30px; }
  .pd-grid.nopic .pd-info { padding-top: 4px; }
}
@media (max-width: 700px) {
  .pd { padding: 0; }
  .pd .sheet { height: 100%; border-radius: 0; padding: 16px 14px 24px; }
  #pd-related .items { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* photo viewer: always dark, whatever the mode, so the photo is the brightest thing. Its buttons sit above the picture
   (.ph is placed too and comes later), so a phone can tap the whole of each. */
.lb { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .92); color: var(--scrim-ink); display: grid; place-items: center; padding: 24px max(24px, env(safe-area-inset-right, 0px)) 24px max(24px, env(safe-area-inset-left, 0px)); opacity: 0; visibility: hidden; pointer-events: none; }
.lb.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lb .box { display: grid; justify-items: center; width: 100%; }
.lb .ph { width: min(900px, 100%); aspect-ratio: 4 / 3; font-size: 1.4rem; }
.lb .ph img { object-fit: contain; background: #000; }
.lb .cap { margin-top: 14px; color: var(--scrim-ink); }
.lb .x, .lb .arrow { position: absolute; z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .6); color: #ffffff; font-size: 1.3rem; }
.lb :focus-visible { outline-color: #ffffff; }
.lb .x { top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb .arrow { top: 50%; transform: translateY(-50%); }
.lb .prev { left: max(10px, env(safe-area-inset-left, 0px)); }
.lb .next { right: max(10px, env(safe-area-inset-right, 0px)); }

/* cart drawer and checkout. Closed, it is out of reach of the keyboard as well as out of sight. */
.drawer-bg { position: fixed; inset: 0; background: var(--shade); z-index: 30; opacity: 0; visibility: hidden; pointer-events: none; }
.drawer-bg.open { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--ground); color: var(--ink); z-index: 31; transform: translateX(100%); visibility: hidden; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); border-left: 1px solid var(--rule); }
.drawer.open { transform: none; visibility: visible; }
/* The chat button steps aside while the cart, a product or a photo is open, so it never sits on their buttons. */
body:has(.drawer.open) #shop-chat, body:has(.pd.open) #shop-chat, body:has(.lb.open) #shop-chat { display: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.drawer header h3 { font-size: 1.3rem; }
.drawer .body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer .x { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); font-size: 1.2rem; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.line .nm { font-weight: 600; min-width: 0; }
/* A line's choice (Small, Sage), under the product's name: in the cart and on the order page. */
.line .choice { display: block; font-weight: 400; color: var(--dim); overflow-wrap: anywhere; }
.line .qty { gap: 8px; }
.line .qty button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--edge); background: none; color: var(--ink); }
.line .amt { text-align: right; font-variant-numeric: tabular-nums; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.sum .total { font-weight: 700; font-size: 1.1rem; }
.sum .disc { color: var(--open); }
.promo { display: flex; gap: 8px; margin-top: 14px; }
.promo input { flex: 1; min-width: 0; text-transform: uppercase; border-radius: 999px; }
.promo input::placeholder { text-transform: none; }
.promo-msg { margin: 8px 0 0; font-size: .92rem; }
.promo-msg.ok { color: var(--open); }
.promo-msg .link { margin-left: 6px; }
.form { display: grid; gap: 12px; margin-top: 14px; }
.form label { display: grid; gap: 4px; font-size: .92rem; color: var(--dim); }
.form input, .form select, .form textarea { width: 100%; }
.form .check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: .95rem; }
.form .check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.err { color: var(--error); font-weight: 600; margin: 0; }
/* The drawer's way to the checkout page. The script marks the drawer empty while the cart is, and off while the shop
   takes no orders (app.js); with no script the link is always there. */
.go-checkout { margin: 14px 0 0; }
.drawer.empty .go-checkout, .drawer.off .go-checkout { display: none; }
.drawer #shop-off { margin-top: 10px; }

/* the checkout page (/checkout): the cart whole beside the form; one column on a phone. The header's cart button is a
   link to the cart here. */
a.cart-btn { text-decoration: none; }
.co { max-width: 980px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
.co h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); margin-bottom: .5em; }
.co h2 { font-size: 1.2rem; margin-bottom: .4em; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.co-cart, .co-form { min-width: 0; background: var(--panel); border-radius: var(--radius); padding: 18px; }
.co-form { margin-top: 0; }
#co-lines:focus { outline: none; }
.co-line { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; }
.co-line.nopic { grid-template-columns: minmax(0, 1fr) auto; }
.co-line .co-ph { grid-row: 1 / span 3; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--ground); }
.co-line .co-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-line .nm a { text-decoration: none; overflow-wrap: anywhere; }
.co-line .nm a:hover { text-decoration: underline; }
.co-line .qty .n { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.co-line .qty button:disabled { opacity: .45; cursor: not-allowed; }
.co-line .co-note { grid-column: -3 / -1; overflow-wrap: anywhere; }
.co #pay-mode { margin: 12px 0 0; }
.co #shop-off { grid-column: 1 / -1; }
@media (min-width: 760px) { .co-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; } }
.ok-msg { color: var(--open); font-weight: 600; }

/* the order page (made on the server since the store pages: its heading is the page's h1, sized as the h2 it was) */
.order-body main { padding-block: 32px 56px; }
.order-wrap { max-width: 640px; }
.order-wrap h1 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: .4em; }
.order-note { margin-top: 18px; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
.pill.ready { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pill.cancelled { color: var(--closed); }
.order-card { background: var(--panel); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.order-card .code { font-family: var(--head); font-weight: var(--head-weight); font-size: 2.2rem; letter-spacing: .08em; line-height: 1.1; }
.order-body .btns { margin-top: 10px; }

/* a product's own page (/p/<id>-<name>) */
.pp { max-width: 980px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
/* The product's photos: a strip that swipes by itself and snaps to one photo at a time, scrolling inside itself
   (never the page); a thumbnail jumps to its photo. */
.pp-media { min-width: 0; }
.pp-strip { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; border-radius: var(--radius); background: var(--panel); }
.pp-strip > li { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.pp-strip a { display: block; }
.pp-strip a:focus-visible { outline-offset: -4px; }
.pp-strip img { width: 100%; max-width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--panel); display: block; }
.pp.nopic { max-width: 640px; }
.pp h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); margin: 6px 0 10px; }
.pp .price { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp .crumb, .pp .stock { color: var(--dim); }
.pp .crumb { margin: 0; font-size: .95rem; }
.pp .go.off { opacity: .6; pointer-events: none; border-color: var(--edge); background: var(--panel); color: var(--dim); }
/* A product's choices: one box per kind, its options as large tap targets; every line of words breaks inside its box,
   however long an owner's option name is. The list of every combination is what a shopper reads with no script. */
.choose { display: grid; gap: 12px; margin: 14px 0; }
.choose fieldset { min-width: 0; margin: 0; padding: 10px 14px 12px; border: 1px solid var(--rule); border-radius: var(--radius); }
.choose legend { padding: 0 6px; font-weight: 700; }
.choose label { display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; }
.choose input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 0; }
#choose legend, #choose label, #combo-list li { overflow-wrap: anywhere; }
.combo-list { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--rule); }
.combo-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.pp .go:disabled { opacity: .6; cursor: not-allowed; border-color: var(--edge); background: var(--panel); color: var(--dim); }
/* The product's description (Task 11): its paragraphs and its list, every line breaking inside the column however long
   a word the owner typed. */
.pp-desc { margin: 4px 0 6px; }
.pp-desc p { margin: 0 0 10px; }
.pp-desc ul { margin: 0 0 10px; padding-left: 1.3em; }
.pp-desc li { margin: 2px 0; }
#pp-desc p, #pp-desc li { overflow-wrap: anywhere; }
/* "Goes well with" / "More from this shelf": a row of product cards under the product, as wide as the product. */
.pp-more { max-width: 980px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
.pp-more h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); margin: 0 0 14px; }
@media (max-width: 700px) { .pp-more .items { grid-template-columns: 1fr 1fr; gap: 10px; } }
@media (min-width: 701px) { .pp:not(.nopic) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }

/* Pages the owner writes and news (Task 12): one readable column of blocks (functions/_lib/blocks/), every line of
   words breaking inside it however long a word the owner typed; questions fold open with no script. */
.owner-page .inner, .news-list .inner { max-width: 760px; }
.owner-page h1, .news-list h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); margin-bottom: .5em; }
.draft-line { margin: 0 0 16px; padding: 10px 14px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--panel); font-weight: 700; }
.post-date { margin: 0 0 14px; color: var(--dim); font-size: .95rem; }
.blk { margin: 0 0 22px; }
.blk h2 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); margin: 10px 0 0; }
.blk p { margin: 0 0 10px; }
.blk ul { margin: 0 0 10px; padding-left: 1.3em; }
.blk li { margin: 2px 0; }
.blk h2, .blk p, .blk li, .blk summary, .blk figcaption, .blk td, .blk a { overflow-wrap: anywhere; }
.blk figure { margin: 0; }
.blk img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.blk figcaption { margin-top: 6px; color: var(--dim); font-size: .95rem; }
.blk .pt { display: grid; gap: 16px; }
.blk .pt img { max-width: 100%; }
.blk details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.blk details:first-child { border-top: 1px solid var(--rule); }
.blk summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.blk details > :not(summary) { margin-left: 1.1em; }
.blk table { width: 100%; max-width: 30rem; border-collapse: collapse; }
.blk td { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.blk td + td { text-align: right; }
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 16px 0; border-top: 1px solid var(--rule); }
.posts .post-date { margin-bottom: 4px; }
.posts h2, .posts h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); margin-bottom: 6px; }
.posts h2 a, .posts h3 a { color: var(--ink); }
/* The home page's Latest news: the news list's rows, at the page's own width. */
#latest-news .posts { max-width: 760px; margin-bottom: 18px; }
.posts p { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 701px) {
  .blk .pt { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .blk .pt-right img { order: 2; }
}

/* the page that is not there */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.lost h1 { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.6rem); margin-bottom: 10px; }

/* motion: only for those who have not asked for less */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .pp-strip { scroll-behavior: smooth; }
  .btn, .chip, .cart-btn, #nav a { transition: box-shadow .15s, background-color .15s; }
  /* Closing: fade or slide out, then hide (visibility waits for the end). Opening: visible at once, with no
     visibility transition, so the close button can take the keyboard's focus in the same moment it opens. */
  .pd, .lb, .drawer-bg { transition: opacity .2s, visibility .2s; }
  .pd.open, .lb.open, .drawer-bg.open { transition: opacity .2s; }
  .pd .sheet { transform: translateY(12px); transition: transform .2s; }
  .pd.open .sheet { transform: none; }
  .drawer { transition: transform .3s cubic-bezier(.2, .7, .2, 1), visibility .3s; }
  .drawer.open { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
  .mbox .lid { transition: transform .5s cubic-bezier(.3, 1.4, .4, 1); }
  .mbox .q { transition: opacity .3s; }
  .mbox .prize { transition: opacity .35s .25s; }
  .mbox.shake .crate { animation: shake .5s; }
  @keyframes shake { 20% { transform: rotate(3deg) } 40% { transform: rotate(-4deg) } 60% { transform: rotate(3deg) } 80% { transform: rotate(-2deg) } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
