/* ============================
   API layout: TOC + content inside centered region
   ============================ */

#umi-columns {
  display: flex;
  align-items: flex-start;
  position: relative;
}

/* Fixed TOC inside the centered region */
#umi-toc {
  position: sticky;
  top: 1rem;
  width: 220px;
  flex-shrink: 0;
  padding: 1rem 0.5rem;
  box-sizing: border-box;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #f7f7f9;
  border-right: 1px solid #ddd;
}

/* TOC styling */
#umi-toc h2 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
}

#umi-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#umi-toc li {
  margin: 0.4rem 0;
}

#umi-toc a {
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

#umi-toc a.active {
  font-weight: 600;
  color: #0066cc;
}

/* Scrollable content column */
#umi-content {
  flex: 1;
  padding-left: 2rem;
  box-sizing: border-box;
  min-width: 0; /* prevents overflow */
}

/* Ensure content still respects umi-region geometry */
#umi-content .umi-section {
  max-width: 900px;
  margin: 2.5rem 0;
}

.astro-code {
  padding: 0.5rem;
  border-radius: 6px;
  overflow-x: auto;
}

@media (max-width: 700px) {
  #umi-columns {
    flex-direction: column;
  }

  #umi-toc {
    position: static;
    width: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
  }

  #umi-content {
    padding-left: 0;
  }
}
