
/* ---- listing gallery ---------------------------------------------------
   A scroll-snap strip: touch swipe, trackpad scroll and keyboard arrows for
   free, and no JavaScript at all — this renders on the public article page,
   where a carousel that needs a library is a carousel that shows nothing the
   day the script is blocked. Palette-driven, like every other surface. */
.pub-gallery { margin: 1.25rem 0; }
.pub-gallery-strip {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: .35rem;
  border-radius: var(--bs-border-radius);
}
.pub-gallery-frame {
  flex: 0 0 min(88%, 34rem);
  scroll-snap-align: center;
  margin: 0;
}
.pub-gallery-frame img {
  width: 100%;
  height: 100%;
  max-height: 26rem;
  object-fit: cover;
  border-radius: var(--bs-border-radius);
  background: rgba(var(--bs-secondary-rgb), .08);
}
.pub-gallery-count, .pub-gallery-caption { margin-top: .35rem; }
/* Thin, palette-coloured scrollbar so the strip reads as scrollable. */
.pub-gallery-strip::-webkit-scrollbar { height: 6px; }
.pub-gallery-strip::-webkit-scrollbar-thumb {
  background: rgba(var(--bs-primary-rgb), .35);
  border-radius: 3px;
}
@media (max-width: 576px) {
  .pub-gallery-frame { flex-basis: 92%; }
  .pub-gallery-frame img { max-height: 18rem; }
}

/* ---- gallery nav ------------------------------------------------------- */
.pub-gallery-viewport { position: relative; }
/* Hidden until gallery.js marks the strip ready — see the note there. */
.pub-gallery-nav { display: none; }
.pub-gallery.is-ready .pub-gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  /* Rides the CARD surface, like the deck arrows: apps/gui repaints both in
     its card-surface block, so these follow the palette instead of staying
     the one stock-coloured control on the page. */
  background: var(--bs-card-bg, var(--bs-body-bg));
  color: var(--bs-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  opacity: .92;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 2;
}
.pub-gallery.is-ready .pub-gallery-nav:hover {
  opacity: 1;
  /* Hover was the deck's bug: a stock bootstrap tint instead of the palette. */
  background: rgba(var(--bs-primary-rgb), .12);
  color: var(--bs-primary);
}
.pub-gallery.is-ready .pub-gallery-nav:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}
.pub-gallery.is-ready .pub-gallery-prev { left: .5rem; }
.pub-gallery.is-ready .pub-gallery-next { right: .5rem; }
/* At an end the arrow fades out but keeps its space, so the strip does not
   jump sideways as you reach the last photo. */
.pub-gallery.is-ready .pub-gallery-nav.is-off {
  opacity: 0;
  pointer-events: none;
}
.pub-gallery-nav .mdi { font-size: 1.25rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .pub-gallery-strip { scroll-behavior: auto; }
}

/* ---- teaser wall -------------------------------------------------------
   The free preview fades into the lock rather than stopping dead, so the cut
   reads as deliberate. The gradient is painted from the CARD's own background
   (apps/gui repaints .card per theme with !important), never a literal colour
   — a hard-coded white would sit as a bright band across a dark theme. */
.publications-page .pub-teaser {
  position: relative;
  max-height: 32rem;
  overflow: hidden;
}

.publications-page .pub-teaser::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7rem;
  pointer-events: none;
  background: linear-gradient(to bottom,
                              rgba(0, 0, 0, 0),
                              var(--bs-card-bg, var(--bs-body-bg)) 92%);
}

/* The access panel in the composer: one bordered strip, so "who can read it"
   reads as a decision rather than another loose dropdown in the row. */
.pub-compose .pub-access {
  border-color: var(--bs-border-color) !important;
}
