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

// Assign theme color
$themeColor = #818cf8

:root {
  --vp-c-brand: $themeColor
  --vp-c-brand-light: tint($themeColor, 20%)
  --vp-c-brand-lighter: tint($themeColor, 40%)
  --vp-c-brand-lightest: tint($themeColor, 60%)
  --vp-c-brand-dark: shade($themeColor, 25%)
  --vp-c-brand-darker: shade($themeColor, 50%)
  --vp-c-brand-darkest: shade($themeColor, 75%)
  --vp-c-brand-dimm: alpha($themeColor, 0.08)
}

/**
 * Dark/Light Theme Overrides
 * -------------------------------------------------------------------------- */

html:not(.dark) {
  img[data-mode="darkmode-only"] {
    display: none !important

    & + figcaption {
      display: none !important
    }
  }
}

.dark {
  img[data-mode="lightmode-only"] {
    display: none !important

    & + figcaption {
      display: none !important
    }
  }
}

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

:root {
  --vp-button-brand-bg: var(--vp-c-brand-darker)
}

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

:root {
  --vp-home-hero-name-color: transparent
  --vp-home-hero-name-background: -webkit-linear-gradient(120deg, var(--vp-c-brand) 30%, var(--vp-c-brand-dark))
  --vp-home-hero-image-background-image: linear-gradient(-45deg, var(--vp-c-brand-light) 50%, var(--vp-c-brand-lighter) 50%)
  --vp-home-hero-image-filter: blur(40px)
}

.dark {
  --vp-home-hero-image-background-image: linear-gradient(-45deg, var(--vp-c-brand-darker) 25%, var(--vp-c-brand-darkest) 25%)
}

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

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

.VPFooter {
  .divider {
    color: var(--vp-c-divider)
  }
}

/**
 * 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)
  --vp-custom-block-info-bg: #212127
}

.plugin-tabs {
  &--content {
    padding: 2rem !important
  }
}

/**
 * Component: Algolia
 * -------------------------------------------------------------------------- */

.DocSearch {
  --docsearch-primary-color: var(--vp-c-brand) !important
}

.VPImage.image-src {
  border-radius: 8px
}

/**
 * Component: LocalSearch
 */

.VPLocalSearchBox {
  --vp-local-search-highlight-bg: var(--vp-c-brand-soft)
  --vp-local-search-highlight-text: var(--vp-c-brand-dark)
}

.dark .VPLocalSearchBox {
  --vp-local-search-highlight-text: var(--vp-c-brand-lightest)
}

/**
 * Component: Image Figure
 * -------------------------------------------------------------------------- */

// Shitty method to give elevation to image - TO BE REPLACED

main figure {
  margin: 2rem 0
  transition: transform var(--vp-tt)

  img {
    margin: 0 auto
    border-radius: 12px
    box-shadow: 2px 2px 8px 4px var(--vp-c-bg-alt)
  }

  figcaption {
    text-align: center
    margin-top: 1.25rem
    font-size: 0.875rem
    color: var(--vp-c-text-2)
  }

  & > a .external-link-icon {
    display: none
  }
}

main :where(h1, h2, h3, h4, h5, h6) + figure {
  margin-top: 1.5rem
}

.custom-block {
  figure figcaption {
    color: inherit
  }

  &.tip figure img {
    --vp-c-bg-alt: var(--vp-custom-block-tip-bg)
  }
}

/**
 * Component: Links
 * -------------------------------------------------------------------------- */

@media print {
  figure:has(img)>a[href^="http://"]:after,
  figure:has(img)>a[href^="https://"]:after {
    content: ""
  }
}

.vp-doc a {
  text-decoration: none

  &:hover {
    text-decoration: underline
    text-underline-offset: 2px
  }
}

/**
 * Component: Shortcodes
 * -------------------------------------------------------------------------- */

.navigation {
  color: var(--vp-c-green-2)
  font-weight: 600

  &:hover {
    color: var(--vp-c-green-1)
    cursor: default
  }

  svg,
  span.name {
    vertical-align: middle // Align both SVG and <span> vertically
    position: relative
    bottom: 1px
  }

  svg {
    fill: currentColor
    height: 1em
    width: 1em
    display: inline-block
    margin-right: 4px
  }
}

/**
 * Component: Element Plus
 */

body {
  --el-color-primary: var(--vp-c-brand-1)
}

/**
 * Component: Appearance Switch
 */

.menu + .appearance::before {
  margin-right: 8px !important
}

.appearance + .social-links::before {
  margin-left: 8px !important
}

.VPMenu .CustomSwitchAppearance {
  margin-right: -8px
}

/**
 * Component: Forks page
 */

.forks .VPFeatures {
  padding: 2rem 0 !important

  .VPLink:hover {
    text-decoration: none
  }

  .title {
    line-height: 24px
    font-size: 16px
    font-weight: 600
    margin: 0
    border-top: none
    padding-top: 0
    letter-spacing: 0
    color: var(--vp-c-text-1)
  }
}

@media (min-width 640px) {
  .forks .item.grid-4 {
    width: 50% !important
  }
}
