/*
 * Styling for the plain "copy everything" buttons attached by
 * copybutton_plain.js to non-console code blocks.  These rules
 * mirror sphinx-copybutton's `.copybtn` styling so the two button
 * types look and feel identical.  We deliberately do NOT reuse
 * the `.copybtn` class itself, because sphinx-copybutton binds
 * its prompt-stripping ClipboardJS handler to every `.copybtn`
 * element it can find.
 */
button.copybtn-plain {
    position: absolute;
    display: flex;
    top: .3em;
    right: .3em;
    width: 1.7em;
    height: 1.7em;
    opacity: 0;
    transition: opacity 0.3s, border .3s, background-color .3s;
    user-select: none;
    padding: 0;
    border: #1b1f2426 1px solid;
    outline: none;
    border-radius: 0.4em;
    background-color: #f6f8fa;
    color: #57606a;
}

button.copybtn-plain.success {
    border-color: #22863a;
    color: #22863a;
}

button.copybtn-plain svg {
    stroke: currentColor;
    width: 1.5em;
    height: 1.5em;
    padding: 0.1em;
}

/* Reveal on hover, matching sphinx-copybutton behavior. */
.highlight:hover button.copybtn-plain,
button.copybtn-plain.success {
    opacity: 1;
}

.highlight button.copybtn-plain:hover {
    background-color: rgb(235, 235, 235);
}

.highlight button.copybtn-plain:active {
    background-color: rgb(187, 187, 187);
}

@media print {
    button.copybtn-plain {
        display: none;
    }
}

/* Mirror Sphinx's built-in `user-select: none` rule for
   ``span.gp`` (Generic.Prompt; see ``basic.css``) onto
   ``span.go`` (Generic.Output) inside ``.. code-block::
   console`` blocks.  Sphinx already prevents the mouse from
   selecting the leading ``$ ``/``# `` prompt; this extends
   the same behavior to the lines of command output that
   follow, so a click-drag selection inside a console block
   grabs only the commands - matching what the copy button
   already copies.

   Scoped to ``div.highlight-console`` so the rule cannot
   accidentally hide a selection in any other Pygments lexer
   that happens to emit a ``Generic.Output`` token. */
div.highlight-console span.go {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* The Pygments console lexer renders ``(sdk)[<dir>]$`` as two
   adjacent spans: ``<span class="gp gp-VirtualEnv">(sdk)</span>``
   followed immediately by ``<span class="gp">[<dir>]$ </span>``.
   Authoring the prompt as ``(sdk)[<dir>]$`` (no space between the
   venv marker and the rest of the prompt) is intentional: a literal
   space between the two spans would render as a bare text node, and
   ``user-select: none`` cannot reach text nodes that aren't inside
   any span -- so a click-drag selection would highlight the gap
   even though the copied text wouldn't include it.

   Restore the visual gap with right-padding on the venv-marker span
   instead.  Padding is part of the span's box but isn't selectable,
   so the visual layout matches ``(sdk) [<dir>]$ `` while keeping
   the entire prompt unselectable. */
div.highlight-console span.gp.gp-VirtualEnv {
    padding-right: 0.4em;
}
