/* PyGREET brand colors. Primary is the pale sage green sampled directly from the
   logo diamond in docs/images/splash.png (#CAE3AE), not the saturated app-icon green,
   so the header matches that artwork instead of clashing with it. */
:root {
    --md-primary-fg-color: #CAE3AE;
    --md-primary-fg-color--light: #DEEEC9;
    --md-primary-fg-color--dark: #B8CDA5;
    --md-accent-fg-color: #F2BE00;
    --md-accent-fg-color--transparent: rgba(242, 190, 0, 0.1);
}

/* Text/icon color on the primary background, active now that mkdocs.yml sets
   primary: custom. #CAE3AE is pale, so dark text reads better here, the same way
   splash.png itself uses black line art on this exact green.
   Material sets data-md-color-primary on <body>, not <html>, so these overrides must
   live on the same [data-md-color-primary=custom] selector Material uses -- a :root
   rule loses to it because body is closer in the cascade for its own descendants. */
[data-md-color-primary=custom] {
    --md-primary-bg-color: rgba(0, 0, 0, 0.87);
    --md-primary-bg-color--light: rgba(0, 0, 0, 0.54);
    /* Body hyperlinks default to --md-primary-fg-color, which is now the pale header
       green and too washed out to read as a link on white. Use the app icon's
       saturated green (theme.ts palette.primary.main) instead. */
    --md-typeset-a-color: #50B848;
}

/* Header and navigation styling */
.md-header {
    background-color: #CAE3AE;
}

.md-tabs {
    background-color: #CAE3AE;
}

/* Ensure good text contrast on the pale-green header/tabs */
.md-header__title,
.md-header__button,
.md-tabs__link {
    color: rgba(0, 0, 0, 0.87);
}

/* Active/selected tab styling */
.md-tabs__link--active,
.md-tabs__item .md-tabs__link--active {
    color: #000000 !important;
    font-weight: 700 !important;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    border: 1px solid #849C6C !important;
    border-radius: 6px !important;
    padding: 8px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
}

.md-tabs__link:hover {
    color: rgba(0, 0, 0, 0.95) !important;
    background: rgba(255, 255, 255, 0.4) !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
}

/* Figure styling */
figure {
    margin: 2em auto;
    text-align: center;
    max-width: 100%;
}

figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

figcaption {
    margin-top: 0.75em;
    font-style: italic;
    color: var(--md-default-fg-color--light);
    font-size: 0.9em;
    text-align: center;
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] figure img {
    border-color: var(--md-default-fg-color--lightest);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Center the fullscreen toggle exactly between the contrast (palette)
   toggle and the search bar. */
.md-header__button--fullscreen {
    margin-left: 0;
    margin-right: 0.2rem;
}

/* Equations (MathJax): let wide display equations scroll horizontally
   instead of overflowing the content column. The generous vertical padding
   keeps tall expressions (fractions, exponents, piecewise cases) from being
   clipped at the top or bottom by the horizontal-scroll container. */
mjx-container[display="true"] {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 1em 0;
}
