/* Documentation Layout Styles */

.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.docs-sidebar {
    width: 280px;
    background: var(--ink);
    color: var(--parchment);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.docs-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--ink-light);
}

.docs-sidebar-header h1 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--gold);
}

.docs-sidebar-header h1 a {
    color: inherit;
    text-decoration: none;
}

.docs-sidebar-header .subtitle {
    font-size: 0.8rem;
    color: var(--parchment);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.docs-nav {
    padding: 1rem 0;
}

.docs-nav-section {
    margin-bottom: 0.5rem;
}

.docs-nav-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--gold);
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.docs-nav-section-header:hover {
    background: rgba(255,255,255,0.05);
}

.docs-nav-section-header .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    filter: invert(78%) sepia(38%) saturate(500%) hue-rotate(3deg) brightness(95%);
}

.docs-nav-section-header .chevron {
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.5;
}

.docs-nav-section.collapsed .chevron {
    transform: rotate(-90deg);
}

.docs-nav-section.collapsed .docs-nav-links {
    display: none;
}

.docs-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-nav-link {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    color: var(--parchment);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.docs-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--gold);
}

.docs-nav-link.active {
    background: rgba(201, 162, 39, 0.1);
    color: var(--gold);
    border-left-color: var(--gold);
}

/* Mobile sidebar toggle */
.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 101;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold);
    border: 2px solid var(--gold);
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Main content */
.docs-main {
    flex: 1;
    margin-left: 280px;
    background: var(--parchment);
}

.docs-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 3rem 4rem;
}

/* Section styling */
.docs-section {
    padding-top: 1.25rem;
    margin-bottom: 2rem;
}

.docs-section:first-child {
    padding-top: 0;
}

.docs-section h2 {
    color: var(--accent);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

/* Sub-section h2s (without audience-header icon) — smaller, lighter */
.docs-section h2:not(.audience-title) {
    font-size: 1.35rem;
    border-bottom: 1px solid var(--gold);
    color: var(--ink);
}

.docs-section h3 {
    color: var(--ink);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.docs-section h4 {
    color: var(--ink-light);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Audience section headers */
.audience-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.audience-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

img.audience-icon {
    filter: sepia(1) saturate(2) hue-rotate(-10deg) brightness(0.6);
}

.audience-title {
    margin: 0;
    color: var(--accent);
    font-size: 1.75rem;
    line-height: 1.2;
}

.audience-desc {
    margin: 0.15rem 0 0;
    margin-left: 0.5rem;
    color: var(--ink-light);
    font-style: italic;
    font-size: 0.95rem;
}

/* Code blocks */
.docs-section code {
    background: rgba(0,0,0,0.05);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.docs-section pre {
    background: #2c2416;
    color: #f4f1e8;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border-left: 4px solid var(--gold);
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.docs-section pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Tables */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.docs-table th,
.docs-table td {
    border: 1px solid #ddd;
    padding: 0.6rem 0.75rem;
    text-align: left;
}

.docs-table th {
    background: var(--ink);
    color: var(--parchment);
    font-weight: normal;
}

.docs-table tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

.docs-table td:first-child {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
}

/* Tips and warnings */
.docs-tip,
.docs-info,
.docs-warning {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.docs-tip {
    background: #e8f4e8;
    border-color: #4a7;
}

.docs-info {
    background: #e8eff8;
    border-color: #4a8ad4;
}

.docs-warning {
    background: #fef3e8;
    border-color: #e85;
}

.docs-tip strong,
.docs-info strong,
.docs-warning strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Lists */
.docs-section ul,
.docs-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.docs-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.docs-section li strong {
    color: var(--ink);
}

/* Back to top */
.docs-back-to-top {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--ink);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.docs-back-to-top:hover {
    background: var(--gold);
    color: var(--ink);
}

/* Search */
.docs-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ink-light);
}

.docs-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--ink-light);
    color: var(--parchment);
    font-family: inherit;
    font-size: 0.85rem;
}

.docs-search input::placeholder {
    color: rgba(244, 241, 232, 0.5);
}

.docs-search input:focus {
    outline: none;
    border-color: var(--gold);
}

/* Footer link in sidebar */
.docs-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--ink-light);
    margin-top: 1rem;
}

.docs-sidebar-footer a {
    color: var(--parchment);
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.7;
}

.docs-sidebar-footer a:hover {
    opacity: 1;
    color: var(--gold);
}

/* Field tags for schema property display */
.field-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.35rem 0 0;
}

.field-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(44, 36, 22, 0.06);
    border: 1px solid rgba(44, 36, 22, 0.15);
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    color: var(--ink-light);
    white-space: nowrap;
}

/* Schema structure blocks */
.schema-block {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--gold);
    background: rgba(201, 162, 39, 0.04);
}

.schema-block h4 {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.95rem;
}

.schema-block p {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-light);
}

/* Table category group headers */
.docs-table .table-group td {
    background: var(--ink);
    color: var(--parchment);
    font-weight: bold;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.75rem;
    font-family: inherit;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
    }
    
    .docs-sidebar-toggle {
        display: flex;
    }
    
    .docs-main {
        margin-left: 0;
    }
    
    .docs-content {
        padding: 1.5rem;
    }
    
    .audience-header {
        flex-direction: column;
        text-align: center;
    }
    
    .docs-table {
        font-size: 0.8rem;
    }
    
    .docs-table th,
    .docs-table td {
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 600px) {
    .docs-content {
        padding: 1rem;
    }
    
    .docs-section h2 {
        font-size: 1.4rem;
    }
    
    .docs-section h3 {
        font-size: 1.1rem;
    }
    
    .docs-section pre {
        font-size: 0.75rem;
        padding: 0.75rem;
    }
}
