/* The record: one piece in a pop-up over the page, opened from a wall tile or any
   [data-item]. Loaded by site.js. Toy box look: flat bright colour, navy outline,
   offset shadow, no gradients. 18px text floor, 44px targets.

   The end panel (A.J. picked it on the 2026-10-20 board, docs/piece-view-2026-10-20.md):
   the piece on flat teal like the end of its own box, the era on a plate, the name in box
   lettering with the maker as the address line, then the tag word for word with its story,
   Call and Email (pinned), the pieces most like it, and the booths line as the slogan rule.
   A pop-up, never a whole page: from 600px a centred card with the page dimmed all round it;
   under 600px a sheet from the bottom.

   Layouts (2026-11-22, after A.J.'s iPad: a picture column ending in 40% empty cream while the
   words were squeezed and cut off on the right):
   - one column on phones and on any upright screen (an iPad held upright, the open Fold):
     the panel, the name, then the words, Call and Email pinned to the foot of the card;
   - two columns on a screen on its side from 700px: the panel on the left stays put and is
     exactly as tall as the card, so it never ends in empty space, and the words scroll on the
     right. The picture grows to fill the panel (container units; a browser without them keeps
     the fixed-size panel).
   Spacing: 4 8 12 16 24 32. */

.rec{
  position:fixed;top:0;right:0;bottom:0;left:0;z-index:90;display:none;align-items:center;justify-content:center;
  --pad:48px;padding:var(--pad);--gal-h:268px;--tp:16px;
}
.rec[data-open="true"]{display:flex}
body.rec-open{overflow:hidden}
.rec-scrim{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(27,47,94,.78)}

.rec-card{
  position:relative;width:min(640px,100%);max-height:calc(100vh - 2 * var(--pad));max-height:calc(100dvh - 2 * var(--pad));
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  background:var(--cream,#FBF6E6);color:var(--navy,#1B2F5E);
  border:3px solid var(--navy,#1B2F5E);border-radius:6px;box-shadow:8px 8px 0 var(--mustard,#F2B632);
  font-family:var(--body,'Jost',sans-serif);font-size:19px;line-height:1.5;
}

/* the top strip: the kind on the left, a big Close on the right, stays put while the card scrolls (56px tall) */
.rec-top{
  position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:6px 8px 6px 16px;background:var(--navy,#1B2F5E);color:var(--cream,#FBF6E6);
}
.rec-kind{
  font-family:var(--display,'Rokkitt',serif);font-weight:900;font-size:20px;letter-spacing:.08em;text-transform:uppercase;
  min-width:0;line-height:1.1;overflow-wrap:anywhere;
}
.rec-close{
  display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;flex:0 0 auto;
  background:var(--mustard,#F2B632);color:var(--navy,#1B2F5E);border:2px solid var(--mustard,#F2B632);border-radius:4px;
  font-weight:700;font-size:19px;cursor:pointer;
}
.rec-close svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}

.rec-body{display:grid;grid-template-columns:minmax(0,1fr)}
.rec-left{min-width:0;display:flex;flex-direction:column}

/* ---------- the end panel: the piece on flat colour, the era on a plate ---------- */
.rec-panel{position:relative;background:var(--teal,#17797B);border-bottom:3px solid var(--navy,#1B2F5E);display:flex;flex-direction:column}
.rec-gal{min-width:0;flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
/* the strip over the pictures: the era plate on the left, the arrows and dots on the right, on one row whenever they
   fit. A short era is as wide as its words; a long one keeps at least 13em, so it is two lines at most, and when the
   arrows do not fit beside that they drop under the plate. Never one over the other. Margins, not gap, so Safari
   before 14.5 spaces them too. */
.rec-head{flex:none;display:flex;flex-wrap:wrap;align-items:center;padding:12px 12px 0}
.rec-plate{flex:0 1 auto;line-height:1;margin:0 12px 8px 0}
.rec-plate--long{flex:1 1 13em}
.rec-plate span{
  display:inline-block;max-width:100%;box-sizing:border-box;padding:4px 12px;
  background:var(--cream,#FBF6E6);border:3px solid var(--navy,#1B2F5E);
  font-family:var(--display,'Rokkitt',serif);font-weight:900;font-size:26px;line-height:1.05;color:var(--navy,#1B2F5E);
}
.rec-plate--long span{font-size:21px}
.rec-galnav{flex:none;margin:0 0 8px auto;display:flex;align-items:center}
.rec-track{
  flex:none;display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;height:var(--gal-h);
  overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.rec-track::-webkit-scrollbar{display:none}
.rec-track:focus-visible{outline:3px solid var(--mustard,#F2B632);outline-offset:-3px}
.rec-slide{
  position:relative;flex:0 0 100%;min-width:0;margin:0;scroll-snap-align:start;scroll-snap-stop:always;overflow:hidden;
  display:flex;align-items:center;justify-content:center;padding:6px 16px 14px;box-sizing:border-box;--pic-h:calc(var(--gal-h) - 20px);
}
/* a real photo sits in a navy frame that takes the picture's own shape (--ar is width over height) */
.rec-frame{
  position:relative;display:block;box-sizing:content-box;--ar:1;flex:none;
  width:min(100% - 6px,calc((var(--pic-h) - 6px) * var(--ar)));aspect-ratio:var(--ar);
  border:3px solid var(--navy,#1B2F5E);border-radius:4px;background:var(--white,#fff);overflow:hidden;
}
.rec-frame img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
/* every picture is a button that opens it full screen */
button.rec-frame{padding:0;margin:0;font:inherit;color:inherit;cursor:zoom-in;-webkit-appearance:none;appearance:none}
button.rec-frame:focus-visible{outline:3px solid var(--mustard,#F2B632);outline-offset:3px}
/* the piece on its own stands on the panel with a second ink printed slightly off */
.rec-slide--cutout .rec-frame,.rec-slide--render .rec-frame{
  border:0;border-radius:0;background:none;overflow:visible;
  width:min(100% - 24px,calc((var(--pic-h) - 12px) * var(--ar)));
}
.rec-slide--cutout .rec-frame img,.rec-slide--render .rec-frame img{object-fit:contain;filter:drop-shadow(6px 6px 0 var(--mustard,#F2B632))}
/* a browser with container units sizes the picture to the slide it is in, whatever the slide's size */
@supports (container-type:size){
  .rec-slide{container-type:size}
  .rec-frame{width:min(100cqw - 6px,calc((100cqh - 6px) * var(--ar)))}
  .rec-slide--cutout .rec-frame,.rec-slide--render .rec-frame{width:min(100cqw - 24px,calc((100cqh - 12px) * var(--ar)))}
}
/* where the piece is in the photo */
.rec-ring{
  position:absolute;box-sizing:border-box;min-width:28px;min-height:28px;border:4px solid var(--mustard,#F2B632);border-radius:50%;
  box-shadow:0 0 0 3px var(--navy,#1B2F5E),inset 0 0 0 3px var(--navy,#1B2F5E);pointer-events:none;
}
.rec-note{
  position:absolute;left:16px;bottom:8px;margin:0;padding:2px 8px;background:var(--cream,#FBF6E6);color:var(--navy,#1B2F5E);
  border:2px solid var(--navy,#1B2F5E);border-radius:4px;font-weight:700;font-size:18px;line-height:1.3;
}
.rec-galbtn{
  width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  background:var(--cream,#FBF6E6);color:var(--navy,#1B2F5E);border:3px solid var(--navy,#1B2F5E);border-radius:6px;
}
.rec-galbtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.rec-galbtn:disabled{opacity:.4;cursor:default}
.rec-dots{display:flex}
.rec-dots button{width:44px;height:44px;padding:0;background:none;border:0;display:grid;place-items:center;cursor:pointer}
.rec-dots i{display:block;width:14px;height:14px;border-radius:7px;background:var(--cream,#FBF6E6);border:3px solid var(--navy,#1B2F5E)}
.rec-dots button[aria-current="true"] i{width:30px;background:var(--red,#D5331F)}

/* ---------- the band: the name in box lettering, the maker as the address line ---------- */
.rec-band{flex:none;padding:16px 16px 0}
.rec .rec-band h2{font-family:var(--display,'Rokkitt',serif);font-weight:900;font-size:30px;line-height:1.05;margin:0;color:var(--navy,#1B2F5E);text-wrap:balance}
.rec-rule{height:7px;margin-top:10px;border-top:3px solid var(--red,#D5331F);border-bottom:2px solid var(--red,#D5331F)}
.rec-addr{margin-top:8px;font-weight:700;font-size:18px;line-height:1.3;letter-spacing:.1em;text-transform:uppercase;color:var(--navy,#1B2F5E)}

/* ---------- the words ---------- */
.rec-text{min-width:0;display:flex;flex-direction:column;gap:16px;padding:var(--tp)}
.rec-facts{margin:-4px 0 0;display:flex;flex-wrap:wrap;gap:4px 24px;font-size:19px;line-height:1.35}
.rec-facts div{display:flex;gap:8px;min-width:0}
.rec-facts dt{font-weight:700}
.rec-facts dt::after{content:":"}
.rec-facts dd{margin:0}
.rec-about{margin:0;font-size:19px;line-height:1.5}

.rec-tags b,.rec-like b{
  display:block;font-family:var(--display,'Rokkitt',serif);font-weight:900;font-size:20px;letter-spacing:.05em;text-transform:uppercase;margin-bottom:8px;
}
.rec-ref{
  display:flex;align-items:center;min-height:48px;padding:8px 0;
  color:var(--navy,#1B2F5E);font-weight:600;font-size:18px;line-height:1.3;overflow-wrap:anywhere;
  text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px;
}
.rec-chips{display:flex;flex-wrap:wrap;gap:8px;padding-bottom:8px}
.rec-chips a{
  display:inline-flex;align-items:center;min-height:44px;padding:0 16px;
  border:2px solid var(--navy,#1B2F5E);border-radius:999px;background:var(--cream,#FBF6E6);
  color:var(--navy,#1B2F5E);font-weight:600;font-size:18px;text-decoration:none;
}

/* one tag paper block: the tag first, in the hand, then the story under a rule, with the links one
   per line. The paper and the hand say what it is; "On the tag" is read out, not shown. */
.rec-tag{
  position:relative;background:var(--paper,#FFF1C2);border:2px solid var(--navy,#1B2F5E);border-radius:4px 14px 14px 4px;
  padding:12px 16px 12px 34px;
}
.rec-tag::before{content:"";position:absolute;left:12px;top:18px;width:10px;height:10px;border-radius:50%;background:var(--cream,#FBF6E6);border:2px solid var(--navy,#1B2F5E)}
.rec-tag--notes{padding-left:16px}
.rec-tag--notes::before{display:none}
.rec-tag>p{margin:0;font-family:var(--hand,'Mynerve',cursive);font-size:24px;line-height:1.3}
.rec-tag>p+p{margin-top:6px}
.rec-notes{margin-top:12px;padding-top:12px;border-top:2px solid rgba(27,47,94,.22)}
.rec-tag--notes .rec-notes{margin-top:0;padding-top:0;border-top:0}
.rec-notes p{margin:0 0 8px;font-size:19px;line-height:1.5}
.rec-notes p:last-child{margin-bottom:0}
.rec-notes ul{list-style:none;margin:4px 0 -8px;padding:0}
.rec-notes li{border-top:2px solid rgba(27,47,94,.18)}
.rec-tags ul{margin:0;padding-left:22px}
.rec-tags li{margin:4px 0;font-size:18px}

/* ---------- the buttons: Listen under the words it reads, Save and Share, then Call and Email as the pinned foot.
   Two to a row, every row on the same two equal columns ---------- */
.rec-tools,.rec-keep,.rec-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch}
.rec .btn{min-height:52px;font-size:19px}
.rec-tools .btn,.rec-keep .btn,.rec-actions .btn{min-width:0;justify-content:center;padding-inline:12px}
.rec-tools svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round;flex:0 0 auto}
.rec-tools .btn{gap:8px}
/* on a phone half a row is too narrow for "Save to my list" on one line, so there Save and Share each take the row
   (the phone rule below); the wrap here is only a safety for a very large text setting */
.rec-keep .btn{white-space:normal;line-height:1.15;text-align:center}
.rec .rec-wide{grid-column:1/-1}
.rec .btn--white{background:var(--white,#fff);color:var(--navy,#1B2F5E)}
.rec-listen[aria-pressed="true"]{background:var(--teal,#17797B);color:var(--white,#fff)}
.rec-call{white-space:nowrap}
.rec-call-long{display:none}
.rec-keep svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round;flex:0 0 auto}
.rec-keep .btn{gap:8px}
.rec-save[aria-pressed="true"]{background:var(--navy,#1B2F5E);color:var(--cream,#FBF6E6)}
.rec-save[aria-pressed="true"] svg{fill:var(--mustard,#F2B632);stroke:var(--mustard,#F2B632)}
.rec-keep-note{grid-column:1/-1;margin:0;min-height:0;font-size:18px;font-weight:700;color:var(--teal,#17797B)}
.rec-keep-note:empty{display:none}
/* Call and Email are the foot of the card: pinned to its bottom edge while the words scroll under them, and written
   last in the record (site.js), so the way to ask is always in reach and whatever is cut off is cut at the bar, which says there is more (a bare
   card edge slicing More like this read as broken, A.J.'s iPad 2026-11-22). Every size, a desk screen too, since
   2026-11-22; until then only under 900px. */
.rec-actions{
  margin-bottom:calc(-1 * var(--tp));
  position:sticky;bottom:0;z-index:2;margin-inline:calc(-1 * var(--tp));padding:12px var(--tp) calc(12px + env(safe-area-inset-bottom));
  background:var(--cream,#FBF6E6);border-top:3px solid var(--navy,#1B2F5E);
}

/* ---------- the pieces most like this one: a picture and a name each, tap one to open it here ---------- */
/* the heading tight on its pictures (a 28px band instead of 38), so it is less often left on its own just above the
   pinned bar with no picture showing */
.rec .rec-like b{line-height:1.1;margin-bottom:6px}
.rec-like-row{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x proximity;margin:0 calc(-1 * var(--tp));padding:2px var(--tp) 8px;scrollbar-width:none}
.rec-like-row::-webkit-scrollbar{display:none}
.rec-like-tile{
  flex:0 0 124px;min-width:0;padding:0;background:none;border:0;cursor:pointer;text-align:left;scroll-snap-align:start;
  display:flex;flex-direction:column;gap:6px;color:var(--navy,#1B2F5E);font:inherit;
}
/* the picture box has its own width: iPad Safari gives a box in a button no width of its own otherwise */
.rec-like-pic{
  position:relative;display:block;width:100%;height:112px;box-sizing:border-box;flex:none;
  background:var(--white,#fff);border:2px solid var(--navy,#1B2F5E);border-radius:4px;
}
.rec-like-tile:nth-child(4n+1) .rec-like-pic{background:#FCE3A0}
.rec-like-tile:nth-child(4n+2) .rec-like-pic{background:#CFE9E6}
.rec-like-tile:nth-child(4n+3) .rec-like-pic{background:#F9D3CB}
.rec-like-pic img{position:absolute;top:8px;left:8px;width:calc(100% - 16px);height:calc(100% - 16px);max-width:none;object-fit:contain}
.rec-like-name{font-weight:600;font-size:18px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.rec-like-tile:focus-visible .rec-like-pic{outline:3px solid var(--mustard,#F2B632);outline-offset:3px}

/* the slogan rule at the foot, like the maker's line on a box */
.rec-foot{margin-top:auto;padding-top:12px;border-top:3px solid var(--red,#D5331F);font-weight:600;font-size:18px;line-height:1.4}

/* ---------- phones: a sheet from the bottom ---------- */
@media (max-width:599px){
  .rec{--pad:0px;align-items:flex-end;--gal-h:248px}
  .rec-card{
    width:100%;max-height:calc(100vh - 56px);max-height:calc(100dvh - 56px);
    border-width:4px 0 0;border-color:var(--mustard,#F2B632);border-radius:14px 14px 0 0;box-shadow:none;
  }
  .rec-top{border-radius:10px 10px 0 0}
  /* a phone swipes; the dots stay as 44px targets */
  .rec-galbtn{display:none}
  .rec-plate--long span{font-size:20px}
  .rec-keep{grid-template-columns:minmax(0,1fr)}
}

/* ---------- from 700px, either way up: the name on a navy band, the number on Call, the related pieces in a grid ---------- */
@media (min-width:700px){
  .rec{--pad:24px;--tp:24px}
  .rec-top{padding:6px 12px 6px 24px}
  .rec-head{padding:16px 16px 0}
  .rec-plate span{font-size:32px;padding:6px 14px}
  .rec-plate--long span{font-size:24px}
  .rec-band{background:var(--navy,#1B2F5E);color:var(--cream,#FBF6E6);padding:16px 24px 18px;border-top:3px solid var(--cream,#FBF6E6)}
  .rec .rec-band h2{font-size:32px;color:var(--cream,#FBF6E6)}
  .rec-rule{display:none}
  .rec-addr{color:var(--mustard,#F2B632)}
  .rec-panel{border-bottom:0}
  .rec-call-short{display:none}
  .rec-call-long{display:inline}
  .rec-like-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px;overflow:visible;margin:0;padding:0}
  .rec-like-pic{height:150px}
  @supports (aspect-ratio:1){ .rec-like-pic{height:auto;aspect-ratio:4/3} }
}
@media (min-width:1200px){ .rec{--pad:48px} }
/* the open Fold and other upright screens from 600px: a taller panel, so the photo is not a stamp in the teal */
@media (min-width:600px) and (max-width:699px){ .rec{--gal-h:320px} }
/* on its side and under 1060px the words column is too narrow for "Call (516) 446-2693" in half of it: in the pinned
   bar, Call takes three fifths and Email two. The rows above stay equal halves. */
@media (min-width:700px) and (max-width:1059px) and (orientation:landscape){
  .rec-actions{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
}

/* upright, from 700px (an iPad held upright): one column, like a phone with more room */
@media (min-width:700px) and (orientation:portrait){
  .rec-card{width:min(720px,100%)}
  .rec{--gal-h:min(44vh,460px)}
}

/* on its side, from 700px: two columns, the panel on the left stays put while the words scroll */
@media (min-width:700px) and (orientation:landscape){
  .rec{--gal-h:min(46vh,380px)}
  .rec-card{width:min(1040px,100%)}
  .rec-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}
  .rec-left{position:sticky;top:56px;align-self:start;border-right:3px solid var(--navy,#1B2F5E)}
  .rec-like-pic{height:132px}
  @supports (aspect-ratio:1){ .rec-like-pic{height:auto;aspect-ratio:1} }
}
@media (min-width:700px) and (max-width:899px) and (orientation:landscape){
  .rec .rec-band h2{font-size:28px}
}
/* tall enough: the left column is exactly as tall as the card can be (the screen less the margins, the card's border
   and the 56px top strip), or as tall as the words when they are shorter, and the teal panel fills what the name
   leaves, in every browser. The pictures sit in the middle of it at their fixed size... */
@media (min-width:700px) and (orientation:landscape) and (min-height:560px){
  .rec-left{
    align-self:stretch;
    max-height:calc(100vh - 2 * var(--pad) - 62px);max-height:calc(100dvh - 2 * var(--pad) - 62px);
  }
  .rec-panel{flex:1 1 auto;min-height:300px}
  .rec-track{flex:0 1 auto;min-height:0;margin:auto 0}
}
/* ...and a browser with container units (Safari 16, iPadOS 16, on) grows them to fill it */
@supports (container-type:size){
  @media (min-width:700px) and (orientation:landscape) and (min-height:560px){
    .rec-track{flex:1 1 0;height:auto;margin:0}
  }
}

@media (prefers-reduced-motion:no-preference){
  .rec[data-open="true"] .rec-card{animation:rec-in .18s ease-out}
  .rec[data-open="true"] .rec-scrim{animation:rec-dim .18s ease-out}
  @keyframes rec-in{from{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}
  @keyframes rec-dim{from{opacity:0}to{opacity:1}}
}

/* ---------- one piece's pictures, full screen (site.js openFull) ----------
   The picture on cream so a cut-out keeps its edges, a navy strip with the count and a big Close, arrows on the
   sides on a desk and at the foot on a phone, where a swipe does the same. */
.rec-full{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10;display:none;flex-direction:column;background:var(--cream,#FBF6E6)}
.rec-full[data-open="true"]{display:flex}
.rec-full-top{
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:6px 8px 6px 16px;padding-top:calc(6px + env(safe-area-inset-top));background:var(--navy,#1B2F5E);color:var(--cream,#FBF6E6);
}
.rec-full-pos{font-weight:700;font-size:19px;line-height:1.2}
.rec-full-track{
  flex:1;min-height:0;display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;
  overscroll-behavior:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.rec-full-track::-webkit-scrollbar{display:none}
.rec-full-track:focus-visible{outline:3px solid var(--mustard,#F2B632);outline-offset:-3px}
.rec-full-slide{
  flex:0 0 100%;min-width:0;margin:0;box-sizing:border-box;scroll-snap-align:start;scroll-snap-stop:always;
  display:flex;align-items:center;justify-content:center;padding:16px 16px calc(88px + env(safe-area-inset-bottom));
}
.rec-full-slide img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.rec-full-slide--photo img{border:3px solid var(--navy,#1B2F5E);border-radius:4px;background:var(--white,#fff)}
.rec-full-slide--cutout img,.rec-full-slide--render img{filter:drop-shadow(6px 6px 0 var(--mustard,#F2B632))}
.rec-full-btn{
  position:absolute;bottom:calc(16px + env(safe-area-inset-bottom));width:56px;height:56px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  background:var(--white,#fff);color:var(--navy,#1B2F5E);border:3px solid var(--navy,#1B2F5E);border-radius:6px;box-shadow:4px 4px 0 var(--mustard,#F2B632);
}
.rec-full-btn svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.rec-full-btn:disabled{opacity:.35;cursor:default;box-shadow:none}
.rec-full-btn:focus-visible{outline:3px solid var(--mustard,#F2B632);outline-offset:3px}
.rec-full-prev{left:16px}
.rec-full-next{right:16px}
@media (min-width:900px){
  .rec-full-slide{padding:24px 96px}
  .rec-full-btn{bottom:auto;top:50%;transform:translateY(-50%)}
  .rec-full-prev{left:24px}
  .rec-full-next{right:24px}
}
