/*
 * Aplós v3.0.0 (https://aplos.gxbs.me/)
 * Copyright 2024-present Gabriel Cozma
 * Licensed under MIT License (https://github.com/aplosdev/aplos/blob/main/LICENSE)
 *
 * A VitePress theme (https://vitepress.dev) & inspired by Duckquill (https://duckquill.daudix.one)
 */

@use "common";
@use "medias";
@use "typography";
@use "colors";
@use "variables";

/* Components */

@use "components/cards";
@use "components/semantics";
@use "components/table";
@use "components/images";
@use "components/links";
@use "components/list";

/* Plugins */

@import url("https://raw.githubusercontent.com/aplosdev/plugins/main/index.scss");

:root {
  --content-width: 58rem;
}

*,
::before,
::after {
  box-sizing: border-box;
}

body {
  grid-template-rows: auto minmax(auto, 1fr) auto;
  background-color: var(--color-background);
  min-height: 100vh;
  scroll-behavior: smooth;
  font-size: 1rem;
  line-height: 1.5;
}

main {
  margin: 7.5% auto 4%;
  width: 60vw;
  max-width: var(--content-width);
}

html {
  scroll-behavior: smooth;
  accent-color: var(--color-accent);
}

.lang {
  position: absolute;
  right: 1.5rem;
  transition: all 0.25s ease;
  margin-top: 0.825rem;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.vp-code:hover .lang {
  display: none;
}

:focus-visible {
  animation: focus-in 0.2s;
  outline: 0.125rem solid var(--color-accent);
  outline-offset: 2px;
}

@supports not selector(:focus-visible) {
  :focus {
    animation: focus-in 0.2s;
    outline: 0.125rem solid var(--color-accent);
    outline-offset: 2px;

    @keyframes focus-in {
      from {
        outline: 0.5rem solid transparent;
        outline-offset: 0.25rem;
      }
    }
  }
}

/* Miscellaneous */

.table-of-contents {
  -webkit-backdrop-filter: blur(0.625rem);
  position: fixed;
  top: 9.375rem;
  left: 3%;
  z-index: 9999;
  background-color: var(--color-header-hover);
  border: 0.0625rem solid var(--color-border);
  backdrop-filter: blur(0.625rem);
  border-radius: 1rem;
  padding: 1.625rem 1.5625rem;
  overflow: hidden;
  text-align: left;

  ul {
    margin: 0 0 0 0.9375rem;
    padding: 0;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    list-style-type: decimal;

    &:first-child::before {
      display: block;
      margin-bottom: 0.625rem;
      content: "Table of Contents";
      color: var(--color-text-secondary);
      font-weight: 700;
      font-size: 0.95rem;
      text-align: center;
    }

    li {
      margin: 0.3rem 0;
      text-align: left;

      ul li {
        list-style-type: disc;
      }

      a {
        display: block;
        transform: scale(1);
        transition:
          color 0.7s ease,
          transform 100ms ease;
        margin: 0 0.3125rem;
        font-weight: 600;
        font-size: 0.875rem;
        letter-spacing: -0.045rem;
        text-align: left;
        text-decoration: underline solid var(--color-accent);

        &:hover {
          color: var(--color-accent);
        }

        &:active {
          transform: scale(0.9);
          color: var(--color-accent);
        }

        &.active {
          color: var(--color-accent);
        }
      }
    }
  }
}

button.copy,
.header-anchor {
  display: none;
  /* Needs to be written */
}
