// Font size for navigational elements
$toc-font-size: 0.875rem !default;

/* Code Block Formatting */
// Code Block Border Treatment
$code-block-border-left: false !default;
$code-block-border-left-style: solid !default;
$code-block-border-left-size: 3px !default;
$code-block-padding-left: 0.6em !default;

// Code Block Background Treatment
// $code-block-bg, $code-block-bg-padding, $code-block-bg-alpha
$code-block-bg: true !default;
$code-block-bg-padding: 0.4em !default;
$code-block-bg-alpha: -0.35 !default;

// Controls when the code block will switch to a dark
// version of a theme
$code-block-theme-dark-threshhold: 40% !default;

/* Inline Code Formatting */
// $code-bg, $code-color, $code-padding
$code-color: #9954bb !default;

/* Callout customization */
// Formatting
$callout-border-width: 5px !default;
$callout-border-scale: 0% !default;
$callout-icon-scale: 10% !default;
$callout-margin-top: 1.25rem !default;
$callout-margin-bottom: 1.25rem !default;

// Navbar
$theme-name: if(variable-exists(theme), $theme, "");
$navbar-default: if(variable-exists(primary), $primary, #517699);
$navbar-bg: theme-override-value(
  $theme-name,
  "navbar-bg",
  $navbar-default
) !default;

$white: #ffffff !default;
$gray-900: #212529 !default;
$body-contrast-bg: if(variable-exists(body-bg), $body-bg, $white);
$body-contrast-color: if(variable-exists(body-color), $body-color, $gray-900);
$navbar-fg: if(
  $navbar-bg == transparent,
  theme-override-value(
    $theme-name,
    "navbar-fg",
    theme-contrast($body-contrast-color, $body-contrast-bg)
  ),
  theme-override-value(
    $theme-name,
    "navbar-fg",
    theme-contrast($navbar-bg, $navbar-bg)
  )
) !default;

$navbar-hl: theme-override-value(
  $theme-name,
  "navbar-hl",
  if(
    variable-exists(link-color),
    theme-contrast($link-color, $navbar-bg),
    $navbar-fg
  )
) !default;
$navbar-brand: theme-override-value(
  $theme-name,
  "navbar-brand",
  $navbar-fg
) !default;
$navbar-brand-hl: theme-override-value(
  $theme-name,
  "navbar-brand-hl",
  $navbar-hl
) !default;

$navbar-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-fg}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
$navbar-togger-border-color: rgba($navbar-fg, 0.4);
$navbar-hover-color: rgba($navbar-hl, 0.8);
$navbar-disabled-color: rgba($navbar-fg, 0.75);

// We omit the !default here b/c the dark and light variants
// are not meaningful in our usage of bootstrap. Instead, we will explicitly
// manage these using the above documented variables
$navbar-dark-bg: $navbar-bg;
$navbar-dark-color: $navbar-fg;
$navbar-dark-hover-color: $navbar-hover-color;
$navbar-dark-active-color: $navbar-hl;
$navbar-dark-disabled-color: $navbar-disabled-color;
$navbar-dark-toggler-icon-bg: $navbar-toggler-icon-bg;
$navbar-dark-toggler-border-color: $navbar-togger-border-color;

$navbar-light-bg: $navbar-bg;
$navbar-light-color: $navbar-fg;
$navbar-light-hover-color: $navbar-hover-color;
$navbar-light-active-color: $navbar-hl;
$navbar-light-disabled-color: $navbar-disabled-color;
$navbar-light-toggler-icon-bg: $navbar-toggler-icon-bg;
$navbar-light-toggler-border-color: $navbar-togger-border-color;

$navbar-light-brand-color: $navbar-brand;
$navbar-light-brand-hover-color: $navbar-brand-hl;
$navbar-dark-brand-color: $navbar-brand;
$navbar-dark-brand-hover-color: $navbar-brand-hl;

// Sidebar coloring
$sidebar-bg: if(variable-exists(light), $light, #fff) !default;
$sidebar-fg: null;
@if $sidebar-bg == transparent {
  $sidebar-fg: theme-contrast($body-contrast-color, $body-contrast-bg) !default;
} @else {
  $sidebar-fg: theme-contrast($body-contrast-color, $sidebar-bg) !default;
}
$sidebar-hl: null;
$sidebar-font-size: 0.925rem !default;
$sidebar-font-size-section: 0.875rem !default;
$sidebar-font-size-collapse: 1rem !default;
$sidebar-font-size-section-collapse: 1.1rem !default;
$sidebar-border: false !default;

// Footer coloring
$footer-bg: if(variable-exists(body-bg), $body-bg, #fff) !default;
$footer-fg: theme-contrast($footer-bg, $footer-bg, "AA") !default;
$footer-font-size: 0.825em !default;
$footer-left-font-size: $footer-font-size !default;
$footer-center-font-size: $footer-font-size !default;
$footer-right-font-size: $footer-font-size !default;

// Disable default grid system and switch to CSS grid
$enable-grid-classes: false;
$enable-cssgrid: true;

$zindex-pagelayout: 998;

$popover-bg: if(variable-exists(body-bg), $body-bg, null) !default;
$input-bg: if(variable-exists(body-bg), $body-bg, null) !default;

// Note that 'default' is intentionally omitted from this
// because we're using the default value if one is defined at this
// point (the if variable exists check in the default).
// This is a change to override the input border color for
// darkly, which sets the border color to the body color for
// whatever reason.
$input-border-color: theme-override-value(
  $theme-name,
  "input-border-color",
  if(variable-exists(input-border-color), $input-border-color, null)
);
