/*******************************************************************************
CUSTOM STYLES

Add your custom CSS styles here to override or extend the default styles.
*******************************************************************************/

/* Expandable details: replace list bullet with chevron indicator */
li:has(> details), li:has(> .pub-item > details) {
  list-style: none !important;
}

details > summary {
  cursor: pointer;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

details[open] > summary::before {
  content: "▾";
}

/* Tag pills */
a.tag-pill,
a.tag-pill:link,
a.tag-pill:visited {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background-color: var(--theme-code-bg) !important;
  border: 1px solid var(--theme-table-border);
  color: var(--theme-text) !important;
  text-decoration: none !important;
  line-height: 1.6;
}
a.tag-pill:hover {
  border-color: var(--theme-text);
  text-decoration: none !important;
}
a.tag-current,
a.tag-current:link,
a.tag-current:visited {
  background-color: var(--theme-text) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-text);
}

/* Blog post descriptions on archive page */
.post-description {
  display: inline-block;
  margin-top: 0.2em;
  font-size: 0.85em;
  opacity: 0.65;
}

/* Post meta dates in margin notes */
.post-meta-dates {
  display: inline-block;
  margin-top: 0.6em;
  opacity: 0.7;
  font-style: italic;
}

/* Mobile: metadata margin notes render compactly below content */
@media (max-width: 760px) {
  /* Publications: flex reorder to move marginnote below citation
     (these li already have list-style: none from li:has(> details)) */
  li:has(> details):has(.marginnote-meta),
  li:has(> .pub-item):has(.marginnote-meta) {
    display: flex;
    flex-direction: column;
  }

  li > p:has(> .marginnote-meta),
  .pub-item > p:has(> .marginnote-meta) {
    order: 99;
    margin: 0;
  }

  .pub-item {
    display: flex;
    flex-direction: column;
  }

  /* More vertical space between list entries with metadata notes */
  li:has(.marginnote-meta) {
    margin-bottom: 0.75rem;
  }

  /* Blog/tag post entries: inline-flex column to reorder margin note below content.
     inline-flex (not flex) preserves the <li> line box so ::marker aligns with the title. */
  .post-entry {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
  }

  .post-entry > .marginnote-meta {
    order: 99;
  }

  /* All metadata margin notes: compact inline display */
  .marginnote-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35em;
    background: none;
    border: none;
    padding: 0.25rem 0 0;
    margin: 0.25rem 0 0;
    width: auto;
    left: 0;
    font-size: 0.85em;
    color: var(--theme-secondary-text);
  }

  /* Hide only direct-child line breaks (tag/date separator), preserve breaks inside .post-meta-dates */
  .marginnote-meta > br {
    display: none;
  }

  /* Dates on own line below tags in individual blog posts */
  .marginnote-meta .post-meta-dates {
    flex-basis: 100%;
    margin-top: 0.25em;
  }
}