/* 
 * Documentation Pages Styles
 * 
 * This file contains all styles specific to documentation pages:
 * - Right sidebar table of contents
 * - Code block components with copy buttons
 * - Documentation layout adjustments
 * 
 * This file is loaded separately in app/views/layouts/docs.html.erb
 */

/* Right sidebar TOC for docs */
.main-container .docs-toc {
  display: none;
  position: fixed;
  top: 6rem;
  right: 2rem;
  width: 200px;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding: 1rem;
}

@media screen and (min-width: 1200px) {
  .main-container .docs-toc {
    display: block;
  }
  
  /* Add padding to main content to make room for TOC - only on docs pages */
  .main-container:has(.docs-toc) main {
    padding-right: 260px;
  }
}

/* Code Block Component with Copy Button */
.code-block-container {
  position: relative;
  max-width: 100%;
  margin-bottom: 1rem;
}

.code-block-container .copy-button {
  position: absolute;
  top: 7px;
  right: 7px;
  background: var(--color-box);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

.code-block-container .copy-button:hover {
  opacity: 1;
  background: var(--header-bg);
}

.code-block-container .copy-button.copied {
  color: var(--color-success);
}

.code-block-container pre {
  margin: 0;
  position: relative;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  overflow-y: visible;
}

/* Height variants */
.code-block-container.h4 pre {
  min-height: 6rem;
}

.code-block-container.h5 pre {
  min-height: 8rem;
}

.code-block-container code {
  font-family: var(--font-stack-monospace);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .code-block-container pre {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

