/* 
  This file overrides and extends default VitePress theme CSS variables and styles:
  https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
*/

/* Emoji Flag Unicode Polyfill */
@font-face {
  font-family: "Flag Emoji Polyfill";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
    U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url("./CountryFlagsPolyfill.woff2") format("woff2");
  font-display: swap;
}

/* Define custom color variables, fabricmc.net brand colors, and other shared properties. */
:root {
  --vp-c-blue-1: #1662c5;
  --vp-c-blue-2: #2275da;
  --vp-c-blue-3: #5c9de4;
  --vp-c-blue-soft: rgba(52, 130, 219, 0.14);

  --vp-c-brand-1: var(--vp-c-blue-3);
  --vp-c-brand-2: var(--vp-c-blue-2);
  --vp-c-brand-3: var(--vp-c-blue-1);
  --vp-c-brand-soft: var(--vp-c-blue-soft);

  /* Override Hero Text Gradient */
  --vp-home-hero-name-color: transparent;
  --vp-home-hero-name-background: -webkit-linear-gradient(
    120deg,
    #3463fe 30%,
    #4787ff
  );

  /* Flag Emoji Polyfill (Chrome does not render county flags on windows) */
  --vp-font-family-base: "Flag Emoji Polyfill", "Inter", ui-sans-serif,
    system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
}

:root:where(:lang(zh)) {
  /* Flag Emoji Polyfill (Chrome does not render county flags on windows) */
  --vp-font-family-base: "Flag Emoji Polyfill", "Punctuation SC", "Inter",
    ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
}

/* Sidebar Scrollbar - Styles scrollbars within the side navigation pane for improved visibility. */
.VPSidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--vp-c-gray-1) var(--vp-c-bg-alt);
}

/* Custom scrollbar visuals for WebKit-based browsers */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--vp-c-bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--vp-c-gray-1);
}

/* Homepage Container - Center content and limit maximum width. */
.homepage-container {
  margin: auto;
  width: 100%;
  max-width: 1280px;
  padding: 0 24px;
}

/* Override default margin on the VitePress Home component */
.VPHome {
  margin-bottom: 0px !important;
}

/* Responsive Adjustments - Increase padding for wider screens. */
@media (min-width: 640px) {
  .homepage-container {
    padding: 0 48px;
  }
}

@media (min-width: 960px) {
  .homepage-container {
    width: 100%;
    padding: 0 64px;
  }
}

/* Local Search Box Animations - Fade in backdrop and animate search box on appearance. */
.VPLocalSearchBox > .backdrop {
  opacity: 0;
  animation: show 200ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
}

.VPLocalSearchBox > .shell {
  animation: show 400ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
  opacity: 0;
  transform: rotateX(-90deg);
  transform-origin: top center;
}

/* Medium Zoom Overlays - Increase stacking order for zoomed images and their overlay. */
.medium-zoom-overlay {
  z-index: 10000;
}

.medium-zoom-image--opened {
  z-index: 10001;
}

/* Simple keyframe animation for fading/showing elements */
@keyframes show {
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Style <kbd> elements in the search popup */
kbd:not(.DocSearch-Button-Key) {
  background-color: #eee !important;
  border-radius: 3px;
  border: 1px solid #b4b4b4;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  color: #333;
  display: inline-block;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  padding: 5px;
  white-space: nowrap;
}

/* Center images within paragraphs. */
.vp-doc > p > img,
.vp-doc > div > p > img {
  margin-left: auto;
  margin-right: auto;
}

/* Style the <h1> heading generated from the frontmatter */
h1.vp-doc {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 40px;
}

/* Custom Icons */
.vpi-versioning {
  --icon: url("data:image/svg+xml;charset=utf-8;base64,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