/**
 * Custom CSS for Gallery Page
 * Responsive grid layout with fullscreen modal viewer
 */

/* Gallery Section */
.section-gallery {
  padding: 80px 0 100px 0;
}

/* Gallery Grid - 4 columns responsive */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  background-color: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item img.loaded {
  opacity: 1;
}

/* Skeleton Loading State for Gallery Items */
.gallery-item.skeleton,
.skeleton-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  aspect-ratio: 1;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Load More Section */
.load-more-wrapper {
  text-align: center;
  padding: 40px 0;
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 40px 0;
  color: #666;
  font-size: 16px;
}

/* Pagination Container */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #EABE0D;
  border-color: #EABE0D;
  color: #fff;
  transform: translateY(-2px);
}

.pagination-btn.active {
  background-color: #EABE0D;
  border-color: #EABE0D;
  color: #fff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.prev-btn,
.pagination-btn.next-btn {
  font-size: 18px;
  padding: 8px 16px;
}

.pagination-ellipsis {
  color: #666;
  font-size: 18px;
  padding: 0 8px;
}

.pagination-info {
  margin-left: 20px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* Fullscreen Gallery Modal */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s ease;
}

.gallery-modal.hidden {
  display: none;
}

.gallery-modal.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Content */
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 85%;
  max-height: 85%;
  text-align: center;
}

/* Modal Image */
.modal-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.modal-image.fade-in {
  animation: fadeInImage 0.3s ease;
}

/* Modal Info */
.modal-info {
  margin-top: 20px;
  color: #fff;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.modal-info h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-info p {
  font-size: 14px;
  color: #ccc;
  line-height: 1.6;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10000;
  line-height: 1;
  user-select: none;
}

.modal-close:hover,
.modal-close:focus {
  color: #EABE0D;
}

/* Modal Navigation Arrows */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  padding: 20px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.modal-nav:hover {
  background: rgba(234, 190, 13, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.modal-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-nav svg {
  display: block;
  width: 30px;
  height: 30px;
}

/* Modal Counter */
.modal-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 10000;
  backdrop-filter: blur(10px);
}

/* Error State & Empty State */
.gallery-error,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  grid-column: 1 / -1;
}

.gallery-error h3,
.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #333;
}

.gallery-error p,
.empty-state p {
  font-size: 16px;
  margin-bottom: 24px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: #ccc;
}

.gallery-error button {
  padding: 12px 30px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: #EABE0D;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-error button:hover {
  background-color: #d4ab0a;
}

/* Responsive Breakpoints */

/* Tablet - 3 columns */
@media screen and (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .section-gallery {
    padding: 60px 0 80px 0;
  }

  .pagination-container {
    margin-top: 40px;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .pagination-info {
    margin-left: 10px;
    font-size: 13px;
  }

  .modal-close {
    font-size: 40px;
    right: 30px;
  }

  .modal-nav {
    font-size: 20px;
    padding: 15px 12px;
  }

  .modal-nav svg {
    width: 24px;
    height: 24px;
  }
}

/* Mobile Landscape - 2 columns */
@media screen and (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .section-gallery {
    padding: 40px 0 60px 0;
  }

  .pagination-container {
    margin-top: 30px;
    gap: 6px;
  }

  .pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .pagination-ellipsis {
    font-size: 16px;
    padding: 0 4px;
  }

  .pagination-info {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
    font-size: 12px;
  }

  .modal-content {
    max-width: 90%;
    max-height: 90%;
  }

  .modal-image {
    max-height: 60vh;
  }

  .modal-info h3 {
    font-size: 16px;
  }

  .modal-info p {
    font-size: 12px;
  }

  .modal-close {
    top: 15px;
    right: 20px;
    font-size: 35px;
  }

  .modal-nav {
    padding: 12px 10px;
  }

  .modal-prev {
    left: 10px;
  }

  .modal-next {
    right: 10px;
  }

  .modal-counter {
    bottom: 20px;
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* Mobile Portrait - 2 columns */
@media screen and (max-width: 479px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-item {
    border-radius: 8px;
  }

  .pagination-btn {
    min-width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .pagination-btn.prev-btn,
  .pagination-btn.next-btn {
    font-size: 14px;
    padding: 6px 10px;
  }

  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }

  .modal-nav {
    font-size: 18px;
    padding: 10px 8px;
  }

  .modal-nav svg {
    width: 20px;
    height: 20px;
  }

  .modal-counter {
    bottom: 15px;
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .button-load-more,
  .modal-nav {
    transition: none;
  }

  .gallery-item:hover {
    transform: none;
  }

  .modal-image {
    animation: none;
  }

  .gallery-modal {
    animation: none;
  }
}

/* Footer Logo Boxes */
.logo-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  padding: 12px 30px;
  margin-left: -1px;
  background:
    linear-gradient(#fff, #fff) left center / 2px 50% no-repeat,
    linear-gradient(#fff, #fff) right center / 2px 50% no-repeat;
}

.logo-box:first-child {
  margin-left: 0;
}

.logo-box .footer_marquee_image {
  display: block;
}
