/* etcd-docsy full file override: we're not tracking changes to the docsy file of the same name. */

.td-home {
  h1 {
    // @extend .display-1;
    margin-bottom: 2.5rem;
    text-align: center;
  }

  h2 {
    // @extend .display-2;
    margin-bottom: 1.5rem;
    text-align: center;
  }

  h3 {
    //@extend .display-3;
  }

  h4 {
    // @extend .display-4;
    margin-bottom: 1rem;
  }

  .home--top-section {
    text-align: center;
  }

  .cncf-logo {
    width: 20rem;
    max-width: 80%;
  }

  .site-logo {
    max-height: 8rem;
    max-width: 65%;
  }
}

// Components and objects

.c-features {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;

  h3 {
    color: $etcd-dark-blue;
  }
}

.o-features__feature {
  display: inline-flex;
  flex-direction: column;

  margin-bottom: 1.5rem;
  padding-left: 1rem;
  padding-right: 1rem;

  h3 {
    margin-bottom: 1.5rem;
  }
}

.o-feature__icon {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem;
  max-width: 15rem;
  max-height: 10rem;
}

.o-icon {
  margin-right: 0.25rem;
}

.used-by-logo {
  max-height: 4rem;
  max-width: 100%;
}

.c-used-by__users {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: -3rem;
}

.c-used-by__user {
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-bottom: 3rem;
}

@include media-breakpoint-up(sm) {
  .c-features {
    padding-right: 3rem;
    padding-left: 3rem;
  }
}

@include media-breakpoint-up(md) {
  .c-features {
    flex-direction: row;
  }

  .c-used-by__users {
    flex-direction: row;
    justify-content: between;
  }

  .c-used-by__user {
    padding-bottom: 1.5rem;
  }
}

// Bootstrap and Docsy overrides

.alert > p:last-child {
  margin-bottom: 0;
}

// Utilities

.bg-gray-100 {
  background-color: $gray-100;
}

// Fixes https://github.com/etcd-io/website/issues/266: the docsy partial
// shouldn't be hard coding styles by using classes like "text-uppercase". This
// overrides the docsy styling.
.navbar-brand > .text-uppercase {
  text-transform: initial !important;
}


// Layout
.l-container--padded {
  padding-top: 2rem;
  padding-bottom: 2rem;
}


// DOCS

.td-toc {
  padding-top: 1rem;
}

// Extend the sidebar to the end of the visible page.
.td-sidebar-toc {
  height: initial;
  padding-top: 4.75rem;
}

.td-sidebar-nav__section {
  .ul-1 ul { padding-left: 1rem; }
  .ul-2 { padding-left: 0 !important; }
}

// Custom in-page toc. Apply this class as a modifier on top of the Docsy-provided .td-toc
.td-toc--inline {
  padding-top: 0;
  padding-bottom: 1rem;
  border-left: none;
  position: static;
  height: auto;

  & + .td-content {
    margin-top: 1.5rem;
  }

  // Workaround to prevent the first three entries from being hidden
  & #td-content__toc.collapse:not(.show) {
    display: block;
    overflow: hidden;
    min-height: 5.5rem;
    height: 5.5rem;
  }

  & #td-content__toc.collapsing {
    height: 5rem;
  }

  & #td-content__toc.collapse:not(.show) + #td-content__toc-link-expanded::before,
  & #toc-contents.collapse:not(.show) + #td-content__toc-link-expanded::before {
    content: "…";
  }

  & #td-content__toc.collapse.show + #td-content__toc-link-expanded::before,
  & #toc-contents + #td-content__toc-link-expanded::before {
    content: "\2303";
  }
}

#td-content__toc-link span i.fa-chevron-right {
  transition: transform 250ms ease-in-out;
}

#td-content__toc-link[aria-expanded="true"] span i.fa-chevron-right {
  transform: rotate(-90deg);
}

#td-content__toc-link-expanded {
  background-color: $gray-200;
}

// add icon to signify that a link is external
// from https://fontawesome.com/v5.15/icons/external-link-alt?style=solid

.td-content a[href^="http://"]:after,
.td-content a[href^="https://"]:after {
  @extend .fas;
  font-size: 50%;
  margin-left: 1px;
  opacity: 0.8;
  vertical-align: text-top;
  content: fa-content($fa-var-external-link-alt);
}

.card-title {
  .fab::before, .fas::before { margin-right: .5rem; }
}

// ************************************
// Version menu
// ************************************

.cncf-vers-menu--item {
  &:hover {
    background: $primary;
    color: white;
  }
}

.cncf-vers-menu--item__not-found {
  color: $gray-600;
  &:hover {
    background: lighten($primary, 60%);
    color: $gray-900;
  }
  &:after {
    @extend .fas;
    font-size: .8rem;
    padding-left: 6px;
    content: fa-content($fa-var-home);
    color: lighten($primary, 15%);
  }
}
