@import "../../../../themes/recast2025/style.css";

.toc-nav {
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  background-color: var(--neutrals-white);
  font-family: var(--font-family-body);
  color: var(--neutrals-black);
  box-shadow: none;
}

.toc-nav ul, .toc-nav ul li {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0px;
}

.toc-nav p {
  margin: 0;
}

.toc-nav ul li {
    display: flex;
    list-style: none !important;
    padding: 8px 30px 8px 8px;
    border: 2px solid var(--neutrals-grey-1);
    margin-top: -2px !important;
}

.toc-nav ul li:hover {
  background-color: var(--neutrals-grey-1);
}

.nav-header {
  font-family: var(--font-family-headings, "Host Grotesk");
  font-size: var(--size-heading-xs, 20px);
  font-style: normal;
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0.6px;
}

.nav-header-mobile {
  display: none;
  font-weight: 700;
}

.toc-nav a {
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  text-decoration: none;
  position: relative;
  transition: left 0.2s ease;
  left: 0;
}

.toc-nav a:hover {
  text-decoration: none;
}

.toc-nav a.active {
  text-decoration: none;
}

.toc-nav.marker a.active {
  left: 20px;
  transition: left 0.1s ease;
}

.elementor-widget-table_of_contents_nav .toc-link,
.elementor-widget-table_of_contents_nav .toc-link.active {
  color: var(--neutrals-black) !important;
}

.toc-dropdown {
  display: none;
}

.toc-dropdown p {
  padding: 0;
}

.toc-nav-toggle-icon {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
    margin-right: 8px;
}

[data-widget_type="table_of_contents_nav.default"]:has(.sticky-enabled) {
  position: sticky;
  top: var(--toc-sticky-offset, 0);
  z-index: 20;
}

.marker .toc-active-indicator {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: transform 0.1s ease;
}

.marker .toc-active-indicator i {
  position: relative;
  top: 2px;
}

.toc-active-indicator.inactive {
  display: none;
  transform: translateY(50px);
}

/* Mobile styles */
@media screen and (max-width: 820px) {

  .toc-nav {
    padding: var(--gap-m) var(--margins-base-hori) !important;
  }

  .toc-active-indicator { display: none; }

  .e-con.e-child:has(.sticky-enabled) {
    position: sticky;
    top: var(--toc-sticky-offset, 0);
    z-index: 50;
    background: #fff;
    transition: none;
    width: 100%;
  }

  .toc-sticky-sentinel {
    top: calc(var(--toc-sticky-offset, 0) * -1 - 2px);
  }

  .e-con.e-child:has(.is-sticky) {
    left: 0;
    right: 0;
    margin: 0 auto;
    padding: 0px;
    min-width: 100vw;
  }

  [data-widget_type="table_of_contents_nav.default"]:has(.sticky-enabled) {
    position: relative;
    top: 0;
    z-index: 50;
  }

  .toc-nav {
    border: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    display: block;
    margin: 0 -20px;
  }

  .elementor-sticky--active .toc-nav {
    box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.3);
    padding: 20px 40px !important;
  }

  .nav-header {
    display: none;
    font-size: 14px;
    padding-bottom: 8px;
  }
  
  .nav-header-mobile {
    display: block;
    font-size: 14px;
    padding-bottom: 8px;
  }

  .toc-dropdown-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toc-dropdown {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 2px solid #EFEFEF;
    background: #fff;
    cursor: pointer;
    width: 100%;
    /* z-index: 90; */
  }

  .toc-dropdown.active {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .toc-dropdown.active .toc-nav-toggle-icon {
    transform: rotate(-90deg); /* Right to down */
  }

  .toc-nav ul {
    display: none;
    position: absolute;
    left: 20px;
    right: 20px;
    z-index: 50;
    gap: 12px;
    padding: 12px;
  }

  .toc-nav a.active,
  .toc-nav.marker a.active {
    left: 0;
  }

  .toc-nav ul li {
    padding: 0;
    border: none;
  }

  .toc-nav ul li:last-child {
    border-bottom: none;
  }

  .toc-nav ul.active {
    display: flex !important;
    border-left: 2px solid #EFEFEF;
    border-right: 2px solid #EFEFEF;
    border-bottom: 2px solid #EFEFEF;
    gap: 12px;
    padding: 12px;
    background-color: var(--neutrals-white);
  }
}