/* ===== PORTFOLIO PAGE STYLES ===== */

/* Filter Bar */
.filter-section {
  background: var(--white);
  padding: 28px 0;
  border-bottom: 1px solid var(--ivory);
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--ivory);
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--gold-light);
  color: var(--gold-dark);
  background: var(--ivory);
}

.filter-btn.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--white);
}

/* Gallery Grid */
.gallery-section { padding-top: 60px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 320px;
  gap: 16px;
}

.gallery-item { border-radius: var(--radius-md); overflow: hidden; }
.gallery-item-tall { grid-row: span 2; }
.gallery-item-wide { grid-column: span 2; }

.gallery-item.hidden {
  display: none;
}

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

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.85) 0%, rgba(26,26,26,0.1) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.08); }

/* Hide overlay for bedroom items so images display without dark overlay */
.gallery-item[data-category="bedroom"] .gallery-overlay {
  display: none !important;
}

.gallery-info { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }

.gallery-tag {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 10px;
  width: fit-content;
}

.gallery-info h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.gallery-info p {
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
}

.gallery-zoom {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
  font-size: 0.9rem;
}

.gallery-zoom:hover {
  background: var(--gold);
  border-color: var(--gold);
}

/* Before After on Portfolio */
.ba-slider-wrapper {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  cursor: ew-resize;
}

.ba-slider {
  position: relative;
  width: 100%;
  height: 520px;
  user-select: none;
}

.ba-before, .ba-after {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ba-before img, .ba-after img {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-after { clip-path: inset(0 50% 0 0); }

.ba-label {
  position: absolute;
  bottom: 20px; left: 20px;
  background: rgba(26,26,26,0.75);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}

.ba-label-right { left: auto; right: 20px; background: rgba(200,169,110,0.85); }

.ba-handle {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 3px;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ba-handle-circle {
  width: 48px; height: 48px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  color: var(--charcoal);
  font-size: 1rem;
}

/* Results */
.results-section { padding: 60px 0; }
.results-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.result-item {
  flex: 1;
  text-align: center;
  padding: 24px;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.result-item:last-child { border-right: none; }
.result-item .stat-num { color: var(--white); font-size: 3.2rem; font-family: var(--font-heading); font-weight: 300; }
.result-item .stat-plus { color: var(--gold); font-size: 1.1rem; font-weight: 600; }
.result-item p { color: rgba(255,255,255,0.5); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 8px; }

/* CTA */
.cta-banner { position: relative; padding: 120px 0; text-align: center; overflow: hidden; }
.cta-bg { position: absolute; inset: 0; }
.cta-bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(42,42,42,0.88), rgba(42,42,42,0.7)); }
.cta-content { position: relative; z-index: 2; }
.cta-content h2 em { font-style: italic; color: var(--gold-light); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.open { opacity: 1; pointer-events: all; }

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  object-fit: contain;
}

.lightbox-content p {
  color: rgba(255,255,255,0.7);
  margin-top: 16px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.lightbox-close {
  position: absolute;
  top: -48px; right: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 1.1rem;
  transition: var(--transition);
}

.lightbox-close:hover { background: var(--gold); border-color: var(--gold); }

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item-wide { grid-column: span 1; }
}

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .gallery-item-tall { grid-row: span 1; }
  .ba-slider { height: 280px; }
  .results-grid { flex-wrap: wrap; }
  .result-item { flex: 1 1 40%; border-right: none; }
}
