/* Layout */
.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 4vw, 3rem);
}

  /* Sidebar */
  .sidebar h3 {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    text-transform: uppercase;
  }
  
  .sidebar ul {
    list-style: none;
    padding: 0;
  }
  
  .sidebar li {
    margin-bottom: 0.75rem;
  }
  
  .filter-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #777;
    padding: 0;
  }
  
  .filter-btn.active {
    color: #000;
    font-weight: 600;
    text-decoration: underline;
  }
  
/* Masonry Grid */
.grid {
  column-gap: clamp(1rem, 3vw, 2rem);
  column-count: 3;
}
.grid {
  column-gap: clamp(1rem, 3vw, 2rem);
  column-count: 3;
}

@media (max-width: 1200px) {
  .grid {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .grid {
    column-count: 1;
  }
}



/* Portfolio Item */
.item {
  break-inside: avoid;
  margin-bottom: 2rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.item img {
  width: 100%;
  display: block;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.item img.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Caption */
figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

/* Hidden state for filtering */
.item.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}


.sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
}

  /* Responsive */
  @media (max-width: 900px) {
    .portfolio-layout {
      grid-template-columns: 1fr;
    }

    .sidebar {
      position: relative;
      top: auto;
      border-bottom: 1px solid #e5e5e5;
      padding-bottom: 1rem;
    }
  
    .sidebar h3 {
      display: none;
    }
  
    .sidebar ul {
      display: flex;
      gap: 1.25rem;
      overflow-x: auto;
      padding-bottom: 0.5rem;
    }
  
    .sidebar li {
      margin-bottom: 0;
      white-space: nowrap;
    }
  }
  

  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
  }
  
  .lightbox.active {
    opacity: 1;
    pointer-events: all;
  }
  
  .lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  }
  
  .lightbox p {
    margin-top: 16px;
    color: #eee;
    font-size: 16px;
    opacity: 0.85;
    max-width: 80%;
    text-align: center;
  }
  
  /* Mobile tweaks */
  @media (max-width: 600px) {
    .lightbox img {
      max-width: 95vw;
      max-height: 70vh;
    }
  }
  
  .item img {
    cursor: zoom-in;
  }

  @media (hover: hover) {
    .item img:hover {
      transform: scale(1.02);
    }
  }

  