/*
 * .text-photo — eyebrow, heading and text on the left, a photo card with a logo and a dark centred caption panel
 * on the right (template-parts/flexible/text-photo.php, photo card: components/photo-caption.css).
 * Figma: About "More than an ERP implementation partner" D 18:42352 / M 18:50034.
 *
 * Phones and tablets: text, then the photo. From 1025 px: text 648 and photo 690 px side by side, 62 px apart.
 * A 1 px line closes the block above (the line under the hero, full width).
 */

.text-photo {
  --tp-eye-pad: clamp(0.4375rem, 0.5222rem - 0.0948vw, 0.5rem);

  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
  border-top: 0.0625rem solid rgba(26, 121, 191, 0.1);
  background: linear-gradient(180deg, #f6f7f9 57.4%, var(--nv-steel) 100%);
  background-clip: padding-box;
}

/* .text-photo__container — text above the photo; two columns from 1025 px */
.text-photo__container {
  display: flex;
  flex-direction: column;
  gap: 3.125rem;

  /* @media (width >= 64.0625em) .text-photo__container */
  @media (width >= 64.0625em) {
    display: grid;
    grid-template-columns: minmax(0, 648fr) minmax(0, 690fr);
    column-gap: 3.875rem;
    align-items: start;
  }
}

/* .text-photo__body — the text column */
.text-photo__body {
  min-width: 0;
}

/* .text-photo__head — left aligned */
.text-photo__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* .text-photo__eyebrow — green caps label with a rhomb; the pill padding is 10 px at the sides */
.text-photo__eyebrow {
  display: flex;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: var(--tp-eye-pad) 0.625rem;
  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;

  /* .text-photo__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;
  }
}

/* .text-photo__title — 40 → 90 px; eyebrow → heading 30 (to the cap height) → 50 px (to the line box). The column (7.2 em) lets "implementation"
   stand alone and "partner" wrap, as in the frame */
.text-photo__title {
  margin-top: calc(clamp(1.875rem, 1.4307rem + 1.8957vw, 3.125rem) - 0.14em);
  color: var(--nv-navy);
  font-weight: 400;
  font-size: var(--nv-fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;

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

  /* @media (width >= 64.0625em) .text-photo__title */
  @media (width >= 64.0625em) {
    max-width: 7.2em;
    margin-top: clamp(1.875rem, 1.4307rem + 1.8957vw, 3.125rem);
  }

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

/* .text-photo__subtitle — bold lead, then the text one line below; 20 → 23 px; baseline → cap height 50 px */
.text-photo__subtitle {
  margin-top: calc(3.125rem - 0.24em - 0.14 * var(--nv-fs-h2));
  color: var(--nv-navy);
  font-size: var(--nv-fs-lead);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;

  /* @media (width >= 64.0625em) .text-photo__subtitle */
  @media (width >= 64.0625em) {
    margin-top: calc(3.125rem - 0.34em);
    line-height: 1.4;
  }

  & > * {
    margin: 0;
  }

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

  & strong {
    font-weight: 700;
  }
}

/* .text-photo__photo — phones: portrait card; tablets: landscape; from 1025 px: 690 × 721, level with the bottom
   of the eyebrow pill (34 px). --pc-angle follows the proportions (atan(.431 · height / width)) */
.text-photo__photo {
  --pc-ratio: 335 / 385;
  --pc-angle: 26.4deg;

  margin-top: calc(var(--nv-fs-lead) * -0.24); /* text → photo is 50 px from the baseline of the last line */

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

  /* @media (width >= 64.0625em) .text-photo__photo */
  @media (width >= 64.0625em) {
    --pc-ratio: 690 / 721;
    --pc-angle: 24.2deg;

    margin-top: calc(var(--nv-fs-eyebrow) + 2 * var(--tp-eye-pad));
  }
}

/* .text-photo__container without a text column — the photo alone stands centred, not pushed into the left column */
.text-photo__container:not(:has(.text-photo__body)) {
  /* @media (width >= 64.0625em) .text-photo__container (photo only) */
  @media (width >= 64.0625em) {
    grid-template-columns: minmax(0, 43.125rem);
    justify-content: center;
  }

  & .text-photo__photo {
    margin-top: 0;
  }
}
