/**
 * Customize default theme styling by overriding CSS variables:
 * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
 */

/**
 * Colors
 *
 * Each colors have exact same color scale system with 3 levels of solid
 * colors with different brightness, and 1 soft color.
 *
 * - `XXX-1`: The most solid color used mainly for colored text. It must
 *   satisfy the contrast ratio against when used on top of `XXX-soft`.
 *
 * - `XXX-2`: The color used mainly for hover state of the button.
 *
 * - `XXX-3`: The color for solid background, such as bg color of the button.
 *   It must satisfy the contrast ratio with pure white (#ffffff) text on
 *   top of it.
 *
 * - `XXX-soft`: The color used for subtle background such as custom container
 *   or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
 *   on top of it.
 *
 *   The soft color must be semi transparent alpha channel. This is crucial
 *   because it allows adding multiple "soft" colors on top of each other
 *   to create a accent, such as when having inline code block inside
 *   custom containers.
 *
 * - `default`: The color used purely for subtle indication without any
 *   special meanings attched to it such as bg color for menu hover state.
 *
 * - `brand`: Used for primary brand colors, such as link text, button with
 *   brand theme, etc.
 *
 * - `tip`: Used to indicate useful information. The default theme uses the
 *   brand color for this by default.
 *
 * - `warning`: Used to indicate warning to the users. Used in custom
 *   container, badges, etc.
 *
 * - `danger`: Used to show error, or dangerous message to the users. Used
 *   in custom container, badges, etc.
 * -------------------------------------------------------------------------- */


/**
 * Colors
 * -------------------------------------------------------------------------- */

:root {
  --vp-c-brand: #ae3ec9;
  --vp-c-brand-light: #da77f2;
  --vp-c-brand-lighter: #e599f7;
  --vp-c-brand-lightest: #f3d9fa;
  --vp-c-brand-dark: #9c36b5;
  --vp-c-brand-darker: #862e9c;
  --vp-c-brand-dimm: rgba(145, 71, 150, 0.08);

  --vp-local-search-highlight-bg: var(--vp-c-brand-light);
  --vp-local-search-highlight-text: var(--vp-c-bg);
}

/**
 * Component: Button
 * -------------------------------------------------------------------------- */

:root {
  --vp-button-brand-border: var(--vp-c-brand-light);
  --vp-button-brand-bg: var(--vp-c-brand);
  --vp-button-brand-hover-border: var(--vp-c-brand-light);
  --vp-button-brand-hover-bg: var(--vp-c-brand-light);
  --vp-button-brand-active-border: var(--vp-c-brand-light);
  --vp-button-brand-active-bg: var(--vp-button-brand-bg);
  --vp-button-brand-text: #eee;
}

/**
 * Component: Home
 * -------------------------------------------------------------------------- */

:root {
  --vp-home-hero-name-color: transparent;
  --vp-home-hero-name-background: linear-gradient(
    30deg,
    #be4bdb 0%,
    #7950f2 80%
  );

  --vp-home-hero-image-background-image: linear-gradient(
    -45deg,
    #cc5de845 50%,
    #845ef745 50%
  );
  --vp-home-hero-image-filter: blur(40px);
}

@media (min-width: 640px) {
  :root {
    --vp-home-hero-image-filter: blur(56px);
  }
}

@media (min-width: 960px) {
  :root {
    --vp-home-hero-image-filter: blur(72px);
  }
}

/**
 * Component: Custom Block
 * -------------------------------------------------------------------------- */

:root {
  --vp-custom-block-tip-border: var(--vp-c-brand);
  --vp-custom-block-tip-text: var(--vp-c-brand-darker);
  --vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}

.dark {
  --vp-custom-block-tip-border: var(--vp-c-brand);
  --vp-custom-block-tip-text: var(--vp-c-brand-lightest);
  --vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}

/**
 * VitePress: Custom fix
 * -------------------------------------------------------------------------- */

/*
  Use lighter colors for links in dark mode for a11y.
  Also specify some classes twice to have higher specificity
  over scoped class data attribute.
*/
.dark .vp-doc a,
.dark .vp-doc a > code,
.dark .VPNavBarMenuLink.VPNavBarMenuLink:hover,
.dark .VPNavBarMenuLink.VPNavBarMenuLink.active,
.dark .link.link:hover,
.dark .link.link.active,
.dark .edit-link-button.edit-link-button,
.dark .pager-link .title {
  color: var(--vp-c-brand-lighter);
}

.dark .vp-doc a:hover,
.dark .vp-doc a > code:hover {
  color: var(--vp-c-brand-lightest);
  opacity: 1;
}

/* Transition by color instead of opacity */
.dark .vp-doc .custom-block a {
  transition: color 0.25s;
}

.VPLocalSearchBox .result {
  --vp-c-bg-search-result: var(--vp-c-bg);
  background: var(--vp-c-bg-search-result) !important;
  padding: 4px !important;
  border: 1px solid var(--vp-c-divider) !important;
}
.VPLocalSearchBox .result.selected {
  --vp-c-bg-search-result: var(--vp-c-bg-soft) !important;
}
.VPLocalSearchBox .result .excerpt-gradient-top {
  background: linear-gradient(
    var(--vp-c-bg-search-result),
    transparent
  ) !important;
}
.VPLocalSearchBox .result .excerpt-gradient-bottom {
  background: linear-gradient(
    transparent,
    var(--vp-c-bg-search-result)
  ) !important;
}
.VPLocalSearchBox .title-icon {
  display: none;
}
.VPLocalSearchBox .excerpt-wrapper {
  margin-top: 4px;
}

.VPHomeHero .VPImage {
  border-radius: 16px;
}

.changeLog {
  padding: 16px;
  border-radius: 12px;
  background: var(--vp-c-bg-soft);
}

.vp-doc h2 {
  margin: 48px 0 16px;
  border-top: 1px solid var(--vp-c-divider);
  padding-top: 24px;
  letter-spacing: -.02em;
  line-height: 32px;
  font-size: 24px;
}
