/* Schema Gallery Frontend Styles */

/* Gallery Grid - ADD PADDING TO PREVENT SHADOW CLIPPING */

/* ===== POWERED BY ===== */
.sg-powered-by {
  text-align: center !important;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
  font-size: 10px !important;
  font-weight: 300 !important;
  color: #555 !important;
  opacity: 0.85 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.3px !important;
}

.sg-powered-by a {
  color: #555 !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  transition: all 0.2s ease;
}

.sg-powered-by a:hover {
  color: #1f4170 !important;
  text-decoration: underline !important;
  opacity: 1 !important;
}


.sg-gallery { 
  margin: 1.5rem 0;
  padding: 20px; /* Prevents shadow from being cut off at edges */
}

.sg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px; /* Increased from 16px for better shadow visibility */
}

/* UPDATED - Remove border and shadow from container */
.sg-item {
  background: transparent; /* Changed from #fff */
  border: none; /* Removed border */
  border-radius: 0; /* Removed */
  overflow: visible; /* Changed from hidden to allow shadow */
  box-shadow: none; /* Removed shadow from container */
}

/* UPDATED - Add white border and tight shadow to image */
.sg-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 12px; /* Rounded corners */
  border: 1px solid #ffffff; /* White border between image and shadow */
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.12),  /* Tight primary shadow */
    0 1px 3px rgba(0,0,0,0.08);  /* Subtle depth layer */
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effect */
}

/* ADDED - Hover effect for better interactivity */
.sg-item img:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.15),
    0 2px 4px rgba(0,0,0,0.1);
}

/* Caption styling - keep as is */
.sg-caption {
  font-size: 14px;
  padding: 10px 12px;
  color: #1f2937;
}

.sg-empty, 
.sg-error { 
  color: #6b7280; 
}

/* ===== Theme Lightbox Conflict Prevention ===== */
/* Prevent common theme lightboxes from interfering */
.sg-lightbox-link.sg-no-theme-lightbox {
  pointer-events: auto !important;
}

/* ===== Lightbox ===== */
.sg-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 999999; /* Higher than most theme lightboxes */
  padding: 60px 20px 60px;
  box-sizing: border-box;
}

.sg-lightbox-overlay.visible {
  opacity: 1;
}

/* Lightbox Container - wraps everything */
.sg-lightbox-container {
  position: relative;
  display: inline-block;
}

/* Lightbox Image Frame */
.sg-lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.sg-lightbox-content img {
  max-width: 85vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Close Button - minimal floating */
.sg-lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10000;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.sg-lightbox-close:hover {
  transform: scale(1.15);
}

/* Navigation Arrows - minimal with tan background */
.sg-lightbox-prev,
.sg-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  width: 50px;
  height: 100px;
  border-radius: 5%;
  background: rgba(242, 108, 79, 0.3); /* tan/brown color */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  z-index: 10001;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.sg-lightbox-prev:hover,
.sg-lightbox-next:hover {
  transform: translateY(-50%) scale(1.15);
  background: rgba(139, 115, 85, 1); /* solid on hover */
}

.sg-lightbox-prev {
  left: -60px;
}

.sg-lightbox-next {
  right: -60px;
}

/* Counter */
.sg-lightbox-counter {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 10000;
  white-space: nowrap;
}

/* ===== Pagination ===== */
.sg-pagination {
  margin-top: 20px;
  text-align: center;
}

.sg-pagination a {
  display: inline-block;
  margin: 0 4px;
  padding: 8px 14px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #1f2937;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.sg-pagination a:hover {
  background: #1f4170;
  color: #fff;
}

.sg-pagination .active {
  background: #1f4170;
  color: #fff;
  pointer-events: none;
}

.sg-pagination .sg-prev,
.sg-pagination .sg-next {
  font-weight: 600;
}

/* ===== Responsive Mobile ===== */
@media (max-width: 768px) {
  /* UPDATED - Reduce padding on mobile */
  .sg-gallery {
    padding: 15px;
  }
  
  .sg-grid {
    gap: 15px;
  }
  
  .sg-lightbox-overlay {
    padding: 50px 10px 10px;
  }
  
  .sg-lightbox-content {
    padding: 6px;
  }
  
  .sg-lightbox-content img {
    max-width: 95vw;
    max-height: 75vh;
  }
  
  .sg-lightbox-close {
    top: 15px;
    right: 15px;
    font-size: 32px;
    width: 44px;
    height: 44px;
  }
  
  .sg-lightbox-prev,
  .sg-lightbox-next {
    font-size: 40px;
    width: 50px;
    height: 50px;
    background-color: rgba(255,255,255,0.15);
  }
  
  .sg-lightbox-prev {
    left: 15px;
  }
  
  .sg-lightbox-next {
    right: 15px;
  }
  
  .sg-lightbox-counter {
    bottom: 20px;
    font-size: 12px;
    padding: 6px 12px;
  }
}