/* Shared table and field-list layout for both RTD manuals. */

/* RTD's responsive wrapper normally forces table cells onto one line.
 * Allow prose and inline option names to wrap within the content column. */
.rst-content table.docutils {
    width: 100%;
    max-width: 100%;
}

.rst-content .wy-table-responsive table.docutils th,
.rst-content .wy-table-responsive table.docutils td,
.rst-content table.docutils th,
.rst-content table.docutils td {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.rst-content table.docutils code.literal,
.rst-content table.docutils code.literal .pre {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Ruff Options/Properties and Sphinx C parameter documentation use HTML5
 * field lists. RTD reserves
 * 80--95% for the description in addition to the label's intrinsic width.
 * Use two bounded columns instead, with no grid stretching inside labels. */
html.writer-html5 .rst-content dl.field-list {
    grid-template-columns: minmax(0, 30%) minmax(0, 1fr);
    column-gap: 1.25rem;
    row-gap: 0.5rem;
}

html.writer-html5 .rst-content dl.field-list > dt {
    display: block;
    align-self: start;
    min-width: 0;
    margin: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

html.writer-html5 .rst-content dl.field-list > dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.rst-content dl.field-list code.literal,
.rst-content dl.field-list code.literal .pre {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Stack labels and descriptions on phones, and when the desktop sidebar
 * leaves too little width for two useful columns. */
@media (max-width: 600px), (min-width: 769px) and (max-width: 1000px) {
    html.writer-html5 .rst-content dl.field-list {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }

    html.writer-html5 .rst-content dl.field-list > dt {
        margin-bottom: 0.25rem;
    }

    html.writer-html5 .rst-content dl.field-list > dd {
        margin-bottom: 1rem;
    }
}
