/* Documentation-specific styles */

/* Layout */
.docs-layout {
    min-height: calc(100vh - 4rem);
}

@media (min-width: 64rem) {
    .docs-shell-row {
        min-height: calc(100dvh - 4rem);
    }
}

@media (min-width: 80rem) {
    .docs-content-row {
        min-height: calc(100dvh - 4rem);
    }
}

/* Prose overrides for dark theme */
.docs-prose {
    --tw-prose-headings: oklch(94% 0.01 260);
    --tw-prose-body: oklch(85% 0.01 260);
    --tw-prose-links: oklch(45% 0.12 250);
    --tw-prose-bold: oklch(94% 0.01 260);
    --tw-prose-code: oklch(90% 0.01 260);
    --tw-prose-pre-bg: oklch(10% 0.02 260);
    --tw-prose-pre-code: oklch(85% 0.01 260);
    --tw-prose-th-borders: oklch(30% 0.03 260);
    --tw-prose-td-borders: oklch(22% 0.03 260);
}

.docs-prose a {
    color: oklch(55% 0.15 250);
    text-decoration: none;
    transition: color 0.2s ease;
}

.docs-prose a:hover {
    color: oklch(65% 0.18 250);
    text-decoration: underline;
}

/* Tables */
.docs-prose table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
    table-layout: fixed;
}

.docs-prose thead th {
    background: oklch(16% 0.025 260);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid oklch(30% 0.03 260);
}

.docs-prose thead th:first-child {
    width: 33%;
}

.docs-prose thead th:last-child {
    width: 67%;
}

.docs-prose tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid oklch(20% 0.025 260);
    vertical-align: middle;
}

/* Compact bullet lists inside table cells */
.docs-prose td ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.docs-prose td li {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.docs-prose tbody tr:hover {
    background: oklch(14% 0.02 260);
}

/* Figures and images */
.docs-prose figure {
    margin: 1.5rem 0;
    text-align: center;
}

.docs-prose figure img {
    border-radius: 0.5rem;
    border: 1px solid oklch(25% 0.03 260);
    max-width: 100%;
    height: auto;
}

.docs-prose figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: oklch(60% 0.01 260);
    font-style: italic;
}

/* Details/summary (FAQ, troubleshooting) */
.docs-prose details {
    margin: 0.75rem 0;
    border: 1px solid oklch(25% 0.03 260);
    border-radius: 0.5rem;
    overflow: hidden;
}

.docs-prose details summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: oklch(16% 0.025 260);
    font-weight: 500;
    transition: background 0.2s ease;
}

.docs-prose details summary:hover {
    background: oklch(20% 0.03 260);
}

.docs-prose details[open] summary {
    border-bottom: 1px solid oklch(25% 0.03 260);
}

.docs-prose details > *:not(summary) {
    padding: 0 1rem;
}

/* Admonitions */
.docs-prose .admonition {
    border-left: 4px solid oklch(45% 0.12 250);
    background: oklch(14% 0.02 260);
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
}

.docs-prose .admonition-title {
    font-weight: 600;
    color: oklch(55% 0.15 250);
    margin-bottom: 0.5rem;
}

.docs-prose .admonition.warning {
    border-left-color: oklch(66% 0.179 58.318);
}

.docs-prose .admonition.warning .admonition-title {
    color: oklch(66% 0.179 58.318);
}

.docs-prose .admonition.danger {
    border-left-color: oklch(59% 0.249 0.584);
}

.docs-prose .admonition.danger .admonition-title {
    color: oklch(59% 0.249 0.584);
}

/* TOC right sidebar */
.docs-toc-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-toc-content li {
    margin: 0;
    padding: 0;
}

.docs-toc-content a {
    display: block;
    padding: 0.25rem 0;
    color: oklch(60% 0.01 260);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.5;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.docs-toc-content a:hover {
    color: oklch(55% 0.15 250);
    border-left-color: oklch(55% 0.15 250);
}

.docs-toc-content ul ul {
    padding-left: 0.75rem;
}

/* Permalink anchors */
.docs-prose .headerlink {
    color: oklch(40% 0.1 250);
    text-decoration: none;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.875em;
}

.docs-prose h1:hover .headerlink,
.docs-prose h2:hover .headerlink,
.docs-prose h3:hover .headerlink,
.docs-prose h4:hover .headerlink {
    opacity: 1;
}

/* Search modal — top-aligned using DaisyUI modal */
.docs-search-dialog {
    align-items: flex-start;
    padding-top: 10vh;
}

/* Stronger backdrop for dark theme */
.docs-search-dialog[open] {
    background-color: oklch(0% 0 0 / 0.7);
}

#docs-search-modal .ais-SearchBox-form {
    display: flex;
    width: 100%;
}

#docs-search-modal .ais-SearchBox-input {
    flex: 1;
    padding: 0 0.5rem;
}

#docs-search-modal .ais-SearchBox-submit,
#docs-search-modal .ais-SearchBox-reset {
    display: none;
}

#docs-search-modal .ais-Hits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-search-result {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.docs-search-result:hover,
.docs-search-result.active {
    background: oklch(20% 0.03 260);
}

.docs-search-section {
    font-size: 0.75rem;
    color: oklch(55% 0.01 260);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.docs-search-title {
    font-weight: 600;
    color: oklch(94% 0.01 260);
}

.docs-search-snippet {
    font-size: 0.8125rem;
    color: oklch(70% 0.01 260);
    line-height: 1.4;
    margin-top: 0.25rem;
}

#docs-search-modal mark,
#docs-search-modal .ais-Highlight-highlighted,
#docs-search-modal .ais-Snippet-highlighted {
    background: oklch(45% 0.12 250 / 0.3);
    color: oklch(94% 0.01 260);
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
}

/* Nav group auto-open for active sections */
.docs-nav-group[open] > summary {
    margin-bottom: 0;
}
