.why-us {
  padding: 1em;
}

.why-us-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.why-us-title h2 {
  font-size: var(--title-font);
  text-align: center;
  margin-top: 1em;
  margin-bottom: 2em;
}

.why-us-content {
  display: flex;
  flex-direction: row;
  margin-bottom: 4em;
  justify-content: center;
  gap: 6em;
}

.why-us-item {
  font-size: var(--text-font);
  color: #333;
  max-width: 350px;
  text-align: justify;
}

.why-us-item-title {
  font-size: 1.5em;
  margin-bottom: 1em;
  text-align: center;
}

.why-us-item-image {
  display: flex;
  justify-content: center;
  margin-bottom: 1em;
}

/* About me*/

.about-me-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 3em auto;
  gap: 2em;
  flex-wrap: wrap;
  margin-top: 8em;
}

.about-me-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.about-me-image {
  flex: 1;
  position: relative;
  display: inline-block;
  width: 500px;
  margin: 0 auto;
  margin-top: 0.6em;
}

.about-me-image img[alt="Tajana"] {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
}

.about-me-title,
.my-story-title {
  font-size: var(--title-font);
  margin-bottom: 0.5em;
  margin-top: 0;
}

.about-me-text,
.my-story-text {
  font-size: var(--text-font);
  line-height: 1.5;
  color: #333;
  margin-bottom: 0;
  text-align: justify;
}

.my-story-container {
  flex: 2;
  text-align: justify;
}

/* SECOND SECTION*/

.work-process {
  background-color: var(--off-white);
  padding: 2em 2em 8em 3em;
  height: fit-content;
}

.work-process-wrapper {
  border-left: 5px solid var(--primary-color);
  padding-left: 0.7em;
}

.work-process-heading {
  margin-bottom: 3em;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 1em;
}

.work-process-title {
  margin: 0;
  margin-top: 1em;
  font-size: var(--title-font);
}

.work-process-subtitle {
  font-size: var(--text-font);
  margin-top: 0.2em;
  padding-top: 0.2em;
  color: #333;
  width: 50%;
  margin-bottom: 5em;
}

/* Timeline styles */
.timeline {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  max-width: 1200px;
  margin: 3em auto 0 auto;
  padding-bottom: 2em;
  min-height: 220px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  z-index: 0;
  transform: translateY(-50%);
}

.timeline-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  min-width: 180px;
  max-width: 260px;
  margin: 0 0.5em;
}

/* This is the trick: use a wrapper to align icon vertically centered */
.icon {
  width: 70px;
  height: 70px;
  background: #fff;
  border: 4px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Place .icon absolutely, so .textbox can be above or below */
.timeline-step {
  position: relative;
  min-height: 180px; /* Ensures enough space for text above/below */
}

.textbox {
  width: 100%;
}

.textbox h2 {
  color: black;
  font-size: 1.7em;
  margin-bottom: 0;
}

.textbox p {
  font-size: var(--text-font);
  margin-top: 0.5em;
  color: #333;
}

/* Default: text below the icon */
.timeline-step .textbox {
  position: absolute;
  left: 60%;
  top: calc(50% + 45px); /* icon height/2 + margin */
  transform: translateX(-50%);
  width: 330px;
}

/* .above: text above the icon */
.timeline-step.above .textbox {
  top: unset;
  bottom: calc(50% + 45px);
  left: 60%;
  transform: translateX(-50%);
  max-width: 330px;
}

@media (max-width: 900px) {
  .work-process-subtitle {
    display: none;
  }

  .work-process {
    padding-bottom: 2em;
    padding-top: 2em;
  }

  .work-process-wrapper {
    border-left: none;
    padding-left: 0;
  }

  .timeline {
    flex-direction: column;
    align-items: flex-start;
    max-width: 90vw;
    margin: 2em auto 0 auto;
    padding: 0;
    position: relative;
    min-height: unset;
    background: none;
  }

  /* Vertical line close to the left edge */
  .timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: -2px;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    z-index: 0;
    transform: none;
  }

  .timeline-step {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 2.5em 0;
    z-index: 1;
  }

  /* Icon is absolutely centered on the vertical line */
  .icon {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, 0);
    width: 50px;
    height: 50px;
    background: #fff;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  }

  /* Text is inline with the icon, with left margin to clear the icon */
  .textbox {
    position: relative;
    margin-left: 2em; /* 30px (line) + 25px (icon radius) + 15px gap */
    width: calc(100% - 2em);
    text-align: left;
    max-width: none;
    padding-top: 0.3em;
  }

  .textbox h2 {
    font-size: var(--mobile-title-font);
    margin-top: 0.4em;
    margin-bottom: 0.1em;
  }

  .textbox p {
    font-size: var(--text-font);
    margin-top: 0;
    margin-bottom: 0;
  }

  /* Remove absolute positioning for .textbox */
  .timeline-step .textbox,
  .timeline-step.above .textbox {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none;
    width: calc(100% - 2em);
    max-width: none;
  }

  /* Remove .above effect on mobile for consistency */
  .timeline-step.above {
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .why-us {
    padding: 0;
    max-width: 90%;
    margin: 0 auto;
  }

  .why-us-content {
    flex-direction: column;
  }

  .why-us-title h2 {
    font-size: var(--title-font);
    text-align: center;
    margin-left: 0;
  }

  .why-us-item-title {
    font-size: var(--mobile-title-font);
    color: black;
  }

  .why-us-item {
    font-size: var(--text-font);
  }
}

@media (max-width: 900px) {
  .about-me-wrapper {
    flex-direction: column;
    gap: 2em;
    max-width: 90%;
    padding: 0 0.5em;
    margin: 2em auto;
    margin-top: 5em;
  }

  .about-me-container,
  .my-story-container {
    padding: 0;
    max-width: 100%;
  }

  .about-me-title,
  .my-story-title {
    font-size: var(--title-font);
    text-align: left;
  }

  .about-me-text,
  .my-story-text {
    font-size: var(--text-font);
    text-align: justify;
    max-width: 100%;
    margin: 0 auto 1.5em auto;
    padding: 0 0.2em;
  }

  .about-me-image {
    width: 100%;
    max-width: 100%;
    margin: 1.2em auto 1.2em auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .about-me-image img[alt="Tajana"] {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    display: block;
    margin: 0 auto;
  }
}
