/* Language switcher in footer */
.language-switcher {
    text-align: center;
    padding: 1rem 0 0.5rem;
    font-size: 0.9rem;
}

.language-switcher a {
    color: var(--color-foreground-secondary);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.language-switcher a:hover {
    color: var(--color-foreground-primary);
    background-color: var(--color-background-hover);
}

.language-switcher a.active {
    font-weight: bold;
    color: var(--color-foreground-primary);
}

.language-switcher .separator {
    /* #767676 meets WCAG 2.1 AA 4.5:1 contrast on Furo's light background. */
    color: #767676;
    margin: 0 0.25rem;
}

/* Visually hide the submit button in Furo's sidebar search form. The button
   must exist (H32 accessibility), but we keep the Furo styling which uses
   Enter-to-submit visually. */
.sidebar-search-submit {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* sphinx-design badge contrast fixes (WCAG 2.1 AA).
   The default bg-success and bg-info backgrounds have ~3:1 contrast with
   white text; darken them to #0a8927 / #008297 per pa11y recommendation. */
.sd-bg-success.sd-bg-text-success {
    background-color: #0a8927 !important;
}

.sd-bg-info.sd-bg-text-info {
    background-color: #008297 !important;
}

/* Print-friendly layout for cheat sheet and reference pages */
@media print {
    .sidebar-drawer,
    .toc-drawer,
    nav,
    footer,
    .language-switcher,
    .header-article-link,
    .sd-dropdown {
        display: none !important;
    }

    .content {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sd-card {
        break-inside: avoid;
        border: 1px solid #ccc !important;
    }

    .sd-row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .sd-col {
        flex: 0 0 33% !important;
        max-width: 33% !important;
    }
}

/* sphinx-copybutton: reveal the button on touch / narrow viewports where
   :hover never fires (the upstream CSS keeps it at opacity:0 until hover). */
@media (hover: none), (max-width: 768px) {
    .highlight button.copybtn {
        opacity: 0.6;
    }

    .highlight button.copybtn:focus,
    .highlight button.copybtn:active {
        opacity: 1;
    }
}
