/*
 * A long document's contents, beside its text (shared/_report_nav): a rail
 * on the left, sticky and scrolling on its own from 1024px, a closed
 * disclosure above the text below that. The quarterly report
 * (pages/quarterly_reports/show) and the filing reader
 * (companies/filing_documents/_document) both read by it.
 *
 * `.report-layout` is the two columns, the rail and the text.
 */
@layer components {
  .report-layout {
    @media (width >= 1024px) {
      display: grid;
      grid-template-columns: 16rem minmax(0, 1fr);
      gap: var(--space-2xl);
      align-items: start;
    }
  }

  .report-nav {
    padding-block: var(--space-md);
    font-family: var(--font-ui);
    font-size: var(--text-ui-sm);
    line-height: var(--leading-ui-sm);

    @media (width >= 1024px) {
      position: sticky;
      inset-block-start: 0;
      max-block-size: 100vh;
      overflow-y: auto;
      overscroll-behavior: contain;
    }
  }

  .report-nav__disclosure {
    border-block: var(--rule-hairline);

    @media (width >= 1024px) {
      border-block: 0;

      &::details-content {
        content-visibility: visible;
        block-size: auto;
      }
    }
  }

  .report-nav__summary {
    padding-block: var(--space-xs);
    font-weight: var(--weight-semibold);
    cursor: pointer;

    @media (width >= 1024px) {
      display: none;
    }
  }

  .report-nav__list {
    margin: 0;
    padding: 0 0 var(--space-sm);
    list-style: none;
  }

  .report-nav__item {
    padding-block: var(--space-3xs);
  }

  .report-nav__item--part {
    margin-block-start: var(--space-sm);
    padding-block-start: var(--space-xs);
    border-block-start: var(--rule-heavy);
    font-weight: var(--weight-semibold);
  }

  .report-nav__item--sub {
    padding-inline-start: var(--space-md);
    color: var(--color-ink-muted);
  }

  .report-nav__link {
    color: inherit;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }

    /* The section being read (report_nav_controller): ink, heavier, and
       underlined as a current tab is. */
    &[aria-current] {
      color: var(--color-ink);
      font-weight: var(--weight-semibold);
      text-decoration: underline;
      text-decoration-thickness: 2px;
      text-underline-offset: 0.2em;
    }
  }
}
