/* ============================================================
   PROJECTS PAGE — MINIMAL ARCHITECTURAL GRID
   ============================================================ */

/* ---- PAGE HERO ---- */
/* ---- PROJECTS BANNER ---- */
.projects-banner {
  width: 100%;
  height: 75vh;
  min-height: 550px;
  overflow: hidden;
  position: relative;
  background: #000;
}

.projects-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .projects-banner {
    height: 50vh;
    min-height: 350px;
  }
}

/* ---- FILTER BAR ---- */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 64px;
  position: sticky;
  top: 81px;
  z-index: 999;
  transition: top 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body:not(.header-visible) .filter-bar {
  top: 0;
}

.filter-bar-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  padding-bottom: 4px; /* Space for scrollbar */
}

.filter-bar-inner::-webkit-scrollbar {
  height: 4px;
}

.filter-bar-inner::-webkit-scrollbar-track {
  background: transparent; 
}

.filter-bar-inner::-webkit-scrollbar-thumb {
  background: #ccc; 
  border-radius: 4px;
}

.filter-bar-inner::-webkit-scrollbar-thumb:hover {
  background: #aaa; 
}

.filter-btn {
  padding: 24px 32px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}
.filter-btn.active {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.08);
  font-weight: 900;
}

/* ---- PROJECTS GRID ---- */
.projects-page {
  padding: 80px 0;
  background: var(--white);
}

.projects-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 40px;
}

.proj-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: transparent;
  overflow: hidden;
  transition: opacity 0.8s ease;
  cursor: pointer;
}

.proj-item-img {
  aspect-ratio: 16/9; /* Adjusted for shorter height per user request */
  overflow: hidden;
  position: relative;
  margin-bottom: 24px;
  background: #ffffff;
}

.proj-item-img-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 4.2s cubic-bezier(0.25, 1, 0.5, 1); /* Extended timing for cinematic zoom */
}

.proj-item:hover .proj-item-img-bg {
  transform: scale(1.08); /* Cinematic zoom factor */
}

.proj-item-content {
  padding: 0;
}

.proj-item-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 4px;
}

.proj-item-location {
  font-size: 1rem;
  font-weight: 500;
  color: #777;
  margin-bottom: 12px;
}

.proj-item-category {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-red);
  line-height: 1.4;
}

/* ============================================================
   RESPONSIVE — PROJECTS
   ============================================================ */
@media (max-width: 1100px) {
  .page-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .projects-page-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
  }
}
@media (max-width: 768px) {
  .page-hero {
    padding: 100px 0 48px;
  }
  .page-hero-title {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
  }
  .page-hero-desc {
    font-size: 0.95rem;
    max-width: 100%;
  }
  .page-hero-count {
    font-size: 0.75rem;
  }
  .projects-page {
    padding: 48px 0;
  }
  .projects-page-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .proj-item-title {
    font-size: 1.2rem;
  }
  .proj-item-location {
    font-size: 0.9rem;
  }
  .filter-btn {
    padding: 14px 20px;
    font-size: 0.7rem;
  }
  .filter-bar {
    padding: 0 16px;
    top: 64px;
  }
  body.header-visible .filter-bar {
    top: 64px;
  }
  body:not(.header-visible) .filter-bar {
    top: 0;
  }
}
@media (max-width: 480px) {
  .page-hero {
    padding: 80px 0 36px;
  }
  .page-hero-title {
    font-size: clamp(2rem, 9vw, 3.5rem);
  }
  .page-hero-desc {
    font-size: 0.85rem;
  }
  .projects-page {
    padding-top: 120px;
    padding-bottom: 36px;
  }
  .projects-page-grid {
    gap: 28px;
  }
  .proj-item-title {
    font-size: 1.1rem;
  }
  .proj-item-img {
    aspect-ratio: 16/10;
  }
  .filter-btn {
    padding: 12px 16px;
    font-size: 0.65rem;
  }
  .filter-bar {
    padding: 0 12px;
    top: 64px;
  }
  body.header-visible .filter-bar {
    top: 64px;
  }
  body:not(.header-visible) .filter-bar {
    top: 0;
  }
}

/* ============================================================
   SINGLE PROJECT — GALLERY SLIDER & LIGHTBOX
   ============================================================ */

.pd-hero { position: relative; width: 100%; height: 100vh; background: #111; overflow: hidden; }
.pd-gallery-slider { position: relative; width: 100%; height: 100%; }
.pd-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease; }
.pd-slide.active { opacity: 1; z-index: 1; }
.pd-slide img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }

.pd-gallery-controls { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.pd-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s; }
.pd-dot.active { background: #fff; transform: scale(1.3); }

.pd-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; background: rgba(0,0,0,0.5); border: none; color: #fff; padding: 12px; cursor: pointer; transition: background 0.3s; border-radius: 50%; }
.pd-nav-arrow:hover { background: rgba(0,0,0,0.8); }
.pd-prev { left: 20px; }
.pd-next { right: 20px; }

.pd-expand { position: absolute; top: 20px; right: 20px; z-index: 5; background: rgba(0,0,0,0.5); border: none; color: #fff; padding: 10px; cursor: pointer; border-radius: 50%; transition: background 0.3s; }
.pd-expand:hover { background: rgba(0,0,0,0.8); }

.pd-counter { position: absolute; top: 24px; left: 24px; z-index: 5; color: #fff; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; background: rgba(0,0,0,0.4); padding: 6px 14px; border-radius: 20px; }

/* Thumbnail Strip */
.pd-thumb-strip { background: #ffffff; padding: 16px 0; border-bottom: 1px solid var(--border); }
.pd-thumb-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pd-thumb { width: 100px; height: 70px; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.3s, opacity 0.3s; opacity: 0.6; flex-shrink: 0; }
.pd-thumb.active { border-color: var(--text-primary); opacity: 1; }
.pd-thumb:hover { opacity: 1; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Lightbox */
.pd-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.pd-lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.92); }
.pd-lightbox-img { position: relative; z-index: 1; max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 4px; }
.pd-lightbox-close { position: absolute; top: 20px; right: 24px; z-index: 2; background: none; border: none; color: #fff; font-size: 36px; cursor: pointer; line-height: 1; }
.pd-lightbox-prev, .pd-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,0.1); border: none; color: #fff; padding: 16px; cursor: pointer; border-radius: 50%; transition: background 0.3s; }
.pd-lightbox-prev:hover, .pd-lightbox-next:hover { background: rgba(255,255,255,0.25); }
.pd-lightbox-prev { left: 20px; }
.pd-lightbox-next { right: 20px; }
.pd-lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.9rem; font-weight: 600; z-index: 2; }

@media (max-width: 768px) {
  .pd-hero { height: 100vh; }
  .pd-nav-arrow { padding: 8px; }
  .pd-thumb { width: 70px; height: 50px; }
}

/* ============================================================
   MASONRY GALLERY GRID (below project details)
   ============================================================ */

.pd-masonry-section {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border, #e0e0e0);
  margin-top: 60px;
}
.pd-masonry-header {
  padding: 0 4vw;
}
.pd-masonry-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 40px;
  color: var(--text-primary, #1a1a1a);
}

.pd-masonry-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 12px;
  padding: 0 4vw;
}

/* Alternating layout pattern: 35/65 Ratio Portrait and Landscape */
.pd-masonry-item:nth-child(4n + 1) { grid-column: span 7; } /* Left Portrait (35%) */
.pd-masonry-item:nth-child(4n + 2) { grid-column: span 13; } /* Right Landscape (65%) */
.pd-masonry-item:nth-child(4n + 3) { grid-column: span 13; } /* Left Landscape (65%) */
.pd-masonry-item:nth-child(4n + 4) { grid-column: span 7; } /* Right Portrait (35%) */

.pd-masonry-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border-radius: 2px;
  height: 48vw;
}
.pd-masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 4.2s ease, filter 4.2s ease;
}
.pd-masonry-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.9);
}
.pd-masonry-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  pointer-events: none;
}
.pd-masonry-item:hover::after {
  background: rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
  .pd-masonry-grid {
    grid-template-columns: repeat(20, 1fr);
    gap: 8px;
    padding: 0 20px;
  }
  .pd-masonry-item { height: 46vw; }
  .pd-masonry-item:nth-child(4n + 1) { grid-column: span 7; }
  .pd-masonry-item:nth-child(4n + 2) { grid-column: span 13; }
  .pd-masonry-item:nth-child(4n + 3) { grid-column: span 13; }
  .pd-masonry-item:nth-child(4n + 4) { grid-column: span 7; }
  .pd-masonry-section { padding: 40px 0 20px; margin-top: 40px; }
}
