@use "@/styles/variables";

$pad-lg: 3rem;
$pad-sm: 1rem;

.main {
  overflow-x: auto;
  position: relative;
  padding-right: 1rem;
}

.header {
  padding-top: 2rem;
  padding-bottom: 2rem;
  padding-left: $pad-lg;
  padding-right: $pad-lg;
  background: var(--cmm-color-surface-1);

  @include variables.mq("xl") {
    padding-left: $pad-sm;
    padding-right: $pad-sm;
  }

  &__inner {
    @include variables.container(72rem, 0);
    display: grid;
    row-gap: 1rem;
  }

  &__title {
    font-weight: var(--cmm-font-weight-bold);
    font-size: var(--cmm-font-size-4xl);
    line-height: 1.5;

    @include variables.mq("lg") {
      font-size: var(--cmm-font-size-4xl);
    }
  }

  &__description {
    color: var(--cmm-color-font-muted);
    font-weight: var(--cmm-font-weight-normal);
  }

  &__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;

    > * {
      display: inline-flex;
    }
  }
}

.markup {
  padding-bottom: 3rem;
  container-type: inline-size;

  :where(h1, h2, h3, h4, h5, h6) {
    scroll-margin-top: calc(variables.$headerHeight + 0.5rem) !important;
  }
}

.aside {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  border-top: 1px solid var(--cmm-color-border-base);
}

%panel {
  padding-top: 3rem;
  padding-left: $pad-lg;
  padding-bottom: 4rem;

  @include variables.mq("xl") {
    padding-left: $pad-sm;
  }
}

.panel {
  @extend %panel;
}

.tag {
  --cmm-Tag-icon-size: 1rem;
  --cmm-Tag-icon-margin: 0 -0.25rem 0 0;
}

.tab {
  > :global(.Tab__list) {
    background: var(--cmm-color-surface-1);
    padding-left: $pad-lg;

    @include variables.mq("xl") {
      padding-left: $pad-sm;
    }

    > :global(.Tab) {
      font-weight: var(--cmm-font-weight-medium);
    }
  }

  > :global(.Tab__panel) {
    @extend %panel;

    margin-top: 0;
  }
}

.bundleSizeTooltip {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  > div {
    display: flex;

    > dt {
      width: 3em;
    }
  }
}
