/* GraphChinese — 分享 Shareables catalog (assets/shareables.js).
   Built from the shared tokens in styles.css, so it inherits dark mode instead
   of declaring its own. The thumbnails are canvases drawn by card-studio.js and
   already carry their own paper — this file only frames them.
   Mobile first: one column on a phone, and every tap target clears 44px. */

.sh-root { display: block; }
.sh-loading, .sh-empty { color: var(--ink-whisper); padding: 26px 2px; }

/* ── filters ─────────────────────────────────────────────────────────────── */
.sh-filters { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.sh-chiprow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sh-chiplab {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-whisper); flex: 0 0 auto; min-width: 42px;
}
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-chip {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px;
  padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap;
  background: var(--paper-raised); color: var(--ink-faded);
  border: 1px solid var(--hairline); border-radius: 999px;
}
.sh-chip:hover { color: var(--ink); border-color: var(--ink-whisper); }
.sh-chip.on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.sh-n { font-style: normal; font-size: 11.5px; opacity: 0.7; }

.sh-searchrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-srch { flex: 1 1 220px; display: block; }
.sh-q {
  width: 100%; font: inherit; font-size: 14.5px; padding: 10px 14px; min-height: 44px;
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--hairline); border-radius: 999px;
}
.sh-q:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sh-count { font-size: 13px; color: var(--ink-whisper); flex: 0 0 auto; }
.sh-blurb { font-size: 14.5px; line-height: 1.6; color: var(--ink-faded); max-width: 62ch; margin: 0 0 18px; }

/* ── the grid ────────────────────────────────────────────────────────────── */
.sh-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.sh-card {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  font: inherit; color: inherit; text-decoration: none; cursor: pointer;
  padding: 10px; background: var(--paper-raised);
  border: 1px solid var(--hairline); border-radius: 14px;
}
.sh-card:hover { border-color: var(--ink-whisper); }
.sh-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sh-thumb {
  display: block; position: relative; border-radius: 9px; overflow: hidden;
  background: var(--paper-sunken); aspect-ratio: 4 / 5;
}
.sh-thumb-canvas { display: block; width: 100%; height: auto; }
.sh-thumb-wait {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, var(--paper-sunken), var(--paper-raised), var(--paper-sunken));
  background-size: 300% 100%; animation: sh-shim 1.5s ease-in-out infinite;
}
@keyframes sh-shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sh-thumb-wait { animation: none; } }
.sh-thumb-fail {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding: 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-whisper);
}

.sh-meta { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px; }
.sh-fam {
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.sh-title { font-family: var(--serif-display); font-size: 16.5px; line-height: 1.3; color: var(--ink); }
.sh-teach { font-size: 13px; line-height: 1.5; color: var(--ink-faded); }

/* ── one card, on its own page ───────────────────────────────────────────── */
.sh-one { display: grid; gap: 28px; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
.sh-one .sh-thumb { cursor: pointer; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.sh-table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 15px; }
.sh-table th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-whisper); font-weight: 600; padding: 0 12px 6px 0;
}
.sh-table td { padding: 8px 12px 8px 0; border-top: 1px solid var(--hairline); vertical-align: baseline; }
.sh-table .sh-hz { font-family: var(--han); font-size: 20px; }
.sh-table .sh-py { color: var(--gold); font-style: italic; white-space: nowrap; }
.sh-table .sh-en { color: var(--ink-faded); font-size: 14px; }
.sh-line { margin: 0 0 14px; }
.sh-line .sh-py { display: block; color: var(--gold); font-style: italic; font-size: 13.5px; }
.sh-line .sh-hz { display: block; font-family: var(--han); font-size: 22px; line-height: 1.5; }
.sh-line .sh-en { display: block; color: var(--ink-faded); font-size: 14px; }
.sh-note { font-size: 15px; line-height: 1.7; color: var(--ink-faded); border-left: 3px solid var(--accent); padding-left: 14px; margin: 0 0 18px; max-width: 62ch; }

@media (max-width: 700px) {
  .sh-one { grid-template-columns: 1fr; gap: 20px; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .sh-title { font-size: 15px; }
  .sh-chiplab { min-width: 0; }
}
