/* Shared publication components: Publications, Research and Misc.
   Revision: 20261015-harmonized1. Load AFTER marcostyle.css.
   Preserves the yellow background, original blue titles, button colors,
   smooth BibTeX transitions and automatic wrapping. */

.publication-list {
  margin-top: 0.85rem;
  padding-left: 1.45rem;
}

.publication-list > .publication-item {
  margin: 0 0 1.2rem;
  padding: 0.12rem 0.15rem 0.85rem;
  border-bottom: 1px solid rgba(37, 107, 148, 0.22);
  line-height: 1.55;
}

.publication-title {
  font-weight: 700;
  line-height: 1.4;
  color: #23709E; /* Original blue link color, now used for non-clickable titles. */
}

.publication-authors { margin-top: 0.2rem; color: #293743; }
.publication-citation { margin-top: 0.12rem; color: #344653; }

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.publication-actions .publication-button {
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid #77a4c7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #174f7c;
  font: 600 0.79rem/1.25 "Atkinson Hyperlegible Next", Verdana, sans-serif;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.publication-actions a.publication-button:hover,
.publication-actions button.publication-button:hover {
  background: #fff;
  color: #123b67;
  border-color: #3669a6;
  text-decoration: none;
}

.publication-actions .bibtex-toggle {
  border-color: #647991;
  color: #263c56;
}

.publication-actions .bibtex-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.publication-actions .publication-button.unavailable {
  opacity: 0.56;
  cursor: default;
  border-color: #89979d;
  border-style: dashed;
  background: rgba(236, 236, 236, 0.55);
  color: #4a4a4a;
}

.publication-actions a.publication-button:focus-visible,
.publication-actions button.publication-button:focus-visible,
.pub-bibtex .copy-btn:focus-visible {
  outline: 3px solid #245db8;
  outline-offset: 2px;
}

/* Smooth opening and closing, restoring the original fade behavior.
   0fr -> 1fr animates to the content's actual height without guessing a max-height.
   The nested wrapper is essential for a fully collapsed 0fr track. */
.pub-bibtex {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-top: 0;
  transition:
    grid-template-rows 0.42s ease-in-out,
    opacity 0.38s ease-in-out,
    margin-top 0.42s ease-in-out,
    visibility 0s linear 0.42s;
}

.pub-bibtex.show {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: 0.65rem;
  transition:
    grid-template-rows 0.42s ease-in-out,
    opacity 0.38s ease-in-out,
    margin-top 0.42s ease-in-out,
    visibility 0s linear 0s;
}

.pub-bibtex-inner {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pub-bibtex-content {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid rgba(37, 107, 148, 0.38);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  color: #1c2a3a;
}

@media (prefers-reduced-motion: reduce) {
  .pub-bibtex, .pub-bibtex.show { transition: none; }
}

.pub-bibtex pre.purebibtex {
  box-sizing: border-box;
  margin: 0;
  padding: 0.25rem 0;
  font: 0.92rem/1.55 'Atkinson Hyperlegible Mono', Consolas, Monaco, 'Courier New', monospace;
  /* As in the original marcostyle.css: wrap long titles and links
     inside the box, while preserving indentation and line breaks.
     Copy / download still uses the untouched BibTeX source text. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  overflow-x: visible;
  width: 100%;
  max-width: 100%;
  color: inherit;
}

.pub-bibtex .bibtex-tools {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

.pub-bibtex .copy-btn {
  border: 1px solid #a6bad0;
  border-radius: 6px;
  padding: 5px 9px;
  background: white;
  color: #294c70;
  cursor: pointer;
}
.pub-bibtex .copy-btn:hover { background: #e9f3ff; }

.software-list > li { margin-bottom: 0.8rem; }
.software-citation-note { margin: 0.28rem 0 0; }

@media (max-width: 540px) {
  .publication-actions { gap: 0.35rem; }
  .publication-actions .publication-button {
    font-size: 0.74rem;
    padding: 5px 9px;
  }
  .pub-bibtex-content { padding: 0.55rem; }
  .pub-bibtex pre.purebibtex { font-size: 0.86rem; }
}
.publication-list { padding-left: 0; }
.publication-list > .publication-item { position: relative; padding-left: 1.1rem; }
.publication-list > .publication-item::before {
  position: absolute;
  left: 0;
  top: 0.1rem;
  margin-left: 0;
  width: 1rem;
}


/* Keep publication content aligned with the site’s existing mobile width. */
@media (max-width: 800px) {
  .publication-list { padding-left: 0; }
}

/* The current global `a:hover` adds a dotted bottom border. Buttons
   should change background instead, with no baseline movement. */
.publication-actions a.publication-button:hover { border-bottom-style: solid; }

@media print {
  .publication-actions, .pub-bibtex { display: none !important; }
}

/* All pages using these components share the same font stacks. */
.publication-actions .publication-button { font-family: var(--font-text); }
.pub-bibtex pre.purebibtex { font-family: var(--font-code); }
