/* posix-next custom theme overrides */

/* Theme variables for doxytooltip popups (overridden by css/light.css or
   css/dark.css when dark mode is enabled). */
:root {
    --content-wrap-background-color: #fcfcfc;
    --body-color: #404040;
}

/* ── Tagline ─────────────────────────────────────────────────────────────── */

p.pn-tagline {
    font-size: 1.1em;
    color: var(--body-color);
    opacity: 0.85;
    margin: -0.5em 0 1.6em 0;
    line-height: 1.5;
}

/* ── Nav tile grid ───────────────────────────────────────────────────────── */

.pn-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.6rem 0 2.4rem 0;
}

a.pn-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.2rem 1rem;
    border: 1px solid var(--hr-color, #dde);
    border-radius: 8px;
    background: var(--content-background-color, linear-gradient(145deg, #f9fbff 0%, #f0f4ff 100%));
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

a.pn-tile:hover {
    box-shadow: 0 4px 14px rgba(0,80,180,0.15);
    transform: translateY(-2px);
    border-color: var(--link-color, #9ab);
}

.pn-tile-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.pn-tile-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--link-color, #1a4f8a);
}

.pn-tile-desc {
    font-size: 0.80rem;
    color: var(--body-color);
    opacity: 0.75;
    line-height: 1.3;
}

/* ── Graphviz diagrams: transparent background ───────────────────────────── */

.graphviz svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ── Logo sizing ─────────────────────────────────────────────────────────── */

/* Fill the full sidebar nav-search area */
.wy-side-nav-search > a img.logo,
.wy-side-nav-search > a.icon img.logo {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: var(--logo-opacity, 1.0);
}

/* Remove extra padding that RTD puts around the nav-search block */
.wy-side-nav-search {
    padding: 0 !important;
}

.wy-side-nav-search > a {
    display: block !important;
    padding: 0 !important;
}

/* ── Metrics / coverage iframe ───────────────────────────────────────────── */

/*
 * Zephyr's RTD custom.css caps .wy-nav-content at 915px — too narrow for gcovr
 * tables. Drop that cap on the Metrics page so the iframe can use the viewport.
 */
@media only screen and (min-width: 769px) {
    .wy-nav-content:has(#metrics) {
        max-width: none;
    }
}

#metrics .pn-coverage-frame {
    display: block;
    width: 100%;
    min-height: 85vh;
    border: 1px solid #dde;
    border-radius: 4px;
    background: #fff;
}

/* ── POSIX symbol search page tweaks ─────────────────────────────────────── */

#__posix-search {
    margin-top: 1rem;
}

/* ── Dark mode toggle ────────────────────────────────────────────────────── */

dark-mode-toggle::part(fieldset) {
    padding-inline: 0.75rem;
    padding-block: 0;
}

dark-mode-toggle::part(darkLabel),
dark-mode-toggle::part(lightLabel),
dark-mode-toggle::part(toggleLabel) {
    font-size: unset;
}
