/* Collapsible Headers */
.collapsible-header-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8em;
  padding: 0;
  margin-left: 1em;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.post-content h3:hover .collapsible-header-button,
.post-content h4:hover .collapsible-header-button,
.post-content h5:hover .collapsible-header-button,
.post-content h6:hover .collapsible-header-button {
  opacity: 1;
}

.collapsible-header-button:hover {
  color: var(--foreground);
}

.collapsible-header-button.collapsed {
  transform: rotate(-90deg);
}

/* Ensure headers with buttons are properly aligned */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  display: flex;
  align-items: center;
  margin-top: 1.5em;
  position: relative;
  padding-left: 2em;  /* Add padding to offset the negative space used by anchor */
  margin-left: -2em;  /* Pull the header back to align with content */
}

/* Style the anchor link */
.hanchor {
  color: var(--accent);
  text-decoration: none;
  position: relative;
  opacity: 0;
  margin-left: 1em;
  transition: opacity .2s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hanchor svg {
  stroke: var(--accent);
}

.post-content h1:hover .hanchor,
.post-content h2:hover .hanchor,
.hanchor:hover {
  opacity: 1;
  transition: opacity .2s ease;
}

/* Add some spacing between headers and their content */
.post-content h1 + *:not(h1),
.post-content h2 + *:not(h1, h2),
.post-content h3 + *:not(h1, h2, h3),
.post-content h4 + *:not(h1, h2, h3, h4),
.post-content h5 + *:not(h1, h2, h3, h4, h5),
.post-content h6 + *:not(h1, h2, h3, h4, h5, h6) {
  margin-top: 1em;
} 