/**
 * CEPAL International — sistema de diseño (referencia: Página 1)
 * tokens.css + este archivo + main.css en el índice.
 * Páginas interiores: tokens.css + design-system.css (.ds-page) + pages.css.
 */

/* ===== Página 1 — ritmo vertical de tarjetas (.benefits) =====
   Cinco bloques: imagen | título+descripción (.card-text) | tiles | botón.
   Espaciados fijos (--space-*). Sin margin-top: auto ni space-between. */

.benefits {
  column-gap: var(--gap);
  row-gap: var(--gap);
}

.benefits .benefit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-content: start;
}

.benefits .card-content {
  display: contents;
}

.benefits .card-text {
  margin-top: var(--space-img-title);
}

.benefits .card-text h2 {
  margin: 0 0 var(--space-title-desc);
}

.benefits .card-text p {
  margin: 0 0 var(--space-desc-tiles);
}

.benefits .tile-grid {
  margin: 0 0 var(--space-tiles-btn);
}

.benefits .outlined {
  margin-top: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.ds-page {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--navy);
  background: var(--ice);
  line-height: 1.5;
}

.ds-page button {
  font-family: inherit;
  cursor: pointer;
}

.ds-page svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.ds-page .site {
  max-width: var(--site-max);
  padding: 0 28px 60px;
  margin: 0 auto;
}

/* —— Marca —— */
.ds-page .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  position: relative;
  z-index: 2;
}

.ds-page .brand img {
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.ds-page .brand span {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.ds-page .brand strong {
  font-size: 21px;
  color: var(--blue);
  font-weight: 800;
}

.ds-page .brand small {
  font-size: 14px;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.ds-page .brand--link {
  text-decoration: none;
  color: inherit;
}

.ds-page .brand--link:hover strong {
  color: var(--navy);
}

.ds-page .page-header {
  padding: 24px 0 0;
}

/* —— Tipografía (tarjetas P1) —— */
.ds-page .ds-h1 {
  margin: 0;
  font-size: clamp(29px, 3.2vw, 38px);
  line-height: 1.09;
  letter-spacing: -1.2px;
  font-weight: 800;
  color: var(--navy);
}

.ds-page .ds-h1 .text-blue {
  color: var(--blue);
}

.ds-page .ds-h1 .text-gold {
  color: var(--yellow);
  text-shadow: 1px 1px 0 var(--blue);
}

.ds-page .ds-h1 .emphasis {
  color: var(--blue);
  border-bottom: 4px solid var(--yellow);
}

.ds-page .ds-lead {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 14px 0 0;
  max-width: 36em;
}

.ds-page .card-content h2 {
  font-size: 21px;
  letter-spacing: -0.65px;
  line-height: 1.22;
  margin: 0 0 var(--space-title-desc);
  font-weight: 800;
  color: var(--navy);
}

.ds-page .card-content h3 {
  font-size: 16px;
  letter-spacing: -0.35px;
  line-height: 1.25;
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--navy);
}

.ds-page .card-content p {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-body);
  margin: 0 0 var(--space-desc-tiles);
}

.ds-page .card-content p:last-child {
  margin-bottom: 0;
}

/* —— Hint / etiqueta de programa —— */
.ds-page .hint {
  background: var(--hint-bg);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
  max-width: 100%;
  line-height: 1.35;
}

.ds-page .hint--block {
  border-radius: 12px;
  display: flex;
  width: 100%;
  max-width: none;
}

/* —— Imagen de cabecera (P1 + interiores): fundido con fondo ice —— */
.hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: var(--ice);
  isolation: isolate;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
  display: block;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 11%,
    rgba(0, 0, 0, 0.7) 23%,
    #000 36%,
    #000 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 11%,
    rgba(0, 0, 0, 0.7) 23%,
    #000 36%,
    #000 100%
  );
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to right,
    var(--ice) 0%,
    rgba(234, 245, 251, 0.94) 11%,
    rgba(234, 245, 251, 0.5) 22%,
    transparent 36%
  );
}

.hero .hero-media,
.ds-page .intro-hero .hero-media {
  width: 100%;
  max-width: none;
  height: min(340px, 36vw);
  min-height: 240px;
}

@media (max-width: 720px) {
  .hero-media {
    display: none !important;
  }
}

/* —— Cabecera interior (misma lógica que hero P1) —— */
.ds-page .intro-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: stretch;
  padding: 18px 0 24px;
}

.ds-page .intro-hero__copy {
  min-width: 0;
  position: relative;
  z-index: 1;
  padding-right: 12px;
}

.ds-page .intro-hero__photo {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  align-self: end;
  width: 100%;
  min-width: 0;
}

/* —— Fotografía (tarjetas P1) —— */
.ds-page .photo-area {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background: #d3eaf8;
  flex-shrink: 0;
}

.ds-page .photo-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ds-page .photo-area--card {
  height: var(--photo-h);
}

.ds-page .photo-area--wide {
  width: 100%;
  height: 180px;
  margin-top: var(--space-desc-tiles);
}

/* —— Panel = tarjeta benefit P1 —— */
.ds-page .ds-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.ds-page .benefit {
  background: var(--white);
  padding: var(--card-pad);
  border-radius: var(--round);
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(215, 235, 247, 0.65);
}

.ds-page .benefit--static {
  transition: none;
}

.ds-page .benefit--static:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.ds-page .card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* —— Recuadros / tiles (P1) —— */
.ds-page .tile-grid {
  display: grid;
  gap: var(--tile-gap);
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.ds-page .tile-grid--gap-bottom {
  margin-bottom: var(--space-tiles-btn);
}

.ds-page .tile-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ds-page .tile-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ds-page .tile-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-page .tile {
  border: 1px solid var(--border-soft);
  background: var(--tile-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  gap: 6px;
  padding: 10px 6px 9px;
  min-height: var(--tile-min-h);
}

.ds-page .tile-icon {
  display: grid;
  place-items: center;
  border-radius: 11px;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--blue) !important;
  background-color: var(--icon-bg) !important;
}

.ds-page .tile-icon svg {
  width: 21px;
  height: 21px;
}

.ds-page .tile-label {
  font-size: 11px;
  line-height: 1.25;
  color: var(--navy);
  font-weight: 650;
  text-align: center;
  padding: 0 4px;
  min-height: calc(1.25em * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ds-page .tile--feature {
  min-height: 0;
  padding: 12px 8px 10px;
  gap: 4px;
}

.ds-page .tile-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  line-height: 1.25;
  margin: 0;
}

.ds-page .tile-desc {
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-body);
  text-align: center;
  margin: 0;
}

/* —— Tarjetas de cifra / enumeración (estilo P2, reutilizable P3–P5) —— */
.ds-page .ds-stat-grid {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ds-page .ds-stat-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ds-page .ds-stat-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-page .ds-stat-grid--one {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(100%, 320px);
}

.ds-page .ds-stat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 76px;
  padding: 14px 10px 12px;
  border-radius: 13px;
  background: var(--tile-bg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.ds-page .ds-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--blue) 22%,
    #3daee9 52%,
    var(--yellow) 78%,
    transparent 100%
  );
  opacity: 0.92;
}

.ds-page .ds-stat::after,
[data-page-id="2"] .p2-stat::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    125deg,
    transparent 0%,
    transparent 32%,
    rgba(255, 255, 255, 0.22) 38%,
    rgba(255, 255, 255, 0.78) 50%,
    rgba(255, 255, 255, 0.22) 62%,
    transparent 68%,
    transparent 100%
  );
  filter: blur(2.5px);
  transform: translate3d(-60%, -60%, 0);
  animation: ds-stat-glint 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ds-stat-glint {
  0% {
    transform: translate3d(-60%, -60%, 0);
    opacity: 0;
  }

  3% {
    opacity: 0.95;
  }

  16.67% {
    transform: translate3d(60%, 60%, 0);
    opacity: 0;
  }

  100% {
    transform: translate3d(60%, 60%, 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-page .ds-stat::after,
  [data-page-id="2"] .p2-stat::after {
    animation: none;
    content: none;
  }
}

.ds-page .ds-stat__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.ds-page .card-content .ds-stat .ds-stat__num {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(28px, 3.2vw, 32px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 42%, #0a8fd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ds-page .card-content .ds-stat .ds-stat__num--phrase {
  font-size: clamp(17px, 2.2vw, 20px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 11em;
}

.ds-page .card-content .ds-stat .ds-stat__label {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(12px, 2vw, 13px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--navy);
}

@media (max-width: 720px) {
  .ds-page .ds-stat {
    min-height: 72px;
    padding: 12px 8px 10px;
  }

  .ds-page .card-content .ds-stat .ds-stat__num {
    font-size: clamp(26px, 7vw, 30px);
  }

  .ds-page .card-content .ds-stat .ds-stat__num--phrase {
    font-size: clamp(15px, 4vw, 18px);
  }

  .ds-page .card-content .ds-stat .ds-stat__label {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .ds-page .ds-stat-grid--three {
    grid-template-columns: 1fr;
  }
}

/* —— Chips (mismo borde/fondo que tiles) —— */
.ds-page .chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tile-gap);
}

.ds-page .chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  background: var(--tile-bg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  color: var(--navy);
  line-height: 1.25;
}

/* —— Notas informativas —— */
.ds-page .ds-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--hint-bg);
  font-size: 12px;
  line-height: 1.4;
  color: var(--blue);
  font-weight: 500;
}

.ds-page .ds-note .note-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* —— Listado numerado —— */
.ds-page .chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-page .chapter-grid li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.35;
  color: var(--navy);
}

.ds-page .chapter-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--icon-bg);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.ds-page .text-highlight {
  color: var(--blue);
  font-weight: 800;
}

.ds-page .brand-text {
  color: var(--blue);
  font-weight: 800;
}

/* Callout informativo (estándar P2 / interiores) */
.ds-page .p2-tech-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(7, 92, 158, 0.18);
  background: linear-gradient(135deg, rgba(225, 241, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 55%);
  box-shadow: 0 4px 18px rgba(8, 44, 97, 0.06);
}

.ds-page .p2-tech-callout__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(7, 92, 158, 0.1);
  border: 1px solid rgba(7, 92, 158, 0.15);
}

.ds-page .p2-tech-callout__icon svg {
  width: 20px;
  height: 20px;
}

.ds-page .p2-tech-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--navy);
}

.ds-page .p2-tech-callout strong {
  color: var(--blue);
  font-weight: 800;
}

/* —— Cita / énfasis —— */
.ds-page .ds-quote {
  margin: var(--space-desc-tiles) 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--hint-bg);
  border-left: 4px solid var(--blue);
  font-size: 14px;
  line-height: 1.45;
  color: var(--navy);
}

.ds-page .ds-quote strong {
  color: var(--blue);
  font-weight: 800;
}

/* —— Franja de cierre —— */
.ds-page .footer-band {
  padding: 22px 20px;
  border-radius: var(--round);
  background: var(--navy);
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.ds-page .footer-band p {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--white);
}

.ds-page .footer-band .footer-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.92;
}

/* —— Navegación —— */
.ds-page .page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.ds-page .page-nav a {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.ds-page .page-nav a:hover {
  text-decoration: underline;
}

.ds-page .outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: var(--btn-min-h);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}

.ds-page .outlined:hover {
  background: var(--blue);
  color: var(--white);
}

.download-pdf-fab {
  position: fixed;
  right: 17px;
  bottom: 17px;
  z-index: 50;
  border: 0;
  border-radius: 50px;
  background: var(--navy);
  color: var(--white);
  padding: 13px 17px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 5px 22px rgba(8, 44, 97, 0.32);
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
}

.download-pdf-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(8, 44, 97, 0.35);
}

@media (max-width: 720px) {
  .ds-page .intro-hero {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .ds-page .intro-hero__copy {
    padding-right: 0;
  }
}

@media (max-width: 820px) {
  .ds-page .tile-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ds-page .site {
    padding: 0 16px 40px;
  }

  .ds-page .tile-grid-three,
  .ds-page .tile-grid-two {
    grid-template-columns: 1fr;
  }

  .ds-page .chapter-grid {
    grid-template-columns: 1fr;
  }

  .download-pdf-fab {
    display: none !important;
  }
}
