/* ---- Publications: clean, responsive list ---- */
:root {
  --pub-accent: #2b5d9e;
  --pub-muted: #666;
  --pub-border: #e8e8e8;
  --pub-bg-dd: #fff;
  --pub-break: 700px;
}

#publications-root {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

.pub-loading,
.pub-error {
  color: var(--pub-muted);
  font-size: 0.95rem;
  padding: 1rem 0;
}
.pub-error { color: #c00; }

.pub-year-group {
  margin-top: 1.6rem;
}

.pub-year-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pub-accent);
  margin: 0.6rem 0;
}

.pub-year-list {
  padding-left: 0;
  list-style: none;
}

/* ---- Each publication row ---- */
.pub-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pub-border);
}

.pub-entry-line {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.pub-entry-line strong { font-weight: 600; }
.pub-entry-line em { font-style: italic; }

/* ---- Right side: Link + Citation icon/dropdown ---- */
.pub-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--pub-border);
  border-radius: 4px;
  background: #fafafa;
  color: var(--pub-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pub-link:hover {
  background: #f0f0f0;
  color: var(--pub-accent);
  border-color: #ccc;
}
.pub-link:focus-visible {
  outline: 2px solid var(--pub-accent);
  outline-offset: 2px;
}
.pub-link svg {
  display: block;
}

/* Citation: icon button + dropdown */
.pub-cite-wrap {
  position: relative;
}

.pub-cite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--pub-border);
  border-radius: 4px;
  background: #fafafa;
  color: var(--pub-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pub-cite-btn:hover {
  background: #f0f0f0;
  color: var(--pub-accent);
  border-color: #ccc;
}
.pub-cite-btn:focus-visible,
.pub-cite-dropdown button:focus-visible {
  outline: 2px solid var(--pub-accent);
  outline-offset: 2px;
}
.pub-cite-btn svg {
  display: block;
}

.pub-cite-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 120px;
  padding: 0.35rem 0;
  background: var(--pub-bg-dd);
  border: 1px solid var(--pub-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}
.pub-cite-dropdown.open { display: block; }

.pub-cite-dropdown button {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}
.pub-cite-dropdown button:hover {
  background: #f5f5f5;
}

.pub-cite-feedback {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--pub-accent);
}

/* ---- Mobile ---- */
@media (max-width: 700px) {
  #publications-root {
    padding: 0.5rem 0;
  }

  .pub-entry {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .pub-entry-line {
    flex: none;
    font-size: 0.9rem;
    padding-right: 0;
  }

  .pub-actions {
    flex-wrap: wrap;
    padding-top: 0.25rem;
  }

  .pub-link {
    width: 44px;
    height: 44px;
  }

  .pub-cite-btn {
    width: 44px;
    height: 44px;
  }

  .pub-cite-dropdown {
    left: 100%;
    right: auto;
    margin-left: 4px;
    min-width: 140px;
  }
}
