/* =======================================================
   Modern skin for bibtexbrowser (card-style publications)
   - No HTML/PHP changes required
   - Works with the default table/row markup
   ======================================================= */

/* -------- Theme tokens -------- */
:root {
  --bb-bg:        #f6f7f9;      /* page background (already set in site css)   */
  --bb-surface:   #ffffff;      /* card background                             */
  --bb-border:    #e5e9f2;      /* card border                                 */
  --bb-border-2:  #cfd6e3;      /* hover/active border                         */
  --bb-shadow:    0 1px 2px rgba(16,24,40,.04);
  --bb-shadow-2:  0 6px 16px rgba(16,24,40,.08);

  --bb-text:      #1f2a37;      /* primary text                                */
  --bb-subtle:    #667085;      /* secondary text                              */
  --bb-accent:    #0b5cab;      /* link/accent                                 */
  --bb-accent-bg: #e8f3ff;      /* chip bg                                     */

  --bb-radius:    14px;         /* card radius                                 */
  --bb-gap:       10px;         /* vertical gap between cards                  */

  --bb-title:     1.02rem;      /* title font size                             */
  --bb-meta:      .95rem;       /* meta line size                              */
  --bb-chip:      .78rem;       /* chip size                                   */
}

/* -------- Year headers -------- */
.sheader {
  background: transparent !important;
  border: 0 !important;
  color: var(--bb-text);
  font-weight: 700;
  font-size: 1.3rem;
  padding: 0px;
}

/* -------- Results table as a "list of cards" -------- */
table.result {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 var(--bb-gap) !important; /* vertical gap between rows */
}

tr.bibline { line-height: 1.4; }

/* Remove old alternating row fills */
tr.bibline:nth-child(2n) td.bibitem {
  background: transparent !important;
}

/* Each entry becomes a rounded card */
tr.bibline td.bibitem {
  background: var(--bb-surface);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  padding: 5px 10px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

/* Hover/active state */
tr.bibline td.bibitem:hover {
  border-color: var(--bb-border-2);
  box-shadow: var(--bb-shadow-2);
}

/* -------- Typographic cleanup for common bits -------- */
.bibauthor {
  font-variant: normal !important;  /* override small-caps from old css */
  font-weight: 500;
  color: var(--bb-text);
  display: block;
  margin-bottom: 2px;
}

.bibtitle {
  font-style: normal !important;    /* drop italic title for a cleaner look */
  font-weight: 650;
  font-size: var(--bb-title);
  margin: 2px 0 6px;
}
.bibtitle a {
  color: var(--bb-accent);
  text-decoration: none;
}
.bibtitle a:hover { text-decoration: underline; }

/* Generic “meta” line (venue, year, volume, etc.) */
.bibbooktitle, .bibpublisher, .bibjournal, .bibnote {
  color: var(--bb-subtle);
  font-size: var(--bb-meta);
}

/* Space out paragraphs inside a card */
tr.bibline td.bibitem p { margin: 4px 0; }

/* -------- Chips for links (doi/pdf/arXiv/bibtex/URL) -------- */
/* Works whether bibtexbrowser emits classes or not */
tr.bibline td.bibitem a.bibdoi,
tr.bibline td.bibitem a.bibtex,
tr.bibline td.bibitem a.biburl {
  display: inline-block;
  margin-right: 8px;
  margin-top: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--bb-border);
  background: var(--bb-accent-bg);
  color: var(--bb-accent) !important;
  font-size: var(--bb-chip);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
tr.bibline td.bibitem a.bibdoi:after { content: "DOI "; font-weight: 600; }
tr.bibline td.bibitem a[href$=".pdf"]:before { content: "PDF "; font-weight: 600; }
tr.bibline td.bibitem a.bibtex:before { content: "BibTeX "; font-weight: 600; }

tr.bibline td.bibitem a:hover {
  border-color: var(--bb-accent);
}

/* -------- Search bar / filters -------- */
table#searchbar {
  width: 100%;
  background: #eef2f7 !important;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  padding: 10px 12px !important;
  margin: 6px 0 12px;
  font-size: smaller;
}

table#searchbar td { 
  vertical-align: middle; 
}

/* Inputs */
#searchbar select,
#searchbar input[type="text"],
#searchbar input[type="submit"] {
  font: inherit;
  border: 1px solid var(--bb-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--bb-text);
  outline: none;
}

#searchbar input[type="text"] { width: 180px; }
#searchbar input[type="submit"] {
  cursor: pointer;
  background: var(--bb-accent);
  color: #fff;
  border-color: var(--bb-accent);
}
#searchbar input[type="submit"]:hover {
  filter: brightness(0.97);
}

/* -------- Small utilities -------- */
a { color: var(--bb-accent); }                   /* unify link color */

/* Keep authors and the trailing colon on the same line */
.bibauthor {
  display: inline;            /* was: block */
  font-weight: 500;
  color: var(--bb-text);
  margin: 0;                  /* no block margin needed */
  line-height: 1.3;
}

/* Slightly tighten the spacing before the title line */
.bibtitle {
  margin-top: 2px;            /* was: 6px */
}

/* Size only: icons inside the action chips */
a.biburl > img.icon,
a[href*="doi.org"] > img.icon,
a[href*="arxiv.org"] > img.icon,
a[href$=".pdf"] > img.icon {
  width: 16px;
  height: 16px;
  max-width: none;        /* defeat any global img { max-width:100% } */
  display: inline-block;  /* consistent box for alignment */
  vertical-align: -3px;   /* nudge to baseline */
  margin-right: 6px;      /* gap before the label (if any) */
}

/* If you previously added left padding for pseudo-icons, remove it */
a.biburl,
a[href*="doi.org"],
a[href$=".pdf"] {
  padding-left: 10px;     /* or 0 — whatever your chip needs now */
}

/* Base size variable (optional) */
:root { --bb-icon-h: 16px; }

/* Only widen the BibTeX icon */
a.biburl > img.icon {
  height: var(--bb-icon-h);
  width: calc(var(--bb-icon-h) * 2.5);  /* 1.5x wider */
  max-width: none;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 0px;
}

/* If you ever hit very narrow widths, keep one line by letting the input shrink */
@media (max-width: 600px){
  #searchbar input[type="text"] { width: 130px; }
  .bb-search{ min-width: 100px; width: min(50vw, 360px); }
}
/* Prevent overflow in bibtexbrowser code/pre blocks */
pre, code {
  white-space: pre-wrap;   /* wrap long lines */
  word-break: break-word;  /* break words if needed */
  overflow-x: auto;        /* allow horizontal scroll if still too wide */
  max-width: 100%;         /* keep inside container */
  box-sizing: border-box;
}
/* Keep below sticky header when scrolled to */
#pubs{ scroll-margin-top: 96px; }
