.sitemap-list {
  list-style: none;
  padding-left: 0;
  margin-top: 2rem;
}

.toggle-arrow {
  width: 1rem;
  height: .8rem;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  margin-right: 2rem;
  position: relative;
}

.toggle-arrow::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 0.35em;
  width: 0.4em;
  height: 0.4em;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.toggle-arrow::before {
  transform: rotate(-45deg); /* Start as arrow pointing right */
}

.folder.open > .folder-header > .toggle-arrow::before {
  transform: rotate(45deg); /* Point down when open */
}

.nested {
  display: none;
  margin-left: 1.5rem;
  border-left: 1px solid #ccc;
  padding-left: 1rem;
}

.folder.open > .nested {
  display: block;
}

.sitemap-list,
.sitemap-list ul,
.sitemap-list li {
  list-style: none;
}


.folder > .folder-header > .folder-link {
  font-weight: bold;
  text-transform: capitalize;
}

.nested > li:not(.folder) > a {
  text-transform: capitalize;
}

/* Hover Effects */
.sitemap-list a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0.25rem 0.5rem;
}

.sitemap-list a:hover {
  color: #fff;
  background-color: #333;
  padding: 0.25rem 0.5rem;
}

body.dark-mode .sitemap-list a {
  color: #efefef;
}

body.dark-mode .sitemap-list a:hover {
  color: #111;
  background-color: #efefef;
}

/* Folder arrow in dark mode */
body.dark-mode .toggle-arrow::before {
  border-right: 2px solid #efefef;
  border-bottom: 2px solid #efefef;
}

/* Divider for mobile vertical layout */
@media (max-width: 768px) {
  body.dark-mode .nested {
    border-top: 1px solid #444;
  }
  
  .nested {
    margin-left: 0;
    padding-left: 1rem;
    border-left: none;
    border-top: 1px solid #ccc;
  }

  .folder.open > .nested {
    display: block;
  }

  .sitemap-list li {
    font-size: 1.15rem;
    line-height: 1.75;
    padding: .5rem;
  }

  .folder-header {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 1.35rem;
  }

  .toggle-arrow {
    height: 1rem;
    margin-right: 3rem;
  }
}