/* ==========================================================
   Academy-PC — sezione "Esercizi" comune ai corsi statici
   Tutto è dentro .ap-esercizi: non tocca il resto della pagina.
   Colori propri, così resta leggibile su pagine chiare e scure.
   ========================================================== */
.ap-esercizi {
  --ap-sfondo: #ffffff; --ap-testo: #1b2433; --ap-tenue: #5b6676; --ap-linea: #d9dee6;
  --ap-accento: #2453a6; --ap-riquadro: #f4f6fa;
  box-sizing: border-box; max-width: 1100px; margin: 2.5rem auto; padding: 1.5rem;
  background: var(--ap-sfondo); color: var(--ap-testo); border: 1px solid var(--ap-linea);
  border-top: 5px solid var(--ap-accento); border-radius: 12px;
  font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; text-align: left;
  scroll-margin-top: 150px; /* spazio per le barre fisse in cima ad alcune pagine */
}
.ap-esercizi * { box-sizing: border-box; }
.ap-esercizi h2 {
  margin: 0 0 .35rem; padding: 0; border: 0; background: none; color: var(--ap-testo);
  font: 800 1.5rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-fill-color: currentColor;
}
.ap-esercizi .ap-intro { margin: 0 0 1.25rem; color: var(--ap-tenue); }
.ap-esercizi ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: ap; }
.ap-esercizi .ap-es {
  counter-increment: ap; margin: 0; padding: 1rem 1.1rem; background: var(--ap-riquadro);
  border: 1px solid var(--ap-linea); border-radius: 10px;
}
.ap-esercizi .ap-testa { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ap-esercizi .ap-testa::before {
  content: counter(ap); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; flex: none;
  border-radius: 50%; background: var(--ap-accento); color: #fff; font-weight: 800; font-size: .9rem;
}
.ap-esercizi .ap-testa h3 { flex: 1 1 12rem; min-width: 0; }
.ap-esercizi h3 {
  margin: 0; padding: 0; border: 0; background: none; color: var(--ap-testo);
  font: 700 1.05rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-fill-color: currentColor;
}
.ap-esercizi .ap-liv { padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.ap-esercizi .ap-liv.base { background: #dcefe3; color: #1d5c37; }
.ap-esercizi .ap-liv.medio { background: #fbecc8; color: #6b4a00; }
.ap-esercizi .ap-liv.sfida { background: #f6d6d3; color: #7d1a14; }
.ap-esercizi p, .ap-esercizi li li { color: var(--ap-testo); }
.ap-esercizi .ap-es p { margin: .4rem 0; }
.ap-esercizi .ap-es ul { margin: .4rem 0 .4rem 1.2rem; padding: 0; list-style: disc; }
.ap-esercizi .ap-es ul li { margin: .15rem 0; padding: 0; background: none; border: 0; }
.ap-esercizi code {
  padding: 1px 5px; border-radius: 4px; background: #e6eaf1; color: #1b2433;
  font: .9em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.ap-esercizi details { margin-top: .6rem; }
.ap-esercizi summary { cursor: pointer; color: var(--ap-accento); font-weight: 700; }
.ap-esercizi details > div { margin-top: .4rem; padding: .6rem .8rem; background: var(--ap-sfondo); border-left: 3px solid var(--ap-accento); border-radius: 0 6px 6px 0; }
.ap-esercizi .ap-consegna { margin-top: .5rem; font-size: .92rem; color: var(--ap-tenue); }
@media (max-width: 640px) {
  .ap-esercizi { margin: 2rem 12px; padding: 1.1rem; }
}
