/* =============================================
   PACKTECH — GALLERY SECTION
   ============================================= */

.gallery-section {
  width: 100%;
  background: #ffffff;
  padding-bottom: 80px;
}

/* ─── Header Area ───────────────────────────── */
.gallery-header {
  position: relative;
  width: 100%;
  min-height: 520px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  padding-top: 40px;
}

.gallery-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 1.2s ease;
  transform: scale(1.02);
}

/* .gallery-header:hover .gallery-bg {
  transform: scale(1.05);
} */

.gallery-content {
  position: relative;
  z-index: 5;
  text-align: center;
  width: 100%;
  max-width: 1400px;
  padding: 0 20px;
}

.gallery-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-title-wrap {
  position: relative;
  display: inline-block;
  padding: 25px 90px;
  margin-bottom: 20px;
}

.gallery-torn-title {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: -1;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.2));
}

.gallery-main-title {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 400;
  color: #6a2900;
  margin: 0;
  line-height: 0.8;
}

/* Divider */
.gallery-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 50px;
}

.gal-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.gal-icon {
  color: #ffffff;
  display: flex;
  transition: transform 0.6s ease;
}

.gallery-header:hover .gal-icon {
  transform: rotate(180deg) scale(1.2);
}

/* ─── Filters ───────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.filter-btn {
  position: relative;
  background: none;
  border: none;
  padding: 12px 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.filter-btn span {
  position: relative;
  z-index: 2;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a0d05;
  white-space: nowrap;
}

.filter-torn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 1;
  opacity: 0.8;
  filter: grayscale(1) brightness(1.2);
  transition: all 0.3s ease;
}

.filter-btn:hover {
  transform: translateY(-3px) scale(1.05);
}

.filter-btn.active .filter-torn,
.filter-btn:hover .filter-torn {
  opacity: 1;
  filter: grayscale(0) brightness(1);
}

.filter-btn.active span {
  color: #6a2900;
}

/* ─── Grid ──────────────────────────────────── */
.gallery-grid-container {
  max-width: 1400px;
  margin: 60px auto 0;
  padding: 0 20px;
}

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

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #f0f0f0;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* Item variations */
.gallery-item.tall {
  grid-row: span 2;
}

.gallery-item.wide {
  grid-column: span 2;
}

/* Overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(106, 41, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid #fff;
  padding: 8px 20px;
  border-radius: 4px;
  transform: translateY(10px);
  transition: transform 0.4s ease;
}

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

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-header {
    min-height: 480px;
  }

  .gallery-filters {
    gap: 10px;
  }

  .filter-btn {
    padding: 8px 20px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .gallery-item.tall,
  .gallery-item.wide {
    grid-row: auto;
    grid-column: auto;
  }

  .gallery-item {
    height: 300px;
  }
}