/* ────────────────────────────────────────────────────────────
   Rafal Wojczal — Vertical scroll-snap photo gallery
   Applies only when body.GalleryPage is present
   ──────────────────────────────────────────────────────────── */

/* 1. Body becomes a flex column — header takes natural height,
      gallery stretches into the rest of the viewport */
body.GalleryPage {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: hidden !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2. Header stays — just pin it so it never shrinks */
body.GalleryPage > header {
  flex-shrink: 0;
  position: relative;
  z-index: 1000;
}

/* 3. Footer — hidden, not needed in full-screen gallery mode */
body.GalleryPage footer {
  display: none !important;
}

/* 4. The main content wrapper fills all remaining height.
      min-height:0 is required so a flex child can actually scroll. */
body.GalleryPage > .main.wrapper {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

body.GalleryPage > .main.wrapper > .inner.typography.line {
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* 5. Gallery wrapper — fills the content area, relative so
      absolutely-positioned children (arrows, counter) are contained */
.rwj-gallery {
  position: relative;
  height: 100%;
  width: 100%;
  background: #000;
  overflow: hidden;
}

/* 6. Vertical scroll track with snap */
.rwj-track {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;          /* VERTICAL */
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rwj-track::-webkit-scrollbar { display: none; }

/* 7. Each slide — full height of the track, photo centred */
.rwj-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rwj-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 8. Back link — top-left corner, minimal */
.rwj-back {
  position: absolute;
  top: 14px;
  left: 20px;
  z-index: 200;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 10px;
  font-family: sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s;
}
.rwj-back:hover,
.rwj-back:focus { color: #fff; text-decoration: none; }
.rwj-back svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* 9. Up / down arrows — right edge, barely visible */
.rwj-nav {
  position: absolute;
  right: 18px;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.22);
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  z-index: 200;
  padding: 8px 12px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.rwj-nav:hover { color: rgba(255, 255, 255, 0.8); }
.rwj-prev { top: 14px; }
.rwj-next { bottom: 14px; }

/* 10. Slide counter — bottom-centre, subtle */
.rwj-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  color: rgba(255, 255, 255, 0.28);
  font-size: 10px;
  font-family: sans-serif;
  letter-spacing: 0.2em;
  pointer-events: none;
  white-space: nowrap;
}

/* 11. Mobile — slightly smaller chrome */
@media (max-width: 600px) {
  .rwj-nav { font-size: 34px; right: 10px; }
  .rwj-back { top: 10px; left: 14px; font-size: 9px; }
  .rwj-counter { font-size: 9px; bottom: 10px; }
}
