/* ================================
   PROJECT HERO
================================ */

.project-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero-overlay);
}

.project-hero__website {
  margin-top: var(--space-md);
}

/* ================================
   PROJECT SECTION (content-height)
================================ */

.proj-section--dark {
  background-color: var(--color-blue);
  color: var(--color-white);
}

/* text + media split */
.proj-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Yellow text labels are reserved for dark project surfaces. */
.proj-section--dark .label,
.proj-section--dark .proj-stat__label {
  color: var(--color-yellow);
}

.proj-split__text .label {
  margin-bottom: var(--space-sm);
}

.proj-split__text h2 {
  font-size: var(--text-5xl);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.proj-split__text p {
  margin-bottom: var(--space-md);
  max-width: 520px;
}

/* no trailing margin under the last paragraph → the gap to the image is just
   the grid gap (small on mobile), not paragraph-margin + gap stacked */
.proj-split__text p:last-child { margin-bottom: 0; }

.proj-section--dark .proj-split__text p {
  color: var(--text-on-dark);
}

.proj-media {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 62vh;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background-color: var(--color-grey);
}

.proj-split--text-only { grid-template-columns: 1fr; }

.proj-media--contain {
  object-fit: contain;
  background-color: var(--color-white);
}

.project-sdgs {
  margin-top: var(--space-md);
}

.project-sdgs__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.project-sdgs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-sdgs__list li {
  flex: 0 0 auto;
  width: calc(var(--space-md) * 4);
  max-width: 100%;
}

.project-sdgs__icon {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

/* ================================
   PROJECT STATS ROW
================================ */
.proj-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--space-lg);
}

.proj-stat {
  padding-left: var(--space-md);
  border-left: 1px solid rgba(35, 45, 57, 0.2);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.proj-section--dark .proj-stat {
  border-left-color: rgba(255,255,255,0.25);
}

.proj-stat__value {
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1;
}

.proj-stat__label {
  font-family: var(--label-font);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  line-height: 150%;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-blue);
}

/* ================================
   MILESTONES
================================ */
/* Top-align content so the sticky left column has room to travel */
.proj-section.milestones {
  align-items: start;
}

.milestones__inner {
  width: 100%;
  max-width: var(--max-width-wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-xl);
  align-items: start;
}

/* Left column stays put; the timeline (any length, data-driven) scrolls past it */
.milestones__intro {
  position: sticky;
  top: calc(var(--header-height) + var(--space-sm) + var(--space-xs));
  align-self: start;
}

.milestones__head > .label {
  margin-bottom: var(--space-sm);
}

.milestones__intro h2 {
  margin-bottom: var(--space-md);
}

.milestones__meta > p {
  margin-bottom: var(--space-md);
  max-width: 380px;
}

.milestones__meta {
  width: 100%;
  container-type: inline-size;
}

.milestones__social {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

#milestones-contact > .btn {
  margin-bottom: var(--space-md);
}

.milestones__social a {
  color: var(--color-blue);
  transition: color 0.15s;
}

.milestones__social a:hover {
  color: var(--color-yellow);
}

/* Team lead uses the shared `.board-card` component (components.css) */
#teamlead:not(.board-card) {
  display: grid;
  gap: var(--space-md);
}

#teamlead .btn svg {
  flex-shrink: 0;
}

/* Keep contact labels readable when the desktop milestone column is narrow. */
@container (max-width: 400px) {
  #teamlead.board-card,
  #teamlead > .board-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    row-gap: var(--space-sm);
    text-align: center;
  }

  #teamlead .board-card__photo,
  #teamlead .board-card__person > div,
  #teamlead .btn {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }

  #teamlead .btn { margin-top: 0; }
}

/* ================================
   TIMELINE
================================ */
.timeline {
  position: relative;
  border-left: 2px solid var(--color-yellow);
  padding-left: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline__item {
  position: relative;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-lg) - 6px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-yellow);
}

.timeline__year {
  font-family: var(--label-font);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--color-blue);
  margin-bottom: var(--space-xs);
}

.timeline__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline__desc {
  font-size: var(--text-sm);
  color: var(--color-blue);
  max-width: 460px;
}

.timeline__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background-color: var(--color-grey);
  margin-top: var(--space-md);
}

.timeline__image--portrait {
  aspect-ratio: var(--timeline-portrait-ratio);
}

.timeline__image--natural {
  aspect-ratio: auto;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
  .project-hero__content {
    padding-inline: var(--space-md);
  }

  .proj-split,
  .milestones__inner {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .proj-split__text h2 { font-size: var(--text-3xl); margin-bottom: var(--space-sm); }

  /* tighter heading→text and paragraph spacing on mobile */
  .proj-split__text p { margin-bottom: var(--space-sm); }

  /* smaller gap between milestone entries */
  .timeline { gap: var(--space-md); }

  #teamlead:not(.board-card) { gap: var(--space-sm); }

  #teamlead.board-card,
  #teamlead > .board-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    row-gap: var(--space-sm);
    text-align: center;
  }

  #teamlead .board-card__photo,
  #teamlead .board-card__person > div,
  #teamlead .btn {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }

  #teamlead .btn { margin-top: 0; }

  /* Mobile milestones order: heading → timeline → intro text/socials → team lead.
     display:contents lifts the intro's head/meta out so they're siblings of the
     timeline in the flex column, then `order` interleaves them. */
  .milestones__inner {
    display: flex;
    flex-direction: column;
  }

  .milestones__intro {
    position: static;
    display: contents;
  }

  .milestones__head { order: 1; }
  .timeline { order: 2; }
  .milestones__meta { order: 3; }

  /* heading sits directly on the timeline — flex gap owns the spacing */
  .milestones__intro h2 { margin-bottom: 0; }

  .proj-stats {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .proj-stat {
    padding-left: 0;
    border-left: none;
  }
}
