/* =====================================================
   GalleriaPro — Base Styles
   All gallery styles extend these foundations
   ===================================================== */

/* ---- Custom Properties ---- */
.gp-gallery-wrap {
  --gp-cols:    3;
  --gp-gap:     16px;
  --gp-radius:  8px;
  --gp-accent:  #6366f1;
  --gp-overlay: rgba(0, 0, 0, 0.55);
  --gp-trans:   0.38s;
  --gp-ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --gp-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --gp-white:   #ffffff;
  --gp-dark:    #0f0f11;
  box-sizing: border-box;
  width: 100%;
  position: relative;
}

.gp-gallery-wrap *, .gp-gallery-wrap *::before, .gp-gallery-wrap *::after {
  box-sizing: inherit;
}

/* ---- Gallery Inner (default grid) ---- */
.gp-gallery-inner {
  display: grid;
  grid-template-columns: repeat(var(--gp-cols), 1fr);
  gap: var(--gp-gap);
  width: 100%;
}

/* ---- Item ---- */
.gp-item { position: relative; display: block; overflow: hidden; }
.gp-item-inner { position: relative; display: block; overflow: hidden; border-radius: var(--gp-radius); }

/* ---- Image wrap ---- */
.gp-img-wrap { display: block; overflow: hidden; }
.gp-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--gp-trans) var(--gp-ease), filter var(--gp-trans) var(--gp-ease), opacity var(--gp-trans) var(--gp-ease);
}

/* Aspect ratio mode */
.gp-img-wrap[style*="padding-bottom"] {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.gp-img-wrap[style*="padding-bottom"] img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ---- Overlay ---- */
.gp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.0) 60%);
  opacity: 0;
  transition: opacity var(--gp-trans) var(--gp-ease);
  pointer-events: none;
  z-index: 2;
}
.gp-item:hover .gp-overlay,
.gp-item:focus-within .gp-overlay { opacity: 1; }

/* ---- Caption ---- */
.gp-caption { color: #fff; transform: translateY(6px); transition: transform var(--gp-trans) var(--gp-ease); }
.gp-item:hover .gp-caption { transform: translateY(0); }
.gp-caption-title { margin: 0 0 4px; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.gp-caption-desc  { margin: 0; font-size: 0.8rem; opacity: 0.85; line-height: 1.4; }

/* ---- Links ---- */
.gp-item a, .gp-item-wrap { display: block; }

/* ---- Pro nag ---- */
.gp-pro-nag {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 24px; background: #f8f6ff;
  border: 2px dashed var(--gp-accent); border-radius: var(--gp-radius);
  color: #4b5563; font-size: 0.95rem;
}
.gp-pro-lock { font-size: 1.4rem; }
.gp-pro-nag a { color: var(--gp-accent); font-weight: 600; }

/* ---- Notice (before/after needs 2 images) ---- */
.gp-notice { padding: 16px 20px; background: #fef3c7; border-radius: 6px; color: #92400e; }

/* =====================================================
   LIGHTBOX
   ===================================================== */

.gp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s ease;
  user-select: none;
}
.gp-lightbox:not([hidden]) { opacity: 1; }
.gp-lightbox[hidden] { display: none !important; }

.gp-lb-stage {
  position: relative;
  width: 100%;
  max-width: min(90vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gp-lb-img-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
}
.gp-lb-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.32s var(--gp-spring), opacity 0.28s ease;
  opacity: 0;
}
.gp-lightbox:not([hidden]) .gp-lb-img { transform: scale(1); opacity: 1; }

.gp-lb-caption-wrap {
  margin-top: 14px;
  text-align: center;
  color: rgba(255,255,255,0.9);
}
.gp-lb-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; }
.gp-lb-desc  { font-size: 0.88rem; opacity: 0.72; margin: 0; }

/* Lightbox buttons */
.gp-lb-close, .gp-lb-prev, .gp-lb-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.gp-lb-close:hover, .gp-lb-prev:hover, .gp-lb-next:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(1.1);
}
.gp-lb-close { top: 20px; right: 20px; font-size: 1.6rem; }
.gp-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.gp-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.gp-lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.gp-lb-next:hover { transform: translateY(-50%) scale(1.1); }

.gp-lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 20px;
}

/* =====================================================
   SWIPER OVERRIDES
   ===================================================== */

.gp-gallery-wrap .swiper { width: 100%; }
.gp-gallery-wrap .swiper-slide { height: auto; }

/* Default swiper nav color from accent */
.gp-gallery-wrap .swiper-button-next,
.gp-gallery-wrap .swiper-button-prev { color: var(--gp-accent); }
.gp-gallery-wrap .swiper-pagination-bullet-active { background: var(--gp-accent); }

/* =====================================================
   BEFORE / AFTER
   ===================================================== */

.gp-before-after {
  position: relative;
  overflow: hidden;
  border-radius: var(--gp-radius);
  cursor: col-resize;
  user-select: none;
  aspect-ratio: 16/9;
}
.gp-ba-before, .gp-ba-after {
  position: absolute; inset: 0;
}
.gp-ba-before img, .gp-ba-after img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gp-ba-after { clip-path: inset(0 50% 0 0); }

.gp-ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: col-resize;
  z-index: 10;
}
.gp-ba-handle::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
.gp-ba-arrow-left, .gp-ba-arrow-right {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  font-size: 0.9rem;
  color: #111;
}
.gp-ba-arrow-left  { margin-right: -4px; }
.gp-ba-arrow-right { margin-left: -4px; }

.gp-ba-labels { position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 20px; pointer-events: none; }
.gp-ba-label  { background: rgba(0,0,0,0.55); color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* =====================================================
   SNAP SCROLL (styles 81, 93)
   ===================================================== */

.gp-snap-inner {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}
.gp-snap-slide {
  scroll-snap-align: start;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
.gp-snap-slide img { width: 100%; height: 100%; object-fit: cover; }
.gp-snap-caption {
  position: absolute;
  bottom: 60px; left: 60px; right: 60px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.gp-snap-caption h2 { font-size: 2.4rem; margin: 0 0 12px; }
.gp-snap-caption p  { font-size: 1.1rem; opacity: 0.85; margin: 0; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
  .gp-gallery-inner { grid-template-columns: repeat(max(2, calc(var(--gp-cols) - 1)), 1fr) !important; }
  .gp-lb-prev { left: 6px; }
  .gp-lb-next { right: 6px; }
  .gp-snap-caption { left: 24px; right: 24px; bottom: 32px; }
  .gp-snap-caption h2 { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  .gp-gallery-inner { grid-template-columns: repeat(min(2, var(--gp-cols)), 1fr) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-gallery-wrap *, .gp-gallery-wrap *::before, .gp-gallery-wrap *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
