/**
 * PLM repo explore tints — per product-type color (avatar + list accent).
 * Topics applied by apply_forgejo_repo_branding.py / plm_repo_provision.py
 */

:root {
  /* Spectral + accent hex from marketing/brand/tokens.yaml (web) */
  --lzx-tint-hardware: #EC7514;
  --lzx-tint-semver: #0F4E9C;
  --lzx-tint-pcb: #EC7514;
  --lzx-tint-panel: #F2B012;
  --lzx-tint-fabricated: #E23B1E;
  --lzx-tint-packaging: #46205E;
  --lzx-tint-firmware: #0F4E9C;
  --lzx-tint-software: #46205E;
  --lzx-tint-website: #42A251;
  --lzx-tint-virtual: #46205E;
  --lzx-tint-other: #6D6963;
}

/* Repo list — left accent by PLM product-type topic (primary visual) */
.repository.list .item:has(a.label[href*="topic/plm-pcb"]),
.repo-list .item:has(a.label[href*="topic/plm-pcb"]),
#explore-repo .item:has(a.label[href*="topic/plm-pcb"]),
#org-repo-list .item:has(a.label[href*="topic/plm-pcb"]) {
  border-left: 4px solid var(--lzx-tint-pcb);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-panel"]),
.repo-list .item:has(a.label[href*="topic/plm-panel"]),
#explore-repo .item:has(a.label[href*="topic/plm-panel"]),
#org-repo-list .item:has(a.label[href*="topic/plm-panel"]) {
  border-left: 4px solid var(--lzx-tint-panel);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-fabricated"]),
.repo-list .item:has(a.label[href*="topic/plm-fabricated"]),
#explore-repo .item:has(a.label[href*="topic/plm-fabricated"]),
#org-repo-list .item:has(a.label[href*="topic/plm-fabricated"]) {
  border-left: 4px solid var(--lzx-tint-fabricated);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-packaging"]),
.repo-list .item:has(a.label[href*="topic/plm-packaging"]),
#explore-repo .item:has(a.label[href*="topic/plm-packaging"]),
#org-repo-list .item:has(a.label[href*="topic/plm-packaging"]) {
  border-left: 4px solid var(--lzx-tint-packaging);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-firmware"]),
.repo-list .item:has(a.label[href*="topic/plm-firmware"]),
#explore-repo .item:has(a.label[href*="topic/plm-firmware"]),
#org-repo-list .item:has(a.label[href*="topic/plm-firmware"]) {
  border-left: 4px solid var(--lzx-tint-firmware);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-software"]),
.repo-list .item:has(a.label[href*="topic/plm-software"]),
#explore-repo .item:has(a.label[href*="topic/plm-software"]),
#org-repo-list .item:has(a.label[href*="topic/plm-software"]) {
  border-left: 4px solid var(--lzx-tint-software);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-website"]),
.repo-list .item:has(a.label[href*="topic/plm-website"]),
#explore-repo .item:has(a.label[href*="topic/plm-website"]),
#org-repo-list .item:has(a.label[href*="topic/plm-website"]) {
  border-left: 4px solid var(--lzx-tint-website);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-virtual"]),
.repo-list .item:has(a.label[href*="topic/plm-virtual"]),
#explore-repo .item:has(a.label[href*="topic/plm-virtual"]),
#org-repo-list .item:has(a.label[href*="topic/plm-virtual"]) {
  border-left: 4px solid var(--lzx-tint-virtual);
  padding-left: 0.75rem;
}

.repository.list .item:has(a.label[href*="topic/plm-other"]),
.repo-list .item:has(a.label[href*="topic/plm-other"]),
#explore-repo .item:has(a.label[href*="topic/plm-other"]),
#org-repo-list .item:has(a.label[href*="topic/plm-other"]) {
  border-left: 4px solid var(--lzx-tint-other);
  padding-left: 0.75rem;
}

/* Fallback: revision family when no product-type topic yet */
.repository.list .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-hardware"]),
.repo-list .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-hardware"]),
#explore-repo .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-hardware"]) {
  border-left: 4px solid var(--lzx-tint-hardware);
  padding-left: 0.75rem;
}

.repository.list .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-semver"]),
.repo-list .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-semver"]),
#explore-repo .item:not(:has(a.label[href*="topic/plm-"])):has(a.label[href*="topic/revision-semver"]) {
  border-left: 4px solid var(--lzx-tint-semver);
  padding-left: 0.75rem;
}

/* Product-type topic badges */
a.label[href*="topic/plm-pcb"] { background: var(--lzx-tint-pcb) !important; color: #0E0B08 !important; }
a.label[href*="topic/plm-panel"] { background: var(--lzx-tint-panel) !important; color: #0E0B08 !important; }
a.label[href*="topic/plm-fabricated"] { background: var(--lzx-tint-fabricated) !important; color: #EEEBE3 !important; }
a.label[href*="topic/plm-packaging"] { background: var(--lzx-tint-packaging) !important; color: #EEEBE3 !important; }
a.label[href*="topic/plm-firmware"] { background: var(--lzx-tint-firmware) !important; color: #EEEBE3 !important; }
a.label[href*="topic/plm-software"] { background: var(--lzx-tint-software) !important; color: #EEEBE3 !important; }
a.label[href*="topic/plm-website"] { background: var(--lzx-tint-website) !important; color: #0E0B08 !important; }
a.label[href*="topic/plm-virtual"] { background: var(--lzx-tint-virtual) !important; color: #EEEBE3 !important; }
a.label[href*="topic/plm-other"] { background: var(--lzx-tint-other) !important; color: #EEEBE3 !important; }

a.label[href*="topic/revision-hardware"] {
  background: var(--lzx-tint-hardware) !important;
  color: #0E0B08 !important;
  font-weight: 600;
}

a.label[href*="topic/revision-semver"] {
  background: var(--lzx-tint-semver) !important;
  color: #EEEBE3 !important;
  font-weight: 600;
}

a.label[href*="topic/toolchain-"] {
  opacity: 0.92;
  font-size: 0.85em;
  background: #6D6963 !important;
  color: #EEEBE3 !important;
}

a.label[href*="topic/part-"] {
  display: none !important;
}

/* Release tag chip — match product type when present */
.repository.list .item:has(a.label[href*="topic/plm-firmware"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-firmware"]) .lzx-release-tag,
.repository.list .item:has(a.label[href*="topic/plm-software"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-software"]) .lzx-release-tag,
.repository.list .item:has(a.label[href*="topic/plm-website"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-website"]) .lzx-release-tag,
.repository.list .item:has(a.label[href*="topic/plm-virtual"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-virtual"]) .lzx-release-tag {
  background: var(--lzx-tint-firmware);
  color: #EEEBE3;
}

.repository.list .item:has(a.label[href*="topic/plm-panel"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-panel"]) .lzx-release-tag {
  background: var(--lzx-tint-panel);
  color: #0E0B08;
}

.repository.list .item:has(a.label[href*="topic/plm-fabricated"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-fabricated"]) .lzx-release-tag {
  background: var(--lzx-tint-fabricated);
  color: #EEEBE3;
}

.repository.list .item:has(a.label[href*="topic/plm-packaging"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-packaging"]) .lzx-release-tag {
  background: var(--lzx-tint-packaging);
  color: #EEEBE3;
}

.repository.list .item:has(a.label[href*="topic/plm-pcb"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/plm-pcb"]) .lzx-release-tag,
.repository.list .item:has(a.label[href*="topic/revision-hardware"]) .lzx-release-tag,
.repo-list .item:has(a.label[href*="topic/revision-hardware"]) .lzx-release-tag {
  background: var(--lzx-tint-pcb);
  color: #0E0B08;
}

.lzx-repo-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.lzx-part-no {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: inherit;
  background: rgba(127, 127, 127, 0.15);
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  border: 1px solid rgba(127, 127, 127, 0.35);
}

.repository.list .item:has(a.label[href*="topic/plm-pcb"]) .lzx-part-no,
.repo-list .item:has(a.label[href*="topic/plm-pcb"]) .lzx-part-no {
  border-color: var(--lzx-tint-pcb);
  color: var(--lzx-tint-pcb);
}

.repository.list .item:has(a.label[href*="topic/plm-panel"]) .lzx-part-no,
.repo-list .item:has(a.label[href*="topic/plm-panel"]) .lzx-part-no {
  border-color: var(--lzx-tint-panel);
  color: #F2B012;
}

.repository.list .item:has(a.label[href*="topic/plm-firmware"]) .lzx-part-no,
.repo-list .item:has(a.label[href*="topic/plm-firmware"]) .lzx-part-no {
  border-color: var(--lzx-tint-firmware);
  color: var(--lzx-tint-firmware);
}

.lzx-release-tag {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #EEEBE3;
  background: var(--lzx-tint-semver);
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
}

.repository.list .item.lzx-plm-repo-row .content,
.repo-list .item.lzx-plm-repo-row .content {
  position: relative;
}

.repository.list .item .description,
.repo-list .item .description {
  margin-bottom: 0.15rem;
}
