/* Media + list — image (left) beside eyebrow + heading + a list of items.
   Merged from the former content_list (About) + values_list (Career). Modifiers:
     .media-list--bleed        → image bleeds to the viewport's left edge and sticks, capped to
                                  the viewport height so it pins even when taller than the list.
     (no --bleed, default)     → image is contained in the grid and sticks while the list scrolls.
     .media-list--numbered/--icon → item rendering (auto 01 / 02 … vs icon/logo above title).
   NOTE: --bleed clips the left-edge overhang with overflow-x:clip; because only the x-axis is
   clipped, overflow-y stays visible, so vertical position:sticky still works underneath it. */
.media-list {
  padding-block: var(--section-y) 0;
}
.media-list--bleed {
  overflow-x: clip; /* contain the media's left-edge bleed (100vw vs scrollbar) */
}
.media-list__inner {
  row-gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* Optional full-width pull-quote across the top */
.media-list__quote {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: var(--lh-quote);
  color: var(--c-text);
  text-wrap: balance;
}

/* — Media (left) — */
.media-list__media {
  align-self: start;
}
.media-list__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.media-list--impact .media-list__media {
  max-height: 62.5rem;
  position: sticky;
  top: calc(var(--nav-height, 4.5rem) + 1.5rem); /* nav bar + breathing gap; --nav-height set in nav.js */
}

.media-list .media-list__main {
  grid-column: 7 / -1;
  position: sticky;
  top: calc(var(--nav-height, 4.5rem) + 1.5rem);
  padding-block: var(--section-y);
}

/* Contained + sticky (former content_list / About) */
.media-list:not(.media-list--bleed) .media-list__media {
  grid-column: 1 / 6;
}
.media-list:not(.media-list--bleed) .media-list__img {
  aspect-ratio: 3 / 4;
  border-radius: 4px;
}


/* Left-edge bleed + stretch to the list height (former values_list / Career).
   As a stretched grid item, the negative left margin grows the box leftward by the
   container's centred side-margin (0 once the viewport is narrower than the container)
   plus the page padding; .media-list--bleed clips the scrollbar-width overhang. */
.media-list--bleed .media-list__media {
  --edge-bleed: max(0px, (100vw - var(--container)) / 2);
  grid-column: 1 / span 6;
  align-self: start;
  margin-left: calc(-1 * (var(--edge-bleed) + var(--container-pad)) + var(--gutter));
  /* Sticky even when the image is taller than the list — cap to the viewport so it
     always fits and pins. */
  position: sticky;
  top: calc(var(--nav-height, 4.5rem) + 1.5rem);
  /* height: calc(100svh - var(--nav-height, 4.5rem) - 3rem); */
  max-height: 62.5rem;
}
.media-list--bleed .media-list__img {
  height: 100%; /* fill the stretched media box; object-fit crops */
  border-radius: var(--radius);
  object-position: center top;
}
.media-list--bleed .media-list__main {
  grid-column: 8 / -1;
}

/* — Head — */
.media-list__head {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.media-list__heading {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: var(--text-h5);
  line-height: var(--lh-snug);
  color: var(--c-heading);
}

/* — Items (shared) — */
.media-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.media-list__item {
  margin: 0;
}

.media-list__item-body {
  font-family: var(--font-body);
  color: var(--c-text);
}
.media-list__item-body p { margin: 0 0 1em; }
.media-list__item-body p:last-child { margin-bottom: 0; }
.media-list__item-body ul { margin: 0 0 1em; padding-left: 1.2em; }
.media-list__item-body li { margin-bottom: 0.5em; }
.media-list__item-body a { color: var(--c-link); text-decoration: underline; }

/* Numbered style (Career "One TTW") */
.media-list--numbered .media-list__items {
  gap: clamp(2.5rem, 5vw, 4.5rem);
}
.media-list__item-head {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-h6);
  line-height: var(--lh-snug);
  color: var(--c-text);
  margin-bottom: var(--sp-md);
}
.media-list__num {
  font-family: var(--font-body);
}
.media-list__sep {
  color: var(--color-clay);
}
.media-list--numbered .media-list__item-title {
  font-family: var(--font-body);
}
.media-list--numbered .media-list__item-body {
  font-weight: 300;
  font-size: var(--text-body-lg);
  line-height: var(--lh-body);
}

/* Icon style (About "Our Impact") */
.media-list--icon .media-list__items {
  gap: var(--sp-3xl);
}
.media-list__icon {
  margin-bottom: var(--sp-md);
}
.media-list__icon-img {
  width: auto;
  height: 48px;
  max-width: 200px;
  object-fit: contain;
}
.media-list--icon .media-list__item-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-h6);
  margin: 0 0 var(--sp-md);
}
.media-list--icon .media-list__item-body {
  font-size: var(--text-body-main);
}

/* — Mobile: stack full-width, drop sticky + bleed — */
@media (max-width: 768px) {
  .media-list__inner {
    row-gap: clamp(2rem, 8vw, 3rem);
  }
  .media-list__quote {
    font-size: var(--text-h4);
  }
  .media-list__media,
  .media-list__main {
    grid-column: 1 / -1;
  }
  .media-list__media {
    position: static;
    align-self: start;
    height: auto;
    max-height: none;
    margin-left: 0;
    margin-bottom: 2.5rem;
  }
  .media-list--bleed .media-list__img {
    height: auto;
    aspect-ratio: 4 / 5;
  }
}
