@import "remark-github-blockquote-alert/alert.css";

@import "./css-config/entry.css";
@import "./main-page.css";

@import "./docs/nav/nav.css";
@import "./docs/toc/toc.css";
@import "./docs/nav/version-select.css";
@import "./docs/docs.css";
@import "./docs/collapsible.css";

@import "./components/featurelist.css";
@import "./components/marquee.css";

.theme-toggle {
  height: 24px;
  font-size: 1.614rem;
  color: hsla(var(--signal-color) / 0.7);

  &:hover {
    cursor: pointer;
    color: hsla(var(--signal-color) / 1);
  }
}

/* color styling */
.header {
  background-color: hsl(var(--bg-400));
  box-shadow: 0 1px 1px 1px hsla(var(--white) 100 0 / 0.1);
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    box-shadow var(--theme-transition);
}

.baselayout,
.docslayout {
  background-color: hsl(var(--background));
  color: hsl(var(--secondary-900));
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition);
}

a {
  color: hsl(var(--link));
  text-decoration: none;
  transition: color var(--theme-transition);

  &:hover {
    text-decoration: underline;
    cursor: pointer;
  }
}

html.dark .baselayout,
html.dark .docslayout,
html:has(input#theme-manual-toggle:checked) .baselayout,
html:has(input#theme-manual-toggle:checked) .docslayout {
  background-color: hsl(var(--bg-900));
  color: hsl(var(--secondary-400));
}

html.dark,
html:has(input#theme-manual-toggle:checked) {
  & .header {
    background-color: hsl(var(--secondary-900));
    color: hsl(var(--secondary-500));
  }

  & .theme-toggle {
    color: hsla(var(--func-color) / 0.7);

    &:hover {
      color: hsla(var(--func-color) / 1);
    }
  }
}

/* layout and positioning */
.separator-el {
  width: 75%;
  height: 1px;
  margin-block: 0.618rem;
  background: linear-gradient(
    to right,
    transparent,
    hsl(var(--blue) 100% 59%),
    transparent
  );
}

.unset {
  all: unset;
}

[id] {
  /*offset for header*/
  scroll-margin-top: 4rem;
}

body {
  overflow: auto;
}

body.overflow-nav,
body.overflow-toc {
  overflow: hidden;
}

.search {
  display: none;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 12;
  display: flex;
  align-items: center;
  height: 3.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.header-title {
  display: block;
  font-size: 1.614em;
  font-weight: 700;
  line-height: 1.272;
}

.header-title.mobile {
  display: block;
}

.header-item {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  flex-grow: 1;
  align-items: center;
}

.header-left {
  justify-content: flex-start;
}

.header-right {
  justify-content: flex-end;
}

.header-spacer {
  height: 1.5rem;
  width: 2px;
  background-color: hsla(var(--white) 40% 50% / 0.3);
  display: block;
}

footer {
  position: relative;
  margin-top: var(--2xl);
  width: 100%;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  flex-shrink: 0;
  background: hsl(var(--footer-bkg));
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition);

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: calc(50% + 1.25rem);
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      hsl(var(--footer-bkg-border)) 100%
    );
  }

  &::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: calc(50% + 1.25rem);
    height: 1px;
    background: linear-gradient(
      90deg,
      hsl(var(--footer-bkg-border)) 0%,
      transparent 100%
    );
  }

  & .theme-toggle {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    height: max-content;
  }

  & a {
    color: hsl(var(--text-dark));
    transition: color var(--theme-transition);

    & .hint {
      transition: color var(--theme-transition);
    }

    &:nth-child(2) .hint {
      color: hsl(var(--green) 30% 45%);
    }

    &:nth-child(3) .hint {
      color: hsl(var(--blue) 30% 45%);
    }

    &:hover {
      color: hsl(var(--text));

      &:nth-child(2) .hint {
        color: hsl(var(--green) 60% 60%);
      }

      &:nth-child(3) .hint {
        color: hsl(var(--blue) 60% 66%);
      }
    }
  }

  & .credits {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    color: hsl(var(--text-dark));

    & > p {
      margin-bottom: 0.2rem;
      color: hsl(0deg 0% 40%);
    }

    & > a {
      text-decoration: none;
    }
  }

  & .links {
    justify-self: flex-end;
  }

  & .socials {
    display: flex;
    gap: 0.373rem;
    align-items: flex-start;
    font-size: 2.5rem;
  }

  & .changelog {
    display: flex;

    & a {
      text-decoration: none;
      margin-inline: auto;
    }
  }
}

@media not (min-width: 40rem) {
  footer {
    padding-inline: 0.75rem;

    & .credits > a {
      padding: 0.2rem 0;
    }
  }
}

@media (min-width: 40rem) {
  html {
    font-size: 16px;
  }
}

@media (min-width: 65rem) {
  .toc-collapsed-spacer {
    display: none;
  }
}

@media (min-width: 85rem) {
  .nav-collapsed-spacer {
    display: none;
  }
}
