.gallery-section {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  overflow-x: hidden;
}

.gallery-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 2.5rem auto;
}

.gallery-badge {
  display: inline-block;
  background-color: rgba(96, 37, 33, 0.08);
  color: var(--brand-brown);
  border: 1px solid rgba(96, 37, 33, 0.2);
  padding: 0.35rem 1.1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.gallery-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: -2.5rem;
}

/* Category Filter Tabs */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.gallery-filter-btn {
  padding: 0.55rem 1.3rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gallery-filter-btn:hover {
  color: var(--brand-brown);
  border-color: var(--brand-orange);
  transform: translateY(-2px);
}

.gallery-filter-btn.active {
  background-color: var(--brand-brown);
  color: #ffffff;
  border-color: var(--brand-brown);
  box-shadow: 0 4px 12px rgba(96, 37, 33, 0.25);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(96, 37, 33, 0.08);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(96, 37, 33, 0.16);
  border-color: var(--brand-orange);
}

.gallery-img-wrapper {
  position: relative;
  width: 100%;
  height: 270px;
  overflow: hidden;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

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

/* Hover Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(96, 37, 33, 0.92) 0%, rgba(96, 37, 33, 0.3) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gallery-tag {
  display: inline-block;
  align-self: flex-start;
  background-color: var(--brand-orange);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.gallery-img-title {
  color: #FFFBE0;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: 0.2rem;
}

.gallery-zoom-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  background-color: rgba(255, 255, 255, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* Lightbox Modal */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(15, 10, 8, 0.94);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overscroll-behavior: contain;
  touch-action: none;
}

.gallery-lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 860px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-box {
  background-color: #1a100b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(245, 143, 41, 0.3);
  max-width: 100%;
  width: 100%;
}

.lightbox-image {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lightbox-caption {
  padding: 1rem 1.4rem;
  background-color: #241611;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-category {
  display: inline-block;
  color: var(--brand-orange);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 0.2rem;
}

.lightbox-title {
  color: #FFFBE0;
  font-size: 1.15rem;
  font-family: var(--font-heading);
}

.lightbox-counter {
  color: #d5c8b8;
  font-size: 0.85rem;
  font-weight: 500;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  color: #FFFBE0;
  font-size: 1.7rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  transition: transform var(--transition-fast);
}

.lightbox-close:hover {
  transform: scale(1.2);
  color: var(--brand-orange);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(96, 37, 33, 0.75);
  color: #ffffff;
  border: 1px solid rgba(245, 143, 41, 0.5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.lightbox-arrow:hover {
  background-color: var(--brand-brown);
  border-color: var(--brand-orange);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

.gallery-preview-footer {
  text-align: center;
  margin-top: 3rem;
}

.gallery-explore-btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(96, 37, 33, 0.15);
}

@media (max-width: 900px) {
  .lightbox-prev { left: 8px; background-color: rgba(15, 10, 8, 0.75); }
  .lightbox-next { right: 8px; background-color: rgba(15, 10, 8, 0.75); }
  .lightbox-close { top: -38px; right: 4px; }
}

@media (max-width: 768px) {
  .gallery-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(15, 10, 8, 0.88) 0%, rgba(15, 10, 8, 0.3) 50%, transparent 100%);
    padding: 1.25rem 1rem;
  }
  .gallery-zoom-icon { top: 0.75rem; right: 0.75rem; width: 32px; height: 32px; font-size: 1rem; }
  .gallery-img-title { font-size: 1.1rem; }
  .gallery-description { margin-top: -1.5rem; font-size: 0.95rem; padding: 0 0.5rem; }
}

@media (max-width: 650px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .gallery-img-wrapper { height: 220px; }
  .gallery-filters { gap: 0.4rem; }
  .gallery-filter-btn { padding: 0.45rem 1rem; font-size: 0.82rem; }
  .gallery-lightbox { padding: 0.8rem; }
  .lightbox-image { max-height: 55vh; }
  .lightbox-caption { padding: 0.75rem 1rem; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .lightbox-counter { align-self: flex-end; }
  .lightbox-arrow { width: 38px; height: 38px; font-size: 1.5rem; }
  .gallery-explore-btn { width: 100%; max-width: 320px; }
}

