/* ============================================================
   GALLERY PAGE — gallery.css
   Sunstar Construction and Interiors
   ============================================================ */

/* --- Hero Stats Strip --- */
.gallery-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-8);
  max-width: 900px;
}

.gallery-stat-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: left;
}

.gallery-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1.1;
  font-family: 'Sora', sans-serif;
}

.gallery-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* --- Gallery Filter Bar --- */
.gallery-filter-section {
  padding: var(--space-8) 0 var(--space-4) 0;
  background-color: var(--color-bg-surface);
  position: relative;
  z-index: 10;
}

.gallery-filter-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery-filter-wrap::-webkit-scrollbar {
  height: 4px;
}
.gallery-filter-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: var(--radius-full);
}

.gallery-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1.15rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: 'Sora', sans-serif;
  color: var(--color-text-secondary);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  user-select: none;
}

.gallery-filter-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-accent);
  background: var(--color-bg-surface);
  transform: translateY(-1px);
}

.gallery-filter-btn.active {
  color: #0A1628;
  background: var(--color-accent);
  border-color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 4px 14px rgba(229, 169, 59, 0.35);
}

.filter-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.gallery-filter-btn.active .filter-badge-count {
  background: rgba(0, 0, 0, 0.2);
  color: #0A1628;
}

/* --- Gallery Grid --- */
.gallery-section {
  padding-bottom: var(--space-20);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-6);
}

/* Gallery Card */
.gallery-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 340px;
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(10, 22, 40, 0.2);
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.gallery-card:hover .gallery-card__img {
  transform: scale(1.08);
}

/* Scrim Gradient */
.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.92) 0%,
    rgba(10, 22, 40, 0.45) 45%,
    rgba(10, 22, 40, 0.05) 80%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-5);
  transition: opacity var(--transition-base);
  z-index: 2;
}

.gallery-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-card__badge {
  background: rgba(255, 255, 255, 0.95);
  color: #0A1628;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gallery-card__zoom-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: transform var(--transition-fast), background-color var(--transition-fast), opacity var(--transition-fast);
}

.gallery-card:hover .gallery-card__zoom-btn {
  opacity: 1;
  transform: scale(1.1);
  background: var(--color-accent);
  color: #0A1628;
  border-color: var(--color-accent);
}

.gallery-card__bottom {
  margin-top: auto;
}

.gallery-card__title {
  color: #FFFFFF;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  font-family: 'Sora', sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gallery-card__desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.825rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Hidden items during category filtering */
.gallery-card.is-hidden {
  display: none !important;
}

/* Empty State */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  background: var(--color-bg-elevated);
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-xl);
}

.gallery-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  color: var(--color-text-muted);
}

.gallery-empty__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.gallery-empty__desc {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  max-width: 400px;
  margin: 0 auto;
}

/* --- LIGHTBOX MODAL --- */
.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: var(--space-4);
}

.gallery-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.gallery-modal__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
}

.gallery-modal__close:hover {
  background: var(--color-accent);
  color: #0A1628;
  transform: rotate(90deg);
}

.gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.gallery-modal__nav:hover {
  background: var(--color-accent);
  color: #0A1628;
  transform: translateY(-50%) scale(1.1);
}

.gallery-modal__nav--prev {
  left: 24px;
}

.gallery-modal__nav--next {
  right: 24px;
}

.gallery-modal__container {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 92vh;
}

.gallery-modal__img-wrap {
  width: 100%;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-modal__img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.gallery-modal__info {
  width: 100%;
  margin-top: var(--space-4);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  color: #FFFFFF;
}

.gallery-modal__meta {
  flex: 1;
}

.gallery-modal__badge {
  display: inline-block;
  background: var(--color-accent);
  color: #0A1628;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.gallery-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.gallery-modal__desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
}

.gallery-modal__counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  align-self: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-card {
    height: 300px;
  }
  .gallery-modal__nav {
    width: 42px;
    height: 42px;
  }
  .gallery-modal__nav--prev {
    left: 8px;
  }
  .gallery-modal__nav--next {
    right: 8px;
  }
  .gallery-modal__close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  .gallery-modal__info {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .gallery-card {
    height: 280px;
  }
  .gallery-stats-strip {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}
