/*
 * .bento-card — photo card under a dark gradient (template-parts/cards/bento-card.php).
 * Figma: industries 337:17077 (featured) / M 337:16644; solutions 337:15183;
 * duo 337:14627.
 *
 * Content on top, button at the bottom (the 340 → 440 px min-height keeps the 75 px gap of
 * short cards; long lists shrink it to 40 px, as in Figma 337:17077).
 * Markers: diamond-list; text: rich-text; badge: icon-tile.
 * Buttons: .button--primary (featured) / .button--secondary from index.css.
 */

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  min-height: clamp(21.25rem, 19.0284rem + 9.4787vw, 27.5rem);
  border-radius: 1rem;
  padding: clamp(1.25rem, 1.0278rem + 0.9479vw, 1.875rem);
  overflow: hidden;
  background-color: var(--nv-navy);
  color: var(--nv-white);
  isolation: isolate;

  /* @media (width >= 48em) .bento-card — body → button 24 → 40 px */
  @media (width >= 48em) {
    gap: 2.5rem;
  }
}

/* .bento-card__media — photo + gradient (Figma: navy 100 % → navy 60 % → blue 60 %) */
.bento-card__media {
  position: absolute;
  z-index: -1;
  inset: 0;

  /* .bento-card__media::after */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--nv-navy) 0%, rgba(19, 33, 50, 0.6) 64%, rgba(26, 121, 191, 0.6) 100%);
  }
}

/* .bento-card__media picture — the phone-photo wrapper must not collapse the image's 100 % height */
.bento-card__media picture {
  display: contents;
}

/* .bento-card__image */
.bento-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .bento-card__body — title, then list or text: 50 px apart on phones, 25 px on desktop (Figma) */
.bento-card__body {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5625rem, 3.6806rem - 2.3697vw, 3.125rem);
}

/* .bento-card__title — 32 → 50 px; line box trimmed to cap top / baseline, as Figma */
.bento-card__title {
  margin-block: -0.15em -0.144em;
  font-weight: 400;
  font-size: clamp(2rem, 1.6001rem + 1.7061vw, 3.125rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
}

/* .bento-card__list — markers 16 → 23 px, 50 px under the title;
   Figma: 120 % inside an item, 160 % on the first line of the next one (→ 0.4em between items) */
.bento-card__list {
  gap: 0.4em;
  margin-block: calc(1.5625rem - 0.236em) -0.236em;
  color: var(--nv-steel);
  font-size: clamp(1rem, 0.8445rem + 0.6635vw, 1.4375rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

/* .bento-card__list .diamond-list__item — 32 px text indent, rhomb centred on the first line */
.bento-card__list .diamond-list__item {
  padding-left: 2rem;

  /* .bento-card__list .diamond-list__item::before */
  &::before {
    top: calc(0.6em - 0.25rem);
    left: 0.75rem;
  }
}

/* .bento-card__text — 18 → 23 px; line box trimmed to cap top / baseline, as Figma */
/* .bento-card__text — 16 → 23 px at 120 %, -3 % tracking on phones, -2 % from 768 px (Figma) */
.bento-card__text {
  margin-block: -0.236em;
  color: var(--nv-white);
  font-size: clamp(1rem, 0.8445rem + 0.6635vw, 1.4375rem);
  line-height: 1.2;
  letter-spacing: -0.03em;

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

  & > * + * {
    margin-top: 1.25rem;
  }

  & strong,
  & b {
    font-weight: 700;
  }
}

/* .bento-card__button — full width, label left, arrow right */
.bento-card__button {
  justify-content: space-between;
  width: 100%;
  height: 4rem;
  margin-top: auto;
  padding: 0 1.25rem;
  font-size: 1rem;

  /* @media (width >= 48em) .bento-card__button */
  @media (width >= 48em) {
    height: 4.625rem;
    padding: 0 1.875rem;
    font-size: 1.25rem;
  }
}

/* .bento-card--featured — green accent in the text (Figma 337:15183) */
.bento-card--featured {
  /* .bento-card--featured .bento-card__text strong */
  & .bento-card__text strong,
  & .bento-card__text b {
    color: var(--nv-green);
  }

  /* @media (width >= 64.0625em) .bento-card--featured — text column and button 481 / 444 px */
  @media (width >= 64.0625em) {
    & .bento-card__body:has(.bento-card__text) {
      max-width: 30.0625rem;
    }

    & .bento-card__body:has(.bento-card__text) ~ .bento-card__button {
      max-width: 27.75rem;
    }
  }
}

/* .bento-card__badge — blue tile with "?" (duo) */
.bento-card__badge {
  background-color: rgba(26, 121, 191, 0.7);
}

/* .bento-grid--duo .bento-card — text at the bottom, 400 → 500 px (Figma 337:14627 / M 337:14407) */
.bento-grid--duo .bento-card {
  min-height: 25rem;

  /* .bento-grid--duo .bento-card__body — pushed to the bottom; title → text 40 → 30 px (Figma + 10 px, Vlad 2026-10-17) */
  & .bento-card__body {
    gap: clamp(1.875rem, 2.7222rem - 0.9479vw, 2.5rem);
    max-width: 28rem;
    margin-top: auto;
  }

  /* .bento-grid--duo .bento-card__title — 24 → 32 px, -4 % tracking on phones, -2 % from 768 px;
     385 px wide so the lines break as in Figma (Vlad 2026-10-17) */
  & .bento-card__title {
    max-width: 24.0625rem;
    font-weight: 500;
    font-size: clamp(1.5rem, 1.3223rem + 0.7583vw, 2rem);
    letter-spacing: -0.04em;

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

  /* .bento-grid--duo .bento-card__text — 16 → 18 px */
  & .bento-card__text {
    font-size: clamp(1rem, 0.9556rem + 0.1896vw, 1.125rem);
  }

  /* @media (width >= 64.0625em) .bento-grid--duo .bento-card */
  @media (width >= 64.0625em) {
    min-height: 31.25rem;
  }
}

/* .bento-grid--industries .bento-card — 500 px on desktop (Figma 1574:18151) */
.bento-grid--industries .bento-card {
  min-height: 25rem;

  /* .bento-grid--industries .bento-card__body — 25 px to the list on phones too (Figma 1574:17679) */
  & .bento-card__body {
    gap: 1.5625rem;
  }

  /* @media (width >= 64.0625em) .bento-grid--industries .bento-card */
  @media (width >= 64.0625em) {
    min-height: 31.25rem;
  }
}

/* .bento-card .bento-card__text ul — a list in the card text: rhomb markers (6 px square turned 45° = 8.5 px) on
   a line height of --nv-li-lh (160 %), no gaps; --nv-li-indent is the text indent, --nv-li-marker the rhomb's left edge (set by the layout) */
.bento-card .bento-card__text {
  --nv-li-indent: 1.75rem;
  --nv-li-marker: -0.0625rem;
  --nv-li-lh: 1.6;

  & ul {
    gap: 0;
    padding-left: 0;
    list-style: none;
    line-height: var(--nv-li-lh);

    /* the taller line adds its extra leading over the wrapper's 120 % trim */
    &:first-child {
      margin-top: calc((1.2 - var(--nv-li-lh)) * 0.5em);
    }

    &:last-child {
      margin-bottom: calc((1.2 - var(--nv-li-lh)) * 0.5em);
    }
  }

  & li {
    padding-left: var(--nv-li-indent);
    list-style: none;

    &::before {
      top: calc(var(--nv-li-lh) * 0.5em - 0.265rem);
      left: var(--nv-li-marker);
      width: 0.53rem;
      height: 0.53rem;
    }
  }
}

/* .bento-grid--spotlight .bento-card — titles 600 (Figma About D 18:42365); the large card is the green-button
   one, the list in its text is a wysiwyg <ul> */
.bento-grid--spotlight .bento-card {
  /* .bento-grid--spotlight .bento-card__title */
  & .bento-card__title {
    font-weight: 600;
  }

  /* .bento-grid--spotlight .bento-card__body — title → list 30 px on phones, 50 px from 768 px */
  & .bento-card__body {
    gap: 1.875rem;

    @media (width >= 48em) {
      gap: 3.125rem;
    }
  }

  /* .bento-grid--spotlight .bento-card__text — 16 → 23 px at 160 %, steel; list text 24 px in on phones (Figma M 18:49949), 35 px from 768 px; the card is not narrowed to 481 px */
  & .bento-card__text {
    --nv-li-indent: 1.5rem;
    --nv-li-marker: 0.375rem;
    color: var(--nv-steel);
    line-height: 1.6;
    letter-spacing: -0.03em;

    /* @media (width >= 48em) .bento-grid--spotlight .bento-card__text */
    @media (width >= 48em) {
      --nv-li-indent: 2.1875rem;
      --nv-li-marker: 0.75rem;
    }
  }
}

/* .bento-grid--spotlight .bento-card--featured — 400 px high on phones (Figma M 18:50050); from 1025 px the grid rows give 500;
   30 px padding at every width, the same as the small cards under it (Vlad, 2026-11-18; Figma M has 20 px) */
.bento-grid--spotlight .bento-card--featured {
  min-height: 25rem;
  padding: 1.875rem;
}

/* .bento-grid--spotlight .bento-card--featured — text column and button run the full card width
   (the 481 / 444 px caps are the business-central featured card's) */
.bento-grid--spotlight .bento-card--featured .bento-card__body:has(.bento-card__text),
.bento-grid--spotlight .bento-card--featured .bento-card__body:has(.bento-card__text) ~ .bento-card__button {
  max-width: none;
}

/* .bento-card--compact — small card: 240 px high, 30 px padding on phones too, title 32 px, arrow-only
   64 → 74 px square button at the bottom left (the label stays the accessible name) */
.bento-card--compact {
  min-height: 15rem;
  padding: 1.875rem;

  /* .bento-card--compact .bento-card__title */
  & .bento-card__title {
    font-size: 2rem;
  }

  /* .bento-card--compact .bento-card__button */
  & .bento-card__button {
    justify-content: center;
    width: 4rem;
    min-width: 0;
    padding: 0;

    /* @media (width >= 48em) .bento-card--compact .bento-card__button */
    @media (width >= 48em) {
      width: 4.625rem;
    }
  }
}

/* .page-id-116 .bento-grid--duo .bento-card — About "Microsoft Expertise. Global Capability." (Figma D 18:42488 /
   M 18:50178); the same duo as Business Central, but radius 10, 500 → 721 px high, photos at 50 % on navy under a
   70 % (80 % on the right card, desktop) navy → 42 % (48 %) blue overlay, a 50 px title and 160 % rhomb lists */
.page-id-116 .bento-grid--duo .bento-card {
  border-radius: 0.625rem;
  min-height: 31.25rem;
  padding-bottom: 1.6875rem;

  /* .page-id-116 .bento-grid--duo .bento-card__image */
  & .bento-card__image {
    opacity: 0.5;
  }

  /* .page-id-116 .bento-grid--duo .bento-card__media::after */
  & .bento-card__media::after {
    background: linear-gradient(0deg, rgba(19, 33, 50, 0.7) 0%, rgba(19, 33, 50, 0.42) 64%, rgba(26, 121, 191, 0.42) 100%);
  }

  /* .page-id-116 .bento-grid--duo .bento-card__body — 590 px wide, title → list 40 px on phones, 43 px on desktop */
  & .bento-card__body {
    gap: 2.5rem;
    max-width: 36.875rem;

    /* @media (width >= 48em) .page-id-116 .bento-grid--duo .bento-card__body */
    @media (width >= 48em) {
      gap: 2.6875rem;
    }
  }

  /* .page-id-116 .bento-grid--duo .bento-card__title — 32 → 50 px, -3 % tracking */
  & .bento-card__title {
    max-width: 36.875rem;
    font-size: clamp(2rem, 1.6001rem + 1.7061vw, 3.125rem);
    letter-spacing: -0.03em;
  }

  /* .page-id-116 .bento-grid--duo .bento-card__text — 18 → 23 px, -3 % tracking, list rows 24 px (phones) / 39 px
     apart; the closing paragraph 700 on phones, 600 from 768 px */
  & .bento-card__text {
    --nv-li-lh: 1.3333;
    font-size: clamp(1.125rem, 0.9695rem + 0.6635vw, 1.4375rem);
    letter-spacing: -0.03em;

    & ul + * {
      margin-top: 1.625rem;
    }

    /* @media (width >= 48em) .page-id-116 .bento-grid--duo .bento-card__text */
    @media (width >= 48em) {
      --nv-li-lh: 1.6957;

      & ul + * {
        margin-top: 1.75rem;
      }

      & strong {
        font-weight: 600;
      }
    }
  }

  /* @media (width >= 64.0625em) .page-id-116 .bento-grid--duo .bento-card — 721 px high, the text starts 302 px from
     the top instead of sitting on the bottom */
  @media (width >= 64.0625em) {
    min-height: 45.0625rem;
    padding-top: 18.875rem;
    padding-bottom: 1.875rem;
    padding-left: 2.5rem;

    & .bento-card__body {
      margin-top: 0;
    }
  }
}

/* .page-id-116 .bento-grid--duo .bento-grid__item:nth-child(2) .bento-card__media::after — right card 80 → 48 % from 768 px */
.page-id-116 .bento-grid--duo .bento-grid__item:nth-child(2) .bento-card__media::after {
  @media (width >= 48em) {
    background: linear-gradient(0deg, rgba(19, 33, 50, 0.8) 0%, rgba(19, 33, 50, 0.48) 64%, rgba(26, 121, 191, 0.48) 100%);
  }
}
