/* cards__layout */
.cards__module {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cards__module .cards__module-content {
  max-width: 1320px;
  width: 100%;
}

.cards__module-footer {
  margin-top: var(--sp10);
}

.cards__layout {
  --card-bg: var(--clr-white);
  --card-px: var(--sp12);
  --card-py: var(--sp14);
  --card-img-h: 228px;
  --cards-gap: var(--sp12);
  display: flex;
  gap: var(--cards-gap);
}

.card__item {
  background: var(--card-bg);
  padding: var(--card-py) var(--card-px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: visible;
  position: relative;
}

.card__with-shadow .card__item {
  box-shadow: 0 4px 6px 0px #d5dce2;
  margin-bottom: 10px;
}

.card__tagging {
  position: absolute;
  right: 0;
  top: 25px;
  padding: 2px 20px;
  background: var(--clr-primary);
  color: var(--clr-white);
  text-transform: uppercase;
  font-size: var(--fs-13);
  font-weight: var(--fw-bold);
  border-top-left-radius: 12px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__number {
  font-size: var(--fs-153);
  line-height: 0.8;
  color: var(--clr-gray-50);
  font-weight: var(--fw-bold);
  display: block;
  margin-bottom: 0 !important;
  position: relative;
  margin-left: -8px;
}

.card__number:after {
  content: "";
  width: 100%;
  height: 15px;
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  background: var(--card-bg);
}

.card__header .card__number+* {
  margin-top: -11px;
  position: relative;
}

.card__media-left-0 {
  position: relative;
  left: calc(-1 * var(--card-px));
  width: calc(100% + var(--card-px));
}

.card__media {
  overflow: hidden;
}

.card__media img {
  width: 100%;
  object-fit: cover;
  height: var(--card-img-h);
  transition: transform 0.6s linear 0s;
}

.card__item:hover .card__media img {
  transform: scale(1.1);
}

.card__header {
  padding-bottom: var(--sp8);
}

.card__header>*:not(:last-child) {
  margin-bottom: var(--sp4);
}

.card__title {
  font-size: var(--fs-24);
  line-height: 1.125;
  font-weight: var(--fw-bold);
  color: var(--clr-gray-dark);
  margin: 0;
}

.card__subtitle {
  font-size: var(--fs-21);
  line-height: 1.28571;
  font-weight: var(--fw-bold);
  color: var(--clr-blue);
  margin: 0;
}

.card__description {
  line-height: 1.5;
}

.card__link {
  --icon-text-gap: 50px;
  margin-top: var(--sp7);
  font-size: var(--fs-16);
  line-height: 1.2;
  font-weight: var(--fw-bold);
  color: var(--clr-blue);
  text-decoration: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* A plain-text variant (e.g. "Coming soon..." - no icon, not even a real
   <a>) only gets `display:flex`/`align-items:center` from `.icon-field-item`
   (icon classes), which it doesn't carry - so its box is just its own text
   line-height (~22px) instead of matching the icon variant's 39px-tall
   row (icon--arrow-right8's --icon-height), and since .card__footer
   bottom-anchors these, the shorter box's text sits visibly lower than the
   icon variant's vertically-centered text in the same footer row. */
.card__link:not(a) {
  display: flex;
  min-height: 39px;
  color: var(--clr-gray-dark);
}

.hover-page-link:hover .card__link,
.card__link:hover {
  color: var(--clr-black);
}

/* Plain-text variant (e.g. "Coming soon...") isn't a real link - nothing
   happens on hover/click, so its text shouldn't visually react like one. */
.hover-page-link:hover .card__link:not(a),
.card__link:not(a):hover {
  color: var(--clr-gray-dark);
}

.card__action-link {
  font-size: 0;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
}

/* cards__keythemes */
.cards__layout.cards__keythemes {
  --card-px: var(--sp10);
  --card-py: var(--sp10);
  --card-img-h: 219px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp6);
}

@media (min-width: 1600px) {
  .cards__layout.cards__keythemes {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 3-column grid breaks the 2-column layout's 4n-based alternating corner
     pattern below - simpler 2n parity instead. */
  .cards__keythemes .card__item {
    border-radius: 0 var(--radius-35) 0 var(--radius-35) !important;
  }

  .cards__keythemes .card__item:nth-child(2n) {
    border-radius: var(--radius-35) 0 var(--radius-35) 0 !important;
  }
}

.cards__keythemes .card__item {
  box-shadow: 0 4px 6px 0px #d5dce2;
  overflow: hidden;
  --body-texts-vr-gap: 10px;
}

.cards__keythemes .card__item--coming-soon .card__media img {
  opacity: 0.5;
}

.cards__keythemes .card__item:nth-child(4n+1),
.cards__keythemes .card__item:nth-child(4n) {
  border-radius: 0 var(--radius-35) 0 var(--radius-35);
}

.cards__keythemes .card__item:nth-child(4n+2),
.cards__keythemes .card__item:nth-child(4n+3) {
  border-radius: var(--radius-35) 0 var(--radius-35) 0;
}

/* A lone last card in an odd-numbered row spans full width so it doesn't
   sit awkwardly half-empty - but not if it carries an image, since a
   full-width image card looks like a mistake/banner rather than a card. */
.cards__keythemes .card__item:last-child:nth-child(odd):not(:has(.card__media)) {
  grid-column: 1 / -1;
}

/* 3-column parity (see the grid-template-columns override above) breaks the
   rule just above - placed after it so same-specificity source order
   resolves in this override's favor at this width. This media query's own
   nth-child(4n):last-child rule takes over the "lone trailing card" special
   case instead. */
@media (min-width: 1600px) {
  .cards__keythemes .card__item:last-child:nth-child(odd):not(:has(.card__media)) {
    grid-column: unset;
  }

  .cards__keythemes .card__item:nth-child(3n+1):last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
    align-items: flex-start;
  }

  .cards__keythemes .card__item:nth-child(3n+1):last-child .card__media {
    left: auto;
    width: 100%;
  }

  .cards__keythemes .card__item:nth-child(3n+1):last-child .card__header {
    padding-bottom: 0;
  }
}

.cards__keythemes .card__number {
  font-size: var(--fs-100);
  line-height: 1;
  color: var(--clr-blue-gray-100);
}

.cards__keythemes .card__header {
  padding-bottom: var(--sp6);
}

.cards__keythemes .card__header>*:not(:last-child) {
  margin-bottom: var(--sp5);
}

/* Figma's number sits directly above the title with no explicit gap and no
   overlap - its own oversized line-height already leaves enough visual
   breathing room below the glyph. The shared primitive's -11px pull (tuned
   for its much bigger default number size) overlaps too aggressively here. */
.cards__keythemes .card__header .card__number+* {
  margin-top: 0;
}

.cards__keythemes .card__link {
  line-height: 1.25;
}

/* ============================================================
   Transform 2030 focus-areas orphan-row handling - ADDITIVE ONLY.
   Nothing above this comment is touched. Both blocks below are scoped
   (via :has()/width ranges) so they only ever activate for the exact
   leftover-card counts they target - everywhere else the existing rules
   above (single-orphan full-width, 4n/3n+1 corner-radius alternation,
   etc.) keep running completely unchanged.
   ============================================================ */

/* Above 1600px (3 cards/row): the existing single-orphan rule
   (.card__item:nth-child(3n+1):last-child, further up) already handles a
   lone trailing card. This covers the OTHER leftover case - exactly 2
   cards in the final row - so they split that row 50/50 instead of
   sitting at the grid's normal 1/3-width columns with a gap on the right.
   Exact 50/50 isn't expressible as an integer column-span on a 3-column
   grid (a span of 1 = 33%, a span of 2 = 67% - nothing lands on 50%), so
   this redefines the grid to 6 equal (narrower) tracks ONLY while that
   2-card-orphan state exists: every normal card spans 2 of 6 tracks
   (2/6 = 1/3, identical width to the untouched 3-column case), while the
   trailing pair spans 3 of 6 tracks each (3/6 = 1/2). The :has() gate
   means the base `grid-template-columns: repeat(3, 1fr)` rule further up
   stays fully in effect, and this override simply never matches, for
   every other card count. */
@media (min-width: 1600px) {
  .cards__keythemes:has(> .card__item:nth-child(3n + 1):nth-last-child(2)) {
    grid-template-columns: repeat(6, 1fr);
  }

  .cards__keythemes:has(> .card__item:nth-child(3n + 1):nth-last-child(2)) .card__item {
    grid-column: span 2;
  }

  .cards__keythemes:has(> .card__item:nth-child(3n + 1):nth-last-child(2)) .card__item:nth-child(3n + 1):nth-last-child(2),
  .cards__keythemes:has(> .card__item:nth-child(3n + 1):nth-last-child(2)) .card__item:nth-child(3n + 1):nth-last-child(2)~.card__item {
    grid-column: span 3;
  }
}

/* 767px to 1600px (2 cards/row): a lone trailing card should always grow
   to the row's full width here - unlike the existing single-orphan rule
   above (`:not(:has(.card__media))`), which skips that for cards carrying
   an image. New, separate rule rather than editing that one, scoped to
   just this width band so the existing rule's own behavior (and its
   image exception) is untouched everywhere else. */
@media (min-width: 767px) and (max-width: 1599px) {
  .cards__keythemes .card__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    --card-img-h: 350px;
  }
}
