/* Fix anchor link scrolling to account for fixed header. */
html {
    scroll-padding-top: 5rem;
}

/* OVERRIDE: Prevent margin collapse on headings. */
h1, h2, h3, h4, h5, h6 {
    border-top: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    margin: 0 auto !important;
    padding-top: 2rem !important;
    padding-bottom: 1rem !important;
}

/* Restore tight spacing between breadcrumbs and page title. */
.page .title-assembly h1.title, .section .title-assembly h1.title, .taxonomy .title-assembly h1.title {
    padding-top: 0 !important;
}

.page .title-assembly {
  margin-bottom: 1.4em;
}

/* Set up for Antora TOC sidebar. */
@media screen and (min-width: 1024px) {
  .body {
    display: flex;
  }
  
  .section {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    position: relative; /* allow absolute-positioned nav to anchor here */
  }
}

/* Porting note:
    * Antora ".container" -> es-style ".container". 
    * Antora ".content" -> es-style ".page".
*/
@media screen and (max-width: 1023.5px) {
  aside.toc.sidebar {
    display: none;
  }

  .container > .page {
    margin: 0 1rem;
    overflow-x: auto;
  }
}

@media screen and (min-width: 1024px) {
  .container {
    flex: auto;
    min-width: 0; /* min-width: 0 required for flexbox to constrain overflowing elements */
    display: flex;
    flex-direction: column;
    width: 100%; /* allow content to span underneath nav */
  }

  .container > .page {
    display: flex;
    flex-direction: column;
  }

  aside.toc.embedded {
    display: none;
  }

  aside.toc.sidebar {
    flex: 0 0 var(--toc-width);
    order: 1;
  }
}

section.section {
  padding: 0 !important;
}

section .container {
  margin-top: 1rem;
}

/* Fix larger first paragraph. Antora wraps every paragraph in a div which means they're all first-of-type. Not quite what we want. */
.page #es-content p:first-of-type, .section #es-content p:first-of-type, .taxonomy #es-content p:first-of-type {
    font-size: 100%;
}

#es-content #preamble div.paragraph:first-of-type, #es-content > div.paragraph:first-of-type {
    font-size: 115%;
}

/* Restore tighter spacing in CTA block. */
cta h2, cta h3, cta h4 {
    margin: 0 auto !important;
    padding: .5em 0 0 !important;
}

/* Fix URL for endmark background. */
.page .es-endmark .es-endmark-inner, .section .es-endmark .es-endmark-inner, .taxonomy .es-endmark .es-endmark-inner {
    background-image: url("/_/img/endmark-background.png");
}

.page-date {
    padding-top: .2em;
}

/* Doc anchor link from Antora default UI -- Add to Zola? */
.page h1 .anchor,
.page h2 .anchor,
.page h3 .anchor,
.page h4 .anchor,
.page h5 .anchor,
.page h6 .anchor {
  position: absolute;
  text-decoration: none;
  width: 1.75ex;
  margin-left: -1.5ex;
  visibility: hidden;
  font-size: 0.8em;
  font-weight: normal;
  padding-top: 0.05em;
}

.page h1 .anchor::before,
.page h2 .anchor::before,
.page h3 .anchor::before,
.page h4 .anchor::before,
.page h5 .anchor::before,
.page h6 .anchor::before {
  font-size: 1.2rem;
  content: "\00a7";
}

.page h1:hover .anchor,
.page h2:hover .anchor,
.page h3:hover .anchor,
.page h4:hover .anchor,
.page h5:hover .anchor,
.page h6:hover .anchor {
  visibility: visible;
}

/* Pagination adapted from Antora default UI -- Add to Zola template? */
nav.pagination {
    font-family: expo-sans-pro,sans-serif;
    font-size: 90%;
    max-width: 40rem;
    width: 100%;
    display: flex;
    line-height: 1;
    margin: 2rem auto;
    padding: 0.75rem 1rem 0;
}

nav.pagination span {
    display: flex;
    flex: 1;
    flex-direction: column;
}

nav.pagination .prev {
    padding-right: 0.5rem;
    text-align: left;
}

nav.pagination .next {
    padding-left: 0.5rem;
    text-align: right;
}

nav.pagination span::before {
    color: #888;
    font-size: 0.75em;
    padding-bottom: 0.1em;
}

nav.pagination .prev::before {
    content: "Previous";
}

nav.pagination .next::before {
    content: "Next";
}

nav.pagination a {
    font-weight: bold;
    line-height: 1.3;
    position: relative;
}

nav.pagination a::before,
nav.pagination a::after {
    color: #888;
    font-weight: normal;
    font-size: 1.5em;
    line-height: 0.75;
    position: absolute;
    top: 0;
    width: 1rem;
}

nav.pagination .prev a::before {
    content: "\2039";
    transform: translateX(-100%);
}

nav.pagination .next a::after {
    content: "\203a";
}

/* Top-align pagination links when they have different heights */
nav.pagination {
  align-items: flex-start;
}

/* TOC menu */
@media screen and (max-width: 1023.5px) {
  html.is-clipped--nav {
    overflow-y: hidden;
  }
}

.nav-container {
  font-family: expo-sans-pro,sans-serif;
  position: fixed;
  top: 0; /* var(--navbar-height); */
  left: 0;
  width: 100%;
  font-size: 85%; /* calc(17 / var(--rem-base) * 1rem); */
  z-index: 1;
  visibility: hidden;
}

@media screen and (min-width: 769px) {
  .nav-container {
    width: calc(8vw + 5rem); /* var(--nav-width); */
  }
}

@media screen and (min-width: 1024px) {
  .nav-container {
    font-size: 80%;
    flex: none;
    position: absolute; /* overlap the content horizontally */
    left: 0;
    top: 0;
    bottom: 0; /* stretch to section height */
    z-index: 2;
    visibility: visible;
    background: #ddd; /* var(--nav-background); */
    overflow: hidden;
  }
}
.nav-container.is-active {
  visibility: visible;
}

.nav {
  position: relative;
  top: 3.5rem; /* var(--toolbar-height); */
  height: calc(100vh - 3.5rem); /* var(--nav-height); */
}

@media screen and (min-width: 769px) {
  .nav {
    box-shadow: 0.5px 0 3px #aaa; /* var(--nav-border-color); */
  }
}

@media screen and (min-width: 1024px) {
  .nav {
    top: 0;
    box-shadow: none;
    position: absolute; /* fill nav-container */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: auto;
    display: flex;
    flex-direction: column;
  }
}

.nav a {
  color: inherit;
}

.nav .panels {
  display: flex;
  flex-direction: column;
  height: inherit;
}

.nav-panel-menu {
  overflow-y: scroll;
  overscroll-behavior: none;
  height: calc(100% - 2.5rem); /* var(--nav-panel-menu-height); */
}

@media screen and (min-width: 1024px) {
  .nav-panel-menu {
    overflow-y: visible;
  }
}

.nav-panel-menu:only-child {
  height: 100%;
}

.nav-panel-menu:not(.is-active) .nav-menu {
  opacity: 0.75;
}

.nav-panel-menu:not(.is-active)::after {
  content: "";
  /* background: rgba(0, 0, 0, 0.5); */
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.nav-menu {
  min-height: 100%;
  padding: 0.5rem 0.75rem;
  line-height: 1.35; /* var(--nav-line-height); */
  position: relative;
}

.nav-menu-toggle {
  background: transparent url(../img/octicons-16.svg#view-unfold) no-repeat center / 100% 100%;
  border: none;
  float: right;
  height: 1em;
  margin-right: -0.5rem;
  opacity: 0.75;
  outline: none;
  padding: 0;
  position: sticky;
  top: .85rem; /* calc((var(--nav-line-height) - 1 + 0.5) * 1rem); */
  visibility: hidden;
  width: 1em;
}

.nav-menu-toggle.is-active {
  background-image: url(../img/octicons-16.svg#view-fold);
}

.nav-panel-menu.is-active:hover .nav-menu-toggle {
  visibility: visible;
}

.nav-menu h3.title {
  color: #888;
  font-size: inherit;
  font-weight: 600; /* var(--body-font-weight-bold); */
  margin: 0;
  padding: 0.25em 0 0.125em;
}

.nav-container .nav .nav-list {
  list-style: none;
  margin: 0 0 0 0.75rem;
  padding: 0;
}

.nav-container .nav .nav-list li {
  list-style: none;
  margin-left: 0;
}

.nav-menu > .nav-list + .nav-list {
  margin-top: 0.5rem;
}

.nav-item {
  margin-top: 0.5em;
}

/* adds some breathing room below a nested list */
.nav-item-toggle ~ .nav-list {
  padding-bottom: 0.125rem;
}

/* matches list without a title */
.nav-item[data-depth="0"] > .nav-list:first-child {
  display: block;
  margin: 0;
}

.nav-item:not(.is-active) > .nav-list {
  display: none;
}

.nav-item-toggle {
  background: transparent url(/_/img/caret.svg) no-repeat center / 50% 60%;
  font-size: 1rem;
  border: none;
  outline: none;
  line-height: inherit;
  padding: 0;
  position: absolute;
  height: 1.35em; /* calc(var(--nav-line-height) * 1em); */
  width: 1.35em; /* calc(var(--nav-line-height) * 1em); */
  margin-top: -0.05em;
  margin-left: -1.35em; /* calc(var(--nav-line-height) * -1em); */
}

.nav-item.is-active > .nav-item-toggle {
  transform: rotate(90deg);
}

.is-current-page > .nav-link,
.is-current-page > .nav-text {
  font-weight: 600; /* var(--body-font-weight-bold); */
}

.page .admonitionblock {
  max-width: 40rem;
  margin: 1.4rem auto 0 auto;
}

.page .admonitionblock .title,
.page .exampleblock .title,
.page .imageblock .title,
.page .literalblock .title,
.page .listingblock .title,
.page .openblock .title,
.page .videoblock .title,
.page table.tableblock caption {
  color: #555;
  font-size: 1rem;
  font-style: normal;
  font-weight: 400;
  hyphens: none;
  margin-top: 3rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.075rem;
}

.page .listingblock {
  width: min(46rem, 100%);
  margin: 1.4rem auto 0 auto;
}

.page .listingblock .content {
  background: #eee;
  border: 2px solid #ddd;
  border-radius: 0.25em;
}

.page .listingblock.prefer .content {
  border-color: #60bf64;
}

.page .listingblock.avoid .content {
  border-color: #ff8080;
}

.page .listingblock code.hljs {
  margin: 0;
}

.page code,
.page kbd,
.page pre {
  font-family: "fira-code", monospace;
  font-size: 0.9em;
  padding: 0.25em 0.5em;
  hyphens: none;
}

.page .admonitionblock td.content > :not(.title):first-child,
.page .admonitionblock td.content > .title + * {
  margin-top: 0;
}

.page .admonitionblock td.content pre {
  font-size: 15rem;
}

.page .admonitionblock > table {
  table-layout: fixed;
  position: relative;
  width: 100%;
}

.page .admonitionblock td.content {
  padding: 1rem 1rem 0.75rem;
  background: #ddd;
  border-radius: 0.45rem;
  width: 100%;
  word-wrap: anywhere;
}

.page .admonitionblock td.icon {
  font-size: 80%;
  left: 0;
  line-height: 1;
  position: absolute;
  top: 0;
  transform: translate(-0.5rem, -50%);
}

/* Adjust admonition icon and prefer/avoid badge positioning on mobile to prevent clipping */
@media screen and (max-width: 1023.5px) {
  .page .admonitionblock > table {
    position: relative;
  }
  
  .page .admonitionblock td.content {
    position: static;
  }
  
  .page .admonitionblock td.icon {
    position: absolute !important;
    left: 0.75rem !important;
    top: 0 !important;
    transform: translateY(-50%) !important;
    z-index: 10;
    width: auto !important;
  }
  
  .page .listingblock.prefer .content::before,
  .page .listingblock.avoid .content::before {
    position: absolute !important;
    left: 0.75rem !important;
    top: 0 !important;
    transform: translateY(-50%) !important;
  }
  
  .page .listingblock.prefer .content,
  .page .listingblock.avoid .content {
    margin-top: 0.75rem;
  }
}

.page .admonitionblock td.icon i {
  align-items: center;
  border-radius: 0.45rem;
  display: inline-flex;
  filter: initial;
  height: 1.25rem;
  padding: 0.5rem;
  vertical-align: initial;
  width: fit-content;
}

.page .admonitionblock td.icon i::after {
  content: attr(title);
  font-family: expo-sans-pro,sans-serif;
  font-size: 80%;
  font-weight: 600;
  text-transform: uppercase;
}

.page .admonitionblock td.icon i.icon-caution {
  background-color: var(--caution-color);
  color: var(--caution-on-color);
}

.page .admonitionblock td.icon i.icon-important {
  background-color: #d32f2f;
  color: white;
}

.page .admonitionblock td.icon i.icon-note {
  background-color: #217ee7;
  color: white;
}

.page .admonitionblock td.icon i.icon-tip {
  background-color: #2e7d32;
  color: white;
}

.page .admonitionblock td.icon i.icon-warning {
  background-color: var(--warning-color);
  color: var(--warning-on-color);
}

@media screen and (min-width: 1024px) {
  .page .comments {
    width: 40rem;
  }
}

.page .listingblock.prefer .content,
.page .listingblock.avoid .content {
  margin-top: .75rem;
  position: relative;
}

.page .listingblock.prefer .content::before,
.page .listingblock.avoid .content::before {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-0.5rem, -50%);
  z-index: 10;
  font-family: expo-sans-pro, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.5rem;
  border-radius: 0.45rem;
  line-height: 1;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.page .listingblock.prefer .content::before {
  content: "Prefer";
  background-color: #2e7d32;
  color: white;
}

.page .listingblock.avoid .content::before {
  content: "Avoid";
  background-color: #d32f2f;
  color: white;
}
