/* ==========================================================================
   Page: Gallery (Figma node 242:4024)
   ========================================================================== */

.gallery-section {
  position: relative;
  background-color: var(--color-page-bg, #f8f7f3);
  padding-top: 48px;
  padding-bottom: 96px;
}

.gallery-section .section-tag {
  color: #615D57;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: 16.5px;
  letter-spacing: 2.42px;
  margin-bottom: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.gallery-title {
  font-family: var(--font-family-base, 'Inter Tight', sans-serif);
  font-weight: 900;
  font-size: clamp(40px, 5.5vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #151515;
  margin: 0 0 40px 0;
}

.gallery-filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.gallery-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 33px;
  border-radius: 9999px;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}

.gallery-tab-btn--photo {
  width: 168px;
}

.gallery-tab-btn--video {
  width: 204px;
}

.gallery-tab-btn.is-active {
  background-color: #151515;
  border: 0.444px solid #151515;
  color: #FBFAF6;
}

.gallery-tab-btn:not(.is-active) {
  background-color: #FFFFFF;
  border: 0.444px solid #D9D7D2;
  color: #615D57;
}

.gallery-tab-btn:not(.is-active):hover {
  border-color: #151515;
  color: #151515;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gallery-card {
  position: relative;
  height: 240px;
  border-radius: 30px;
  overflow: hidden;
  background-color: #EDEBE5;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 30px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card__img {
  transform: scale(1.06);
}

.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.5) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 18px;
  pointer-events: none;
}

.gallery-card:hover .gallery-card__overlay {
  opacity: 1;
}

.gallery-card__zoom-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #151515;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card__zoom-icon {
  transform: translateY(0);
}

/* Lightbox Modal */
.gallery-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 40px;
}

.gallery-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-modal__content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal__img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 20px;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.gallery-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.gallery-modal__close:hover {
  opacity: 0.7;
}

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding-top: 32px;
  }
  .gallery-section .section-tag {
    font-size: 16px;
    margin-bottom: 24px;
  }
  .gallery-title {
    font-size: 38px;
    margin-bottom: 24px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .gallery-card {
    height: 180px;
    border-radius: 20px;
  }
  .gallery-card__img {
    border-radius: 20px;
  }
  .gallery-tab-btn--photo {
    width: 140px;
  }
  .gallery-tab-btn--video {
    width: 160px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-card {
    height: 220px;
  }
}
