/* ==========================================================================
   Gallery Styles - Home Page & Works Page
   Exact column specification: 4 columns on Desktop, 2 columns on Tablet & Phone
   ========================================================================== */

.work-gallery-section {
  position: relative;
  background-color: var(--bg-deep);
  padding: 100px 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .work-gallery-section {
    padding: 70px 0;
  }
}

/* Filter Tabs for Works Page */
.gallery-filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.gallery-filter-btn {
  background: rgba(13, 48, 39, 0.6);
  border: 1px solid var(--gold-border);
  color: var(--text-cream);
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 24px;
  clip-path: polygon(10px 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0% 50%);
  border-radius: 0 !important;
  cursor: pointer;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: var(--transition-smooth);
}

.gallery-filter-btn:hover,
.gallery-filter-btn.is-active {
  background: var(--gold-gradient);
  color: #071f19;
  border-color: transparent;
  font-weight: 700;
  transform: translateY(-2px);
  filter: drop-shadow(0 6px 16px rgba(201, 155, 83, 0.5));
}

/* Gallery Grid Layout - EXACT REQUIREMENT: 4 columns desktop, 2 columns tablet & phone */
.work-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Desktop: 4 columns */
  gap: 20px;
  width: 100%;
}

@media (max-width: 1024px) {
  .work-gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* Tablet & Phone: 2 columns */
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .work-gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* Phone: strictly 2 columns as requested */
    gap: 10px;
  }
}

/* Individual Gallery Item Card */
.gallery-item-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-surface);
  border: 1px solid rgba(201, 155, 83, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.gallery-item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Hover Overlays & Accents */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(5, 22, 18, 0) 0%,
    rgba(5, 22, 18, 0.3) 50%,
    rgba(5, 22, 18, 0.9) 100%);
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.gallery-item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 14px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  transform: translateY(4px);
  transition: var(--transition-smooth);
}

.gallery-item-meta {
  display: flex;
  flex-direction: column;
}

.gallery-item-category {
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 500;
  margin-bottom: 2px;
}

.gallery-item-title {
  font-family: var(--font-heading) !important;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.25;
}

@media (max-width: 640px) {
  .gallery-item-title {
    font-size: 0.92rem;
  }
  .gallery-item-content {
    padding: 12px 10px;
  }
}

.gallery-zoom-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201, 155, 83, 0.25);
  border: 1px solid var(--primary-gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.gallery-zoom-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Hover States */
.gallery-item-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-light);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(201, 155, 83, 0.25);
}

.gallery-item-card:hover img {
  transform: scale(1.08);
}

.gallery-item-card:hover .gallery-item-overlay {
  opacity: 0.95;
}

.gallery-item-card:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.gallery-item-card:hover .gallery-item-content {
  transform: translateY(0);
}

/* Gallery Footer / View All Link */
.gallery-footer-cta {
  text-align: center;
  margin-top: 50px;
}

/* ==========================================================================
   Full Screen Lightbox Modal
   ========================================================================== */
.gallery-lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 15, 12, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
}

.gallery-lightbox-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content-box {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(201, 155, 83, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(201, 155, 83, 0.2);
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--text-cream);
  font-size: 1rem;
}

.lightbox-caption-title {
  font-family: var(--font-heading) !important;
  font-size: 1.2rem;
  color: var(--gold-light);
}

.lightbox-counter {
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* Lightbox Controls */
.lightbox-btn-close {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: rgba(13, 48, 39, 0.8);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
  z-index: 3010;
}

.lightbox-btn-close:hover {
  background: var(--gold-gradient);
  color: #071f19;
  transform: scale(1.1);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: rgba(13, 48, 39, 0.85);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  z-index: 3010;
}

.lightbox-nav-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.lightbox-nav-btn:hover {
  background: var(--gold-gradient);
  color: #071f19;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-gold);
}

.lightbox-btn-prev {
  right: 24px;
}

.lightbox-btn-next {
  left: 24px;
}

@media (max-width: 768px) {
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
  }
  .lightbox-btn-prev {
    right: 10px;
  }
  .lightbox-btn-next {
    left: 10px;
  }
  .lightbox-btn-close {
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
}
