/* Fix pandas DataFrame rendering in dark mode.
 *
 * nbsphinx renders notebook output cells with pandas DataFrames that carry
 * light-mode background colours.  The pydata-sphinx-theme exposes CSS
 * custom properties for all palette entries, so we override the hard-coded
 * values using those variables when the dark theme is active.
 */

[data-theme="dark"] .dataframe,
[data-theme="dark"] .dataframe td,
[data-theme="dark"] .dataframe th {
    background-color: var(--pst-color-background) !important;
    color: var(--pst-color-text-base) !important;
    border-color: var(--pst-color-border) !important;
}

[data-theme="dark"] .dataframe tbody tr:nth-child(odd) td,
[data-theme="dark"] .dataframe tbody tr:nth-child(odd) th {
    background-color: var(--pst-color-surface) !important;
}

/* Task entry points use theme colours in both colour modes. */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.workflow-card {
    padding: 1rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 0.35rem;
    background: var(--pst-color-surface);
}
.workflow-card p:last-child { margin-bottom: 0; }
.version-status { font-size: 0.8rem; line-height: 1.3; }
.project-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.85rem; }
.bd-article a:focus-visible, .version-status:focus-visible, .project-links a:focus-visible {
    outline: 2px solid var(--pst-color-primary);
    outline-offset: 3px;
}
.notebook-actions { padding: 0.8rem 1rem; border-left: 3px solid var(--pst-color-primary); }
.notebook-actions p:last-child { margin-bottom: 0; }
.bd-article img { max-width: 100%; height: auto; }
@media (max-width: 575px) {
    .version-status { max-width: 9rem; }
    .bd-article .table-wrapper { overflow-x: auto; }
}
