@import url('index-small.css');

.portfolio-gallery {
  padding: 64px 0;
}

/* Masonry Layout - Mobile */
.gallery-masonry {
  column-count: 2;
  column-gap: 1rem;
  margin-bottom: 48px;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-light);
  transition: all 0.4s ease;
}

/* Dynamic height based on aspect ratio */
.gallery-item[data-aspect="portrait"] {
  aspect-ratio: 3/4;
}

.gallery-item[data-aspect="landscape"] {
  aspect-ratio: 4/3;
}

.gallery-item[data-aspect="square"] {
  aspect-ratio: 1/1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item:hover {
  box-shadow: var(--shadow-warm);
  transform: translateY(-8px);
  border-color: var(--secondary);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(44, 24, 16, 0.95), transparent);
  padding: 24px 16px 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h3 {
  color: var(--text-light);
  font-size: 1.125rem;
  margin: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 12px 20px;
  background-color: white;
  border: 2px solid var(--border-light);
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 44px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.pagination button:hover:not(:disabled),
.pagination button:focus:not(:disabled) {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  color: white;
  box-shadow: var(--shadow-warm);
  transform: translateY(-2px);
}

.pagination button.active {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  color: white;
  box-shadow: var(--shadow-md);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  color: var(--text-light);
  text-align: center;
  padding: 16px;
  font-size: 1.125rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--text-light);
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2001;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.lightbox-close:hover,
.lightbox-close:focus {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  transform: rotate(90deg);
  box-shadow: var(--shadow-warm);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--text-light);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2001;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-prev:focus,
.lightbox-next:hover,
.lightbox-next:focus {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-warm);
}

/* Enhanced Pagination Styles */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.pagination button {
  padding: 12px 20px;
  background-color: white;
  border: 2px solid var(--border-light);
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 44px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pagination button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(210, 105, 30, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.pagination button:hover:not(:disabled)::before,
.pagination button:focus:not(:disabled)::before {
  width: 200px;
  height: 200px;
}

.pagination button:hover:not(:disabled),
.pagination button:focus:not(:disabled) {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  color: white;
  box-shadow: var(--shadow-warm);
  transform: translateY(-2px);
}

.pagination button.active {
  background: var(--gradient-warm);
  border-color: var(--secondary);
  color: white;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.pagination button:disabled,
.pagination button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.pagination button:disabled::before,
.pagination button.disabled::before {
  display: none;
}

.pagination-ellipsis {
  padding: 12px 8px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}

/* Loading state for pagination */
.pagination.loading button:not(.active) {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive pagination */
@media (max-width: 767px) {
  .pagination {
    gap: 6px;
  }
  
  .pagination button {
    padding: 10px 16px;
    font-size: 0.813rem;
    min-width: 40px;
  }
  
  .pagination-ellipsis {
    padding: 10px 6px;
  }
}

/* Accessibility focus styles */
.pagination button:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

/* Animation for page changes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item {
  animation: fadeIn 0.4s ease-out backwards;
}

