/*
 # -----------------------------------------------------------------------------
 # ~/assets/theme/j1/modules/lightbox3/css/lightbox.css (4)
 # Lightbox v.1.1.0 implementation for J1 Theme.
 #
 # Product/Info:
 # https://jekyll.one
 # http://lokeshdhakar.com/projects/lightbox2/
 #
 # Copyright (C) 2026 Juergen Adams
 # Copyright (C) 2026 Lokesh Dhakar
 #
 # J1 Template is licensed under the MIT License.
 # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
 # Lightbox is licensed under the MIT License.
 # See: https://github.com/lokesh/lightbox3/blob/master/LICENSE
 # -----------------------------------------------------------------------------
*/

.lightbox3-overlay {
  --lb-backdrop-color: rgba(0, 0, 0, 0.95);
  --lb-chrome-bg: rgba(24, 24, 24, 0.8);
  --lb-chrome-text: rgba(255, 255, 255, 0.9);
  --lb-chrome-font-size: 15px;
  --lb-chrome-padding: 16px;
  --lb-chrome-border-radius: 48px;
  --lb-image-border-radius: 24px;
  --lb-image-padding: 40px;
  /* claude - J1 Lightbox modifications #4: wider horizontal padding keeps the image
     clear of the prev/next arrow buttons (75 px hit-area + 20 px breathing room). */
  --lb-image-padding-x: 95px;
  --lb-z-index: 999999;

  position: fixed;
  inset: 0;
  z-index: var(--lb-z-index);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  touch-action: none;
  outline: none;
}

.lightbox3-backdrop {
  position: absolute;
  inset: 0;
  background: var(--lb-backdrop-color);
  cursor: pointer;
}

.lightbox3-strip {
  position: fixed;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

.lightbox3-slide {
  position: absolute;
  top: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.lightbox3-image {
  position: absolute;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  transform-origin: center center;
  touch-action: none;
}

.lightbox3-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: lightbox3-spin 0.7s linear infinite;
}

@keyframes lightbox3-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Chrome UI ===== */

.lightbox3-chrome {
  position: fixed;
  bottom: var(--lb-chrome-padding);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  /* claude - J1 Lightbox modifications #1: symmetric padding — close button moved out of bar */
  padding: 6px 18px;
  background: var(--lb-chrome-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--lb-chrome-border-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--lb-chrome-text);
  font-size: var(--lb-chrome-font-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  width: max-content;
  max-width: min(90vw, 600px);
  z-index: 1;
}

.lightbox3-chrome--minimal {
  padding: 6px;
}

/* claude - J1 Lightbox modifications #2: counter relocated to top-left corner,
   vertically centered to the close button (same top anchor, matching height). */
.lightbox3-counter {
  position: fixed;
  top: var(--lb-chrome-padding);
  left: var(--lb-chrome-padding);
  display: flex;
  align-items: center;
  height: 44px;                        /* matches .lightbox3-close height */
  padding: 0 4px;
  font-size: var(--lb-chrome-font-size); /* matches chrome font-size (15px) */
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

.lightbox3-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: auto;
}

/* claude - J1 Lightbox modifications #1: close button relocated to top-right corner,
   styled to match pswp__button--close (filled path SVG, circular backdrop) */
.lightbox3-close {
  position: fixed;
  top: var(--lb-chrome-padding);
  right: var(--lb-chrome-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  flex-shrink: 0;
  z-index: 1;
  transition: background 0.15s ease;
}

.lightbox3-close:hover {
  background: rgba(0, 0, 0, 0.5);
}

.lightbox3-close:focus {
  outline: none;
}

.lightbox3-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* claude - J1 Lightbox modifications #1: SVG sized to match pswp 32x32 filled-path icon */
.lightbox3-close svg {
  width: 32px;
  height: 32px;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.lightbox3-close:hover svg {
  opacity: 1;
}

/* claude - J1 Lightbox modifications #3: arrow buttons restyled to match
   pswp__button--arrow: large 75×100px transparent hit-area, no circular
   background or blur, flush to the viewport edges (left/right: 0),
   vertically centred via top:50% + margin-top:-50px (same as pswp). */
/* claude - J1 Lightbox modifications #4: subtle edge-hugging gradient added to
   each arrow button so the icon reads clearly against light image content without
   requiring a circular backdrop. Gradient fades from a dark translucent strip at
   the viewport edge toward the image centre. */
.lightbox3-arrow {
  position: fixed;
  top: 50%;
  margin-top: -50px;                  /* centres 100px button on the midline */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 100px;
  padding: 0;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.lightbox3-arrow:hover {
  opacity: 1;
}

.lightbox3-arrow:focus {
  outline: none;
}

.lightbox3-arrow:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* claude - J1 Lightbox modifications #3: SVG sized to match pswp__icn (60×60),
   fill inherits currentColor (white) set on the button. */
/* claude - J1 Lightbox modifications #4: drop-shadow filter on the SVG gives the
   icon a dark halo so it stays legible against bright image regions. */
.lightbox3-arrow svg {
  width: 60px;
  height: 60px;
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.85))
          drop-shadow(0 0 2px rgba(0, 0, 0, 0.60));
}

/* claude - J1 Lightbox modifications #3: next arrow mirrored horizontally,
   identical to how pswp flips its next-arrow icon via transform: scale(-1,1). */
.lightbox3-arrow-next svg {
  transform: scale(-1, 1);
}

/* claude - J1 Lightbox modifications #4: prev arrow — edge gradient fades
   left-to-right (dark at the viewport edge, transparent toward the image). */
.lightbox3-arrow-prev {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.30) 0%, transparent 100%);
}

.lightbox3-arrow-prev:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.50) 0%, transparent 100%);
}

/* claude - J1 Lightbox modifications #4: next arrow — mirror gradient direction. */
.lightbox3-arrow-next {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.30) 0%, transparent 100%);
}

.lightbox3-arrow-next:hover {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.50) 0%, transparent 100%);
}

@media (max-width: 600px) {
  .lightbox3-overlay {
    --lb-image-border-radius: 16px;
    --lb-image-padding: 8px;
    /* claude - J1 Lightbox modifications #4: arrows are hidden on narrow viewports,
       so reset horizontal padding to match the standard vertical padding. */
    --lb-image-padding-x: 8px;
  }

  /* claude - J1 Lightbox modifications #3: hide large hit-area arrows on narrow
     viewports (touch-only); matches pswp--touch hiding behaviour). */
  .lightbox3-arrow {
    display: none;
  }

  .lightbox3-chrome {
    --lb-chrome-padding: 12px;
    --lb-chrome-font-size: 14px;

    bottom: var(--lb-chrome-padding);
    gap: 10px;
    /* claude - J1 Lightbox modifications #1: symmetric padding */
    padding: 5px 14px;
    font-size: var(--lb-chrome-font-size);
  }

  .lightbox3-chrome--minimal {
    padding: 5px 14px;
  }

  /* claude - J1 Lightbox modifications #1: close button at top-right, keep pswp-style size on mobile */
  .lightbox3-close {
    width: 40px;
    height: 40px;
  }

  .lightbox3-close svg {
    width: 28px;
    height: 28px;
  }

  /* claude - J1 Lightbox modifications #2: match counter height to mobile close button */
  .lightbox3-counter {
    height: 40px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox3-image,
  .lightbox3-backdrop,
  .lightbox3-spinner {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
