/* ============================
   JM Heights – Gallery CSS
   ============================ */

.gallery-hero {
  padding: 5rem 0 4rem;
  background: 
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(212,130,26,0.08) 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.gallery-hero .section-tag { margin-bottom: 0.75rem; }

.gallery-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 1rem;
}

.gallery-hero p {
  max-width: 560px;
  color: var(--light-grey);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ========================
   Gallery Section
   ======================== */
.gallery-section { padding: 4rem 0 5rem; }

/* Filter Tabs */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--light-grey);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}
.filter-btn.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--dark);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  border-color: rgba(212,130,26,0.3);
}

.gallery-item--wide { grid-column: span 2; }

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

/* Thumbnail */
.gallery-thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.gallery-item--wide .gallery-thumb { aspect-ratio: 16/7; }

/* Color-coded placeholder backgrounds */
.hvac-thumb-1 { background: linear-gradient(135deg, #1A2C3D 0%, #0D1E2D 100%); }
.hvac-thumb-2 { background: linear-gradient(135deg, #1D2A3A 0%, #102030 100%); }
.contracting-thumb-1 { background: linear-gradient(135deg, #2D2010 0%, #1A1208 100%); }
.commercial-thumb-1 { background: linear-gradient(135deg, #1A1D10 0%, #0F1208 100%); }
.commercial-thumb-2 { background: linear-gradient(135deg, #12181D 0%, #0A0F14 100%); }
.renovation-thumb-1 { background: linear-gradient(135deg, #1D1020 0%, #120A14 100%); }
.renovation-thumb-2 { background: linear-gradient(135deg, #201510 0%, #140E0A 100%); }
.video-thumb-1 { background: linear-gradient(135deg, #1A1010 0%, #100A0A 100%); }
.video-thumb-2 { background: linear-gradient(135deg, #121820 0%, #0A1018 100%); }

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.2);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}

/* Actual image support */
.gallery-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-thumb img { transform: scale(1.04); }

/* Video placeholder */
.video-placeholder { cursor: pointer; }
.play-btn {
  width: 64px;
  height: 64px;
  background: rgba(212,130,26,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  padding-left: 4px;
}
.gallery-thumb:hover .play-btn {
  background: var(--orange);
  transform: scale(1.1);
}

/* Hover overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-thumb:hover .gallery-overlay { opacity: 1; }

.overlay-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--orange);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.overlay-btn:hover { transform: scale(1.1); }

/* Item info */
.gallery-item-info {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
}

.item-category {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.5rem;
}

.gallery-item-info h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.gallery-item-info p {
  font-size: 0.875rem;
  color: var(--light-grey);
  line-height: 1.6;
}

/* Gallery Note */
.gallery-note {
  margin-top: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(212,130,26,0.06);
  border: 1px dashed rgba(212,130,26,0.3);
  border-radius: 4px;
  padding: 1.5rem;
  color: var(--light-grey);
}
.note-icon { color: var(--orange); flex-shrink: 0; margin-top: 2px; }
.gallery-note strong { display: block; color: var(--white); margin-bottom: 0.25rem; font-size: 0.95rem; }
.gallery-note p { font-size: 0.85rem; line-height: 1.6; }
.gallery-note code {
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--orange-light);
}

/* Gallery CTA */
.gallery-cta {
  background: var(--mid);
  border-top: 1px solid var(--border);
}
.gallery-cta-inner {
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
}
.gallery-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.gallery-cta p {
  color: var(--light-grey);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }

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

.lightbox-content { max-width: 900px; width: 100%; }
.lightbox-img-wrap {
  border-radius: 4px;
  overflow: hidden;
  background: var(--dark);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-placeholder {
  width: 100%;
  height: 400px;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-grey);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item--wide { grid-column: span 1; }
  .gallery-item--wide .gallery-thumb { aspect-ratio: 4/3; }
}
