/* Custom CSS for Keraunos PCIe Tile Documentation */
/* Override Read the Docs theme to ensure full-width white background */

/* ===================================================================
   FORCE Full White Background - Override RTD Theme
   =================================================================== */

/* Page-level white background */
body,
html {
    background: white !important;
}

/* Main layout container - white background */
.wy-grid-for-nav {
    background: white !important;
}

/* Content wrapper - full width white background */
.wy-nav-content-wrap {
    background: white !important;
    margin-left: 300px !important;
    min-height: 100vh !important;
}

/* Content area - remove max-width, force white background */
.wy-nav-content {
    max-width: none !important;
    background: white !important;
    min-height: 100vh !important;
    padding: 20px 40px !important;
}

/* Main document body - white background, centered content */
.rst-content {
    background: white !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Ensure section content extends properly */
.document {
    background: white !important;
    width: 100% !important;
}

/* Prevent text wrapping issues in pre/code blocks */
.rst-content pre {
    white-space: pre !important;
    overflow-x: auto !important;
    word-wrap: normal !important;
}

/* Ensure tables don't cause wrapping issues */
.rst-content table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    table-layout: auto !important;
}

/* Navigation sidebar styling */
.wy-side-nav-search {
    background-color: #1976d2 !important;
}

.wy-menu-vertical {
    background: #fcfcfc !important;
}

.wy-nav-side {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 300px !important;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .wy-nav-side {
        left: -300px !important;
    }
    
    .wy-nav-content-wrap {
        margin-left: 0 !important;
    }
}

/* ===================================================================
   Content Styling
   =================================================================== */

/* Make Mermaid diagrams more readable */
.mermaid {
    text-align: center;
    margin: 20px auto;
    max-width: 100%;
}

/* Improve code block styling */
div.highlight {
    background-color: #f8f9fa;
    border-left: 3px solid #1976d2;
    padding: 10px;
    margin: 10px 0;
}

/* Style for note boxes */
.admonition {
    border-left: 4px solid #1976d2;
    padding: 12px;
    margin: 15px 0;
    background-color: #e3f2fd;
}

.admonition-title {
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 8px;
}

/* Table styling */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

table th {
    background-color: #1976d2;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Checkmark styling */
.fa-check-square:before {
    color: #4caf50;
}

/* Improve heading spacing */
h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1976d2;
}

h3 {
    margin-top: 25px;
    margin-bottom: 12px;
    color: #1976d2;
}

/* Code inline styling */
code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 90%;
}

/* Improve list spacing */
ul, ol {
    line-height: 1.8;
}

/* Mermaid diagram container */
div.mermaid-container {
    overflow-x: auto;
    margin: 20px 0;
}

/* Fix section anchors to account for fixed header */
.rst-content .section {
    scroll-margin-top: 20px;
}

/* Improve readability with proper line height */
.rst-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Prevent long code lines from causing horizontal scroll issues */
.rst-content .highlight pre {
    overflow-x: auto !important;
    max-width: 100% !important;
    white-space: pre !important;
    word-break: normal !important;
    word-wrap: normal !important;
}

/* Print styles */
@media print {
    .mermaid {
        page-break-inside: avoid;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    .wy-nav-side {
        display: none;
    }
    
    .wy-nav-content-wrap {
        margin-left: 0 !important;
    }
}
