/* =============================================================
   GALLERY.CSS  –  Sai Eswar Ortho Kids Care
   Styles for Gallery & Before-After pages
   ============================================================= */

/* Page layout and sections */
.gallery-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.gallery-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.gallery-section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--purple);
  margin-top: 8px;
  border-radius: 2px;
}

.gallery-section-desc {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 700px;
  line-height: 1.6;
}

/* Gallery Grids */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

/* Cards */
.gallery-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 4px 20px rgba(124,49,119,.02);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  border-color: var(--purple);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(124,49,119,.1);
}

.gallery-img-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f5;
}

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

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

.gallery-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-card-body h3 {
  font-size: 16px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.gallery-card-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Event Tag */
.gallery-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(42, 16, 64, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* Before and After Card Styling */
.ba-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 36px;
  margin-bottom: 64px;
}

@media (max-width: 480px) {
  .ba-grid {
    grid-template-columns: 1fr;
  }
}

.ba-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 4px 20px rgba(124,49,119,.02);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}

.ba-card:hover {
  border-color: var(--purple);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(124,49,119,.1);
}

.ba-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: #f0f0f0;
  border-bottom: 1.5px solid var(--border);
}

.ba-img-container {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}

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

.ba-img-container:hover img {
  transform: scale(1.05);
}

.ba-label-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.label-before {
  background: #e74c3c; /* Red for Before */
}

.label-after {
  background: #2ecc71; /* Green for After */
}

.ba-card-body {
  padding: 20px;
}

.ba-card-body h3 {
  font-size: 17px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.ba-card-body p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 9, 32, 0.94);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-modal.open {
  display: flex;
}

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

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.lightbox-caption {
  color: rgba(255,255,255,.9);
  margin-top: 16px;
  font-size: 15px;
  text-align: center;
  line-height: 1.5;
  max-width: 600px;
  font-weight: 500;
}

.lightbox-close-btn {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  transition: transform .2s, color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.lightbox-close-btn:hover {
  transform: scale(1.1);
  color: #f7b3f3;
}

@media (max-width: 768px) {
  .lightbox-close-btn {
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
  }
}
