/* ========================================
   PROJECTS SECTION
   ======================================== */
#projects {
  background: #ffffff;
}

.projects__header {
  padding: 80px 60px 60px 60px;
  background: #ffffff;
}

.projects__label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.projects__heading {
  font-family: 'Poppins', sans-serif;
  font-size: 64px;
  font-weight: 700;
  color: #111111;
  line-height: 1.1;
  max-width: 900px;
  margin-bottom: 40px;
}

.projects__filters {
  display: flex;
  gap: 12px;
}

.projects__filter-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1.5px solid #111111;
  border-radius: 999px;
  padding: 12px 26px;
  background: transparent;
  color: #111111;
  cursor: pointer;
  transition: 0.2s ease;
}

.projects__filter-btn:hover {
  background: #111111;
  color: #ffffff;
}

/* HORIZONTAL SCROLL ENGINE */
.projects-section {
  height: calc(100dvh * 5);
  position: relative;
  background: #ffffff;
}

.projects-sticky {
  position: sticky;
  top: var(--space-nav-height);
  height: calc(100dvh - var(--space-nav-height));
  overflow: hidden;
  width: 100%;
}

.projects-track {
  display: flex;
  flex-direction: row;
  height: calc(100dvh - var(--space-nav-height));
  width: fit-content;
  will-change: transform;
  transition: transform 0s linear;
}

/* EACH CARD */
.project-card {
  width: 100vw;
  height: calc(100dvh - var(--space-nav-height));
  display: flex;
  flex-direction: row;
  border-top: 1.5px solid #111111;
  flex-shrink: 0;
}

/* LEFT PANEL */
.project-left {
  width: 32%;
  padding: 48px 40px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.project-number {
  font-family: 'Playfair Display', serif;
  font-size: 200px;
  font-weight: 700;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px #cccccc;
  display: block;
  margin-bottom: 20px;
}

.project-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 600;
  color: #111111;
  margin-bottom: 12px;
  line-height: 1.1;
}

.project-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 300;
  color: #666666;
  line-height: 1.5;
  max-width: 440px;
}

/* RIGHT PANEL */
.project-right {
  width: 68%;
  padding: 40px 40px 40px 0px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1.5px solid #111111;
}

.project-meta span {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #111111;
}

.project-image {
  flex: none;
  height: 72vh;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: auto 0;
}

/* MOBILE below 768px */
@media (max-width: 768px) {
  .projects__header {
    padding: 20px 20px 8px 20px !important; 
    border-bottom: 1px solid #e5e5e5 !important;
  }
  .projects__label {
    margin-bottom: 8px !important; /* Remove desktop 20px margin */
  }
  .projects__heading {
    font-size: 26px !important;
    line-height: 1.25 !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    margin-bottom: 8px !important; /* Remove desktop 40px margin */
  }
  .projects-sticky {
    top: 60px !important; /* Avoid top nav header so numbers don't hide */
    height: calc(100dvh - 60px) !important;
  }
  .project-card {
    width: 100vw !important;
    height: calc(100dvh - 60px) !important; /* Match sticky container */
    flex-direction: column !important;
    border-top: none !important;
  }
  .project-left {
    width: 100vw !important;
    height: auto !important; 
    flex: none !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 8px 20px 16px 20px !important; /* Reduced top padding to 8px to close the gap */
    justify-content: flex-start !important;
  }
  .project-number {
    font-size: 64px !important;
    -webkit-text-stroke: 1px #d0d0d0 !important;
    margin-bottom: 8px !important;
  }
  .project-title {
    font-size: 26px !important;
    margin-bottom: 8px !important;
  }
  .project-desc {
    font-size: 14px !important;
  }
  .project-right {
    width: 100vw !important;
    flex: 1 !important; 
    height: auto !important;
    padding: 0 20px 20px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
  }
  .project-meta {
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
    border-bottom: 1px solid #ebebeb !important;
    margin-top: 8px !important;
  }
  .project-meta span {
    font-size: 9px !important;
    letter-spacing: 1.5px !important;
  }
  .project-image {
    height: 40vh !important;
    max-height: 380px !important;
    width: 100% !important;
    border-radius: 8px !important;
    margin: 0 !important;
    object-fit: cover !important;
  }
}

/* PROJECT SLIDESHOW */
.project-slideshow {
  flex: none;
  position: relative;
  width: 100%;
  height: 72vh;
  margin: auto 0;
  border-radius: 8px;
  overflow: hidden;
}

.slideshow-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slideFade 14s infinite;
  animation-play-state: paused;
}

.last-slide {
  animation: slideFadeLast 14s infinite;
  animation-play-state: paused;
}

.project-slideshow.is-playing .slideshow-img {
  animation-play-state: running;
}

.slideshow-img:nth-child(2) { animation-delay: 1.2s; }
.slideshow-img:nth-child(3) { animation-delay: 3.2s; }
.slideshow-img:nth-child(4) { animation-delay: 5.2s; }
.slideshow-img:nth-child(5) { animation-delay: 7.2s; }
.slideshow-img:nth-child(6) { animation-delay: 9.2s; }
.slideshow-img:nth-child(7) { animation-delay: 11.2s; }

@keyframes slideFade {
  0% { opacity: 0; }
  5.71% { opacity: 1; }
  20.00% { opacity: 1; }
  20.01% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes slideFadeLast {
  0% { opacity: 0; }
  5.71% { opacity: 1; }
  14.29% { opacity: 1; }
  20.00% { opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 768px) {
  .project-slideshow {
    height: 40vh !important;
    max-height: 380px !important;
    margin: 0 !important;
  }
}
