/*********************************************
 * Dropdown button text customization
 *
 * Customizes sphinx-togglebutton text for dropdown admonitions
 * Changes "Click to show" to "Show" and "Click to hide" to "Hide"
 *
 * Note: Toggle directives ({toggle}) are controlled via Sphinx configuration
 * (togglebutton_hint and togglebutton_hint_hide in conf.py), not CSS.
 *********************************************/

/* Issue #342: Fix toggle button arrow shifting when activated
 * Apply consistent min-width and inline-flex display to prevent layout shift */
button.toggle-button {
  display: inline-flex;
  min-width: 5em;
}

/* Change "Click to show" to "Show" for all dropdown admonition buttons */
div.exercise.dropdown button.toggle-button::before,
div.solution.dropdown button.toggle-button::before,
div.hint.dropdown button.toggle-button::before,
div.note.dropdown button.toggle-button::before,
div.warning.dropdown button.toggle-button::before,
div.attention.dropdown button.toggle-button::before,
div.caution.dropdown button.toggle-button::before,
div.danger.dropdown button.toggle-button::before,
div.error.dropdown button.toggle-button::before,
div.important.dropdown button.toggle-button::before,
div.tip.dropdown button.toggle-button::before,
div.admonition.dropdown button.toggle-button::before {
  content: "Show";
}

/* Change "Click to hide" to "Hide" when dropdown is shown */
div.exercise.dropdown.toggle-shown button.toggle-button::before,
div.solution.dropdown.toggle-shown button.toggle-button::before,
div.hint.dropdown.toggle-shown button.toggle-button::before,
div.note.dropdown.toggle-shown button.toggle-button::before,
div.warning.dropdown.toggle-shown button.toggle-button::before,
div.attention.dropdown.toggle-shown button.toggle-button::before,
div.caution.dropdown.toggle-shown button.toggle-button::before,
div.danger.dropdown.toggle-shown button.toggle-button::before,
div.error.dropdown.toggle-shown button.toggle-button::before,
div.important.dropdown.toggle-shown button.toggle-button::before,
div.tip.dropdown.toggle-shown button.toggle-button::before,
div.admonition.dropdown.toggle-shown button.toggle-button::before {
  content: "Hide";
}
