@import "./docs-config.css";
@import "./docs-types.css";

.docslayout {
  transition: background-color 0.3s;
}

.docslayout-root {
  margin-inline: 0.618rem;
  margin-top: 3.5rem;
  display: flex;
  justify-content: center;
  flex-direction: row;
  flex-grow: 1;
  transition: filter 0.3s;
}

.docslayout-inner {
  flex-grow: 1;
  overflow-wrap: anywhere;
}

.docs {
  display: flex;
  flex-direction: row;
}

.dim-content-toc .docslayout-root,
.dim-content-nav .docslayout-root {
  filter: brightness(50%);
  pointer-events: none;
}

:not(html.dark) > .dim-content-toc,
:not(html.dark) > .dim-content-nav {
  background-color: #909090;
}

.docs-content {
  flex-grow: 1;

  & section {
    margin-block: 1.618rem;

    &:nth-child(2) {
      margin-top: 0;
    }
  }

  & p,
  h1,
  h2,
  h3,
  h4,
  h5 {
    margin-block: 0.618rem;
  }

  & hr {
    margin-top: 0;
    margin-bottom: 0.318rem;
  }
}

.c-breadcrumbs {
  --color-link-breadcrumbs: hsl(var(--link));
  margin-top: 0.5rem;
  margin-bottom: 0.318rem;
  max-width: 100svw;
}

.heading {
  & > [id] {
    width: max-content;
  }

  & .heading-hashtag {
    display: inline-block;
    margin-right: 0.1rem;

    & svg {
      width: 1.2em;
      height: 1.2em;
      opacity: 0.5;
      transition: opacity 0.5s;

      &:hover {
        opacity: 1;
        cursor: pointer;
      }
    }
  }

  & .heading-text {
    display: inline-block;
    vertical-align: top;
  }
}

hr {
  opacity: 0.3;
}

ul {
  margin-left: 2.478rem;
}

.markdown-alert {
  margin-block: 0.618rem;

  & > *:not(:first-child) {
    margin-block: 0.724rem;
  }
}

.markdown-alert-title {
  text-transform: lowercase;
  text-transform: capitalize;
  margin-block: 0 !important;
}

@media (min-width: 40rem) {
  .docs-content {
    margin-inline: 1.272rem;

    & p {
      margin-block: 1.217rem;
    }
  }

  .c-breadcrumbs {
    margin-top: 1.056rem;
    margin-inline: 1.272rem;
  }
}

@media (min-width: 85rem) {
  .docslayout-inner {
    max-width: 80rem;
  }

  .docs {
    display: flex;
    flex-direction: row;
  }

  .docslayout-inner {
    min-width: 33.8rem;
  }
}

.docs-collapsible {
  background-color: hsl(var(--white) 40% 50% / 0.1);
  border-radius: 0.618rem;
  overflow: hidden;

  & summary {
    padding: 1.2rem;
    user-select: none;
    box-shadow: 0 0 0.5rem 0px rgba(0deg 0% 0% / 0.25);

    &:hover {
      background-color: hsl(250deg 11% 100% / 0.06);
      cursor: pointer;
    }

    & > div {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 0.1em;
      font-size: 1.117rem;
      font-weight: 500;

      & svg {
        transition: transform 0.3s ease;
        font-size: 1.1em;
      }
    }
  }

  & .accordion-container > div {
    padding: 0 1.2rem;
  }
}

.docs-collapsible[open]:not(.closing) {
  & summary {
    background-color: hsl(250deg 11% 100% / 0.03);
    &:hover {
      background-color: hsl(250deg 11% 100% / 0.06);
      cursor: pointer;
    }

    & div > svg {
      transform: rotate(90deg);
    }
  }
}
