/* Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved.

   This file is part of GDB.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* ROCm theme for the HTML manual, styled after the AMD ROCm
   documentation site.  This sets the palette (the --toc-sidebar-*
   custom properties the feature reads) and the manual's general look,
   the body type and content typography.

   The font stacks are copied from the ROCm documentation site so the
   manual matches the surrounding pages.

   The block below is generated from the live ROCm documentation site,
   which is built with pydata-sphinx-theme; these are that theme's
   light-mode design tokens (ROCm overrides only the row-hover
   background).  The palette, the heading size ramp and weight, and
   the font stacks are all sourced this way, with the source variable
   named in each comment.  Do not edit the block by hand, as
   rocm-theme-sync.py rewrites it in place from the live site.  */
:root {
    /* generated by rocm-theme-sync.py */

    /* palette */
    --toc-sidebar-accent: #0a7d91;    /* pst-color-primary */
    --toc-sidebar-text: #222832;      /* pst-color-text-base */
    --toc-sidebar-muted: #48566b;     /* pst-color-text-muted */
    --toc-sidebar-border: #d1d5da;    /* pst-color-border */
    --toc-sidebar-bg: #f3f4f5;        /* pst-color-surface */
    --toc-sidebar-hover-bg: #e2e8f0;  /* pst-color-table-row-hover-bg */
    --toc-sidebar-search-bg: #fff;    /* pst-color-background */
    --toc-sidebar-on-accent: #fff;    /* pst-color-primary-text */
    --rocm-accent-dark: #8045e5;      /* pst-color-secondary */
    --rocm-code-bg: #f3f4f5;          /* pst-color-surface */
    --rocm-inline-code: #912583;      /* pst-color-inline-code */

    /* type scale */
    --rocm-font-size-h1: 2.5rem;   /* pst-font-size-h1 */
    --rocm-font-size-h2: 2rem;     /* pst-font-size-h2 */
    --rocm-font-size-h3: 1.75rem;  /* pst-font-size-h3 */
    --rocm-font-size-h4: 1.5rem;   /* pst-font-size-h4 */
    --rocm-font-size-h5: 1.25rem;  /* pst-font-size-h5 */
    --rocm-font-size-h6: 1.1rem;   /* pst-font-size-h6 */
    --rocm-heading-weight: 400;    /* pst-font-weight-heading */

    /* font stacks */
    --rocm-font-base: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Helvetica Neue", "Arial", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";  /* pst-font-family-base-system */
    --rocm-font-mono: "SFMono-Regular", "Menlo", "Consolas", "Monaco", "Liberation Mono", "Lucida Console", monospace;  /* pst-font-family-monospace-system */
}

html { scroll-behavior: smooth; }

body {
    color: var(--toc-sidebar-text);
    font-family: var(--rocm-font-base);
    font-size: 16px;           /* pydata light-mode value, hand-transcribed */
    line-height: 1.65;         /* pydata light-mode value, hand-transcribed */
}

/* Heading line-height and margins are pydata-sphinx-theme's
   light-mode values, transcribed by hand.  Unlike the size ramp and
   weight above, pydata keeps these in its heading rule body rather
   than in custom properties, so rocm-theme-sync.py cannot pull
   them. */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.15;
    margin: 2.75rem 0 1.05rem;
    font-weight: var(--rocm-heading-weight);
}
h1 { font-size: var(--rocm-font-size-h1); }
h2 { font-size: var(--rocm-font-size-h2); }
h3 { font-size: var(--rocm-font-size-h3); }
h4 { font-size: var(--rocm-font-size-h4); }
h5 { font-size: var(--rocm-font-size-h5); }
h6 { font-size: var(--rocm-font-size-h6); }

/* The ROCm site underlines links rather than relying on color alone;
   the hover color comes from the palette.  */
a { color: var(--toc-sidebar-accent); text-decoration: underline; }
a:hover { color: var(--rocm-accent-dark); }

pre, code, samp, kbd {
    font-family: var(--rocm-font-mono);
}

/* The code box's border-radius and padding (here and on the inline
   code/samp rule below) are pydata-sphinx-theme's light-mode values,
   transcribed by hand: like the heading metrics above, pydata keeps
   them in its rule bodies rather than in custom properties, so
   rocm-theme-sync.py cannot pull them.  */
pre {
    background: var(--rocm-code-bg);
    border: 1px solid var(--toc-sidebar-border);
    border-radius: 0.25rem;
    padding: 1rem;
    line-height: 1.2;          /* tighter than body text; code reads better dense */
    margin: 1.5em 0;           /* gap above and below, off the surrounding text */
    overflow-x: auto;
}

code, samp {
    color: var(--rocm-inline-code);
    background: var(--rocm-code-bg);
    border: 1px solid var(--toc-sidebar-border);
    /* See note in the pre rule above.  */
    border-radius: 0.25rem;
    padding: 0.1rem 0.25rem;
}
pre code, pre samp {
    color: inherit; background: none; border: none; padding: 0;
}

/* The texinfo per-node prev/next/up panel, toned down with a smaller
   type.  nav-panel is a class texinfo emits in its own HTML output,
   and texinfo does not promise it as a stable name.  If a texinfo
   version ever renames it, this rule stops matching and the panel
   falls back to the browser's default styling.  */
.nav-panel {
    font-size: 0.85rem;
    color: var(--toc-sidebar-muted);
    background: var(--toc-sidebar-bg);
    border: 1px solid var(--toc-sidebar-border);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    margin-bottom: 1.5rem;
}

table { border-collapse: collapse; }
table td, table th {
    border: 1px solid var(--toc-sidebar-border);
    padding: 0.4rem 0.6rem;
}
