/* === Photo gallery container === */
.photo-gallery {
  max-width: 1800px !important; /* Override site max-width for photo gallery */
  margin: 0 auto;
  padding: 0 1rem;
}

/* === Photos grid === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1400px) {
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .photo-grid { grid-template-columns: 1fr; }
}

/* Card & image */
.photo-gallery .photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
  background: var(--theme); /* Use theme background color instead of black */
  height: 400px !important; /* Set fixed height to match thumbnail dimensions */
  display: flex !important;
  align-items: center !important; /* Center images vertically */
  justify-content: center !important; /* Center images horizontally */
}
.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.photo-gallery .photo-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important; /* Maintain aspect ratio while filling container */
  object-position: center !important; /* Center the crop */
  display: block !important;
}

/* Overlay */
.photo-link { display: block; position: relative; }
.photo-overlay {
  position: absolute;
  inset: auto 0 0 0; /* bottom overlay */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 80%);
  color: #fff;
  padding: .5rem .75rem;
  opacity: 0;
  transition: opacity .25s ease;
}
.photo-link:hover .photo-overlay { opacity: 1; }
.photo-text { font-size: .9rem; line-height: 1.2; }
