/* ============================================================
   Publications page
   ============================================================ */

.page-publications .nav {
  background: rgba(7, 22, 44, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---- Filter bar — blush, red label decoration ------------ */
.pub-filter-bar {
  background: var(--blush);
  padding: 1.75rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid rgba(7,22,44,0.10);
}

.pub-filter-bar__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.pub-filter-heading {
  margin-bottom: 1rem;
}

.pub-filter-hint {
  display: block;
  font-size: var(--fs-sm);
  color: rgba(7,22,44,0.55);
}

/* ---- Content area ---------------------------------------- */
.pub-content {
  background: #F5F3F0;
  padding: 2.5rem 0 5rem;
  min-height: 50vh;
}

.pub-content .container {
  padding: 0 2.5rem;
  max-width: var(--max-w);
}

/* ---- Year section ---------------------------------------- */
.year-section {
  margin-bottom: 1.25rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(7,22,44,0.10), 0 0 0 1px rgba(7,22,44,0.06);
  animation: yearSettle 0.55s var(--ease-out) both;
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.year-section.is-collapsed {
  box-shadow: 0 1px 6px rgba(7,22,44,0.12), 0 0 0 1px rgba(7,22,44,0.08);
}

@keyframes yearSettle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Year header — dark navy with red left accent --------- */
.year-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.75rem;
  background: var(--navy);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-base);
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}

/* 4px red left accent stripe — matches contact page */
.year-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
}

/* `:not(:active)` lets the shared press state in css/style.css win while the
   bar is being pressed — publications.css loads after style.css, so a bare
   `:hover` would otherwise take the cascade and the header would never
   visibly depress. */
.year-header:hover:not(:active),
.year-section.is-collapsed .year-header:not(:active) {
  background: var(--blue-dark);
}

/* Year number wrapper — translateX centering animated via JS */
.year-header__year-wrap {
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-spring);
}

.year-header__year {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blush);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Dividing bar — fades out when collapsed, keeps layout space */
.year-header__bar {
  flex: 1 0 0;
  height: 1px;
  background: rgba(247,232,228,0.15);
  transition: opacity var(--dur-base) var(--ease-out);
}

.year-section.is-collapsed .year-header__bar {
  opacity: 0;
}

/* Chevron — spring rotation */
.year-header__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(247,232,228,0.40);
  transition: transform var(--dur-base) var(--ease-spring),
              color var(--dur-fast) var(--ease-out);
  display: block;
}

.year-header:hover .year-header__chevron {
  color: rgba(247,232,228,0.70);
}

.year-header[aria-expanded="false"] .year-header__chevron {
  transform: rotate(-90deg);
}

/* ---- Collapse / expand ----------------------------------- */
.year-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur-slow) var(--ease-inout);
  background: var(--white);
}

.year-body.collapsed {
  grid-template-rows: 0fr;
}

.year-body__inner {
  overflow: hidden;
  transition: opacity var(--dur-base) var(--ease-out);
}

.year-body.collapsed .year-body__inner {
  opacity: 0;
}

/* ---- Stagger-in animation on section expand -------------- */
@keyframes pubEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.pub-item.pub-enter {
  animation: pubEnter 0.45s var(--ease-out) both;
  animation-delay: var(--pub-delay, 0s);
}

/* ---- Publication entry -----------------------------------
   The hover no longer lights a red left border. That stripe was on seven
   components site-wide, and here it fired on any of ~105 rows the pointer
   crossed, which made it the busiest instance of the busiest motif. A
   background shift alone marks the row perfectly well. */
.pub-item {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(7,22,44,0.06);
  transition: background var(--transition);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-item:hover {
  background: rgba(7,22,44,0.035);
}

/* ---- Entry text ------------------------------------------ */
.pub-item__title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.pub-item__title-link {
  color: inherit;
  transition: color var(--transition);
}

.pub-item__title-link:hover {
  color: var(--red);
}

.pub-item__title-link svg {
  width: 11px;
  height: 11px;
  margin-left: 0.4em;
  vertical-align: 1px;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.pub-item__title-link:hover svg {
  opacity: 0.85;
}

.pub-item__authors {
  font-size: var(--fs-sm);
  color: rgba(7,22,44,0.60);
  line-height: 1.65;
  margin-bottom: 0.15rem;
}

.pub-author-link {
  color: var(--blue-mid);
  border-bottom: 1px solid rgba(70,114,162,0.28);
  transition: color var(--transition), border-color var(--transition);
}

.pub-author-link:hover {
  color: var(--red);
  border-color: rgba(176,42,60,0.45);
}

.pub-item__meta {
  font-size: var(--fs-sm);
  color: rgba(7,22,44,0.48);
  line-height: 1.5;
}

/* ---- Marks and topics ------------------------------------
   This row used to carry up to six chips per entry, in three different shapes
   — a 20px-radius bordered filter pill, a 10px-radius filled tag, and a
   3px-radius bordered preprint badge — repeated down ~105 rows. That is where
   most of the site's "too many pills" feeling came from.

   The rule now is: a rounded pill is something you can press (the filters at
   the top of the page); a small square mark is a static flag; and anything
   that is neither is plain text. So "Key publication" and its research
   question collapse into one mark, "Preprint" takes the same mark shape in a
   different colour, and the free-text topics — which were never clickable —
   are simply a line of text.
   ---------------------------------------------------------- */
.pub-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.7;
  padding: 1px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.pub-mark--key {
  background: var(--red);
  color: var(--white);
}
/* The research question rides inside the same mark instead of trailing it as
   a second and third chip. */
.pub-mark__rq {
  font-weight: 500;
  opacity: 0.78;
}

.pub-mark--preprint {
  color: var(--blue-mid);
  border: 1px solid rgba(70,114,162,0.38);
  background: rgba(70,114,162,0.05);
  margin-left: 0.5rem;
}

.pub-item__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  margin-top: 0.5rem;
}

.pub-item__topics {
  font-size: var(--fs-sm);
  color: rgba(7,22,44,0.50);
  line-height: 1.6;
}

/* ---- No results ------------------------------------------ */
.no-results {
  background: var(--white);
  border-radius: 6px;
  text-align: center;
  padding: 4rem 1.5rem;
  color: rgba(7,22,44,0.38);
  font-size: var(--fs-md);
  box-shadow: 0 1px 4px rgba(7,22,44,0.07);
}

/* ---- Responsive ------------------------------------------ */
@media (max-width: 767px) {
  .pub-filter-bar { padding: 1.5rem 1.25rem 1.75rem; }
  .pub-content .container { padding: 0 0.75rem; }
  .pub-content { padding: 1.5rem 0 4rem; }

  .year-header { padding: 0.85rem 1.1rem; }
  .year-header__year { font-size: 1.6rem; }

  .pub-item {
    padding: 1rem 1.1rem 1rem 0.9rem;
  }
}
