/* andreatesta.it — Indice laterale degli articoli */

.post-body__inner h2[id],
.post-body__inner h3[id] { scroll-margin-top: 110px; }

.post-toc { font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.post-toc__id { font-size: 12px; letter-spacing: .08em; opacity: .6; margin-bottom: 10px; }
.post-toc__list { list-style: none; margin: 0; padding: 0; }
.post-toc__item { margin: 0; }
.post-toc__item--l2 { padding-left: 14px; }
.post-toc__item--l3 { padding-left: 28px; }
.post-toc__link {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid transparent;
  color: inherit;
  opacity: .62;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.45;
  transition: opacity .2s, color .2s, border-color .2s;
}
.post-toc__link:hover { opacity: 1; }
.post-toc__link.is-active {
  opacity: 1;
  color: #4880c4;
  border-left-color: #ff8a00;
}

/* Schermi piccoli: riquadro richiudibile */
.post-toc--side { display: none; }
.post-toc--inline {
  border: 1px solid rgba(128, 128, 128, .35);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 32px;
}
.post-toc--inline summary { cursor: pointer; font-size: 13px; letter-spacing: .04em; }
.post-toc--inline .post-toc__list { margin-top: 10px; }

/* Desktop: colonna laterale fissa */
@media (min-width: 1200px) {
  .post-body.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    column-gap: 56px;
    align-items: start;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
  }
  .post-body.has-toc .post-body__inner { margin-left: auto; margin-right: 0; min-width: 0; }
  .post-toc--side {
    display: block;
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-top: 8px;
  }
  .post-toc--inline { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .post-toc { display: none; }
}
