/* Gallery Grid Styles */
.gallery-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  width: 100%;
  grid-auto-rows: auto;
  align-items: start;
}

.gallery-grid-1 {
  grid-template-columns: repeat(1, 1fr);
}

.gallery-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .gallery-grid-3,
  .gallery-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery-grid-2,
  .gallery-grid-3,
  .gallery-grid-4 {
    grid-template-columns: repeat(1, 1fr);
  }
}

.pswp-gallery-item {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.pswp-gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-grid .pswp-gallery-item {
  overflow: hidden;
  border-radius: 6px;
}

.gallery-grid .pswp-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-thumb {
  width: 100%;
  height: auto;
  display: block;
}

/* Article images with lightbox */
.article-content img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.article-content a[data-pswp-width]:hover img {
  opacity: 0.8;
}

/* Reusable image sizing helpers */
.img-medium {
  max-width: 600px;
  width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.img-small {
  max-width: 400px;
  width: 100%;
  height: auto;
  display: block;
}

/* Side-by-side image layout */
.img-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.img-row .img-small {
  flex: 0 1 calc(50% - 8px);
  max-width: 300px;
}

@media (max-width: 768px) {
  .img-row {
    flex-direction: column;
  }
  
  .img-row .img-small {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Photoswipe custom styles */
.pswp--custom {
  --pswp-bg: rgba(0, 0, 0, 0.95);
  --pswp-root-z-index: 100000;
}

.pswp__button {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
  color: white;
}

.pswp__button:hover {
  background: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.pswp__counter {
  color: #fff;
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 14px;
  opacity: 0.8;
}

.pswp__top-bar {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}
