/*
 * .link-cards — head + 2–4 cards with a full-width button
 * (template-parts/flexible/link-cards.php).
 * Figma: /resources D 337:11741 + 337:11747 / M 337:11576.
 *
 * Cards: one column → two from 768 px → one row from 1025 px.
 * Buttons: .button--primary (featured) / .button--secondary from index.css;
 * on light cards the secondary button turns navy.
 */

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

/* .link-cards:has(+ .listing) — cards and the listing under them are one section in Figma: 40 → 50 px between */
.link-cards:has(+ .listing) {
  padding-bottom: var(--nv-flow-gap);
}

/* .link-cards + .listing */
.link-cards + .listing {
  padding-top: 0;
}

/* .link-cards__container — head → cards: 40 → 50 px */
.link-cards__container {
  display: flex;
  flex-direction: column;
  gap: var(--nv-flow-gap);
}

/* .link-cards__head */
.link-cards__head {
  display: flex;
  flex-direction: column;
  gap: var(--nv-flow-gap);
}

/* .link-cards__eyebrow */
.link-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(1rem, 0.9111rem + 0.3792vw, 1.25rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;

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

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

/* .link-cards__title — 40 → 90 px, one line on desktop (Figma 1335 px) */
.link-cards__title {
  margin-top: -0.14em;
  margin-bottom: -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;
  }
}

/* .link-cards__list */
.link-cards__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;

  /* @media (width >= 48em) .link-cards__list */
  @media (width >= 48em) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* @media (width >= 64.0625em) .link-cards__list — all cards in one row */
  @media (width >= 64.0625em) {
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }
}

/* .link-cards__item — light card: text on top, button at the bottom */
.link-cards__item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  border: 0.0625rem solid var(--nv-ice);
  border-radius: var(--nv-radius-s);
  padding: clamp(1.25rem, 1.0278rem + 0.9479vw, 1.875rem);
  background: linear-gradient(180deg, rgba(204, 219, 232, 0.3) 0%, rgba(246, 247, 249, 0.5) 100%), var(--nv-white);
  color: var(--nv-navy);

  /* @media (width >= 48em) .link-cards__item */
  @media (width >= 48em) {
    gap: 0.875rem;
  }
}

/* .link-cards__item--featured — blue gradient, white text, green button */
.link-cards__item--featured {
  border-color: var(--nv-blue);
  background: linear-gradient(171deg, rgba(19, 33, 50, 0) 34%, rgba(19, 33, 50, 0.6) 76%, var(--nv-blue-light) 100%), var(--nv-blue);
  color: var(--nv-white);
}

/* .link-cards__body — name → text 20 px (Figma trims the line boxes) */
.link-cards__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* .link-cards__name — 23 → 32 px */
.link-cards__name {
  margin-top: -0.14em;
  font-weight: 500;
  font-size: clamp(1.4375rem, 1.2375rem + 0.8531vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* .link-cards__text — 16 → 18 px */
.link-cards__text {
  font-size: clamp(1rem, 0.9556rem + 0.1896vw, 1.125rem);
  line-height: 1.2;
  letter-spacing: -0.02em;

  & p + p {
    margin-top: 0.75rem;
  }
}

/* .link-cards__button — full width, label left, arrow right; 64 → 74 px */
.link-cards__button {
  justify-content: space-between;
  width: 100%;
  height: 4rem;
  margin-top: auto;
  padding: 0 1.875rem;
  font-size: 1.125rem;

  /* @media (width >= 48em) .link-cards__button */
  @media (width >= 48em) {
    height: 4.625rem;
    font-size: 1.25rem;
  }

  /* .link-cards__button .button__icon */
  & .button__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
  }
}

/* .link-cards__button.button--secondary — navy label and navy → green frame on light cards */
.link-cards__button.button--secondary {
  color: var(--nv-navy);

  /* .link-cards__button.button--secondary::before */
  &::before {
    background: linear-gradient(90deg, var(--nv-navy) 0%, var(--nv-green) 100%);
  }
}
