/*
 * Lo sviluppo dei contenuti, nella pagina Statistiche.
 *
 * Tre colori per tre macroaree, e sono gli unici colori propri della sezione:
 * servono a legare una barra, una colonna del grafico, una riga della tabella
 * e una cella della griglia alla stessa macroarea. Tutto il resto prende dalle
 * variabili della pagina, perche questa e una sezione in piu, non una
 * schermata nuova.
 */

.mh-st-contenuti {
  --macro-motorio: #f2a33c;
  --macro-analitico: #c62828;
  --macro-situazionale: #2f81c4;

  margin: 18px 0 0;
  border: 1px solid var(--border, rgba(0, 0, 0, .12));
  border-radius: 14px;
  background: var(--surface, #fff);
  overflow: hidden;
}

.mh-st-testa {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 14px;
}

.mh-st-titolo {
  flex: 1;
  min-width: 200px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}
.mh-st-titolo::before { content: "▸ "; opacity: .55; }
.mh-st-titolo[aria-expanded="true"]::before { content: "▾ "; }
.mh-st-titolo:hover { background: rgba(0, 0, 0, .03); }

.mh-st-periodo {
  font-size: 12px;
  opacity: .65;
  white-space: nowrap;
}

.mh-st-contenuti h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .8;
}

.mh-st-spiega,
.mh-st-nota {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: .72;
}

.mh-st-contenuti > div,
.mh-st-contenuti > p {
  padding: 0 16px 16px;
}

/* ------------------------------------------------------------ riepilogo -- */

.mh-st-riepilogo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding-top: 4px !important;
}
.mh-st-riepilogo .mh-st-nota {
  grid-column: 1 / -1;
  margin: 0;
}

.mh-st-tessera {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, .1));
  border-radius: 10px;
}
.mh-st-tessera strong {
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mh-st-tessera small { font-size: 11.5px; opacity: .7; }

/* ------------------------------------------------------------- le barre -- */

.mh-st-barra { margin-bottom: 12px; }
.mh-st-barra:last-child { margin-bottom: 0; }

.mh-st-barra-testa {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 4px;
}
.mh-st-barra-nome { font-weight: 600; }
.mh-st-barra-valore { font-variant-numeric: tabular-nums; opacity: .8; }

.mh-st-binario {
  height: 9px;
  border-radius: 999px;
  background: rgba(127, 127, 127, .18);
  overflow: hidden;
}
.mh-st-pieno { height: 100%; border-radius: 999px; background: currentColor; }

.mh-st-barra-piede { display: block; margin-top: 4px; font-size: 11.5px; opacity: .65; }

.macro-motorio { color: var(--macro-motorio, #f2a33c); }
.macro-analitico { color: var(--macro-analitico, #c62828); }
.macro-situazionale { color: var(--macro-situazionale, #2f81c4); }
.mh-st-barra .mh-st-barra-nome,
.mh-st-barra .mh-st-barra-valore,
.mh-st-barra .mh-st-barra-piede { color: inherit; }
.mh-st-barra-piede { color: inherit; }

/* ----------------------------------------------------------- andamento --- */

.mh-st-mesi {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  overflow-x: auto;
  padding-bottom: 4px;
}
.mh-st-mese {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 44px;
}
.mh-st-pila {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 90px;
  width: 100%;
}
.mh-st-pezzo {
  flex: 1;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}
.mh-st-mese small { font-size: 10.5px; opacity: .7; white-space: nowrap; }
.mh-st-mese em { font-size: 10px; font-style: normal; opacity: .5; font-variant-numeric: tabular-nums; }

.mh-st-legenda {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11.5px;
}
.mh-st-chiave::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 2px;
  background: currentColor;
}

/* ------------------------------------------------------------- tabelle --- */

.mh-st-scorri { overflow-x: auto; }

.mh-st-tabella,
.mh-st-griglia {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.mh-st-tabella th,
.mh-st-tabella td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, .08));
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mh-st-tabella th:first-child,
.mh-st-tabella td:first-child { text-align: left; white-space: normal; }

.mh-st-tabella thead th { padding: 0; }
.mh-st-tabella thead button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: right;
  color: inherit;
  opacity: .6;
  cursor: pointer;
}
.mh-st-tabella thead th:first-child button { text-align: left; }
.mh-st-tabella thead button:hover { opacity: 1; }
.mh-st-tabella thead button.ordinata { opacity: 1; text-decoration: underline; }

.mh-st-nome { line-height: 1.3; }
.mh-st-nome strong { display: block; font-size: 12.5px; }
.mh-st-nome small { font-size: 10.5px; opacity: .6; }

.mh-st-tabella tbody tr.macro-motorio td:first-child { border-left: 3px solid var(--macro-motorio); }
.mh-st-tabella tbody tr.macro-analitico td:first-child { border-left: 3px solid var(--macro-analitico); }
.mh-st-tabella tbody tr.macro-situazionale td:first-child { border-left: 3px solid var(--macro-situazionale); }
.mh-st-tabella tbody tr.mai { opacity: .55; }

.mh-st-variazione { opacity: .8; }

/* ------------------------------------------------------------ copertura -- */

.mh-st-copertura-testa {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.mh-st-cambia {
  border: 1px solid var(--border, rgba(0, 0, 0, .18));
  border-radius: 999px;
  background: transparent;
  padding: 3px 12px;
  font: inherit;
  font-size: 11.5px;
  color: inherit;
  opacity: .75;
  cursor: pointer;
}
.mh-st-cambia:hover { opacity: 1; }

.mh-st-griglia th,
.mh-st-griglia td {
  padding: 4px 6px;
  border: 1px solid var(--border, rgba(0, 0, 0, .07));
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.mh-st-cop-nome {
  text-align: left !important;
  white-space: nowrap;
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--surface, #fff);
}
.mh-st-griglia tr.macro-motorio .mh-st-cop-nome { border-left: 3px solid var(--macro-motorio); }
.mh-st-griglia tr.macro-analitico .mh-st-cop-nome { border-left: 3px solid var(--macro-analitico); }
.mh-st-griglia tr.macro-situazionale .mh-st-cop-nome { border-left: 3px solid var(--macro-situazionale); }
.mh-st-griglia td.piena { background: currentColor; color: inherit; font-weight: 700; }
.mh-st-griglia tr.macro-motorio td.piena { background: var(--macro-motorio); color: #1b1206; }
.mh-st-griglia tr.macro-analitico td.piena { background: var(--macro-analitico); color: #fff; }
.mh-st-griglia tr.macro-situazionale td.piena { background: var(--macro-situazionale); color: #fff; }
.mh-st-griglia td.vuota { opacity: .35; }

.mh-st-cop-elenco { display: grid; gap: 4px; }
.mh-st-cop-voce {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-left: 3px solid currentColor;
  border-radius: 0 6px 6px 0;
  background: rgba(127, 127, 127, .06);
  font-size: 12.5px;
}
.mh-st-cop-voce strong { color: inherit; }
.mh-st-cop-voce span { opacity: .7; text-align: right; }

/* -------------------------------------------------------------- bambini -- */

.mh-st-azione { text-align: right !important; }
.mh-st-azione button {
  border: 1px solid var(--border, rgba(0, 0, 0, .18));
  border-radius: 999px;
  background: transparent;
  padding: 2px 10px;
  font: inherit;
  font-size: 11px;
  color: inherit;
  cursor: pointer;
}

.mh-st-bambino-dettaglio > td { white-space: normal !important; }
.mh-st-bam-elenco {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
  padding: 6px 0;
}
.mh-st-bam-voce {
  display: grid;
  gap: 1px;
  padding: 6px 8px;
  border-left: 3px solid currentColor;
  border-radius: 0 6px 6px 0;
  background: rgba(127, 127, 127, .06);
}
.mh-st-bam-nome { font-size: 12px; font-weight: 600; color: inherit; }
.mh-st-bam-conto { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .85; }
.mh-st-bam-voce small { font-size: 10.5px; opacity: .6; }

/* --------------------------------------------------------- avvertenza --- */

.mh-st-avvertenza {
  margin: 0;
  padding: 12px 16px 16px !important;
  border-top: 1px solid var(--border, rgba(0, 0, 0, .08));
  font-size: 11.5px;
  line-height: 1.55;
  opacity: .68;
}

@media (max-width: 640px) {
  .mh-st-tessera strong { font-size: 18px; }
  .mh-st-pila { height: 70px; }
  .mh-st-contenuti > div,
  .mh-st-contenuti > p { padding-left: 12px; padding-right: 12px; }
}
