/* The landing catalogue as shelves, one per hobby (assets/shelf-core.js, assets/catalog-shelves.js).
   Loaded by index.html only, after toolpath.css and palette.css, so every colour here is a KILN token.
   Measured text pairs (WCAG, on the grounds they actually land on):
     --tx on the paper chip over a black photograph (94% paper)        13.7:1
     --tx on the paper chip over a white photograph                   15.7:1
     --tx on the heart's pill over a black photograph (92% paper)      13.1:1
     --steel-text on --card (shelf numbers)                             7.6:1
     --steel-text on --powder (chip counts)                             6.9:1
     --tx on the current chip (45% butter into --card)                 13.7:1
     --on-accent on --gold (the tape, the same pair as .tape)            5.1:1
   Every control is at least 44px. Logical properties only: inline-start is the right in Hebrew. */

.shelves { margin-top: 8px; }
.shelves[aria-busy="true"] .sh-head .skel { height: 26px; width: min(260px, 60%); }
.shelf { margin-top: 44px; scroll-margin-block-start: calc(var(--jump-h, 60px) + 10px); }
.shelves > .shelf:first-child { margin-top: 12px; }

/* ---- the sticky row of hobbies: it sticks inside #catalog only, so it leaves with the catalogue ---- */
.sh-jump { --jump-h: 60px; position: sticky; inset-block-start: var(--bar-h, 56px); z-index: 30;
  margin: 22px calc(-1 * var(--wrap-x)) 0; padding: 8px var(--wrap-x);
  background: rgba(var(--powder-rgb), .94); border-block-end: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); }
.sh-jump[hidden] { display: none; }
.sh-jump-in { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.sh-jump-in::-webkit-scrollbar { display: none; }
.sh-chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  padding-block: 0; padding-inline: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--tx); font-size: 0.9375rem; font-weight: 500; white-space: nowrap; text-decoration: none !important;
  transition: border-color .18s, background .18s, transform .18s var(--ease); }
.sh-chip .mat-ic { width: 22px; height: 22px; }
.sh-chip .c { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--steel-text);
  background: var(--powder); border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center; }
.sh-chip:hover { border-color: rgba(var(--accent-rgb), .45); }
.sh-chip:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.sh-chip[aria-current="true"] { border-color: var(--accent-deep); background: color-mix(in srgb, var(--pop-butter) 45%, var(--card)); }
.sh-chip[aria-current="true"] .c { background: var(--card); }
.sh-chip[aria-busy="true"] { cursor: progress; }
@media (max-height: 450px) { .sh-jump { position: static; } }

/* ---- a shelf heading: the craft on a pop wash, the name, the numbers, and the line that draws it ---- */
.sh-head { position: relative; display: flex; align-items: center; gap: 14px; padding-block-end: 14px; margin-block-end: 16px; }
.sh-titles { min-width: 0; }
.sh-head h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.375rem, 1.05rem + 1.3vw, 1.875rem); line-height: 1.15; color: var(--tx); }
.sh-head h3:focus { outline: none; }
.sh-head h3:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 4px; border-radius: 6px; }
.shelf-top .sh-head h3 { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.375rem); }
.sh-meta { margin: 4px 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--steel-text); }
/* The wash decorates and never signals: it follows the shelf's place on the page, not its craft, so
   nobody can read it as a legend (the same rule the old craft row had). */
.sh-ic, .sh-art { --wash: var(--pop-butter); flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--wash) 50%, var(--card)); }
.sh-ic { width: 48px; height: 48px; border-radius: 14px; }
.sh-ic svg { width: 30px; height: 30px; }
.sh-art { width: 76px; height: 76px; border-radius: 18px; padding: 4px; }
.sh-art img { width: auto; height: 100%; object-fit: contain; }
@media (min-width: 760px) { .sh-art { width: 96px; height: 96px; } }
.sh-rest > .shelf:nth-child(5n+1) .sh-ic { --wash: var(--pop-pink); }
.sh-rest > .shelf:nth-child(5n+2) .sh-ic { --wash: var(--pop-mint); }
.sh-rest > .shelf:nth-child(5n+3) .sh-ic { --wash: var(--pop-lilac); }
.sh-rest > .shelf:nth-child(5n+4) .sh-ic { --wash: var(--pop-apricot); }
/* The extrusion line: a bead of the craft's own colour that draws itself under the heading, with the
   nozzle riding its end, the day the shelf scrolls into view. */
.sh-line { position: absolute; inset-inline-start: 0; inset-block-end: 0; height: 3px; width: 0; border-radius: 2px;
  background: var(--hue, var(--accent)); transition: width 1s var(--ease) .15s; }
.sh-line::after { content: ""; position: absolute; inset-inline-end: -4px; inset-block-start: -3px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent-deep); box-shadow: 0 0 0 3px var(--powder); }
.sh-head.in .sh-line { width: min(200px, 46%); }

/* ---- the masonry grid: a tenth of a column per row, so a tile spans its own proportions ---- */
.sh-mason { --cols: 2; --gap: 10px; position: relative; container-type: inline-size; }
@media (min-width: 640px) { .sh-mason { --cols: 3; --gap: 14px; } }
@media (min-width: 1000px) { .sh-mason { --cols: 4; } }
.sh-mason[data-view="grid"] .sh-list { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap); row-gap: 0; grid-auto-rows: 17px; grid-auto-flow: row dense; }
@supports (width: 1cqi) {
  .sh-mason[data-view="grid"] .sh-list { grid-auto-rows: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) / 10); }
}
.sh-mason[data-view="grid"] .sh-tile { grid-row: span var(--s, 10); margin-block-end: var(--gap); }
.sh-mason[data-view="grid"] .sh-tile.feat { grid-column: span 2; grid-row: span var(--s2, 21); }

/* ---- a rail: sideways, snapping, arrows only where there is a pointer to use them ---- */
.sh-mason[data-view="rail"] .sh-list { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding-block: 4px 10px; }
.sh-mason[data-view="rail"] .sh-list::-webkit-scrollbar { display: none; }
.sh-mason[data-view="rail"] .sh-tile { flex: none; width: clamp(148px, 40vw, 212px); aspect-ratio: 4 / 5; scroll-snap-align: start; }
.sh-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .sh-mason[data-view="rail"] .sh-arrow { display: grid; place-items: center; position: absolute; z-index: 3;
    inset-block-start: calc(50% - 27px); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--card); color: var(--tx); box-shadow: var(--shadow-card); cursor: pointer; transition: opacity .2s, transform .2s var(--ease); }
  .sh-mason[data-view="rail"] .sh-arrow:hover { transform: scale(1.06); }
  .sh-mason[data-view="rail"] .sh-arrow:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
  .sh-mason[data-view="rail"] .sh-arrow:disabled { opacity: 0; pointer-events: none; }
  .sh-arrow.prev { inset-inline-start: -16px; }
  .sh-arrow.next { inset-inline-end: -16px; }
  .sh-arrow svg { width: 20px; height: 20px; }
}
/* the chevron points left, which is forward in Hebrew; the way back is its mirror */
.sh-arrow.prev svg { transform: scaleX(-1); }
html[dir="ltr"] .sh-arrow.prev svg { transform: none; }
html[dir="ltr"] .sh-arrow.next svg { transform: scaleX(-1); }

/* ---- a tile. The grid places the outer box; the inner card moves, so a hover never waits on the
   staggered entrance delay fx.js writes onto the outer one. ---- */
.sh-tile { position: relative; min-width: 0; }
.sh-tile.reveal { transform: translateY(16px) scale(.985); transition: opacity .55s var(--ease), transform .6s var(--ease); }
.sh-tile.reveal.in { transform: none; }
.sh-card { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; background: var(--tone, var(--glass));
  box-shadow: 0 1px 0 rgba(var(--graphite-rgb), .06), var(--shadow-card);
  transition: transform .22s var(--ease), box-shadow .25s var(--ease); }
.sh-tile:hover .sh-card { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(var(--graphite-rgb), .06), 0 22px 40px -22px rgba(var(--graphite-rgb), .55); }
.sh-tile:active .sh-card { transform: translateY(-1px) scale(.985); }
.sh-open { position: absolute; inset: 0; display: block; color: inherit; text-decoration: none !important; }
.sh-open:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: -3px; border-radius: 16px; }
.sh-open img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.sh-tile:hover .sh-open img { transform: scale(1.04); }
.sh-open img.fit { object-fit: contain; padding: 14%; }
/* the maker, on a paper chip: legible over any photograph because the ground is the chip, not the photo */
.sh-by { position: absolute; inset-inline-start: 8px; inset-block-end: 8px; max-width: calc(100% - 16px);
  display: inline-flex; align-items: center; gap: 6px; padding-block: 3px; padding-inline: 3px 10px; border-radius: 999px;
  background: rgba(var(--paper-rgb), .94); color: var(--tx); box-shadow: 0 6px 16px -10px rgba(var(--graphite-rgb), .7); }
.sh-by .avatar { width: 24px; height: 24px; border-radius: 50%; box-shadow: none; }
.sh-by .n { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sh-by .vf { display: inline-flex; flex: none; color: var(--ok-deep); }
.sh-by .vf svg { width: 14px; height: 14px; }
.sh-tape { position: absolute; z-index: 2; inset-block-start: 8px; inset-inline-start: 8px; font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 600; letter-spacing: .08em; padding: 3px 10px; border-radius: 999px;
  background: var(--gold); color: var(--on-accent); }
.sh-tile.is-demo .sh-card { outline: 1.5px dashed rgba(var(--accent-rgb), .55); outline-offset: -1.5px; }
/* the heart: a 44px target around a smaller paper pill */
.sh-like { position: absolute; z-index: 2; inset-block-start: 2px; inset-inline-end: 2px; min-width: 44px; min-height: 44px;
  padding: 6px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-soft); font: inherit; }
.sh-like .pill { display: inline-flex; align-items: center; gap: 4px; min-width: 32px; height: 32px; padding-inline: 8px;
  justify-content: center; border-radius: 999px; background: rgba(var(--paper-rgb), .92);
  box-shadow: 0 6px 16px -10px rgba(var(--graphite-rgb), .7); font-size: 0.8125rem; font-weight: 600; color: var(--tx);
  font-variant-numeric: tabular-nums; transition: transform .15s var(--ease); }
.sh-like svg { width: 17px; height: 17px; }
.sh-like .n:empty { display: none; }
.sh-like[aria-pressed="true"] svg { fill: var(--accent-deep); color: var(--accent-deep); }
.sh-like:focus-visible { outline: none; }
.sh-like:focus-visible .pill { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
/* A mouse finds an empty heart on hover; a count, a pressed heart, a keyboard and a finger see it always. */
@media (hover: hover) and (pointer: fine) {
  .sh-like:not(.has-n):not([aria-pressed="true"]) .pill { opacity: 0; transition: opacity .18s; }
  .sh-tile:hover .sh-like .pill, .sh-like:focus-visible .pill { opacity: 1; }
}

/* ---- skeletons hold the exact rows the real tiles will take ---- */
.sh-skel .skel { position: absolute; inset: 0; border-radius: 16px; min-height: 0; }
.sh-mason[data-view="rail"] .sh-skel { flex: none; width: clamp(148px, 40vw, 212px); aspect-ratio: 4 / 5; }

/* ---- the foot of a shelf, and the purge line while the next page is on its way ---- */
.sh-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.sh-sentinel { display: block; width: 1px; height: 1px; }
.sh-foot .btn { min-height: 44px; }
.sh-more-btn { position: relative; min-width: 220px; }
.sh-more-btn[aria-busy="true"] { cursor: progress; }
.sh-more-btn[aria-busy="true"]::after { content: ""; position: absolute; inset-inline-start: 18px; inset-block-end: 7px;
  height: 2px; width: 0; border-radius: 1px; background: var(--accent-deep); animation: sh-purge 1.1s var(--ease) infinite; }
@keyframes sh-purge { 0% { width: 0; opacity: 1; } 70% { width: calc(100% - 36px); opacity: 1; } 100% { width: calc(100% - 36px); opacity: 0; } }
.sh-status { margin: 0; min-height: 1.3em; font-size: 0.875rem; color: var(--steel-text); }
.sh-notice { margin-bottom: 14px; }
.sh-empty { padding: 26px 0; }

/* ---- ועוד מלאכות: one card per hobby still too young for a rail ---- */
.sh-minis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sh-mini { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-card);
  scroll-margin-block-start: calc(var(--jump-h, 60px) + 10px); border-block-start: 3px solid var(--hue, var(--line)); }
.sh-mini-h { display: flex; align-items: center; gap: 10px; }
.sh-mini-h h4 { margin: 0; font-size: 1.0625rem; font-weight: 600; color: var(--tx); }
.sh-mini-h h4:focus { outline: none; }
.sh-mini-h .sh-meta { margin-top: 2px; }
.sh-mini .sh-ic { width: 40px; height: 40px; border-radius: 12px; }
.sh-mini .sh-ic svg { width: 26px; height: 26px; }
.sh-mini-works { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sh-mini-works .sh-tile { aspect-ratio: 1; }
.sh-nophoto { margin: 12px 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.sh-makers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sh-makers a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-block: 4px; padding-inline: 4px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--powder); color: var(--tx); font-size: 0.875rem;
  font-weight: 500; text-decoration: none !important; transition: border-color .18s; }
.sh-makers a:hover { border-color: rgba(var(--accent-rgb), .45); }
.sh-makers a:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.sh-makers .avatar { width: 32px; height: 32px; border-radius: 50%; box-shadow: none; }
.sh-mini-body { padding: 4px 0 8px; }

/* ---- motion off: nothing moves, the tiles only fade in, the line is simply there ---- */
@media (prefers-reduced-motion: reduce) {
  .sh-tile.reveal, .sh-tile.reveal.in { transform: none; transition: none; opacity: 1; }
  .sh-tile.reveal.in { animation: sh-fade .45s ease-out both; }
  .sh-card, .sh-open img, .sh-chip, .sh-like .pill { transition: none; }
  .sh-tile:hover .sh-card, .sh-tile:active .sh-card, .sh-tile:hover .sh-open img { transform: none; }
  .sh-line { transition: none; }
  .sh-more-btn[aria-busy="true"]::after { animation: none; width: calc(100% - 36px); opacity: .6; }
  .shelves .skel { animation: none; }
}
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
