/* Portal Document Content Theme - Default */

/* Ensure sticky positioning works */
body, main, .container {
  overflow: visible !important;
}

/* Table of Contents Styling */
.toc-nav {
  position: relative;
  padding-left: 1rem;
}

.toc-nav::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: oklch(from var(--color-base-content) l c h / 0.1);
}

.toc-link {
  position: relative;
  transition: color 0.2s ease;
}

.toc-link.toc-active {
  color: var(--color-primary) !important;
  font-weight: 600;
}

.toc-link.toc-active::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-primary);
  z-index: 1;
}

/* Headings */
.document-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--bc) / 0.1);
}

.document-content h1:first-child {
  margin-top: 0;
}

.document-content h2 {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid hsl(var(--bc) / 0.05);
}

.document-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.document-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.document-content h5 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.document-content h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: hsl(var(--bc) / 0.7);
}

/* Paragraphs */
.document-content p {
  margin-bottom: 1rem;
  line-height: 1.75;
  font-size: 1rem;
}

.document-content p:last-child {
  margin-bottom: 0;
}

/* Links */
.document-content a {
  color: hsl(var(--p));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.document-content a:hover {
  color: hsl(var(--pf));
  text-decoration: none;
}

/* Text formatting */
.document-content strong {
  font-weight: 600;
}

.document-content em {
  font-style: italic;
}

/* Lists */
.document-content ul,
.document-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.document-content ul {
  list-style-type: disc;
}

.document-content ol {
  list-style-type: decimal;
}

.document-content ul ul {
  list-style-type: circle;
  margin-bottom: 0;
}

.document-content ul ul ul {
  list-style-type: square;
}

.document-content li {
  margin-bottom: 0.25rem;
  line-height: 1.75;
}

.document-content li p {
  margin-bottom: 0.25rem;
}

/* Blockquotes */
.document-content blockquote {
  border-left: 4px solid hsl(var(--bc) / 0.2);
  padding-left: 1rem;
  margin: 1rem 0;
  color: hsl(var(--bc) / 0.7);
  font-style: italic;
}

.document-content blockquote p {
  margin: 0.5rem 0;
}

/* Code */
.document-content code {
  background: hsl(var(--b2));
  border: 1px solid hsl(var(--b3));
  color: hsl(var(--bc));
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
}

.document-content pre {
  background: hsl(var(--b2));
  border: 1px solid hsl(var(--b3));
  color: hsl(var(--bc));
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.45;
}

.document-content pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* Horizontal rules */
.document-content hr {
  border: none;
  border-top: 1px solid hsl(var(--bc) / 0.2);
  margin: 2rem 0;
}

/* Images */
.document-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

/* Tables */
.document-content table {
  border-collapse: collapse;
  margin: 1rem 0;
  width: 100%;
}

.document-content th,
.document-content td {
  border: 1px solid hsl(var(--bc) / 0.2);
  padding: 0.5rem;
  text-align: left;
}

.document-content th {
  background: hsl(var(--b2));
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .document-content h1 {
    font-size: 1.75rem;
  }

  .document-content h2 {
    font-size: 1.375rem;
  }

  .document-content h3 {
    font-size: 1.125rem;
  }
}
