/* Parish directory + miniature site energy dashboards. */

.sidebar .site-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 0 21px 26px 0;
  transition: opacity .16s ease;
}

.sidebar .site-list:not(.is-energy-directory-ready) {
  min-height: 120px;
  opacity: 0;
}

.site-energy-network-canvas {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  pointer-events: none;
}

.site-parish-group {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.site-parish-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 27px;
  padding: 6px 7px 3px 6px;
  border: 0;
  background: transparent;
}

.site-parish-heading span {
  color: #3548aa;
  font-family: "Oswald", sans-serif;
  font-size: 10.8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.site-parish-heading small {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef0f8;
  color: #5d6780;
  font-size: 7.8px;
  font-weight: 850;
}

.sidebar .site-row.site-energy-card {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 0;
  padding: 10px 10px 10px 9px;
  border: 1px solid #d7dce5;
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 2px 7px rgba(0,32,92,.035);
  text-align: left;
  cursor: pointer;
  transform: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

/* The entire card is one map-selection button. Child dashboard elements never intercept it. */
.sidebar .site-row.site-energy-card > *,
.sidebar .site-row.site-energy-card .site-energy-details,
.sidebar .site-row.site-energy-card .site-energy-details * {
  pointer-events: none;
}

.sidebar .site-row.site-energy-card:hover {
  border-color: #adb6c6;
  background: #fff;
  box-shadow: 0 5px 14px rgba(0,32,92,.085);
  transform: translateY(-1px);
}

.sidebar .site-row.site-energy-card:focus-visible {
  outline: 2px solid rgba(53,72,170,.55);
  outline-offset: 1px;
}

.sidebar .site-row.site-energy-card.selected {
  border-color: #e2ad25;
  background: #fffef9;
  box-shadow: 0 5px 16px rgba(0,32,92,.09);
}

.sidebar .site-row.site-energy-card.selected::before {
  left: -2px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: #f2b823;
}

.sidebar .site-energy-card .site-logo {
  width: 32px;
  height: 32px;
  margin-top: 1px;
}

.sidebar .site-energy-card .site-copy {
  display: block;
  min-width: 0;
}

.sidebar .site-energy-card .site-name {
  display: block;
  padding-right: 1px;
  color: #09265f;
  font-size: 12.3px;
  font-weight: 800;
  line-height: 1.22;
}

.sidebar .site-energy-card .site-meta,
.sidebar .site-energy-card .site-live-stats,
.sidebar .site-energy-card .site-vpp-history {
  display: none !important;
}

.site-energy-details {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  min-width: 0;
}

.site-energy-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  color: #606d84;
  font-size: 8.05px;
  font-weight: 750;
  line-height: 1.18;
}

.site-energy-metric strong {
  color: #263c70;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.site-energy-powering {
  display: grid;
  gap: 5px;
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px solid rgba(0,32,92,.075);
}

.site-energy-powering-label {
  color: #55637b;
  font-size: 7.8px;
  font-weight: 850;
  line-height: 1;
}

.site-energy-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.site-energy-flow-cell {
  display: block;
  min-width: 0;
  padding: 5px 2px 4px;
  border-radius: 7px;
  text-align: center;
}

.site-energy-flow-cell strong {
  display: block;
  font-family: "Oswald", sans-serif;
  font-size: 13.1px;
  font-weight: 700;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}

.site-energy-flow-cell > span {
  display: block;
  margin-top: 3px;
  font-size: 6.9px;
  font-weight: 850;
  line-height: 1.08;
}

.site-energy-flow-cell.to-site {
  background: rgba(40,139,97,.07);
}
.site-energy-flow-cell.to-site strong,
.site-energy-flow-cell.to-site > span {
  color: #24805a;
}

.site-energy-flow-cell.to-grid {
  background: rgba(242,184,35,.095);
}
.site-energy-flow-cell.to-grid strong,
.site-energy-flow-cell.to-grid > span {
  color: #9a6900;
}

.site-energy-flow-cell.to-grid.is-vpp {
  border: 1px solid rgba(88,225,58,.28);
  background: rgba(94,235,62,.11);
}
.site-energy-flow-cell.to-grid.is-vpp strong,
.site-energy-flow-cell.to-grid.is-vpp > span {
  color: #2f9f24;
}

.site-energy-flow-cell.to-battery {
  background: rgba(53,103,189,.07);
}
.site-energy-flow-cell.to-battery strong,
.site-energy-flow-cell.to-battery > span {
  color: #3567bd;
}

.site-vpp-participant {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  margin-top: 1px;
  padding: 0 7px;
  border: 1px solid rgba(53,72,170,.17);
  border-radius: 999px;
  background: rgba(53,72,170,.055);
  color: #3548aa;
  font-size: 6.7px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .04em;
}

.site-energy-unavailable {
  display: block;
  margin-top: 1px;
  color: #7d8799;
  font-size: 8.1px;
  font-weight: 750;
  line-height: 1.22;
}

.site-energy-unavailable.is-construction {
  color: #b1423f;
  font-size: 8.1px;
  font-weight: 900;
  letter-spacing: .05em;
}

.sidebar .site-energy-card.site-energy-under-construction {
  border-color: #ddd7d7;
  background: linear-gradient(90deg, rgba(229,57,53,.035), #fff 44%);
}

.sidebar .site-energy-card.site-energy-under-construction .site-logo {
  opacity: .74;
}

/* VPP history belongs in the full profile, not in the site directory. */
.profile .vpp-event.vpp-event-history {
  display: grid;
  gap: 7px;
  padding: 11px 16px 12px;
  border-color: #d2d6de;
  background: #fbfcff;
}

.profile .vpp-event.vpp-event-history > strong {
  color: #3548aa;
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .085em;
}

.vpp-event-history-list {
  display: grid !important;
  gap: 4px;
}

.profile .vpp-event.vpp-event-history .vpp-event-history-list > span {
  display: block;
  color: #4e5a71;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .sidebar .site-list {
    padding-right: 21px;
  }

  .sidebar .site-row.site-energy-card {
    min-height: 72px;
  }
}

@media (max-width: 430px) {
  .sidebar .site-energy-card .site-name {
    font-size: 11.9px;
  }

  .site-energy-metric {
    font-size: 7.7px;
  }

  .site-energy-metric strong {
    font-size: 8.6px;
  }

  .site-energy-flow-cell strong {
    font-size: 12.5px;
  }

  .site-energy-flow-cell > span {
    font-size: 6.5px;
  }
}
