/* ==========================================================================
   Project Approach Section ("رویکرد ما در هر پروژه")
   5-Step Sequential Animated Process Section
   ========================================================================== */

/* ==== FONTS ==== */
@font-face {
  font-family: Koodak;
  src: url(/static/Font/B_Koodak.ttf);
}

/* ==== end FONTS ==== */

.project-approach-section {
  background-color: #f7f9fc;
  padding: 60px 24px 70px 24px;
  direction: rtl;
  font-family: iranyekan, system-ui, -apple-system, sans-serif;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
  position: relative;
}

.project-approach-container {
  max-width: 1320px;
  margin: 0 auto;
  text-align: center;
}

/* Section Title */
.project-approach-title {
  font-size: 2rem;
  font-weight: 900;
  color: #0f1b29;
  margin: 0 0 50px 0;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
  font-family: 'Koodak';
}

/* Timeline Flex Wrapper */
.approach-steps-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  position: relative;
  padding-top: 25px;
  /* space for top circles */
  gap: 0;
  direction: ltr;
}

/* Connectors (Arrow lines between steps) */
.step-connector {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -25px;
  /* align with top circle row center Y */
  height: 49px;
  color: #0f1b29;
  opacity: 0;
  transform: translateX(-15px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  overflow: visible;
}

.connector-start {
  flex: 0 0 24px;
}

.connector-end {
  flex: 0 0 24px;
}

.connector-line {
  position: absolute;
  top: 50%;
  left: -100px;
  right: -380%;
  height: 1.5px;
  background-color: #0f1b29;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease-out;
  z-index: 1;
}

.connector-start .connector-line {
  left: 25px;
  right: -400%;
}

.connector-end .connector-line {
  left: -340%;
  right: 25px;
}

.connector-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #0f1b29;
  z-index: 3;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Step Cards */
.approach-step-card {
  flex: 1 1 0px;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  padding: 35px 16px 24px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 27, 41, 0.03);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  z-index: 2;
  /* above connector lines (z-index:1), card bg hides line in card interior */
}

.approach-step-card:hover {
  box-shadow: 0 8px 24px rgba(15, 27, 41, 0.08);
  transform: translateY(-4px);
}

/* Step Circle Badge at Top Center */
.step-circle {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0f1b29;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(15, 27, 41, 0.25);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon Box & SVG */
.step-icon-box {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-svg-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

/* Step Content */
.step-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f1b29;
  margin: 0 0 10px 0;
  line-height: 1.4;
  font-family: 'Koodak';
}

.step-description {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
  font-weight: 400;
}

/* ==========================================================================
   Sequential Scroll Animation Rules (Triggered when section has .in-view)
   ========================================================================== */

/* Step 1 Animation */
.project-approach-section.in-view .step-anim-1.step-connector {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateX(0);
}

.project-approach-section.in-view .step-anim-1 .connector-line {
  transition-delay: 0.15s;
  transform: translateY(-50%) scaleX(1);
}

.project-approach-section.in-view .step-anim-1 .connector-arrow {
  transition-delay: 0.35s;
  transform: translate(-50%, -50%) scale(1);
}

.project-approach-section.in-view .step-anim-1.approach-step-card {
  transition-delay: 0.4s;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-approach-section.in-view .step-anim-1 .step-circle {
  transition-delay: 0.55s;
  transform: translateX(-50%) scale(1);
}

/* Step 2 Animation */
.project-approach-section.in-view .step-anim-2.step-connector {
  transition-delay: 0.8s;
  opacity: 1;
  transform: translateX(0);
}

.project-approach-section.in-view .step-anim-2 .connector-line {
  transition-delay: 0.85s;
  transform: translateY(-50%) scaleX(1);
}

.project-approach-section.in-view .step-anim-2 .connector-arrow {
  transition-delay: 1.05s;
  transform: translate(-50%, -50%) scale(1);
}

.project-approach-section.in-view .step-anim-2.approach-step-card {
  transition-delay: 1.1s;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-approach-section.in-view .step-anim-2 .step-circle {
  transition-delay: 1.25s;
  transform: translateX(-50%) scale(1);
}

/* Step 3 Animation */
.project-approach-section.in-view .step-anim-3.step-connector {
  transition-delay: 1.5s;
  opacity: 1;
  transform: translateX(0);
}

.project-approach-section.in-view .step-anim-3 .connector-line {
  transition-delay: 1.55s;
  transform: translateY(-50%) scaleX(1);
}

.project-approach-section.in-view .step-anim-3 .connector-arrow {
  transition-delay: 1.75s;
  transform: translate(-50%, -50%) scale(1);
}

.project-approach-section.in-view .step-anim-3.approach-step-card {
  transition-delay: 1.8s;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-approach-section.in-view .step-anim-3 .step-circle {
  transition-delay: 1.95s;
  transform: translateX(-50%) scale(1);
}

/* Step 4 Animation */
.project-approach-section.in-view .step-anim-4.step-connector {
  transition-delay: 2.2s;
  opacity: 1;
  transform: translateX(0);
}

.project-approach-section.in-view .step-anim-4 .connector-line {
  transition-delay: 2.25s;
  transform: translateY(-50%) scaleX(1);
}

.project-approach-section.in-view .step-anim-4 .connector-arrow {
  transition-delay: 2.45s;
  transform: translate(-50%, -50%) scale(1);
}

.project-approach-section.in-view .step-anim-4.approach-step-card {
  transition-delay: 2.5s;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-approach-section.in-view .step-anim-4 .step-circle {
  transition-delay: 2.65s;
  transform: translateX(-50%) scale(1);
}

/* Step 5 Animation */
.project-approach-section.in-view .step-anim-5.step-connector {
  transition-delay: 2.9s;
  opacity: 1;
  transform: translateX(0);
}

.project-approach-section.in-view .step-anim-5 .connector-line {
  transition-delay: 2.95s;
  transform: translateY(-50%) scaleX(1);
}

.project-approach-section.in-view .step-anim-5 .connector-arrow {
  transition-delay: 3.15s;
  transform: translate(-50%, -50%) scale(1);
}

.project-approach-section.in-view .step-anim-5.approach-step-card {
  transition-delay: 3.2s;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-approach-section.in-view .step-anim-5 .step-circle {
  transition-delay: 3.35s;
  transform: translateX(-50%) scale(1);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 1024px) {
  .approach-steps-wrapper {
    flex-wrap: wrap;
    gap: 28px 16px;
    justify-content: center;
  }

  .step-connector {
    display: none;
    /* simplified view for tablets */
  }

  .approach-step-card {
    flex: 0 0 calc(33.333% - 16px);
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  .approach-step-card {
    flex: 0 0 calc(50% - 16px);
  }
}

@media (max-width: 520px) {
  .approach-step-card {
    flex: 0 0 100%;
  }

  .project-approach-title {
    font-size: 1.6rem;
  }
}