/* =======================
   PROJECTS SECTION
======================= */

/* ===== Filter Buttons ===== */
.filter-buttons {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.filter-btn {
  background: #fff;
  border: 2px solid #333;
  color: #333;
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.filter-btn:hover {
  background: #333;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.filter-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ===== Shared Gallery Base ===== */
.gallery-one,
.gallery-two {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  margin-bottom: 40px;
  align-items: stretch;
  grid-template-rows: repeat(2, 300px);
}

.gallery-one .gallery-item,
.gallery-two .gallery-item {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.gallery-one img,
.gallery-two img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* ===== Gallery One (Big on Left) ===== */
.gallery-one {
  grid-template-columns: 2fr 1fr;
}

.gallery-one .big {
  grid-column: 1;
  grid-row: 1 / span 2;
}

/* ===== Gallery Two (Big on Right) ===== */
.gallery-two {
  grid-template-columns: 1fr 2fr;
}

.gallery-two .big {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* ===== Overlay Styles ===== */
.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  color: #fff;
  border-radius: inherit;
  transition: all 0.3s ease;
}

.gallery-item:hover .overlay {
  background: none;
  transform: none;
  opacity: 1;
}

/* ===== Black & White + Gradient Overlay ===== */
.gallery-item.bw-bottom {
  position: relative;
  filter: grayscale(100%);
  overflow: hidden;
}

.gallery-item.bw-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  z-index: 1;
}

.gallery-item.bw-bottom .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  z-index: 2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.gallery-item.bw-bottom .overlay h3,
.gallery-item.bw-bottom .overlay p {
  color: #fff;
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
  line-height: 1.1;
  opacity: 1;
  word-wrap: break-word;
  white-space: normal;
  max-width: 95%;
}

/* ===== Sub Headings ===== */
.gallery-wrapper h4 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #111;
  margin: 5rem 0 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.3;
}

/* =======================
   RESPONSIVE DESIGN
======================= */

/* --- Tablets (≤ 1024px) --- */
@media (max-width: 1024px) {
  .section-title {
    font-size: 2.2rem;
  }

  /* 2-column layout for tablets */
  .gallery-one,
  .gallery-two {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .gallery-one .big,
  .gallery-two .big {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-item {
    height: 280px;
  }

  .overlay h3 {
    font-size: 1rem;
  }

  .overlay p {
    font-size: 0.85rem;
  }

  .gallery-wrapper h4 {
    font-size: 1.8rem;
  }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {

  /* Overlay container */
  .gallery-item {
    height: auto;
    overflow: visible;
  }

  /* Overlay itself */
  .overlay {
    position: relative;
    inset: unset;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem 1.2rem;
    overflow: visible;
  }

  /* Overlay text */
  .overlay h3,
  .overlay p {
    font-size: 0.6rem;
    line-height: 1.3;
    max-width: 100%;
    margin: 0;
    color: #fff;
  }

  /* Limit paragraph to 1 line with ellipsis */
  .overlay p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Filter buttons */
  .filter-buttons {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .filter-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* 1-column stacked layout */
  .gallery-one,
  .gallery-two {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .gallery-one .big,
  .gallery-two .big {
    grid-row: auto;
    grid-column: auto;
  }

  .gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  /* Gallery section title */
  .gallery-wrapper h4 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
  }
}