/* ==========================================================
   CSS Overrides for sphinx_idf_theme (Layout & Table Fixes)
   ========================================================== */

/* 1. Default Content Area Styling (Regular Documents)
   - Restore standard max-width so pages don't stretch to full screen.
   - Keep margin: 0 to ensure alignment with the sidebar (no left gap).
*/
.wy-nav-content {
    max-width: 800px; /* Standard theme width */
    margin: 0 !important;
}

/* 2. Expand content area to fit wide tables (for full-table screenshots)
   Shrink-wrap to table width; do NOT use min-width: 100% (that leaves empty
   right margin when the table is narrower than the viewport).
*/
.wy-body-for-nav:has(.wy-table-responsive) .wy-nav-content,
.wy-body-for-nav:has(.power-table) .wy-nav-content {
    max-width: none !important;
    width: fit-content !important;
}

/* 3. Image & Icon Protection
   Prevent images from scaling too large even if the container expands.
*/
.wy-nav-content img {
    max-width: 100%;
    height: auto;
}

/* Specifically limit landing page icons inside standard tables */
.wy-nav-content table:not(.wy-table-responsive) td img {
    max-width: 250px !important;
}

/* 4. Table layout — no inner scrollbar; page grows with the table */
.wy-table-responsive {
    overflow-x: visible !important;
    margin-bottom: 24px;
}

.wy-table-responsive table.docutils {
    display: table !important;
    width: max-content !important;
    table-layout: auto !important;
}

.wy-table-responsive table.docutils th,
.wy-table-responsive table.docutils td {
    white-space: normal !important;
    padding: 12px 14px;
}

/* 5. Custom Power Table Fix */
table.power-table {
    width: max-content !important;
}
