/*
 * Ntgy-Tarjetas de datos destacados (Figma 4110:96087, card component 4110:96120).
 * Cards are the Figma "card-data" used by Ntgy-Cuadrícula de métricas: white card, radius 4,
 * on a gray-10 panel with radius 8, 16px padding and 16px gaps.
 *
 * Wide screens (stepped layout): the grid has one more column than the selected number of
 * columns. Odd rows start in the first column and even rows in the second; each row has its own
 * gray panel, and panels of consecutive rows overlap 16px so they read as one staircase.
 * Narrow containers fall back to a regular grid on a single panel.
 */
.ntgy-block-highlight-cards {
  margin-block: 0;
  padding-block: 5rem;
  color: var(--ntgy-color-blue-100, #004571);
  background: var(--ntgy-color-white, #fdfefe);
}

.ntgy-block-highlight-cards__inner {
  container: ntgy-highlight-cards / inline-size;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: min(100% - (var(--ntgy-gutter) * 2), var(--ntgy-layout-wide));
  margin-inline: auto;
}

/* Eyebrow + title: same as Ntgy-Encabezado de sección. */
.ntgy-block-highlight-cards__header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.ntgy-block-highlight-cards__eyebrow {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  color: var(--ntgy-color-blue-100, #004571);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.ntgy-block-highlight-cards__eyebrow-dot {
  flex: 0 0 0.75rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--ntgy-color-orange-100, #e57200);
}

.ntgy-block-highlight-cards__title {
  max-width: 46.875rem;
  margin: 0;
  color: var(--ntgy-color-blue-100, #004571);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.075rem;
  overflow-wrap: anywhere;
}

/* Regular grid (narrow containers, or a single row): one gray panel. */
.ntgy-block-highlight-cards__grid {
  --ntgy-highlight-cards-current: 1;

  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--ntgy-color-gray-10, #f9f8f7);
}

.ntgy-block-highlight-cards__list {
  display: grid;
  grid-template-columns: repeat(var(--ntgy-highlight-cards-current), minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ntgy-block-highlight-cards__panel {
  display: none;
}

.ntgy-block-highlight-cards__item {
  container-type: inline-size;
  display: flex;
  min-width: 0;
  margin: 0;
}

.ntgy-block-highlight-cards__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 1.5rem 2rem;
  border-radius: 0.25rem;
  background: var(--ntgy-color-white, #fdfefe);
}

.ntgy-block-highlight-cards__card--icon {
  gap: 0.9375rem;
  padding-block: 2rem;
}

.ntgy-block-highlight-cards__card-title {
  width: 100%;
  margin: 0;
  color: var(--ntgy-color-blue-100, #004571);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.ntgy-block-highlight-cards__body {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  width: 100%;
}

.ntgy-block-highlight-cards__value {
  width: 100%;
  margin: 0;
  color: var(--ntgy-color-orange-100, #e57200);

  /* Figma 56px; long figures in narrow cards shrink with the card instead of overflowing it. */
  font-size: min(3.5rem, 24cqi);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.125rem;
  overflow-wrap: break-word;
}

/* Optional unit (not in Figma): half the figure size, so words such as "millones" never split. */
.ntgy-block-highlight-cards__unit {
  font-size: 0.5em;
  letter-spacing: 0;
}

.ntgy-block-highlight-cards__icon {
  display: block;
  flex: 0 0 auto;
  width: 4.1875rem;
  height: 4.1875rem;
  object-fit: contain;
}

.ntgy-block-highlight-cards__text {
  width: 100%;
  margin: 0;
  color: var(--ntgy-color-blue-80, #336a8d);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.ntgy-block-highlight-cards__placeholder {
  margin: 0;
  padding: 2rem;
  border: 1px dashed var(--ntgy-color-blue-80, #336a8d);
  border-radius: 0.5rem;
  color: var(--ntgy-color-blue-80, #336a8d);
}

@container ntgy-highlight-cards (min-width: 30rem) {
  .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-current: 2;
  }
}

@container ntgy-highlight-cards (min-width: 45rem) {
  .ntgy-block-highlight-cards.has-3-columns .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-current: 3;
  }
}

/* Four regular columns from ~12.5rem per card (fits the 1024px desktop). */
@container ntgy-highlight-cards (min-width: 54rem) {
  .ntgy-block-highlight-cards.has-4-columns .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-current: 4;
  }
}

@container ntgy-highlight-cards (min-width: 60rem) {
  .ntgy-block-highlight-cards.has-2-columns .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-tracks: 3;
  }

  .ntgy-block-highlight-cards.has-3-columns .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-tracks: 4;
  }

  /* Stepped layout (Figma desktop): one spare column so even rows can shift one column right. */
  :is(.ntgy-block-highlight-cards.is-stepped.has-2-columns, .ntgy-block-highlight-cards.is-stepped.has-3-columns) .ntgy-block-highlight-cards__grid {
    display: grid;
    grid-template-columns: repeat(var(--ntgy-highlight-cards-tracks), minmax(0, 1fr));
    gap: 1rem;
    background: none;
  }

  /* Every row gets its own gray panel that reaches 16px past its cards, so panels of
     consecutive rows overlap across the 16px row gap. */
  :is(.ntgy-block-highlight-cards.is-stepped.has-2-columns, .ntgy-block-highlight-cards.is-stepped.has-3-columns) .ntgy-block-highlight-cards__panel {
    display: block;
    grid-row: var(--ntgy-highlight-cards-row);
    grid-column: var(--ntgy-highlight-cards-col) / span var(--ntgy-highlight-cards-span);
    margin: -1rem;
    border-radius: 0.5rem;
    background: var(--ntgy-color-gray-10, #f9f8f7);
  }

  :is(.ntgy-block-highlight-cards.is-stepped.has-2-columns, .ntgy-block-highlight-cards.is-stepped.has-3-columns) .ntgy-block-highlight-cards__list {
    grid-row: 1 / span var(--ntgy-highlight-cards-rows);
    grid-column: 1 / -1;
    grid-template-rows: subgrid;
    grid-template-columns: subgrid;
  }

  :is(.ntgy-block-highlight-cards.is-stepped.has-2-columns, .ntgy-block-highlight-cards.is-stepped.has-3-columns) .ntgy-block-highlight-cards__item {
    grid-row: var(--ntgy-highlight-cards-row);
    grid-column: var(--ntgy-highlight-cards-col);
  }
}

/* Four columns need more room before stepping: five tracks of at least ~14rem. */
@container ntgy-highlight-cards (min-width: 75rem) {
  .ntgy-block-highlight-cards.has-4-columns .ntgy-block-highlight-cards__grid {
    --ntgy-highlight-cards-tracks: 5;
  }

  /* Stepped layout (Figma desktop): one spare column so even rows can shift one column right. */
  :is(.ntgy-block-highlight-cards.is-stepped.has-4-columns) .ntgy-block-highlight-cards__grid {
    display: grid;
    grid-template-columns: repeat(var(--ntgy-highlight-cards-tracks), minmax(0, 1fr));
    gap: 1rem;
    background: none;
  }

  /* Every row gets its own gray panel that reaches 16px past its cards, so panels of
     consecutive rows overlap across the 16px row gap. */
  :is(.ntgy-block-highlight-cards.is-stepped.has-4-columns) .ntgy-block-highlight-cards__panel {
    display: block;
    grid-row: var(--ntgy-highlight-cards-row);
    grid-column: var(--ntgy-highlight-cards-col) / span var(--ntgy-highlight-cards-span);
    margin: -1rem;
    border-radius: 0.5rem;
    background: var(--ntgy-color-gray-10, #f9f8f7);
  }

  :is(.ntgy-block-highlight-cards.is-stepped.has-4-columns) .ntgy-block-highlight-cards__list {
    grid-row: 1 / span var(--ntgy-highlight-cards-rows);
    grid-column: 1 / -1;
    grid-template-rows: subgrid;
    grid-template-columns: subgrid;
  }

  :is(.ntgy-block-highlight-cards.is-stepped.has-4-columns) .ntgy-block-highlight-cards__item {
    grid-row: var(--ntgy-highlight-cards-row);
    grid-column: var(--ntgy-highlight-cards-col);
  }
}

@media (max-width: 1023px) {
  .ntgy-block-highlight-cards {
    padding-block: 4rem;
  }
}

@media (max-width: 767px) {
  /* The theme already insets full-width modules on mobile, so the content uses the whole module. */
  .ntgy-block-highlight-cards__inner {
    width: 100%;
  }
}
