/* About / our story: milestones + family blocks */

/* ========== STORY TIMELINE SECTION (squiggle, desktop only) ========== */
.section--story-timeline {
  position: relative;
}

.story-timeline-squiggle {
  display: none;
}

.section--story-timeline .section-title {
  margin-bottom: 5.25rem;
}

.section--story-timeline .story-timeline {
  margin-top: 1.5rem;
}

@media (min-width: 901px) {
  .section--story-timeline .section-title {
    margin-bottom: 5.25rem;
  }

  .section--story-timeline .story-timeline {
    position: relative;
    z-index: 1;
    margin-top: 2.25rem;
  }

  .section--story-timeline .milestone {
    position: relative;
    z-index: 1;
  }

  .story-timeline-squiggle {
    display: block;
    position: absolute;
    z-index: 0;
    pointer-events: none;
    /* Sit lower with timeline + extra space under heading; tall box preserved upward */
    top: calc(clamp(10.25rem, 12vw, 12.75rem) - 2.75rem);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1120px, 100%);
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      #000 1.25%,
      #000 97%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      #000 1.25%,
      #000 97%,
      transparent 100%
    );
  }

  .story-timeline-squiggle svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .story-timeline-squiggle__path {
    stroke: var(--brand-blue);
    stroke-width: 30;
    opacity: 0.4;
  }
}

/* ========== STORY TIMELINE (milestone cards) ========== */
.story-timeline {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.milestone {
  max-width: 1100px;
  margin: 0 auto;
}

.milestone__card {
  background: var(--white);
  padding: 40px 48px;
  border-radius: var(--radius-max);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 1;
}

.milestone__body :first-child {
  margin-top: 0;
}

.milestone__body :last-child {
  margin-bottom: 0;
}

.milestone__body p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 1em;
}

.milestone .story-year {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--brand-blue);
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.9;
}

.milestone__heading-sep {
  display: none;
}

.milestone__heading h3 {
  font-family: var(--font-heading);
  color: var(--brand-blue);
  font-size: 1.35rem;
  margin: 0 0 14px;
}

/* ----- Text-only (centered card) ----- */
.milestone--text-only .milestone__card {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.milestone--text-only .story-year {
  text-align: center;
  margin-bottom: 4px;
}

.milestone--text-only .milestone__body p {
  text-align: left;
}

/* ----- Photo laid on card (desktop) ----- */
.milestone--has-image {
  display: grid;
  grid-template-columns: minmax(252px, 0.5fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(14px, 2.5vw, 28px);
}

.milestone--image-right {
  grid-template-columns: minmax(0, 1fr) minmax(252px, 0.5fr);
}

/* Keep copy clear of the tilted “print” (rotation extends past the grid cell). */
.milestone--image-left .milestone__card {
  padding-left: clamp(60px, 5.5vw + 28px, 96px);
}

.milestone--image-right .milestone__card {
  padding-right: clamp(60px, 5.5vw + 28px, 96px);
}

.milestone--image-left .milestone__photo-aside {
  justify-self: end;
  margin-right: clamp(-40px, -3.25vw, -18px);
}

.milestone--image-right .milestone__photo-aside {
  justify-self: start;
  margin-left: clamp(-40px, -3.25vw, -18px);
}

.milestone__photo-aside {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 12px 0;
}

.milestone__photo {
  margin: 0;
  background: #fff;
  padding: 10px 10px 28px;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 14px 28px rgba(15, 23, 42, 0.12),
    0 28px 56px -16px rgba(15, 23, 42, 0.22);
  /* Avoid flex “% width” blowout: keep frame tight to the image */
  width: fit-content;
  max-width: min(480px, 100%);
  box-sizing: border-box;
  flex: 0 0 auto;
}

.milestone__photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.milestone__photo--tilt-left {
  transform: rotate(-5deg);
}

.milestone__photo--tilt-right {
  transform: rotate(5deg);
}

@media (prefers-reduced-motion: reduce) {
  .milestone__photo--tilt-left,
  .milestone__photo--tilt-right {
    transform: none;
  }
}

@media (max-width: 900px) {
  .story-timeline {
    gap: 56px;
  }

  .milestone__heading-sep {
    display: inline;
    font-family: var(--font-heading);
    font-weight: 600;
    opacity: 0.75;
    color: var(--brand-blue);
    padding: 0 0.05em;
  }

  .milestone__heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    column-gap: 0;
    row-gap: 0.15em;
    text-align: center;
    margin-bottom: 10px;
  }

  .milestone__heading .story-year {
    display: inline;
    margin-bottom: 0;
  }

  .milestone__heading h3 {
    display: inline;
    margin: 0;
    font-size: 1.3rem;
  }

  .milestone__body {
    border-left: 3px solid #d8d8d8;
    padding-left: 1.6rem;
    margin-top: 2px;
  }

  .milestone__body p {
    text-align: left;
    line-height: 1.48;
    margin: 0 0 0.85em;
    font-size: calc(1rem - 1px);
  }

  .milestone--has-image {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  /* Image first, then year + title + copy — no card chrome on small screens */
  .milestone--has-image .milestone__card {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    z-index: 0;
  }

  .milestone--has-image .milestone__photo--tilt-left,
  .milestone--has-image .milestone__photo--tilt-right {
    transform: none;
  }

  .milestone--image-left .milestone__photo-aside,
  .milestone--image-right .milestone__photo-aside {
    justify-self: center;
    justify-content: center;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    order: -1;
    padding: 0;
  }

  .milestone--has-image .milestone__photo {
    max-width: min(460px, calc(100% - 32px));
  }
}

@media (max-width: 768px) {
  .milestone__card {
    padding: 28px 24px;
  }

  .milestone--has-image .milestone__card {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .milestone--text-only .milestone__card {
    padding: 28px 24px;
  }
}
