/* =============================================================
   ranking.css
   "Where to act first": the list of microzones ranked by score.
   ============================================================= */

/* The ranking card fills the rest of the sidebar height. */
.ranking {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 0 auto;
}

.ranking .section-title {
  color: var(--display-02);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* One row: microzone name on the left, score + bar on the right. */
.zone-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 4px 8px;
  border-radius: var(--radius-row);
  text-align: left;
}

.zone-row:hover,
.zone-row[aria-current="true"] {
  background: var(--green-25);
}

/* Name with "N priority areas" under it. */
.zone-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zone-row__meta {
  font-size: var(--caption-3-size);
  line-height: var(--caption-3-line);
  color: var(--grey-700);
}

.zone-row__name {
  min-width: 0;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zone-row__score {
  flex-shrink: 0;
}

.ranking-empty {
  padding: 4px 8px;
  color: var(--grey-700);
}

.zone-row__score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--weight-medium);
}

/* Small score bar (61px wide). --value (0–100) is set in the HTML
   or from JavaScript. */
.score-bar {
  --value: 50;
  width: 61px;
  height: 2px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--green-500) calc(var(--value) * 1%),
    var(--grey-100) calc(var(--value) * 1%)
  );
}
