/* Widget Prestazione energetica — ref docs/WIDGET-APE/Righello.dc.html */
.ape-righello {
  --ape-cyan: #407087;
  --ape-dark: #142e34;
  --ape-muted: #494949;
  --ape-line: #d8d9db;
  --ape-bg: #fafafa;
  box-sizing: border-box;
  margin: 8px 0 20px;
  padding: 28px 24px;
  background: var(--ape-bg);
  color: var(--ape-dark);
  font-family: "General Sans", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-radius: 8px;
}

.ape-righello__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.ape-righello__titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ape-righello__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ape-righello__sub {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ape-cyan);
}

.ape-righello__pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ape-cyan);
  text-decoration: none;
}
.ape-righello__pdf:hover {
  color: var(--ape-dark);
}

.ape-righello__hero {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}

.ape-righello__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 72px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.ape-righello__ep {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ape-righello__ep-value {
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ape-righello__ep-unit {
  font-size: 0.9rem;
  color: var(--ape-muted);
}

.ape-righello__bars,
.ape-righello__labels {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.ape-righello__bars {
  height: 16px;
}

.ape-righello__bar {
  position: relative;
}

.ape-righello__bar.is-current {
  box-shadow: 0 0 0 3px var(--ape-dark);
  z-index: 1;
}

.ape-righello__pointer {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 12px solid var(--ape-dark);
}

.ape-righello__labels span {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ape-muted);
}
.ape-righello__labels span.is-current {
  font-weight: 700;
  color: var(--ape-dark);
}

.ape-righello__axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ape-muted);
  margin-top: 6px;
}

.ape-righello__meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--ape-meta-cols, 4), minmax(0, 1fr));
  border-top: 1px solid var(--ape-line);
  padding-top: 20px;
  gap: 0;
}

.ape-righello__meta > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px;
  border-left: 1px solid var(--ape-line);
}
.ape-righello__meta > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.ape-righello__meta > div:last-child {
  padding-right: 0;
}

.ape-righello__meta dt {
  font-size: 0.85rem;
  color: var(--ape-muted);
}

.ape-righello__meta dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .ape-righello {
    padding: 20px 16px;
    gap: 20px;
  }
  .ape-righello__chip {
    min-width: 64px;
    height: 64px;
    font-size: 1.6rem;
  }
  .ape-righello__ep-value {
    font-size: 1.75rem;
  }
  .ape-righello__meta {
    grid-template-columns: 1fr 1fr;
    gap: 16px 0;
  }
  .ape-righello__meta > div {
    border-left: 0;
    padding: 0 12px 0 0;
  }
  .ape-righello__meta > div:nth-child(odd) {
    padding-right: 12px;
  }
  .ape-righello__meta > div:nth-child(n + 3) {
    border-top: 1px solid var(--ape-line);
    padding-top: 12px;
  }
  .ape-righello__pointer {
    top: -22px;
    border-left-width: 7px;
    border-right-width: 7px;
    border-top-width: 10px;
  }
}
