@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeftFade {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

#custom-toc {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
    z-index: 1;
	display: none;
	scrollbar-width: thin;
}

#custom-toc.toc-visible {
	display: block;
	opacity: 0;
	transform: translateX(-50%);
	animation: slideInLeftFade 1s forwards;
	overflow-y: auto;
	max-height: calc(100vh - 293px);
}

#custom-toc::-webkit-scrollbar {
  	width: 6px; /* Width of the scrollbar */
}

#custom-toc::-webkit-scrollbar-track {
	-webkit-box-shadow: inset 0 0 6px #8b8b8b4d;
	background-color: white;
}

#custom-toc::-webkit-scrollbar-thumb {
	/*-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);*/
	background-color: lightgray;
}

#custom-toc h2 {
    margin-top: 0;
    font-size: 18px;
    font-weight: bold;
}

#custom-toc ul {
    list-style-type: none;
    padding-left: 0;
}

#custom-toc ul li {
    user-select: none;
    border-left: 1px solid #d4d4d4;
    margin: 0;
    min-height: 40px;
    font-size: 16px;
    padding: 0.5rem 0 0.5rem 0.75rem;
}

#custom-toc ul li:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

#custom-toc ul li.active {
    font-weight: bold;
    color: #000;
    border-color: #000;
    letter-spacing: -0.007rem;
}

#custom-toc-container-mobile {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background-color: #e4e4e4;
	z-index: 10;
	display: none;
}

#custom-toc-toggle-mobile {
  display: none;
  width: 100%;
  background-color: transparent;
  padding: 10px;
  border: none;
  cursor: pointer;
  text-align: left;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background-position: bottom left;
    background-repeat: no-repeat;
    background-size: 100% 2px;
	box-shadow: none;
	font-size: 14px;
	letter-spacing: .07rem;
}

#custom-toc-list-mobile {
  display: none;
  list-style-type: none;
  padding: 0;
  margin: 0;
	max-height: 700px;
}

#custom-toc-list-mobile {
    list-style-type: none;
    padding-left: 0;
}

#custom-toc-list-mobile li {
    user-select: none;
    border-left: 1px solid #d4d4d4;
    margin: 0;
    min-height: 40px;
    font-size: 16px;
    padding: 0.5rem 0 0.5rem 0.75rem;
}

#custom-toc-list-mobile li:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

#custom-toc-list-mobile li.active {
    font-weight: bold;
    color: #000;
    border-color: #000;
}

#custom-toc-list-mobile.open {
  display: block;
}

.custom-toc-arrow {
    display: inline-block;
    transition: transform 0.4s ease-in-out;
}

.custom-toc-arrow.rotated {
    transform: rotate(180deg);
}

@media screen and (max-width: 1024px) {
  #custom-toc-container-mobile {
    display: block;
  }
  #custom-toc-toggle-mobile {
    display: inline-flex;
  }
  #custom-toc-list-mobile {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
	max-height: 75vh;
  }
  #custom-toc-list-mobile.open {
    display: block;
  }
}