@use "@beeline/design-tokens/scss/tokens/globals/colors";
@use "@beeline/design-tokens/scss/tokens/themes";
@use '@beeline/design-tokens/scss/tokens/themes/theme-variables' as *;

.custom-block {
  padding: 24px;
    
  &-title {
    font-size: 17px !important;
    line-height: 22px !important;
    font-weight: 700 !important;
    letter-spacing: .2px !important;
    margin-bottom: 12px;
  }

  &.tip a {
    color: #1a73e8;

    &:hover {
      color: #1a73e8;
    }
  }
}

.custom-block {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 24px 24px 24px 64px;
  line-height: 24px;
  font-size: var(--vp-custom-block-font-size);
  color: var(--vp-c-text-2);

  &.custom-block.details {
    padding: 0px;
  }
}

.custom-block.info {
  border-color: var(--vp-custom-block-info-border);
  color: var(--vp-custom-block-info-text);
  background-color: var(--vp-custom-block-info-bg);
}

.custom-block.info a,
.custom-block.info code {
  color: var(--vp-c-brand-1);
}

.custom-block.info a:hover,
.custom-block.info a:hover > code {
  color: var(--vp-c-brand-2);
}

.custom-block.info code {
  background-color: var(--vp-custom-block-info-code-bg);
}

.custom-block.note {
  border-color: var(--vp-custom-block-note-border);
  color: var(--vp-custom-block-note-text);
  background-color: var(--vp-custom-block-note-bg);
}

.custom-block.note a,
.custom-block.note code {
  color: var(--vp-c-brand-1);
}

.custom-block.note a:hover,
.custom-block.note a:hover > code {
  color: var(--vp-c-brand-2);
}

.custom-block.note code {
  background-color: var(--vp-custom-block-note-code-bg);
}

.custom-block.tip {
  border-color: var(--vp-custom-block-tip-border);
  color: var(--vp-custom-block-tip-text);
  background-color: var(--vp-custom-block-tip-bg);

  &::before {
    height: 24px;
    width: 24px;
    background-image: var(--vp-icon-clock);
    position: absolute;
    left: 24px;
    content: '';
  }
}

.custom-block.tip a,
.custom-block.tip code {
  color: var(--vp-c-tip-1);
}

.custom-block.tip a:hover,
.custom-block.tip a:hover > code {
  color: var(--vp-c-tip-2);
}

.custom-block.tip code {
  background-color: var(--vp-custom-block-tip-code-bg);
}

.custom-block.important {
  border-color: var(--vp-custom-block-important-border);
  color: var(--vp-custom-block-important-text);
  background-color: var(--vp-custom-block-important-bg);
}

.custom-block.important a,
.custom-block.important code {
  color: var(--vp-c-important-1);
}

.custom-block.important a:hover,
.custom-block.important a:hover > code {
  color: var(--vp-c-important-2);
}

.custom-block.important code {
  background-color: var(--vp-custom-block-important-code-bg);
}

.custom-block.warning {
  border-color: var(--vp-custom-block-warning-border);
  color: var(--vp-custom-block-warning-text);
  background-color: var(--vp-custom-block-warning-bg);

  &::before {
    height: 24px;
    width: 24px;
    background-image: var(--vp-icon-info-circled);
    position: absolute;
    left: 24px;
    content: '';
  }
}

.custom-block.warning a,
.custom-block.warning code {
  color: $color-text-link;
}

.custom-block.warning a:hover,
.custom-block.warning a:hover > code {
  color: $color-text-link;
}

.custom-block.warning code {
  background-color: var(--vp-custom-block-warning-code-bg);
}

.custom-block.danger {
  border-color: var(--vp-custom-block-danger-border);
  color: var(--vp-custom-block-danger-text);
  background-color: var(--vp-custom-block-danger-bg);

  &::before {
    height: 24px;
    width: 24px;
    background-image: var(--vp-icon-warning-triangle);
    content: '';
    position: absolute;
    left: 24px;
  }
}

.custom-block.danger a,
.custom-block.danger code {
  color: var(--vp-c-danger-1);
}

.custom-block.danger a:hover,
.custom-block.danger a:hover > code {
  color: var(--vp-c-danger-2);
}

.custom-block.danger code {
  background-color: var(--vp-custom-block-danger-code-bg);
}

.custom-block.caution {
  border-color: var(--vp-custom-block-caution-border);
  color: var(--vp-custom-block-caution-text);
  background-color: var(--vp-custom-block-caution-bg);
}

.custom-block.caution a,
.custom-block.caution code {
  color: var(--vp-c-caution-1);
}

.custom-block.caution a:hover,
.custom-block.caution a:hover > code {
  color: var(--vp-c-caution-2);
}

.custom-block.caution code {
  background-color: var(--vp-custom-block-caution-code-bg);
}

.custom-block.details {
  border-color: var(--vp-custom-block-details-border);
  color: var(--vp-custom-block-details-text);
  background-color: transparent;
  border-radius: 12px;
  border: 1px solid $color-border;

  pre {
    border: none !important;
    
  }

  div {
    margin: 0 !important;
  }

  &:open {
    &.custom-block.details summary {
      background-color: $color-background-base-hover;
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;

      &::before {
        background-image: var(--vp-icon-nav-arrow-up);
      }
    }
  }
}

.custom-block.details a {
  color: var(--vp-c-brand-1);
}

.custom-block.details a:hover,
.custom-block.details a:hover > code {
  color: var(--vp-c-brand-2);
}

.custom-block.details code {
  background-color: var(--vp-custom-block-details-code-bg);
}

.custom-block-title {
  font-weight: 600;
}

.custom-block p + p {
  margin: 8px 0;
}

.custom-block.details summary {
  margin: 0;
  padding: 24px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  font-size: 19px;
  line-height: 24px;
  letter-spacing: 0.2px;
  display: block;

  &::before {
    position: absolute;
    right: 24px;
    content: '';
    background-image: var(--vp-icon-nav-arrow-down);
    height: 24px;
    width: 24px;
  }
}

.custom-block.details {
  h1, h2, h3, h4, h5, ul, p {
    margin: 0 24px;

    &:last-child {
      margin-bottom: 24px !important;
    }

    &:first-child {
      margin-top: 24px !important;
    }
  }

  ol {
    padding: 0 24px;

    &:last-child {
      margin-bottom: 24px !important;
    }

    &:first-child {
      margin-top: 24px !important;
    }
  }
}

.custom-block.details summary + p {
  padding: 24px;
  margin: 0;
}

.custom-block a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.25s;
}

.custom-block a:hover {
  opacity: 0.75;
}

.custom-block code {
  font-size: var(--vp-custom-block-code-font-size);
}

.custom-block.custom-block th,
.custom-block.custom-block blockquote > p {
  font-size: var(--vp-custom-block-font-size);
  color: inherit;
}


