/* SEC System Rating — Reusable gauge component for system guide articles
 * Usage: see article-template.json sec_rating HTML structure
 * Enqueued on system-guides child pages via sec-custom.php
 * v2
 */

/* Container */
.sec-rating-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.2rem 0 1.5rem;
  padding: 1.2rem 1.4rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.sec-rating-box-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  margin: 0 0 0.2rem;
}

/* Each metric row */
.sec-rating-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sec-rating-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sec-rating-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #334155;
}

.sec-rating-caption {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Shared track styles */
.sec-rating-track {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sec-rating-track span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  border-right: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s ease;
}

.sec-rating-track span:last-child {
  border-right: none;
}

/* Active segment */
.sec-rating-track span.is-active {
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
  position: relative;
  z-index: 1;
}

/* Gray out everything after the active cell */
.sec-rating-track span.is-active ~ span {
  background: #e5e7eb;
  color: #b0b6bf;
  text-shadow: none;
  box-shadow: none;
  border-right-color: #d1d5db;
}

/* Cost track — green to red gradient */
.sec-rating-track--cost {
  background: linear-gradient(to right, #16a34a, #84cc16, #eab308, #f97316, #dc2626);
}

/* Tariff Exposure track — green to red gradient */
.sec-rating-track--tariff {
  background: linear-gradient(to right, #16a34a, #84cc16, #eab308, #f97316, #dc2626);
}

/* Consumption Fit track — grey to blue to cyan */
.sec-rating-track--consumption {
  background: linear-gradient(to right, #94a3b8, #3b82f6, #0ea5e9);
}

.sec-rating-track--consumption span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-right: 2px solid rgba(255,255,255,0.25);
}

.sec-rating-track--consumption span:last-child {
  border-right: none;
}

.sec-rating-track--consumption span.is-active {
  font-size: 0.82rem;
}

/* Responsive — tighten on small screens */
@media (max-width: 600px) {
  .sec-rating-box {
    padding: 1rem;
  }
  .sec-rating-track {
    height: 30px;
  }
  .sec-rating-track span {
    font-size: 0.65rem;
  }
  .sec-rating-track span.is-active {
    font-size: 0.72rem;
  }
}
