.md-sidebar--primary {
  background-color: #EFEFEF;
}

.md-sidebar--secondary {
  /*Hide the TOC sidebar*/
  /*display: none;*/
}

.md-content {
  background-color: white;
}

.md-nav--secondary * {
  font-size: 14px;
}

a.md-icon {
  /* Hide the repo edit icon/link on each page */
  /*display: none;*/
}

.md-logo img {
  /* width: 100px; */
  -webkit-filter: brightness(0) invert(1);
  filter: brightness(0) invert(1);
}

/* Hide the footer */
footer {
  display: none;
}

/* Fix navigation menu item height and spacing for shadcn theme */
[data-sidebar="menu-item"] {
  height: auto !important;
  min-height: auto !important;
}

[data-sidebar="menu-button"] {
  height: auto !important;
  min-height: 2.4rem !important;
  line-height: 1.4 !important;
  padding: 0.5rem !important;
  display: flex !important;
  align-items: flex-start !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow: visible !important;
}

/* Remove fixed height constraint */
[data-sidebar="menu-button"].h-\[30px\] {
  height: auto !important;
}

/* Ensure proper spacing between menu items */
[data-sidebar="menu-item"] + [data-sidebar="menu-item"] {
  margin-top: 0.2rem;
}

/* Fix text truncation */
[data-sidebar="menu-button"] [&>span:last-child]:truncate {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* Fix anchor links - only show on hover */
/* Hide all anchor links by default */
a.headerlink,
a.anchor-link,
.md-content a[href^="#"],
.md-content a[href*="#"]:not([href="#"]),
.md-content h1 a[href^="#"],
.md-content h2 a[href^="#"],
.md-content h3 a[href^="#"],
.md-content h4 a[href^="#"],
.md-content h5 a[href^="#"],
.md-content h6 a[href^="#"] {
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
  text-decoration: none !important;
}

/* Show anchor links on hover */
.md-content h1:hover a[href^="#"],
.md-content h2:hover a[href^="#"],
.md-content h3:hover a[href^="#"],
.md-content h4:hover a[href^="#"],
.md-content h5:hover a[href^="#"],
.md-content h6:hover a[href^="#"],
.md-content h1:hover .headerlink,
.md-content h2:hover .headerlink,
.md-content h3:hover .headerlink,
.md-content h4:hover .headerlink,
.md-content h5:hover .headerlink,
.md-content h6:hover .headerlink {
  opacity: 1 !important;
}

/* Alternative selectors for shadcn theme */
[data-heading] a[href^="#"],
[data-heading] .anchor-link,
[data-heading] .headerlink {
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

[data-heading]:hover a[href^="#"],
[data-heading]:hover .anchor-link,
[data-heading]:hover .headerlink {
  opacity: 1 !important;
}

/* Generic heading selectors */
h1 a[href^="#"],
h2 a[href^="#"],
h3 a[href^="#"],
h4 a[href^="#"],
h5 a[href^="#"],
h6 a[href^="#"] {
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

h1:hover a[href^="#"],
h2:hover a[href^="#"],
h3:hover a[href^="#"],
h4:hover a[href^="#"],
h5:hover a[href^="#"],
h6:hover a[href^="#"] {
  opacity: 1 !important;
}
