/* Photo gallery specific styles */
:root {
  --photo-border-color: rgba(0, 0, 0, 0.05);
  --photo-hover-shadow: rgba(0, 0, 0, 0.15);
}

main.photo-gallery {
  margin-left: var(--sidebar-width);
  padding: 4rem var(--side-padding);
  box-sizing: border-box;
  width: calc(100% - var(--sidebar-width));
  max-width: 1500px;
  margin-right: auto;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--photo-border-color);
  background-color: var(--color-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.photo-grid img:hover {
  transform: scale(1.025);
  box-shadow: 0 10px 24px var(--photo-hover-shadow);
  opacity: 0.95;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  transition: transform 0.3s ease;
}

.lightbox-content:hover {
  transform: scale(1.02);
}

.close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: #ffffff;
  font-size: var(--font-size-icon-lg);
  cursor: pointer;
  transition: opacity 0.2s ease;
  opacity: 0.8;
}

.close:hover,
.close:focus-visible {
  opacity: 1;
}

@media (max-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 900px) {
  main.photo-gallery {
    margin-left: 170px;
    width: calc(100% - 170px);
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 768px) {
  main.photo-gallery {
    margin-left: 160px;
    width: calc(100% - 160px);
    padding: 2.5rem 1.2rem;
  }
}

@media (max-width: 640px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  main.photo-gallery {
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem calc(4.75rem + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
