/* Library cards (js/library-cards.js). Same card language as the Design
   project drawer: bordered tiles on the raised panel colour, image first. */
.wfc {
  --wfc-bg: var(--panel, var(--pan, #1a2029));
  --wfc-raise: var(--field, var(--pan2, #222b36));
  --wfc-line: var(--line, #344053);
  --wfc-text: var(--text, var(--tx, #edf1f5));
  --wfc-muted: var(--muted, #a8b4c3);
  --wfc-accent: var(--accent, var(--acc, #ff9d59));
  --wfc-focus: var(--focus, var(--blue, #72b9f6));
  color: var(--wfc-text);
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(12px, 3vw, 28px) 32px;
}
.wfc :focus-visible { outline: 2px solid var(--wfc-focus); outline-offset: 2px; }
.wfc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 16px; }
.wfc-head h2 { margin: 0 auto 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.wfc-head input[type=search] { flex: 0 1 240px; min-width: 120px; height: 32px; padding: 0 10px; border: 1px solid var(--wfc-line); border-radius: 7px; background: var(--wfc-raise); color: var(--wfc-text); font: inherit; }
.wfc-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--wfc-muted); font-size: 13px; }
.wfc-sort select { height: 32px; padding: 0 8px; border: 1px solid var(--wfc-line); border-radius: 7px; background: var(--wfc-raise); color: var(--wfc-text); font: inherit; }
.wfc-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--wfc-line); border-radius: 7px; background: var(--wfc-raise); color: var(--wfc-text); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.wfc-btn:hover { text-decoration: none; border-color: color-mix(in srgb, var(--wfc-line), var(--wfc-text) 35%); }
.wfc-primary { background: var(--wfc-accent); border-color: transparent; color: var(--accent-ink, #24140a); font-weight: 650; }
.wfc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 212px), 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.wfc-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; min-width: 0; border: 1px solid var(--wfc-line); border-radius: 10px; background: var(--wfc-raise); overflow: visible; }
.wfc-card:hover { border-color: color-mix(in srgb, var(--wfc-line), var(--wfc-text) 30%); }
.wfc-open { grid-column: 1 / -1; display: block; width: 100%; padding: 6px 6px 0; border: 0; border-radius: 10px 10px 0 0; background: none; cursor: pointer; box-shadow: none; }
.wfc-thumb { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 7px; background: radial-gradient(ellipse at 47% 38%, var(--view-in, #505d70), var(--view-out, #1c2532) 80%); }
.wfc-thumb.wfc-placeholder { object-fit: contain; }
.wfc-text { display: grid; gap: 1px; min-width: 0; padding: 8px 4px 10px 10px; }
.wfc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfc-text small { color: var(--wfc-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfc-more { align-self: center; width: 30px; height: 30px; margin-right: 6px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--wfc-muted); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: none; }
.wfc-more:hover { background: color-mix(in srgb, var(--wfc-raise), var(--wfc-text) 10%); color: var(--wfc-text); }
.wfc-menu { position: absolute; right: 6px; bottom: 40px; z-index: 5; display: grid; min-width: 170px; padding: 4px; border: 1px solid var(--wfc-line); border-radius: 8px; background: var(--wfc-bg); box-shadow: 0 10px 28px -8px #0009; }
.wfc-menu button { padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--wfc-text); font: inherit; font-size: 13px; text-align: start; cursor: pointer; box-shadow: none; }
.wfc-menu button:hover, .wfc-menu button:focus-visible { background: color-mix(in srgb, var(--wfc-bg), var(--wfc-text) 9%); outline: none; }
.wfc-menu .wfc-danger { color: var(--danger, #ff6b6b); }
.wfc-status:empty { display: none; }
.wfc-status { display: grid; justify-items: center; gap: 10px; color: var(--wfc-muted); text-align: center; }
.wfc-status p { margin: 0; }
.wfc-error { color: var(--danger, #ff8080); }
.wfc-empty { display: grid; justify-items: center; gap: 6px; max-width: 420px; padding: 40px 12px; }
.wfc-empty h3 { margin: 6px 0 0; color: var(--wfc-text); font-size: 16px; }
.wfc-empty p { line-height: 1.5; }
.wfc-empty-art { width: 128px; aspect-ratio: 8 / 5; border: 1.5px dashed var(--wfc-line); border-radius: 9px; background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--wfc-raise), var(--wfc-text) 14%) 0 18%, transparent 19%); }
.wfc-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 212px), 1fr)); gap: 12px; width: 100%; }
.wfc-skeleton span { aspect-ratio: 8 / 6.4; border-radius: 10px; background: var(--wfc-raise); animation: wfc-pulse 1.2s ease-in-out infinite alternate; }
@keyframes wfc-pulse { to { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .wfc-skeleton span { animation: none; } }
.wfc-views { display: inline-flex; padding: 2px; border: 1px solid var(--wfc-line); border-radius: 8px; }
.wfc-view { padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--wfc-muted); font: inherit; font-size: 13px; cursor: pointer; box-shadow: none; }
.wfc-view[aria-pressed="true"] { background: color-mix(in srgb, var(--wfc-raise), var(--wfc-accent) 18%); color: var(--wfc-text); font-weight: 600; }
.wfc-trashed .wfc-thumb { filter: grayscale(.8); opacity: .7; }
.wfc-trashed .wfc-open { cursor: default; }
