/* GeoCARE Publications — front-end styles.
   Ported from the hand-written Publications page so the design is unchanged.
   The homepage "Recent publication" card reads .pub-section[data-kind="journal"] .pub
   (.pub-year, .pub-name a, .pub-authors, .pub-venue, .pub-badge) — keep those class names. */

/* ---------- Theme-proof resets ---------- */
.pubs-page,
.pubs-page * { box-sizing: border-box; }

:where(.pubs-page) :where(h2, h3, h4, p) { margin: 0; padding: 0; }

.pubs-page [role="list"] { list-style: none; }

/* ---------- Page shell ---------- */
.pubs-page {
  max-width: 1160px;
  margin: 3rem auto;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #322427;
}
.pubs-page--recent { margin: 0; }

.pubs-title {
  color: #6b1239; /* SIU maroon */
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  text-align: center;
  margin-bottom: 2rem;
}
.pubs-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 0.9rem auto 0;
  background: #6b1239;
  border-radius: 2px;
}

/* ---------- Summary counts ---------- */
.pub-stats { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.6rem; }
.pub-stat {
  flex: 1 1 180px;
  padding: 1.1rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 55%, #f8f0f4 100%);
  border: 1.8px solid #d9bcd5;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(107, 18, 57, 0.08);
}
.pub-stat__n {
  display: block;
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}
.pub-stat__l {
  display: block;
  margin-top: 0.25rem;
  color: #7f4862;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Category filter (CSS only) ----------
   Radios are hidden but focusable; the labels are the visible pills. */
.pubfilter { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.pub-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.8rem; padding-bottom: 1.4rem;
  border-bottom: 2px solid #e2cdd9;
}
.pub-filter {
  display: inline-block;
  padding: 0.4rem 1rem;
  cursor: pointer;
  background: #fff;
  border: 1.8px solid #d9bcd5;
  border-radius: 999px;
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .03em;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pub-filter:hover { border-color: #6b1239; background: #f6eef2; }

#pf-all:checked        ~ .pub-filters label[for="pf-all"],
#pf-journal:checked    ~ .pub-filters label[for="pf-journal"],
#pf-conference:checked ~ .pub-filters label[for="pf-conference"],
#pf-patent:checked     ~ .pub-filters label[for="pf-patent"],
#pf-chapter:checked    ~ .pub-filters label[for="pf-chapter"],
#pf-thesis:checked     ~ .pub-filters label[for="pf-thesis"],
#pf-report:checked     ~ .pub-filters label[for="pf-report"],
#pf-preprint:checked   ~ .pub-filters label[for="pf-preprint"],
#pf-other:checked      ~ .pub-filters label[for="pf-other"] {
  background: #6b1239; border-color: #6b1239; color: #fff;
}
#pf-all:focus-visible        ~ .pub-filters label[for="pf-all"],
#pf-journal:focus-visible    ~ .pub-filters label[for="pf-journal"],
#pf-conference:focus-visible ~ .pub-filters label[for="pf-conference"],
#pf-patent:focus-visible     ~ .pub-filters label[for="pf-patent"],
#pf-chapter:focus-visible    ~ .pub-filters label[for="pf-chapter"],
#pf-thesis:focus-visible     ~ .pub-filters label[for="pf-thesis"],
#pf-report:focus-visible     ~ .pub-filters label[for="pf-report"],
#pf-preprint:focus-visible   ~ .pub-filters label[for="pf-preprint"],
#pf-other:focus-visible      ~ .pub-filters label[for="pf-other"] {
  outline: 3px solid #6b1239; outline-offset: 3px;
}
#pf-journal:checked    ~ .pub-body .pub-section:not([data-kind="journal"]),
#pf-conference:checked ~ .pub-body .pub-section:not([data-kind="conference"]),
#pf-patent:checked     ~ .pub-body .pub-section:not([data-kind="patent"]),
#pf-chapter:checked    ~ .pub-body .pub-section:not([data-kind="chapter"]),
#pf-thesis:checked     ~ .pub-body .pub-section:not([data-kind="thesis"]),
#pf-report:checked     ~ .pub-body .pub-section:not([data-kind="report"]),
#pf-preprint:checked   ~ .pub-body .pub-section:not([data-kind="preprint"]),
#pf-other:checked      ~ .pub-body .pub-section:not([data-kind="other"]) {
  display: none;
}

/* ---------- Section headings ---------- */
.pub-section { margin-bottom: 2.4rem; }
.pub-section:last-child { margin-bottom: 0; }
.pub-section__title {
  display: flex; align-items: center; gap: 0.6rem;
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 1.25rem; font-weight: 800; line-height: 1.3; letter-spacing: .02em;
  margin-bottom: 1rem;
}
.pub-count {
  padding: 0.1rem 0.6rem;
  background: #f6eef2; border: 1px solid #e2cdd9; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
}

/* ---------- Entries ----------
   Year in a fixed left rail so chronology is scannable. */
.pub-list { display: flex; flex-direction: column; gap: 0.7rem; }
.pub {
  display: grid; grid-template-columns: 86px 1fr; gap: 1.1rem; align-items: start;
  padding: 1rem 1.3rem;
  background: #fff;
  border: 1.8px solid #d9bcd5; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(107, 18, 57, 0.07);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.pub:hover { box-shadow: 0 10px 22px rgba(107, 18, 57, 0.14); border-color: #6b1239; }
.pub-year {
  padding-top: 0.1rem;
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 1.15rem; font-weight: 800; letter-spacing: .02em;
}
.pub-year--pending { font-size: 0.8rem; color: #7f4862; text-transform: uppercase; letter-spacing: .06em; }
.pub-name { font-size: 1rem; font-weight: 600; line-height: 1.45; margin-bottom: 0.3rem; }

/* Titles link out; an arrow appears on hover so the list stays quiet at rest. */
.pub-name a {
  color: #322427; text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pub-name a:hover, .pub-name a:focus-visible { color: #6b1239; border-bottom-color: #6b1239; }
.pub-name a::after { content: " \2197"; color: #7f4862; font-size: 0.85em; opacity: 0; transition: opacity 0.2s ease; }
.pub-name a:hover::after, .pub-name a:focus-visible::after { opacity: 1; }

.pub-authors { color: #4c3748; font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.15rem; }
.me { color: #6b1239; font-weight: 700; }                  /* PI's own name */
.pub-lab { text-decoration: underline; text-decoration-color: #c9a7bd; text-underline-offset: 3px; }
.pub-corr, .pub-pres { color: #6b1239; font-weight: 700; font-size: 0.75em; line-height: 0; margin-left: 1px; }

.pub-venue { color: #7f4862; font-size: 0.88rem; font-style: italic; line-height: 1.5; }
.pub-badge {
  display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.55rem;
  background: #f6eef2; border: 1px solid #e2cdd9; border-radius: 999px;
  color: #6b1239; font-size: 0.7rem; font-style: normal; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.pub-badge--granted  { background: #6b1239; border-color: #6b1239; color: #fff; }
.pub-badge--accepted { background: #7f4862; border-color: #7f4862; color: #fff; }

/* Marks entries whose link is a verified DOI (or a PDF) rather than a title search. */
.pub-doi {
  display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem;
  border: 1px solid #c9a7bd; border-radius: 4px;
  color: #7f4862; font-size: 0.62rem; font-style: normal; font-weight: 800; letter-spacing: .1em;
  text-decoration: none;
}
a.pub-file:hover, a.pub-file:focus-visible { background: #6b1239; border-color: #6b1239; color: #fff; }

/* ---------- Under consideration ----------
   Submitted / in-review items sit at the end of their own category and are
   never counted in .pub-stats or the section badge. */
.pub-subgroup { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 2px dashed #e2cdd9; }
.pub-subhead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem;
  margin: 0 0 0.8rem;
  color: #7f4862;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 0.85rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.pub-subhead__note {
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 0.78rem; font-weight: 400; letter-spacing: 0; text-transform: none;
}
.pub--review { border-style: dashed; }

/* ---------- Legend ---------- */
.pub-legend { margin-top: 1.6rem; color: #7f4862; font-size: 0.82rem; }
.pub-legend__k { color: #6b1239; font-weight: 700; }

/* ---------- Preferences, print, small screens ---------- */
@media (prefers-reduced-motion: reduce) {
  .pub, .pub-filter, .pub-name a, .pub-name a::after { transition: none; }
}
@media print {
  .pub-filters, .pub-stats { display: none; }
  .pub-section { display: block !important; }
  .pub { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .pub-name a::after { content: ""; }
}
@media (max-width: 780px) {
  .pubs-page { margin: 2rem auto; }
  .pubs-title { font-size: 1.6rem; }
  .pub-stat { flex-basis: 130px; padding: 0.9rem 0.6rem; }
  .pub-stat__n { font-size: 1.6rem; }
  .pub-stat__l { font-size: 0.68rem; }
  .pub { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.9rem 1rem; }  /* year above citation */
  .pub-year { font-size: 0.95rem; }
}

/* ---------- Editor-only controls (logged-in users with edit rights) ---------- */
.pub-admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem;
  margin: -0.6rem 0 1.6rem;
  padding: 0.7rem 1rem;
  background: #fff8e1;
  border: 1.5px dashed #e0b84a;
  border-radius: 12px;
  color: #6b4d00;
  font-size: 0.85rem;
}
.pub-admin-bar__b { display: flex; gap: 0.5rem; }
.pub-admin-btn {
  display: inline-block; padding: 0.35rem 0.9rem;
  border: 1.8px solid #6b1239; border-radius: 999px;
  color: #6b1239; background: #fff;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.8rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.pub-admin-btn--primary { background: #6b1239; color: #fff; }
.pub-admin-btn:hover, .pub-admin-btn:focus-visible { background: #4e0c29; border-color: #4e0c29; color: #fff; }

.pub--editable { grid-template-columns: 86px 1fr auto; }
.pub-edit {
  align-self: start;
  padding: 0.2rem 0.6rem;
  border: 1px dashed #c9a7bd; border-radius: 999px;
  color: #7f4862; background: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: .04em;
  text-decoration: none; white-space: nowrap;
  opacity: 0.55; transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.pub:hover .pub-edit, .pub-edit:focus-visible { opacity: 1; }
.pub-edit:hover, .pub-edit:focus-visible { background: #6b1239; border-color: #6b1239; color: #fff; }
@media (max-width: 780px) {
  .pub--editable { grid-template-columns: 1fr; }
  .pub-edit { justify-self: start; opacity: 1; }
}
@media print { .pub-admin-bar, .pub-edit { display: none !important; } }

/* ---------- Per-person list (People page cards) ----------
   [geocare_person_publications name="…"] — collapsed by default. */
.ppubs {
  margin: 14px 0 0;
  border-top: 1.5px dashed #e2cdd9;
  padding-top: 10px;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  text-align: left;
}
.ppubs__s {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; list-style: none;
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 0.88em; font-weight: 800; letter-spacing: .04em;
}
.ppubs__s::-webkit-details-marker { display: none; }
.ppubs__s::before {
  content: "";
  width: 0; height: 0;
  border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .2s ease;
}
.ppubs[open] .ppubs__s::before { transform: rotate(90deg); }
.ppubs__pending { color: #7f4862; font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-size: 0.8em; font-weight: 600; letter-spacing: 0; }
.ppubs__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ppubs__item { display: grid; grid-template-columns: 58px 1fr; gap: 8px; margin: 0; padding: 0; font-size: 0.86em; line-height: 1.45; }
.ppubs__item--pending { opacity: .85; }
.ppubs__year { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-weight: 800; font-size: 0.92em; padding-top: 1px; }
.ppubs__item--pending .ppubs__year { font-size: 0.7em; text-transform: uppercase; letter-spacing: .05em; color: #7f4862; }
.ppubs__title { display: block; color: #322427; font-weight: 600; }
.ppubs__title a { color: inherit; text-decoration: none; border-bottom: 1.5px solid transparent; }
.ppubs__title a:hover, .ppubs__title a:focus-visible { color: #6b1239; border-bottom-color: #6b1239; }
.ppubs__venue { display: block; color: #7f4862; font-style: italic; font-size: 0.92em; margin-top: 1px; }
.ppubs__kind {
  display: inline-block; margin-left: 4px; padding: 0 6px;
  border: 1px solid #e2cdd9; border-radius: 999px;
  color: #7f4862; font-style: normal; font-size: 0.78em; font-weight: 700; letter-spacing: .04em;
  vertical-align: 1px;
}
.ppubs .pub-badge { font-size: 0.72em; padding: 0 0.5rem; margin-left: 4px; vertical-align: 1px; }
.ppubs__all { display: inline-block; margin-top: 10px; color: #6b1239; font-size: 0.82em; font-weight: 700; text-decoration: none; border-bottom: 2px solid #d9bcd5; }
.ppubs__all:hover, .ppubs__all:focus-visible { border-bottom-color: #6b1239; }
@media print { .ppubs { display: block; } .ppubs__s::before { display: none; } .ppubs:not([open]) .ppubs__list { display: flex; } }

/* Editor pill pinned to a card corner (People and Courses cards). */
.people-card--editable { position: relative; }
.people-edit { position: absolute; top: 10px; right: 10px; z-index: 2; opacity: .75; }

/* ---------- Citations ---------- */
.pub-cite { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.35rem; padding: 0.12rem 0.6rem 0.12rem 0.45rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; vertical-align: middle; background: #fdf3d5; color: #7a5a00; border: 1px solid #f0c14b; }
.pub-cite--oa { background: #e3f0f5; color: #175a6d; border-color: #b9d9e4; }
.pub-cite__q { font-family: Georgia, serif; font-size: 1rem; line-height: 0.6; opacity: 0.7; }
.pub-metrics { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; margin: -0.6rem 0 1.6rem; padding: 0.8rem 1.2rem; background: linear-gradient(135deg, #fff, #f8f0f4); border: 1.5px solid #e2cdd9; border-radius: 12px; }
.pub-metrics__items { display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; }
.pub-metric { display: flex; align-items: baseline; gap: 0.45rem; }
.pub-metric__n { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 1.35rem; font-weight: 800; line-height: 1; }
.pub-metric__l { color: #7f4862; font-size: 0.78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pub-metrics__src { color: #7f4862; font-size: 0.82rem; }
.pub-metrics__src a { color: #6b1239; font-weight: 700; text-decoration: none; }
.pub-metrics__src a:hover { text-decoration: underline; }
@media print { .pub-metrics { display: none; } }
