/*
 * H3 section
 */

.h3-section > .body {
  & > pre {
    margin: 0;
    padding: 16px;
  }

  @media (max-width: 768px) {
    overflow-x: auto;
  }

  & {
    background: white;
    box-shadow: var(--shadow3);
  }

  /* Collapse/flush */
  @media (max-width: 480px) {
    margin: 0 -16px;
    box-shadow: var(--shadow2);
  }

  /* Border radius */
  @media (min-width: 481px) {
    & {
      border-radius: 2px;
    }

    & > :first-child {
      border-top-left-radius: 3px;
      border-top-right-radius: 3px;
    }

    & > :last-child {
      border-bottom-left-radius: 3px;
      border-bottom-right-radius: 3px;
    }
  }
}

/*
 * Heading
 */

.h3-section > h3 {
  & {
    margin-top: 8px;
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
  }

  /* Mobile: the padding below h3-section is enough */
  @media (max-width: 768px) {
    margin-top: 0;
  }

  /* Horizontal line */
  &::after {
    margin-left: 24px;
    content: '';
    display: inline-block;
    vertical-align: middle;
    width: 100%;
    height: 1px;
    background: linear-gradient(
      to right,
      color-mod(var(--brand-a) alpha(20%)),
      transparent 80%
    );
  }
}

/*
 * Children
 */

.h3-section > .body {
  & > ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
  }

  & > ul > li {
    padding: 8px;
    padding-left: calc(32px + 4px);
    position: relative;
  }

  & > ul > li > p {
    margin: 0;
    padding: 0;
  }

  & > ul > li::before {
    content: '';
    position: absolute;
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--text-mute);
    border-radius: 50%;
    left: 16px;
    top: calc(16px + 2px);
  }

  & > ul > li + li {
    border-top: solid 1px var(--line-color);
  }

  /* Paragraphs */
  & > p {
    padding: 16px;
    margin: 0;
  }

  /* Line divisions */
  & > *:not(:first-child) {
    border-top: solid 1px var(--line-color);
  }

  /* Headings in between bodies */
  & > h4 {
    @extend %ms-font-size--1;
    margin: 0;
    padding: 4px 16px;
    font-weight: normal;
    background: var(--bg-gray);
    color: var(--text-mute);

    /* & + * {
      border-top: solid 1px var(--dark-line-color);
    } */
  }

  /* Description paragraphs */
  & > pre ~ p,
  & > ul ~ p,
  & > iframe ~ p,
  & > table ~ p {
    background: var(--bg-gray);
    color: var(--text-mute);

    /* Links */
    & a,
    & a:visited {
      color: var(--text-body);
      text-decoration: none;
      border-bottom: solid 1px var(--line-color);
    }

    & a:hover {
      color: var(--brand-b);
    }
  }

  /* Collapse paragraphs together */
  & > p + p,
  & > p + p:not(:first-child) {
    margin-top: -1.5em;
    border-top: 0;
  }
}

/*
 * Variant: Prime
 */

.h3-section.-prime > .body {
  @media (min-width: 481px) {
    border-radius: 2px;
    box-shadow: var(--shadow6);
  }
}

/*
 * Variant: Also see :\
 */

ul.-also-see.-also-see.-also-see {
  & {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg-gray);
  }

  & > li {
    flex: 1 0 20%;
    padding: 24px;
    border-top: solid 1px var(--dark-line-color);
  }

  /* Separator */
  & > li + li {
    border-left: solid 1px var(--dark-line-color);
  }

  &,
  & > li {
    list-style-type: none;
  }

  & > li::before {
    display: none;
  }

  & > li > a {
    @extend %ms-font-size-1;
    display: block;
  }

  & > li > em {
    @extend %ms-font-size--1;
    display: block;
  }
}
