/* styles/browse.css — browse by company. Order in VulnerabilityCore.html is the cascade order. */

/* ============================================================ browse */
.ent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  /* 18px, not 14px. The grid gap used to equal .entcard's own internal gap, so the
     space between two cards read exactly like the space between a card's stats row
     and its severity bar — nothing grouped, and the grid read as one undifferentiated
     field. 18px is the house value already used by .detail-grid and .plat-grid, and
     it changes no column count: 4x280 + 3x18 = 1174 still fits the 1268px content
     box, and 5 columns needed 1472 before and after. */
  gap: 18px;
}
.entcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  padding: 18px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  /* Named properties, not the `all` shorthand: with `transition: 0.15s` the focus
     ring below would fade in over 150ms while tabbing, which reads as lag. */
  transition: transform 0.15s, box-shadow 0.15s;
}
.entcard:hover {
  transform: translateY(-2px);
  /* The edge this used to ask for via `border-color` never painted — .entcard sets
     `border: none`, so there was no border to colour. Drawn as a ring instead. */
  box-shadow: var(--shadow), 0 0 0 1px var(--line-2);
}
/* .entcard is a <button> on both Components and Browse and no :focus-visible rule
   ever matched it, so keyboard focus fell through to the UA ring — which this
   file's own comment elsewhere calls a coin-flip on a filled indigo button. */
.entcard:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .entcard {
    transition: box-shadow 0.15s;
  }
  .entcard:hover {
    transform: none;
  }
}
.entcard.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.entcard-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.entcard-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--font-display);
  background: var(--accent-soft);
  color: #fff;
}
.entcard-avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 15px;
}
/* Light mode: the avatar icon is white, but --accent-soft is nearly white here,
   so the icon vanishes. Recolor just the icon to the accent (purple). */
.app[data-theme="light"] .entcard-avatar {
  color: var(--accent);
}
.entcard-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.entcard-name {
  font: 600 15px/1.1 var(--font);
  color: var(--text);
}
.entcard-meta {
  font: 11.5px/1.2 var(--font);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entcard-arrow {
  color: var(--text-faint);
}
/* --text, not --focus and certainly not raw --accent. On dark the chevron rests at
   7.18:1 and hover took it to 1.73:1 — hover was deleting the card's only
   affordance. Even --accent-3 (5.65:1) would still dim what hover means to raise. */
.entcard:hover .entcard-arrow,
.entcard:focus-visible .entcard-arrow {
  color: var(--text);
}
.entcard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.entcard-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.entcard-stat b {
  font: 700 19px/1 var(--font-display);
  color: var(--text);
}
.entcard-stat b.is-warn {
  color: var(--sev-high);
}
.entcard-stat span {
  font: 11px/1 var(--font);
  color: var(--text-faint);
}
.entcard-bar {
  display: flex;
  gap: 2px;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  /* A recessed track. The severity hues are a fixed product palette and are not
     touched here; what changes is the colour behind them. Because gap:2px means
     each segment's neighbouring colour is this track, moving it from --surface to
     --bg lifts dark Critical from 2.72:1 to 3.03:1 and dark Medium from 2.83:1 to
     3.16:1 with no re-hue. --bg forks by theme, so light gets a quiet groove. */
  background: var(--bg);
}
.entcard-seg {
  display: block;
  /* style={{flex:n}} is grow:n with basis:0 and no floor, so 1 Critical alongside
     499 others resolved to roughly half a pixel and rounded away — the single worst
     finding on the card could render as nothing. Deliberately not to scale at the
     extremes: "present" matters more than "proportional", and the legend below
     carries the exact numbers. */
  min-width: 5px;
}
.entcard-seg.sev-critical {
  background: var(--sev-critical);
}
.entcard-seg.sev-high {
  background: var(--sev-high);
}
.entcard-seg.sev-medium {
  background: var(--sev-medium);
}
.entcard-seg.sev-low {
  background: var(--sev-low);
}
.entcard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.entcard-leg {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 11px/1 var(--font);
  color: var(--text-dim);
}
.entcard-leg .chip-dot.sev-critical {
  background: var(--sev-critical);
}
.entcard-leg .chip-dot.sev-high {
  background: var(--sev-high);
}
.entcard-leg .chip-dot.sev-medium {
  background: var(--sev-medium);
}
.entcard-leg .chip-dot.sev-low {
  background: var(--sev-low);
}
.ent-detail {
  padding: 0;
  overflow: hidden;
}
.ent-detail .card-head-row {
  padding: 18px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.ent-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ent-detail-head h3 {
  margin: 0 0 3px;
}
.ent-list {
  display: flex;
  flex-direction: column;
}
.ent-row {
  display: grid;
  grid-template-columns: 104px 132px 1fr 168px auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border: none;
  border-top: 1px solid var(--line);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: 0.1s;
}
.ent-row:first-child {
  border-top: none;
}
.ent-row:hover {
  background: var(--surface-2);
}
.ent-row-id {
  font: 600 12.5px/1 var(--font-mono);
  color: var(--text);
}
.ent-row-desc {
  font: 13px/1.4 var(--font);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ent-row-comp {
  font: 12px/1.2 var(--font);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ent-row-chev {
  color: var(--text-faint);
}
