/*
 * dragonflytheme.css
 * ~~~~~~~~~~~~~~~~~~
 *
 * Dragonfly branding layered on top of python_docs_theme (the docs.python.org/3
 * design).
 *
 * This file is pulled in through 'html_css_files' in conf.py, so it is emitted
 * *after* the theme's own classic.css and pydoctheme.css and can override them.
 * Do not @import those here -- the theme already loads them, and it used to have
 * to be done manually only because conf.py set 'html_style'.
 *
 * Two hacks that used to live in this file are gone on purpose:
 *
 *   - 'html { background-color: #11303d }' matched the dark blue band of the
 *     classic theme's footer. python_docs_theme has a white (or, in dark mode,
 *     #222) page background, so the old colour showed up as a stray blue strip
 *     under short pages.
 *
 *   - the 300px 'div.bodywrapper { margin-left }' / 'div.sphinxsidebar { width }'
 *     pair worked around sphinx-doc/sphinx#11000, where the classic theme let the
 *     table of contents overlap the body text. pydoctheme.css sizes the sidebar
 *     itself -- 'width: min(25vw, 350px)' with a matching bodywrapper margin, and
 *     'display: none' below 1024px in favour of the mobile menu. Pinning 300px
 *     re-broke that responsive behaviour, and the underlying bug is not present
 *     in this theme.
 */

/* -- Branding in the navigation bar ---------------------------------------- */

/*
 * 'root_icon' is the square Dragonfly mark (dragonfly-mark.png, 64x64). The theme
 * ships a 16px-ish py.svg and gives the <img> no dimensions of its own, so
 * constrain it to text height -- otherwise the 64px bitmap stretches the bar.
 */
div.related li img {
    height: 1.25em;
    width: auto;
}

/* -- Sidebar --------------------------------------------------------------- */

/*
 * html_logo is the 1250x300 wordmark. Scale it to the sidebar rather than letting
 * it set the sidebar's own width.
 *
 * The '.menu' half targets the logo in the mobile menu, but is INERT with the
 * currently pinned versions: python_docs_theme/layout.html guards that block with
 * '{%- if logo %}', while Sphinx 7.4.7 only puts 'logo_url' in the HTML context
 * (builders/html/__init__.py:554) -- 'logo' is an undefined Jinja name, so the
 * mobile <p class="logo"> is never rendered. Kept so the rule starts working if
 * the theme fixes that guard; do not assume it is doing anything today.
 */
div.sphinxsidebar p.logo img.logo,
.menu p.logo img.logo {
    display: block;
    width: 100%;
    height: auto;
}

/*
 * NOTE: both brand assets are solid dark navy on a transparent background, so they
 * read well in the light theme but vanish against the dark one. The white-knockout
 * variants are swapped in by dragonflytheme_dark.css -- see the comment at the top
 * of that file for why that has to be a separate stylesheet rather than an
 * '@media (prefers-color-scheme: dark)' block in here.
 */
