/* This css file is used for layout. */

@layer main, print;

@media print {

  @layer print {
    .sidebar {
      display: none;
    }

    .dragbar {
      display: none;
    }

    .color-scheme-toggle {
      display: none;
    }
    .footer {
      display: none;
    }

    .nav-button {
      display: none;
    }

    .document {
      grid-template-areas:
      'brand'
      'header'
      'content'
      'lnav';
      grid-template-columns: 1fr;

    }

    .content {
      overflow: visible;
    }
  }
}

@layer main {
body {
  margin: 0;
  width: 100vw;
}

a.headerlink {
    visibility: hidden;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
    visibility: visible;
}

h1 {
  font-size: 2.0em;
}

h2 {
  font-size: 1.5em;
}

h3 {
  font-size: 1.3em;
}

h4 {
  font-size: 1em;
}

h5 {
  font-size: 0.8em;
}

h6 {
  font-size: 0.7em;
}

div.related {
  h3 {
    display: none;
  }

  ul {
    margin: 0;
    padding: 0 0 0 10px;
    list-style: none;
  }

  li {
    display: inline;

    &.right {
      float: right;
      margin-right: 5px;
    }
  }
}

button {
  height: 2em;
}

.document {
  display: grid;

  grid-template-areas:
    'brand header header'
    'sidebar dragbar content'
    'footer footer lnav';

  grid-template-columns: var(--sidebar-width, auto) 0fr minmax(auto, var(--ndg-content-width)) 1fr;
  grid-template-rows: auto 1fr auto;

  height: 100vh;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  align-self: auto;
  padding: 0.3em;
  height: fit-content;
}

.header {
  grid-area: header;
  display: flex;
  padding: .4em;
  align-items: center;

  .breadcrumbs {
    margin-left: 0.7em;
  }
}

.searchbar {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--ndg-border);

  form {
    flex-grow: 1;
    margin: 0.5em;
    display: flex;
    border: 1px solid var(--ndg-border);
  }

  input {
    border: none;
    flex-grow: 1;
  }

  button {
    border: none;
    border-left: 1px solid var(--ndg-border);
    background-color: none;
    flex-grow: 0;
  }
}

.footer {
  grid-area: footer;
  display: flex;
  align-items: center;
}

.related {
  flex-grow: 1;
}

.color-scheme-toggle {
  flex-grow: 0;
}

.dragbar {
  display: flex;
  width: 0.6rem;
  grid-area: dragbar;
  cursor: grab;
  align-items: center;
  align-content: center;
  padding: 0;
  margin: 0;
}

.sidebarwrapper {
  grid-area: sidebar;
  overflow-y: auto;
  height: 100%;
}

.sidebar {
  padding: 0;
  white-space: nowrap;

  & ul {
    padding-left: 2em;
  }

  & .toc {
    padding: 0.4em;

    & ul {
      padding-left: 0em;
      font-weight: bold;
    }

    & ul ul {
      font-weight: normal;
      padding-left: 1.1em;
      list-style-type: disc;
    }

    & ul ul ul {
      list-style-type: circle;
    }

    & ul ul ul ul {
      list-style-type: square;
    }
  }
}

.content {
  grid-area: content;
  padding-left: 0.5em;
  padding-right: 1em;
  overflow-y: auto;
  padding-bottom: 1em;
}

.lnav {
  grid-area: lnav;
  align-items: center;
  display: flex;
  padding-top: 0.5em;
  padding-bottom: 0.5em;

  .copyright {
    flex-grow: 1;
  }

  .nav-button {
    flex-shrink: 1;
    margin-right: 0.5em;
  }
}

.root {
  section {
    p {
      font-size: 1.3em;
      font-weight: bold;
    }
  }
}

.hidden {
  display: none;
}
}

.hidden {
  display: none;
}
