/**
 * WP Math Formula Renderer Styles
 *
 * MathJax v3 handles most styling via JavaScript injection,
 * but these styles ensure the containers behave responsively
 * within the WordPress theme structure.
 */

/* Ensure block equations do not overflow on mobile screens */
mjx-container[display="true"] {
    display: block;
    margin: 1em 0;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    text-align: center;
}

/* Add a subtle scrollbar styling for better UX on desktop */
mjx-container[display="true"]::-webkit-scrollbar {
    height: 6px;
}

mjx-container[display="true"]::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Fix vertical alignment for inline math in some themes */
mjx-container[jax="CHTML"][display="false"] {
    font-size: 105%;
    position: relative;
    top: -0.1em;
}

/* Ensure focus outlines are visible for accessibility */
mjx-container:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}