.youtube-video {
  width: 100%;
  max-width: 800px; /* Standard YouTube embed width */
  margin: 10px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.youtube-video iframe {
  width: 100%;
  height: 450px; /* Standard YouTube embed height */
  border: none;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .youtube-video {
    max-width: 100%;
  }
  .youtube-video iframe {
    height: calc(100vw * 9 / 16); /* Maintain 16:9 aspect ratio */
  }
}




#main-content {
  position: relative;
}

main {
  max-width: 100%;
}

.toc-sidebar {
  position: fixed; /* Changed from sticky */
  top: 1rem;
  right: 2rem; /* Position from the right edge */
  width: 250px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  z-index: 100;
  
  /* Add some visual separation */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#markdown-toc {
  background: rgba(248, 249, 250, 0.95); /* Slightly transparent */
  backdrop-filter: blur(10px); /* Modern browsers */
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0;
  font-size: 0.9rem;
}

/* Hide on smaller screens */
@media (max-width: 1200px) {
  .toc-sidebar {
    display: none;
  }
}

/* Adjust when sidebar container exists and is visible */
#sidebar-container ~ * #site-nav,
#sidebar-container + * #site-nav {
  transform: translateX(-340px);
  transition: transform 0.3s ease;
}

/* For Just the Docs specific elements */
body:has(#sidebar-container[style*="display: block"]) .side-bar,
body:has(#sidebar-container[style*="width"]) .side-bar {
  transform: translateX(-340px);
  transition: transform 0.3s ease;
}
