/**
 * Jupiter Brass Industries - Gallery Page Stylesheet
 * High-performance, fully responsive layout with clean modern aesthetics and lightbox viewer.
 */

/* 1. Gallery Hero Section */
.gallery-hero-section {
  position: relative;
  background: linear-gradient(180deg, #0b0c10 0%, #151821 100%);
  color: #ffffff;
  padding: clamp(120px, 11vw, 150px) 0 clamp(40px, 5vw, 60px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gallery-hero-section::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(850px, 95vw);
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(243, 27, 27, 0.18) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.gallery-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(243, 27, 27, 0.15);
  border: 1px solid rgba(243, 27, 27, 0.35);
  border-radius: 999px;
  color: #ff7575;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.gallery-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1.18;
  color: #ffffff;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.gallery-hero-title .title-accent {
  color: var(--color-primary, #F31B1B);
}

.gallery-hero-desc {
  font-family: var(--font-body);
  font-size: clamp(0.96rem, 1.15vw, 1.12rem);
  line-height: 1.7;
  color: #cbd5e1;
  max-width: 780px;
  margin: 0 0 28px 0;
}

.gallery-hero-stats {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
  flex-wrap: wrap;
}

.gallery-hero-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.gallery-hero-stat-pill strong {
  color: #ffffff;
  font-weight: 700;
}

/* 2. Gallery Main Section */
.gallery-main-section {
  padding: clamp(36px, 4vw, 60px) 0;
  background-color: #fafbfc;
  min-height: 500px;
}

/* 3. Responsive Pure Image Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* 4. Pure Image Gallery Item */
.gallery-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.12),
              0 0 0 1px rgba(243, 27, 27, 0.3);
  border-color: rgba(243, 27, 27, 0.4);
  outline: none;
}

.gallery-item-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* For product cutouts and clean tool PNGs, use contain to prevent cropping */
.gallery-item-inner.is-contain .gallery-item-img {
  object-fit: contain;
  padding: 12px;
}

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

/* Overlay on Hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.65) 100%);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

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

.gallery-zoom-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary, #F31B1B);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transform: scale(0.8);
  transition: transform 0.25s ease;
}

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

/* 5. Lightbox Modal */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 12, 16, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.is-open {
  display: flex;
  opacity: 1;
}

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

.gallery-lightbox-img-wrap {
  position: relative;
  max-width: 1000px;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.is-open .gallery-lightbox-img {
  transform: scale(1);
}

/* Lightbox Nav Buttons */
.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: var(--color-primary, #F31B1B);
  border-color: var(--color-primary, #F31B1B);
  transform: scale(1.08);
}

.gallery-lightbox-close {
  top: 24px;
  right: 24px;
}

.gallery-lightbox-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-prev:hover {
  transform: translateY(-50%) scale(1.08);
}

.gallery-lightbox-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-next:hover {
  transform: translateY(-50%) scale(1.08);
}

/* 6. Plant Visit CTA Card */
.gallery-cta-section {
  padding: clamp(40px, 6vw, 60px) 0 clamp(60px, 8vw, 90px);
  background: #fafbfc;
}

.gallery-cta-banner {
  background: linear-gradient(135deg, #12141a 0%, #1e222d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--color-primary, #F31B1B);
  border-radius: 20px;
  padding: clamp(32px, 5vw, 54px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.25);
}

.gallery-cta-content {
  max-width: 650px;
}

.gallery-cta-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
}

.gallery-cta-content p {
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
}

.gallery-cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.gallery-cta-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--color-primary, #F31B1B);
  color: #ffffff;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(243, 27, 27, 0.35);
}

.gallery-cta-btn-primary:hover {
  background: #d61414;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(243, 27, 27, 0.45);
  color: #ffffff;
}

.gallery-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.gallery-cta-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
  color: #ffffff;
}

/* 7. Mobile Perfection (<= 768px & <= 480px / 360px) */
@media (max-width: 768px) {
  .gallery-hero-section {
    padding-top: 115px;
    padding-bottom: 35px;
  }

  .gallery-lightbox-prev {
    left: 10px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-next {
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-img {
    max-height: 80vh;
  }

  .gallery-cta-banner {
    padding: 24px 18px;
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-cta-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-cta-btn-primary,
  .gallery-cta-btn-secondary {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .gallery-hero-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .gallery-hero-stats {
    gap: 8px;
  }

  .gallery-hero-stat-pill {
    font-size: 0.74rem;
    padding: 4px 10px;
  }

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

  .gallery-zoom-icon {
    width: 36px;
    height: 36px;
  }

  .gallery-zoom-icon svg {
    width: 18px;
    height: 18px;
  }
}
