/*
 * .list-photo-card — centred head on a dark blue textured background, a framed card with a title, a numbered
 * list and a photo card with a gradient caption panel (template-parts/flexible/list-photo-card.php,
 * photo card: components/photo-caption.css).
 * Figma: About "Experienced consultants. Practical manufacturing knowledge." D 18:42442 / M 18:50128.
 *
 * Phones and tablets: title, list, then the photo (the card is full width on phones). From 1025 px: list 599 px
 * and photo 639 px side by side; the photo has the height of the list.
 */

.list-photo-card {
  --lpc-eye-pad: clamp(0.4375rem, 0.5222rem - 0.0948vw, 0.5rem);
  --lpc-row-pad: clamp(0.625rem, 0.4028rem + 0.9479vw, 1.25rem);

  position: relative;
  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
  background-color: var(--nv-blue);
  color: var(--nv-white);
  overflow: hidden;
  isolation: isolate;
}

/* .list-photo-card__bg — texture and two blurred ellipses, one image over the blue */
.list-photo-card__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* .list-photo-card__bg-image */
.list-photo-card__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .list-photo-card__container — head and card in a column */
.list-photo-card__container {
  display: flex;
  flex-direction: column;
}

/* .list-photo-card__head — centred */
.list-photo-card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* .list-photo-card__eyebrow — green caps label with a rhomb */
.list-photo-card__eyebrow {
  display: flex;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: var(--lpc-eye-pad) 0;
  color: var(--nv-green);
  font-weight: 500;
  font-size: var(--nv-fs-eyebrow);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;

  /* .list-photo-card__eyebrow::before — rhomb */
  &::before {
    content: "";
    flex-shrink: 0;
    width: 0.53rem;
    height: 0.53rem;
    margin-top: calc(0.5lh - 0.265rem);
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }
}

/* .list-photo-card__title — white, 40 → 90 px; eyebrow → heading 30 → 50 px */
.list-photo-card__title {
  margin-top: calc(clamp(1.875rem, 1.4307rem + 1.8957vw, 3.125rem) - 0.14em);
  color: var(--nv-white);
  font-weight: 400;
  font-size: var(--nv-fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;

  /* @media (width >= 48em) .list-photo-card__title */
  @media (width >= 48em) {
    letter-spacing: -0.02em;
  }

  /* @media (width >= 64.0625em) .list-photo-card__title — 3 lines as in the frame */
  @media (width >= 64.0625em) {
    max-width: 14.56em;
  }

  /* .list-photo-card__title strong — "Bold text turns green" (field hint) */
  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .list-photo-card__subtitle — 20 → 23 px, centred; heading → text 30 → 75 px from the baseline to the cap height */
.list-photo-card__subtitle {
  margin-top: calc(clamp(1.875rem, 1.0166rem + 3.6637vw, 4.6875rem) - 0.14 * var(--nv-fs-h2) - 0.24em);
  color: var(--nv-white);
  font-size: var(--nv-fs-lead);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;

  /* @media (width >= 64.0625em) .list-photo-card__subtitle */
  @media (width >= 64.0625em) {
    margin-top: calc(clamp(1.875rem, 1.0166rem + 3.6637vw, 4.6875rem) - 0.14 * var(--nv-fs-h2) - 0.06em);
    max-width: 25em; /* 2 lines; the frame breaks after "advisors" (a manual break: "…advisors who" is narrower than the second line, width alone cannot give it) */
  }

  & > * {
    margin: 0;
  }

  & > * + * {
    margin-top: 1lh;
  }
}

/* .list-photo-card__card — frame with a light stroke inside the padding; text → frame 50 → 75 px from the baseline;
   phones: full width as in the phone frame */
.list-photo-card__card {
  display: flex;
  margin-top: calc(clamp(3.125rem, 2.5694rem + 2.3697vw, 4.6875rem) - 0.24 * var(--nv-fs-lead));
  flex-direction: column;
  margin-inline: -1.25rem;
  padding: calc(1.875rem - 0.0625rem) calc(1.25rem - 0.0625rem);
  border: 0.0625rem solid rgba(232, 242, 249, 0.1);
  border-radius: var(--nv-radius-m);

  /* @media (width >= 48em) .list-photo-card__card */
  @media (width >= 48em) {
    margin-inline: 0;
    padding: calc(3.75rem - 0.0625rem);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* .list-photo-card__card--split — list and photo side by side from 1025 px; the body takes part in the grid */
.list-photo-card__card--split {
  /* @media (width >= 64.0625em) .list-photo-card__card--split */
  @media (width >= 64.0625em) {
    display: grid;
    grid-template-columns: minmax(0, 599fr) minmax(0, 639fr);
    column-gap: 2.5rem;
  }
}

/* .list-photo-card__card--split .list-photo-card__body */
.list-photo-card__card--split .list-photo-card__body {
  /* @media (width >= 64.0625em) .list-photo-card__card--split .list-photo-card__body */
  @media (width >= 64.0625em) {
    display: contents;
  }
}

/* .list-photo-card__card-title — 32 bold → 50 semibold, left; title → first row 30 → 70 px ink to ink
   (the row padding is part of it) */
.list-photo-card__card-title {
  margin-top: -0.14em;
  margin-bottom: calc(clamp(1.875rem, 0.9861rem + 3.7915vw, 4.375rem) - var(--lpc-row-pad) - 0.14em);
  font-weight: 700;
  font-size: clamp(2rem, 1.6rem + 1.7062vw, 3.125rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;

  /* @media (width >= 48em) .list-photo-card__card-title */
  @media (width >= 48em) {
    font-weight: 600;
    letter-spacing: -0.03em;
  }

  & > * {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
  }
}

/* .list-photo-card__list — numbered rows; on desktop the rows spread over the height of the photo */
.list-photo-card__list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 0 calc(2.5rem - var(--lpc-row-pad));
  padding: 0;
  list-style: none;

  /* @media (width >= 64.0625em) .list-photo-card__list */
  @media (width >= 64.0625em) {
    margin-bottom: 0;
  }
}

/* .list-photo-card__item — number + text; the row padding is measured from the cap height */
.list-photo-card__item {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.625rem, 0.4028rem + 0.9479vw, 1.25rem);
  padding-block: calc(var(--lpc-row-pad) - 0.14em);
  font-size: clamp(1.125rem, 1.0140rem + 0.4740vw, 1.4375rem);
  line-height: 1;
}

/* .list-photo-card__number — green, centred in a 26 → 34 px column */
.list-photo-card__number {
  flex: 0 0 clamp(1.625rem, 1.4476rem + 0.7583vw, 2.125rem);
  color: var(--nv-green);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;

  /* @media (width >= 48em) .list-photo-card__number */
  @media (width >= 48em) {
    letter-spacing: 0;
  }
}

/* .list-photo-card__text — Bold on phones, SemiBold from 768 px */
.list-photo-card__text {
  min-width: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;

  /* @media (width >= 48em) .list-photo-card__text */
  @media (width >= 48em) {
    font-weight: 600;
  }
}

/* .list-photo-card__photo — phones: portrait card; tablets: landscape; from 1025 px: 639 × 405 next to the list.
   --pc-angle follows the proportions (atan(.431 · height / width)) */
.list-photo-card__photo {
  --pc-ratio: 335 / 385;
  --pc-angle: 26.4deg;

  /* @media (width >= 48em) .list-photo-card__photo */
  @media (width >= 48em) {
    --pc-ratio: 3 / 2;
    --pc-angle: 16deg;
  }

  /* @media (width >= 64.0625em) .list-photo-card__photo */
  @media (width >= 64.0625em) {
    --pc-ratio: 639 / 405;
    --pc-angle: 15.3deg;
  }
}

/* .list-photo-card__card--split — desktop placement: title and list on the left, the photo right of the list */
.list-photo-card__card--split {
  /* @media (width >= 64.0625em) .list-photo-card__card--split */
  @media (width >= 64.0625em) {
    & .list-photo-card__card-title {
      grid-area: 1 / 1 / 2 / 3; /* the title is wider than the list column */
    }

    & .list-photo-card__list {
      grid-area: 2 / 1;
    }

    & .list-photo-card__photo {
      grid-area: 2 / 2;
    }
  }
}
