/* ==========================================================================
   Ground Impact & Seva Photo Gallery Stylesheet
   Kram Yog Sewa Sadan Trust
   ========================================================================== */

:root {
  --gallery-primary: #1b5182;
  --gallery-primary-dark: #113252;
  --gallery-accent: #13a34a;
  --gallery-accent-hover: #0f853c;
  --gallery-dark: #0f172a;
  --gallery-gray-50: #f8fafc;
  --gallery-gray-100: #f1f5f9;
  --gallery-gray-200: #e2e8f0;
  --gallery-gray-600: #475569;
  --gallery-gray-800: #1e293b;
  --gallery-radius: 12px;
  --gallery-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --gallery-shadow-hover: 0 16px 32px rgba(27, 81, 130, 0.16);
  --gallery-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Section Container --- */
.ground-gallery-section {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 70px 0 80px;
  position: relative;
  overflow: hidden;
}

.ground-gallery-section .header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Section Header */
.gallery-section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 40px;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #e0f2fe;
  color: var(--gallery-primary);
  border: 1px solid #bae6fd;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.gallery-badge i {
  color: var(--gallery-accent);
}

.gallery-section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gallery-primary);
  line-height: 1.25;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.gallery-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--gallery-accent);
  border-radius: 2px;
}

.gallery-section-subtitle {
  font-size: 15px;
  color: var(--gallery-gray-600);
  line-height: 1.6;
  margin-top: 6px;
}

/* Filter Controls */
.gallery-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 35px;
}

.gallery-filter-btn {
  background: #ffffff;
  border: 1px solid var(--gallery-gray-200);
  color: var(--gallery-gray-600);
  padding: 8px 18px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--gallery-transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.gallery-filter-btn:hover {
  background: var(--gallery-gray-100);
  color: var(--gallery-primary);
  border-color: #cbd5e1;
}

.gallery-filter-btn.active {
  background: var(--gallery-primary);
  color: #ffffff;
  border-color: var(--gallery-primary);
  box-shadow: 0 4px 12px rgba(27, 81, 130, 0.25);
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: stretch;
}

/* --- Gallery Card --- */
.gallery-card {
  background: #ffffff;
  border-radius: var(--gallery-radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--gallery-gray-200);
  transition: var(--gallery-transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(27, 81, 130, 0.14);
  border-color: rgba(27, 81, 130, 0.3);
}

/* Card Image Wrapper */
.gallery-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 205px;
  overflow: hidden;
  background: #f1f5f9;
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Category Badge on Image */
.gallery-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(17, 50, 82, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gallery-card-badge i {
  color: #34d399;
}

/* Hover Overlay */
.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.75) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

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

.gallery-zoom-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--gallery-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Card Content Area */
.gallery-card-content {
  padding: 16px 18px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gallery-gray-800);
  line-height: 1.35;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.gallery-card-desc {
  font-size: 12px;
  color: var(--gallery-gray-600);
  line-height: 1.5;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3em;
}

.gallery-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gallery-gray-100);
  padding-top: 10px;
  margin-top: auto;
  font-size: 11.5px;
  font-weight: 600;
}

.gallery-view-link {
  color: var(--gallery-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  transition: color 0.2s;
}

.gallery-card:hover .gallery-view-link {
  color: var(--gallery-accent);
}

.gallery-trust-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gallery-accent);
  background: rgba(19, 163, 74, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Lightbox Modal --- */
.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-modal.active {
  display: flex;
  opacity: 1;
}

.gallery-modal-content {
  position: relative;
  max-width: 960px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--gallery-radius);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modal Header */
.gallery-modal-header {
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--gallery-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.gallery-modal-title-wrap h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gallery-primary);
  margin: 0;
  line-height: 1.25;
}

.gallery-modal-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--gallery-accent);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: inline-block;
  margin-bottom: 2px;
}

.gallery-modal-close {
  background: var(--gallery-gray-100);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--gallery-gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gallery-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg);
}

/* Modal Body */
.gallery-modal-body {
  position: relative;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 65vh;
  overflow: hidden;
}

.gallery-modal-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

/* Navigation Arrows inside Modal */
.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 5;
}

.gallery-nav-btn:hover {
  background: #ffffff;
  color: var(--gallery-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.gallery-nav-prev {
  left: 16px;
}

.gallery-nav-next {
  right: 16px;
}

/* Modal Footer / Caption */
.gallery-modal-footer {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid var(--gallery-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.gallery-modal-caption {
  font-size: 13.5px;
  color: var(--gallery-gray-600);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.gallery-modal-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--gallery-primary);
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 14px;
  white-space: nowrap;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .gallery-card-img-wrapper {
    height: 195px;
  }
}

@media (max-width: 820px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .gallery-section-title {
    font-size: 1.8rem;
  }
  .gallery-card-img-wrapper {
    height: 190px;
  }
}

@media (max-width: 540px) {
  .ground-gallery-section {
    padding: 50px 0 60px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .gallery-section-title {
    font-size: 1.5rem;
  }
  .gallery-card-img-wrapper {
    height: 215px;
  }
  .gallery-card-title {
    height: auto;
  }
  .gallery-card-desc {
    height: auto;
  }
  .gallery-modal {
    padding: 10px;
  }
  .gallery-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .gallery-modal-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
