/* =========================   PIE / DONUT CHART - Arti e Pensieri   Versione trasparente   ========================= */

.ae-pie-card {
  --ae-chart-accent: var(--brush-bullet-color, #B63A6B);
  --ae-chart-color-1: #B63A6B;
  --ae-chart-color-2: #D95F8F;
  --ae-chart-color-3: #E88BAE;
  --ae-chart-color-4: #F3B6CF;
  --ae-chart-color-5: #7F2448;
  --ae-chart-text: #222;
  width: 100%;
  min-height: 100%;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

/* Variante verde */

.page-green .ae-pie-card, .section-green .ae-pie-card {
  --ae-chart-accent: #2bb7a8;
  --ae-chart-color-1: #2bb7a8;
  --ae-chart-color-2: #54c9bd;
  --ae-chart-color-3: #86ddd5;
  --ae-chart-color-4: #bdf0eb;
  --ae-chart-color-5: #16877c;
}

/* Variante blu */

.page-blue .ae-pie-card, .section-blue .ae-pie-card {
  --ae-chart-accent: #2f57b7;
  --ae-chart-color-1: #2f57b7;
  --ae-chart-color-2: #5578c9;
  --ae-chart-color-3: #829ddc;
  --ae-chart-color-4: #bdcbed;
  --ae-chart-color-5: #1d367d;
}

/* Variante rossa */

.page-red .ae-pie-card, .section-red .ae-pie-card {
  --ae-chart-accent: #B63A6B;
  --ae-chart-color-1: #B63A6B;
  --ae-chart-color-2: #D95F8F;
  --ae-chart-color-3: #E88BAE;
  --ae-chart-color-4: #F3B6CF;
  --ae-chart-color-5: #7F2448;
}

/* Contenitore grafico */

.ae-pie-chart-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.35rem;
}

/* Grafico */

.ae-pie-chart {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: conic-gradient(var(--ae-chart-color-1) 0deg 360deg);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* Foro centrale del donut */

.ae-pie-chart::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 1.00);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.045);
}

/* Testo centrale */

.ae-pie-center {
  position: absolute;
  inset: 18%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ae-chart-text);
  pointer-events: none;
}

.ae-pie-total {
  font-family: "GOOD BRUSH", cursive;
  font-size: clamp(2.3rem, 6vw, 3.2rem);
  font-weight: 400;
  line-height: 0.9;
  color: var(--ae-chart-accent);
}

.ae-pie-unit {
  margin-top: 0.15rem;
  color: #555;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Dati sorgente: nascosti, letti dal JS */

.ae-pie-data {
  display: none;
}

/* Legenda */

.ae-pie-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2rem;
  margin-top: 0.6rem;
}

/* Pills legenda */

.ae-pie-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(182, 58, 107, 0.1);
  color: var(--ae-chart-accent);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.ae-pie-pill:hover {
  text-decoration: none !important;
}

/* Background pills per tema */

.page-red .ae-pie-pill, .section-red .ae-pie-pill {
  background: rgba(182, 58, 107, 0.1);
}

.page-green .ae-pie-pill, .section-green .ae-pie-pill {
  background: rgba(43, 183, 168, 0.1);
}

.page-blue .ae-pie-pill, .section-blue .ae-pie-pill {
  background: rgba(47, 87, 183, 0.1);
}

.ae-pie-pill span {
  display: inline-flex;
  align-items: center;
}

.ae-pie-pill-dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Nota sotto al grafico */

.ae-pie-note {
  margin: 1.2rem 0 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
  font-style: italic;
}

/* Mobile */

@media (max-width: 767.98px) {
  .ae-pie-card {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .ae-pie-chart {
    width: min(240px, 76vw);
  }
}

@media (max-width: 767.98px) {
  .ae-pie-legend {
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .ae-pie-pill {
    white-space: normal;
  }
}

