/* Base dropdown styling using theme colors */
details {
  border: 1px solid var(--color-border, #d3d3d3);
  border-radius: 6px;
  padding: 0.5em 1em;
  margin-bottom: 1em;
  background-color: var(--color-bg, #f9f9f9);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

details[open] {
  background-color: var(--color-bg-hover, #f0f0f0);
}

summary {
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  list-style: none;
  color: var(--color-fg, #000);
}

summary::-webkit-details-marker { display: none; }
summary::marker { content: none; }

/* Arrow before summary */
summary:before {
  content: "▶";
  display: inline-block;
  margin-right: 0.5em;
  transition: transform 0.3s ease, color 0.3s ease;
  color: var(--color-fg, #000);
}

details[open] summary:before {
  transform: rotate(90deg);
}

/* Indent publications inside category */
details > .archive__item {
  margin-left: 1em;
  border-left: 2px solid var(--color-border-secondary, #ccc);
  padding-left: 0.5em;
  margin-top: 0.5em;
}

/* Make links inherit text color */
details a {
  color: inherit;
  text-decoration: none;
}
details a:hover {
  text-decoration: underline;
}

/* Dark mode overrides using AcademicPages data-theme attribute */
html[data-theme="dark"] details {
  border-color: var(--color-border-dark, #555);
  background-color: var(--color-bg-dark, #222);
}

html[data-theme="dark"] details[open] {
  background-color: var(--color-bg-hover-dark, #333);
}

html[data-theme="dark"] summary,
html[data-theme="dark"] summary:before {
  color: var(--color-fg-dark, #eee);
}

html[data-theme="dark"] details > .archive__item {
  border-left-color: var(--color-border-secondary-dark, #666);
}
