/*
 * .persona-cards — centred head + gradient box with white persona cards
 * (template-parts/flexible/persona-cards.php).
 * Figma: /solutions D 337:15258 / M 337:15013.
 *
 * Phones: the box bleeds to the screen edges, cards in one column.
 * From 768 px: cards side by side (min 280 px each), up to 1200 px wide.
 */

.persona-cards {
  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
}

/* .persona-cards__container — head → box: 80 px on phones, 75 px from 768 */
.persona-cards__container {
  display: flex;
  flex-direction: column;
  gap: 5rem;

  /* @media (width >= 48em) .persona-cards__container */
  @media (width >= 48em) {
    gap: 4.6875rem;
  }
}

/* .persona-cards__head */
.persona-cards__head {
  display: flex;
  flex-direction: column;
  gap: clamp(1.875rem, 1.4306rem + 1.8957vw, 3.125rem);
}

/* .persona-cards__head--center */
.persona-cards__head--center {
  align-items: center;
  text-align: center;
}

/* .persona-cards__eyebrow */
.persona-cards__eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: calc(0.625rem - 0.14em) 0.625rem;
  color: var(--nv-green);
  font-weight: 500;
  font-size: clamp(0.875rem, 0.7417rem + 0.5687vw, 1.25rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  /* @media (width >= 48em) .persona-cards__eyebrow — the phone mocks track 5 %, the desktop ones 10 % */
  @media (width >= 48em) {
    letter-spacing: 0.1em;
  }

  /* .persona-cards__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;
  }
}

/* .persona-cards__title — trimmed to cap / baseline */
.persona-cards__title {
  max-width: 62.5rem;
  margin-block: -0.14em;
  color: var(--nv-navy);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.3892rem + 4.7393vw, 5.625rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;

  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .persona-cards__box — light gradient without a border, 40 → 100 px / 20 → 40 px inside */
.persona-cards__box {
  margin-inline: -1.25rem;
  border-radius: var(--nv-radius-m);
  padding: clamp(2.5rem, 1.167rem + 5.6872vw, 6.25rem) 1.25rem;
  background: linear-gradient(180deg, #f6f7f9 0%, #dce5ee 100%);

  /* @media (width >= 48em) .persona-cards__box */
  @media (width >= 48em) {
    margin-inline: 0;
    padding-inline: 2.5rem;
  }
}

/* .persona-cards__list */
.persona-cards__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 75rem;
  margin-inline: auto;

  /* @media (width >= 48em) .persona-cards__list */
  @media (width >= 48em) {
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  }
}

/* .persona-cards__item — text on top, photo at the bottom */
.persona-cards__item {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
  border-radius: var(--nv-radius-s);
  background-color: var(--nv-white);
  text-align: center;
  overflow: hidden;
}

/* .persona-cards__body — name → text 20 → 30 px (the line boxes are trimmed below) */
.persona-cards__body {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: clamp(1.25rem, 1.0278rem + 0.9479vw, 1.875rem);
  padding: clamp(2.5rem, 2.2778rem + 0.9479vw, 3.125rem) clamp(1.25rem, 1.0278rem + 0.9479vw, 1.875rem) 0;
}

/* .persona-cards__item:not(:has(.persona-cards__media)) .persona-cards__body — no photo */
.persona-cards__item:not(:has(.persona-cards__media)) .persona-cards__body {
  padding-bottom: clamp(2.5rem, 2.2778rem + 0.9479vw, 3.125rem);
}

/* .persona-cards__name — 23 → 32 px, trimmed to cap / baseline; -4 % tracking on phones (Figma M) */
.persona-cards__name {
  margin-block: -0.14em;
  color: var(--nv-navy);
  font-weight: 500;
  font-size: clamp(1.4375rem, 1.2375rem + 0.8531vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;

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

/* .persona-cards__text — 20 → 23 px at 120 %, blue, line boxes trimmed */
.persona-cards__text {
  margin-block: -0.24em;
  color: var(--nv-blue);
  font-size: clamp(1.25rem, 1.1833rem + 0.2844vw, 1.4375rem);
  line-height: 1.2;
  letter-spacing: -0.03em;

  & p + p {
    margin-top: calc(0.75rem - 0.48em);
  }
}

/* .persona-cards__media — 242 → 280 px, top fades into the card */
.persona-cards__media {
  position: relative;
  height: clamp(15.125rem, 14.2810rem + 3.6019vw, 17.5rem);

  /* .persona-cards__media::before — white fade */
  &::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 1;
    height: 35%;
    background: linear-gradient(180deg, var(--nv-white) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
  }
}

/* .persona-cards__image */
.persona-cards__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
