/* DatasheetHub Pro — category & manufacturer cards (homepage, /manufacturers, manufacturer pages).
   Uses the theme's tokens from datasheethub.css; no colours of its own beyond them. */

.dsh-homecards { display: grid; gap: 36px; }
.dsh-homecards__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dsh-homecards__title { margin: 0; font-size: clamp(19px, 2.2vw, 23px); font-weight: var(--dsh-h-weight, 700); color: var(--dsh-ink); }
.dsh-homecards__sub { margin: 4px 0 0; font-size: 13.5px; color: var(--dsh-muted); }
.dsh-homecards__more { font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.dsh-homecards__more svg { width: 14px; height: 14px; }

/* ── Category cards ──────────────────────────────────────────── */
.dsh-catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dsh-catcard { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 18px 18px 18px 16px; background: var(--dsh-surface);
  border: 1px solid var(--dsh-line); border-radius: calc(var(--dsh-radius) + 4px); overflow: hidden; isolation: isolate;
  transition: border-color .18s, box-shadow .18s, transform .18s; }
/* a faint circuit-trace corner, drawn with gradients only */
.dsh-catcard::before { content: ''; position: absolute; z-index: -1; right: -18px; top: -18px; width: 96px; height: 96px; border-radius: 50%; opacity: .55;
  background: radial-gradient(circle at center, transparent 0 34px, color-mix(in srgb, var(--dsh-accent) 10%, transparent) 34px 35px, transparent 35px 46px, color-mix(in srgb, var(--dsh-accent) 7%, transparent) 46px 47px, transparent 47px); }
.dsh-catcard:hover { border-color: color-mix(in srgb, var(--dsh-accent) 45%, var(--dsh-line)); box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .4); transform: translateY(-2px); }
.dsh-catcard__ico { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 15px; color: var(--dsh-accent);
  background: linear-gradient(145deg, var(--dsh-tint), color-mix(in srgb, var(--dsh-tint) 55%, var(--dsh-accent) 12%));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dsh-accent) 14%, transparent), 0 6px 14px -10px color-mix(in srgb, var(--dsh-accent) 60%, transparent);
  transition: background .18s, color .18s, transform .18s; }
.dsh-catcard__ico svg { width: 29px; height: 29px; }
.dsh-catcard__ico--img { background: #fff; }
.dsh-catcard__ico img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.dsh-catcard:hover .dsh-catcard__ico:not(.dsh-catcard__ico--img) { background: var(--dsh-accent); color: #fff; transform: rotate(-4deg); }
.dsh-catcard__body { min-width: 0; flex: 1; padding-top: 2px; }
.dsh-catcard__name { margin: 0; font-size: 15.5px; font-weight: 650; line-height: 1.3; color: var(--dsh-ink); }
.dsh-catcard__name a { color: inherit; text-decoration: none; }
.dsh-catcard__name a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }   /* whole card clickable */
.dsh-catcard:hover .dsh-catcard__name { color: var(--dsh-accent); }
.dsh-catcard__count { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--dsh-muted); background: var(--dsh-line-2); }
.dsh-catcard__desc { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--dsh-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsh-catcard__go { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: var(--dsh-accent); background: var(--dsh-tint); opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s; }
.dsh-catcard__go svg { width: 14px; height: 14px; }
.dsh-catcard:hover .dsh-catcard__go, .dsh-catcard:focus-within .dsh-catcard__go { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .dsh-catcard, .dsh-catcard__ico, .dsh-catcard__go { transition: none; } .dsh-catcard:hover { transform: none; } .dsh-catcard:hover .dsh-catcard__ico { transform: none; } }

/* ── Manufacturer cards ──────────────────────────────────────── */
.dsh-mfrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.dsh-mfrcard { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 14px 16px;
  background: var(--dsh-surface); border: 1px solid var(--dsh-line); border-radius: calc(var(--dsh-radius) + 4px); color: var(--dsh-ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.dsh-mfrcard:hover { text-decoration: none; border-color: color-mix(in srgb, var(--dsh-accent) 45%, var(--dsh-line)); box-shadow: 0 10px 24px -16px rgba(15, 23, 42, .35); transform: translateY(-1px); }
.dsh-mfrcard__logo { display: grid; place-items: center; width: 100%; height: 64px; }
.dsh-mfrcard__logo img { max-width: 140px; max-height: 56px; width: auto; height: auto; object-fit: contain; }
.dsh-mfrcard__mono { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; font-weight: 700; font-size: 18px; letter-spacing: .02em;
  color: var(--dsh-accent); background: linear-gradient(135deg, var(--dsh-tint), var(--dsh-tint-2)); }
.dsh-mfrcard__name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.dsh-mfrcard__count { font-size: 12px; color: var(--dsh-muted); margin-top: -6px; }
.dsh-mfrcard:hover .dsh-mfrcard__name { color: var(--dsh-accent); }

/* Directory page: an A–Z jump bar above the cards */
.dsh-az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; }
.dsh-az a, .dsh-az span { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--dsh-line); background: #fff; color: var(--dsh-body); text-decoration: none; }
.dsh-az a:hover { border-color: var(--dsh-accent); color: var(--dsh-accent); }
.dsh-az span { color: var(--dsh-faint); background: var(--dsh-line-2); border-color: transparent; }
.dsh-azgroup { scroll-margin-top: 90px; }
.dsh-azgroup + .dsh-azgroup { margin-top: 26px; }
.dsh-azgroup__letter { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--dsh-muted); }

/* Manufacturer page header: logo beside name */
.dsh-mfrhead { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; padding: 16px; background: var(--dsh-surface); border: 1px solid var(--dsh-line);
  border-radius: calc(var(--dsh-radius) + 4px); }
.dsh-mfrhead__logo { display: grid; place-items: center; width: 120px; height: 64px; flex: none; }
.dsh-mfrhead__logo img { max-width: 120px; max-height: 60px; object-fit: contain; }
.dsh-mfrhead__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--dsh-muted); }
.dsh-mfrhead__facts a { font-weight: 600; }
.dsh-mfrhead__facts span { display: inline-flex; align-items: center; gap: 6px; }
.dsh-mfrhead__facts svg { width: 15px; height: 15px; }

@media (max-width: 560px) {
  .dsh-catgrid { grid-template-columns: 1fr; }
  .dsh-mfrgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dsh-mfrhead { flex-direction: column; align-items: flex-start; }
}
