/* =========================================
   Portfolio Page Specific Styles
   ========================================= */

.page-portfolio {
  background-color: var(--bg-light);
}

/* Portfolio Header */
.page-header { padding: 150px 0 60px; text-align: center; }
.page-header h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; color: var(--primary-color); margin-bottom: 10px; }
.page-header p { font-size: 1.25rem; color: #555; }

/* Filter Controls */
.filter-controls { display: flex; justify-content: center; gap: 15px; margin-bottom: 50px; flex-wrap: wrap; }
.filter-btn {
  padding: 10px 25px; border: 2px solid #ddd; background: transparent; 
  border-radius: var(--radius-pill); font-family: var(--font-main); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.3s;
}
.filter-btn:hover, .filter-btn.active { border-color: var(--primary-color); background: var(--primary-color); color: var(--text-light); }

/* Full Grid Layout */
.full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  grid-auto-flow: dense;
  align-items: start;
}
.full-grid .gallery-item { 
  position: relative; 
  border-radius: 12px; 
  overflow: hidden; 
  cursor: pointer; 
  display: block; 
  /* Force WebKit to strictly enforce overflow clipping on border-radius during transitions */
  -webkit-mask-image: radial-gradient(white, black); 
  mask-image: radial-gradient(white, black);
  isolation: isolate; 
  transform: translateZ(0); 
}
.full-grid .gallery-item img { width: 100%; height: auto; display: block; transition: transform 0.6s ease; }
.full-grid .gallery-item:hover img { transform: scale(1.05); }

/* Photo Editing Mosaic Showcase */
.full-grid .gallery-item.photo-mosaic-showcase {
  grid-column: 1 / -1;
  background-color: #d8d8d8; /* Matching the grey background from the design */
  border-radius: 20px;
  padding: 30px;
  cursor: default;
}
.photo-mosaic-grid {
  display: block;
  column-count: 3;
  column-gap: 15px;
}
.m-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  /* Fix WebKit bug for inner elements too */
  -webkit-mask-image: radial-gradient(white, black); 
  mask-image: radial-gradient(white, black);
  isolation: isolate; 
  transform: translateZ(0); 
}
.full-grid .photo-mosaic-grid .m-item img {
  width: 100%;
  height: auto; /* Natural height, no cropping! */
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.6s ease;
}
.m-item:hover img {
  transform: scale(1.1);
  filter: brightness(1.05);
}

@media (max-width: 768px) {
  .full-grid .gallery-item.photo-mosaic-showcase {
    padding: 15px;
  }
  .photo-mosaic-grid {
    column-count: 2; /* 2 columns on mobile */
  }
}

/* Hidden utility for JS filtering */
.gallery-item.hidden { display: none !important; }

/* Full width landscape items */
.full-grid .gallery-item.item-landscape {
  grid-column: 1 / -1;
}

/* Logo specific formatting (Make them look like cards) */
.full-grid .gallery-item[data-category="logos"] {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  border: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3; /* Gives a consistent box shape */
}

.full-grid .gallery-item[data-category="logos"] img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dynamic Branding Special Showcase */
.full-grid .gallery-item.branding-showcase {
  grid-column: 1 / -1;
  display: flex;
  background-color: var(--showcase-bg, #f7e6cc);
  border-radius: 20px;
  padding: 30px;
  gap: 20px;
  cursor: default;
  align-items: stretch;
}
.full-grid .gallery-item.branding-showcase img {
  width: auto; height: auto; transition: none;
}
.full-grid .gallery-item.branding-showcase:hover img {
  transform: none;
}
.fbs-left {
  flex: 0 0 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.fbs-left img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
}
.fbs-right {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.fbs-gradient {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 80px;
  background: linear-gradient(to right, var(--showcase-bg, #f7e6cc) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}
.fbs-scroll-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 0;
  width: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
}
.fbs-scroll-track::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}
.fbs-post {
  flex: 0 0 auto;
  background-color: transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}
.fbs-post img {
  width: auto !important;
  height: 350px !important;
  max-width: 100%;
  object-fit: contain !important;
  display: block;
  transition: transform 0.4s ease !important;
  border-radius: 12px;
}
.fbs-post:hover img {
  transform: scale(1.03) !important;
}
@media (max-width: 768px) {
  .full-grid .gallery-item.branding-showcase {
    flex-direction: column;
    padding: 20px;
  }
  .fbs-left {
    flex: 0 0 auto;
    margin-bottom: 20px;
  }
  .fbs-right {
    width: 100%;
  }
  .fbs-gradient {
    display: none;
  }
}







/* Media Queries for Portfolio */
@media (max-width: 480px) {
  .full-grid { grid-template-columns: 1fr; }
}
