/* Gallery Custom Stylesheet - TeamWork Constructions */

.gallery-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero_2.jpg') no-repeat center center;
  background-size: cover;
  padding: 120px 0;
  text-align: center;
  color: #fff;
}

.gallery-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.gallery-hero p {
  font-size: 1.2rem;
  font-weight: 300;
  color: #f0f0f0;
}

/* Stacking Container */
.gallery-stack {
  position: relative;
  max-width: 1000px;
  margin: 80px auto;
  padding: 0 20px;
}

/* Staggered Sticky Card Styling */
.gallery-card {
  position: -webkit-sticky;
  position: sticky;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 15px 35px rgba(54, 77, 89, 0.12), 0 5px 15px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(220, 224, 230, 0.7);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  margin-bottom: 100px;
  /* High margin bottom creates space for scrolling */
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

/* Staggered offsets for the stack cards */
.gallery-card:nth-child(1) {
  top: 100px;
  z-index: 1;
}

.gallery-card:nth-child(2) {
  top: 130px;
  z-index: 2;
}

.gallery-card:nth-child(3) {
  top: 160px;
  z-index: 3;
}

.gallery-card:nth-child(4) {
  top: 190px;
  z-index: 4;
}

.gallery-card:nth-child(5) {
  top: 220px;
  z-index: 5;
}

.gallery-card:nth-child(6) {
  top: 250px;
  z-index: 6;
}

/* Interactivity: hover state scales slightly and deepens the shadow */
.gallery-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 25px 50px rgba(54, 77, 89, 0.2), 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Alternate Image and Text order */
.gallery-card:nth-child(even) {
  flex-direction: row-reverse;
}

/* Card Media Section */
.gallery-card-media {
  flex: 1.2;
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-card:hover .gallery-card-media img {
  transform: scale(1.08);
}

/* Card Content Section */
.gallery-card-content {
  flex: 1;
  padding: 45px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.gallery-project-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fb7400;
  /* Accent Color */
  margin-bottom: 15px;
}

.gallery-project-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #364d59;
  margin-bottom: 15px;
  line-height: 1.3;
}

.gallery-project-desc {
  font-size: 0.95rem;
  color: #5d7c89;
  line-height: 1.7;
  margin-bottom: 25px;
  font-weight: 300;
}

.gallery-project-details {
  border-top: 1px dashed rgba(220, 224, 230, 0.8);
  padding-top: 20px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.gallery-detail-item {
  display: flex;
  flex-direction: column;
}

.gallery-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #9cb2bd;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gallery-detail-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #364d59;
}

.gallery-project-btn {
  align-self: flex-start;
  background: #364d59;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.gallery-project-btn:hover {
  background: #fb7400;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(251, 116, 0, 0.3);
}

/* Responsiveness */
@media (max-width: 991px) {
  .gallery-card {
    flex-direction: column !important;
    min-height: auto;
    margin-bottom: 80px;
  }

  .gallery-card-media {
    min-height: 300px;
  }

  .gallery-card-content {
    padding: 30px;
  }
}

@media (max-width: 576px) {
  .gallery-hero h1 {
    font-size: 2.5rem;
  }

  .gallery-card {
    border-radius: 16px;
    margin-bottom: 60px;
  }

  .gallery-card-media {
    min-height: 240px;
  }

  .gallery-card-content {
    padding: 24px;
  }

  .gallery-project-title {
    font-size: 1.4rem;
  }
}