/* Gallery page (gallery.qmd) - masonry wall of images scrolling upwards.
   Layout/motion is driven by assets/gallery.js; this file only styles it. */

/* Gallery-only page: keep the navbar, drop the footer and body header */
.page-gallery .nav-footer,
.page-gallery footer.footer {
  display: none;
}

.page-gallery #title-block-header,
.page-gallery .quarto-title-block,
.page-gallery h1.title {
  display: none;
}

/* The wall fills the window, so the page itself never needs to scroll */
.page-gallery {
  overflow: hidden;
}

.page-gallery #quarto-content,
.page-gallery main.content {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Full-bleed (.column-screen), fixed-height window the columns move inside.
   --gallery-top is set by gallery.js to the gallery's distance from the top. */
.gallery-viewport {
  --gallery-gap: 14px;
  position: relative;
  height: calc(100vh - var(--gallery-top, 70px));
  height: calc(100dvh - var(--gallery-top, 70px));
  overflow: hidden;
  padding: 0 var(--gallery-gap);
  box-sizing: border-box;
  touch-action: none; /* drag/swipe is handled by gallery.js */
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-viewport:focus-visible {
  box-shadow: inset 0 0 0 3px #28A569;
}

.gallery-viewport.is-dragging,
.gallery-viewport.is-dragging * {
  cursor: grabbing !important;
}

/* Soft fade at top and bottom edges */
.gallery-viewport::before,
.gallery-viewport::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 2;
  pointer-events: none;
}
.gallery-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
}
.gallery-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
}

/* Before JS runs (or without JS): a plain CSS-columns masonry that the
   visitor can scroll normally. */
.gallery-source {
  columns: 4 260px;
  column-gap: var(--gallery-gap);
  height: 100%;
  overflow-y: auto;
}
.gallery-source p {
  margin: 0;
}
.gallery-source a,
.gallery-source img {
  display: block;
  break-inside: avoid;
  margin-bottom: var(--gallery-gap);
}

/* JS-built columns */
.gallery-columns {
  display: flex;
  gap: var(--gallery-gap);
  align-items: flex-start;
  height: 100%;
}

.gallery-column {
  flex: 1 1 0;
  min-width: 0;
  will-change: transform;
}

.gallery-item {
  display: block;
  margin: 0 0 var(--gallery-gap);
  border-radius: 6px;
  overflow: hidden;
  background: #ecf0f1;
  box-shadow: 0 2px 10px rgba(26, 36, 47, 0.12);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  box-shadow: 0 6px 22px rgba(26, 36, 47, 0.25);
  transform: scale(1.015);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  pointer-events: none; /* clicks land on the link; stops native image drag */
}

/* Small "paused" pill so it's clear why things have stopped */
.gallery-status {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 3;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(26, 36, 47, 0.8);
  color: #fafafa;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.gallery-viewport.is-paused .gallery-status {
  opacity: 1;
}

.visually-hidden-gallery {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Lightbox caption: "Take a closer look" link back to the source page */
.glightbox-container .gslide-description {
  text-align: center;
}

.glightbox-container .gallery-closer-look {
  font-weight: 600;
  color: #1a242f;
  text-decoration: underline;
  text-decoration-color: #28A569;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.glightbox-container .gallery-closer-look:hover,
.glightbox-container .gallery-closer-look:focus-visible {
  color: #28A569;
}
