/**
 * TOC block styles
 */

.toc {
  margin: 1.5rem -1.5rem 2rem -1.5rem;
  padding: 1rem 1.5rem;
  background-color: #f6f7f9;
  border-top: 1px solid #dfdfdf;
  border-bottom: 1px solid #dfdfdf;
  box-shadow: 0 8px 8px -6px rgba(0, 0, 0, 0.2);
}

.toc-header {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
}

.toc-icon {
  width: 23.5px;
  height: 18px;
  margin-right: 0.5rem;
  vertical-align: -2px;
  filter: grayscale(1);
}

.toc-title {
  flex-basis: auto;
  margin: 0 !important;
  font-size: 22px;
  font-weight: 600;
}

.toc-toggle {
  visibility: hidden;
  flex-basis: auto;
  height: 30px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 300;
  line-height: 30px;
  text-transform: uppercase;
  transition: none;
}

.toc-contents {
  display: none;
  margin-top: 1rem;
}

.entry-content .toc-menu {
  margin-top: 0;
  margin-left: 8px;
  margin-bottom: 6px;
  padding: 0;
}

.entry-content .toc-menu-item {
  list-style-type: none;
  padding-left: 30px;
  background: url('../images/toc-arrow-down.svg') no-repeat left 5px;
}

.toc-sidebar {
  display: none;
}

/* Tablet and desktop styles
--------------------------------------------- */

@media (min-width: 768px) {
  .toc {
    margin: 1.5rem 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
  }

  .toc-icon {
    vertical-align: 1px;
  }

  .toc-title {
    font-size: 26px;
  }

  .toc-toggle {
    display: none;
  }

  .toc-contents {
    display: block !important;
  }

  .entry-content .toc-menu-item {
    padding-left: 32px;
  }
}

/* Wide desktop styles
--------------------------------------------- */

@media (min-width: 1400px) {
  .toc-sidebar {
    display: block;
  }

  .toc-sidebar .tocs {
    position: sticky;
    top: 2rem;
    margin-bottom: 2rem;
  }

  .toc {
    margin: 0;
  }

  .toc-icon {
    vertical-align: -2px;
  }

  .toc-title {
    font-size: 20px;
  }

  .toc-menu-item {
    position: relative;
    margin-left: 28px;
    margin-bottom: 1rem;
    padding-left: 11px;
    list-style-type: none;
    transition: margin-left 0.1s ease-in-out;
  }

  .toc-menu-item::before {
    content: '\2022';
    position: absolute;
    margin-left: -30px;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: normal;
    line-height: 24px;
    color: #444;
  }

  .toc-menu-item.active {
    margin-left: 32px;
  }

  .toc-menu-item.active::before {
    content: '';
    width: 12px;
    height: 20px;
    background: url('../images/toc-arrow-right.svg') no-repeat left 7px;
  }

  .toc-menu-item.active .toc-menu-item-link {
    color: #000;
  }

  .toc-mobile-and-desktop {
    display: none;
  }
}

/* TOC open
--------------------------------------------- */

.toc.open .toc-contents {
  display: block;
}

.toc.open .toc-toggle {
  background-color: #cfcfcf;
  color: #000;
}

/* TOC closed
--------------------------------------------- */

.toc.closed .toc-contents {
  display: none;
}

.toc.closed .toc-toggle {
  background-color: #338d4d;
  color: #fff;
}

/* AMP styles
--------------------------------------------- */

.is-amp .toc-sidebar {
  display: none;
}

.is-amp .toc-mobile-and-desktop {
  display: block;
}

.is-amp .toc-toggle {
  visibility: visible;
}

/* Admin styles
--------------------------------------------- */

.acf-block-component .toc-block-component-title .acf-label label {
  margin-top: 14px;
  margin-bottom: 14px;
  font-size: 24px;
  font-weight: 400;
  color: #1e1e1e;
}

.acf-block-component .toc-block-component-title .acf-label label:before {
  display: inline-block;
  width: 24px;
  height: auto;
  margin-right: 15px;
  vertical-align: -4px;
  font-family: 'dashicons';
  content: '\f203';
}

.acf-block-preview .toc-contents {
  margin-top: 0;
}

.acf-block-preview .toc {
  display: block !important;
}
