/* =========================================================
   SENA · Landing comunicado APE — Escritorio (base 1440px)
   Valores tomados del frame Figma "landing Page APE" (57:604)
   ========================================================= */

:root {
  --fondo: #eef5ff;
  --marino: #00304d;
  --marino-2: #002c4d;
  --verde: #00aa00;
  --azul: #005dca;
  --azul-oscuro: #002e64;
  --azul-gov: #0943b5;
  --azul-gov-pie: #3465cc;
  --amarillo: #fec905;
  --gris: #696969;
  --claro: #ececec;

  --fuente: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --contenedor: 1280px;
  --margen: 80px;
}

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

body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--marino);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
p { margin: 0; }

.contenedor {
  width: 100%;
  max-width: calc(var(--contenedor) + var(--margen) * 2);
  margin-inline: auto;
  padding-inline: var(--margen);
}

.texto-centrado { text-align: center; }

/* ---------- Tipografía ---------- */
.titular {
  font-size: clamp(28px, 2.5vw, 36px);
  line-height: 1.173;
  font-weight: 600;
  letter-spacing: -0.08em;
  color: var(--marino-2);
}
.titular--blanco { color: #fff; }
.titular--amarillo { color: var(--amarillo); }

.parrafo {
  font-size: clamp(18px, 1.667vw, 24px);
  line-height: 1.173;
  font-weight: 400;
  letter-spacing: -0.08em;
  color: var(--gris);
}
.parrafo strong { font-weight: 600; }
.parrafo--claro { color: var(--claro); }
.parrafo--blanco { color: #fff; }
.negrita-blanca { color: #fff; }
.parrafo--sic { max-width: 1115px; margin-inline: auto; }

.resaltado-verde { color: var(--verde); }

/* ---------- Etiqueta ---------- */
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 6px 12px;
  border-radius: 9999px;
  color: #fff;
  font-size: 14px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.etiqueta::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.etiqueta--verde { background: var(--verde); }
.etiqueta--azul { background: var(--azul); }

/* ---------- Barra GOV.CO ---------- */
.barra-gov {
  height: 36px;
  background: var(--azul-gov);
  display: flex;
  align-items: center;
}

/* ---------- Barra de navegación ---------- */
.encabezado { padding-block: 20px; }
.barra-navegacion-vidrio {
  padding: 4px 7px 4px 4px;
  border-radius: 38px;
  background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 4px 16px rgba(0, 48, 77, .06);
  backdrop-filter: blur(12px);
}
.barra-navegacion {
  height: 54px;
  padding: 5px 8px 5px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-radius: 32px;
  background: #fff;
}

/* ---------- Distribución general (separación de 40px entre bloques) ---------- */
main {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.seccion { padding-block: 40px; }
.bloque-texto { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Portada (1440 × 662, máscara elíptica) — escala con el ancho ---------- */
.portada { overflow: hidden; }
.portada__escenario {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 662;
  margin-inline: auto;
}
/* elipse 2336.91 × 995 en (-404.36, -350) → en % del escenario 1440 × 662 */
.portada__fondo {
  position: absolute;
  left: -28.081%;
  top: -52.870%;
  width: 162.286%;
  height: 150.302%;
  border-radius: 50%;
  overflow: hidden;
}
/* imagen 1666.92 × 700 en (329.08, 298) dentro de la elipse */
.portada__fondo img {
  position: absolute;
  left: 14.082%;
  top: 29.950%;
  width: 71.330%;
  height: 70.352%;
  max-width: none;
}
.portada__contenido {
  position: absolute;
  /* el texto se queda alineado con el contenedor de 1280px */
  left: calc(max(0px, (100% - 1440px) / 2) + min(11.111%, 160px));
  top: 19.387%;
  width: min(47.778%, 688px);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.portada__icono { width: clamp(80px, 9.514vw, 137px); height: auto; aspect-ratio: 137 / 105; object-fit: cover; }
.portada__titulo {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3.328vw, 47.92px);
  line-height: 1.132;
  font-weight: 700;
  letter-spacing: -0.04em;
}

/* ---------- El SENA informa ---------- */
.seccion--informa { padding-block: 20px;
  padding-bottom: 50px;
}
.informa {
  display: flex;
  gap: clamp(40px, 12.6vw, 182px);
  align-items: flex-start;
}
.informa__texto { flex: 0 1 930px; margin-left: auto; }

/* ---------- Ciudadanía ---------- */
.seccion--ciudadania {
  background: linear-gradient(to bottom right, #16899a 0%, #187100 100%);
}
.pila-centrada {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ---------- Filas texto + imagen ---------- */
.fila-imagen {
  display: flex;
  gap: 40px;
  justify-content: space-between;
  align-items: center;
  min-height: 300px;
}
.fila-imagen__texto {
  flex: 0 1 643px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.imagen {
  height: 300px;
  border-radius: 32px;
  object-fit: cover;
  flex-shrink: 0;
}
.imagen--550 { width: 100%; }

.imagen-contenedor { position: relative; flex: 0 1 550px; min-width: 0; }
.mascota {
  position: absolute;
  right: -46px;
  top: 48px;
  width: 121px;
  height: 267px;
  max-width: none;
}

/* ---------- Recomendaciones ---------- */
.seccion--alerta {
  position: relative;
  isolation: isolate;
  padding-block: 60px;
  background: linear-gradient(90deg, var(--azul) 0%, var(--azul-oscuro) 100%);
}
.seccion--alerta .bloque-texto { gap: 20px; }

/* =========================================================
   Pie de página
   ========================================================= */
.pie-pagina {
  position: relative;
  
  padding-top: 40px;
  min-height: 1162px;
  padding-bottom: 302px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
/* bloque azul con esquinas superiores de 100px (1920 de ancho) */
.pie-pagina::before {
  content: "";
  position: absolute;
  top: 290px;
  left: 50%;
  width: 1920px;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 100px 100px 0 0;
  background: linear-gradient(90deg, var(--azul) 0%, #003b8a 88%, #003b8a 98%);
  z-index: -1;
}
.pie-pagina > .contenedor { position: relative; }

/* Tarjeta blanca */
.pie-tarjeta {
  position: relative;
  min-height: 360px;
  padding-bottom: 24px;
  padding: 49px 44px 0 51px;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 0 14px rgba(0, 0, 0, .25);
  color: var(--marino-2);
  overflow: hidden;
}
.pie-tarjeta__superior {
  display: flex;
  align-items: center;
  gap: 64px;
}
.pie-tarjeta__superior img { width: 158px; height: 112px; flex-shrink: 0; }
.pie-tarjeta__superior p {
  flex: 0 1 928px;
  font-size: 16px;
  line-height: 18.77px;
}
.pie-tarjeta__separador {
  margin: 28px 0 0 2px;
  width: 1183px;
  max-width: 100%;
  border: 0;
  border-top: .6px solid rgba(0, 44, 77, .35);
}
.pie-tarjeta__inferior {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-top: 31px;
  padding-left: 12px;
}
.pie-tarjeta__inferior > img { width: 146px; height: 52px; margin-top: 12px; flex-shrink: 0; }
.enlaces-gobierno {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 23px;
}
.enlaces-gobierno ul {
  margin: 0;
  padding-left: 16px;
  font-size: 16px;
  line-height: 20.8px;
}
.enlaces-gobierno ul:nth-child(1) { width: 136px; }
.enlaces-gobierno ul:nth-child(2) { width: 154px; }
.enlaces-gobierno ul:nth-child(3) { width: 136px; }
.enlaces-gobierno ul:nth-child(4) { width: 150px; }
.enlaces-gobierno ul:nth-child(5) { width: 136px; }
.enlaces-gobierno ul:nth-child(6) { width: 156px; }
.enlaces-gobierno a { color: var(--marino-2); }
.enlaces-gobierno a:hover { color: var(--azul); }
.pie-tarjeta__decoracion {
  position: absolute;
  right: 0;
  bottom: -5px;
  width: 230px;
  height: 189px;
  pointer-events: none;
}

/* Información SENA */
.pie-info {
  display: flex;
  gap: 32px;
  justify-content: space-between;
  margin-top: 45px;
  padding-left: 8px;
}
.pie-info__titulo {
  display: flex;
  align-items: center;
  gap: 15px;
}
.pie-info__titulo img { width: 60px; height: 60px; }
.pie-info__titulo p {
  font-size: 24px;
  line-height: 28.15px;
  font-weight: 700;
}
.pie-info address {
  margin-top: 16px;
  font-style: normal;
  font-size: 16px;
  line-height: 23.2px;
}
.pie-info__logos {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 17px;
  padding-top: 2px;
}
.pie-info__logos img:first-child { width: 235px; height: 57px; margin-right: 5px; }
.pie-info__logos img:last-child { width: 253px; height: 88px; margin-right: -8px; max-width: none; }

/* Redes */
.redes-sociales {
  flex-wrap: wrap;
  list-style: none;
  margin: 29px 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 8.85px;
}
.redes-sociales a {
  display: flex;
  align-items: center;
  gap: 7.37px;
  height: 37px;
  padding: 7.37px 10px 7.37px 7.37px;
  border-radius: 22.12px;
  background: var(--fondo);
  color: var(--azul);
  font-size: 14.75px;
  line-height: 17.3px;
  font-weight: 700;
}
.redes-sociales a:hover { background: #fff; }
.redes-sociales img { width: 22px; height: 22px; }

/* Enlaces legales */
.enlaces-legales {
  margin-top: 28px;
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 17.76px;
  line-height: 17.76px;
}
.enlaces-legales a + a { margin-left: 6px; }
.enlaces-legales a { color: #fff; }
.enlaces-legales a:hover { color: var(--amarillo); }

/* Silueta de ciudad + derechos */
.pie-inferior {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  height: 232px;
}
.pie-inferior__ciudad {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1922px;
  height: 167px;
  max-width: none;
  transform: translateX(-50%);
}
.pie-inferior::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 167px;
  height: 65px;
  background: linear-gradient(90deg, #014070 0%, #012d4e 100%);
}
.pie-inferior__derechos {
  position: absolute;
  left: 0;
  right: 0;
  top: 165px;
  z-index: 1;
  text-align: center;
  font-size: 16px;
  line-height: 18.77px;
  font-weight: 700;
  text-shadow: 0 4px 4px rgba(0, 0, 0, .25);
}
.pie-gov {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: var(--azul-gov-pie);
  display: flex;
  align-items: center;
}
.pie-gov img { margin-left: 7px; }

/* Por debajo de 1440px los saltos de línea manuales del diseño
   generan cortes raros: se dejan fluir los textos */
@media (max-width: 1439px) {
  .br-escritorio { display: none; }
}
.pie-tarjeta__ministerio { flex-shrink: 0; margin-top: 12px; }
.pie-tarjeta__ministerio img { width: 146px; height: 52px; }

/* A 1440px o más, el bloque "El SENA informa" mide lo mismo que en Figma */
@media (min-width: 1440px) {
  .informa { height: 201px; }
}

/* Textura de fondo de la sección azul (10% de opacidad) */
.seccion--alerta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/img/textura-alerta.jpg") center / cover no-repeat;
  opacity: .1;
}

/* Imagen de atención: en Figma va estirada a 550 × 300 */
.imagen--estirada { object-fit: fill; }

/* Mascota "Mario" junto a la foto de atención (137 × 265) */
.mascota--mario {
  left: -68px;
  right: auto;
  top: 45px;
  width: 137px;
  height: 265px;
}

/* En Figma "Hojas de vida" y "Cierre" van pegados, sin los 40px de separación */
.seccion--cierre { margin-top: -40px; }

.pie-gov .contenedor { display: flex; align-items: center; gap: 15px; }
.pie-gov__marca-pais,
.pie-gov__separador,
.pie-gov__escudo,
.br-movil { display: none; }

/* =========================================================
   RESPONSIVE
   - Hasta 1023px: distribución en una columna (tablet y móvil)
   - Hasta 599px: diseño móvil de Figma "senaGoogleCloudMobile" (base 440px)
   ========================================================= */
@media (max-width: 1023px) {
  :root { --margen: 40px; }

  /* Tipografía móvil: titulares 24px, párrafos 18px */
  .titular { font-size: 24px; line-height: 28.15px; text-align: center; }
  .parrafo { font-size: 18px; line-height: 21.11px; text-align: center; }

  main { gap: 20px; }

  /* Barra GOV.CO y navegación centradas */
  .barra-gov .contenedor { display: flex; justify-content: center; }
  .encabezado { padding: 8px 0 12px; }
  .barra-navegacion { justify-content: center; padding: 5px 8px; }

  /* Bloques en una columna, con ancho máximo cómodo de lectura */
  .informa,
  .fila-imagen,
  .bloque-texto,
  .pila-centrada {
    max-width: 640px;
    margin-inline: auto;
  }

  /* El SENA informa */
  .seccion--informa { padding-block: 20px; }
  .informa {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: auto;
  }
  .informa__texto { flex: none; margin-left: 0; text-align: center; }

  /* Ciudadanía */
  .seccion--ciudadania { padding-block: 40px; }

  /* Filas texto + imagen → columna: texto arriba, imagen abajo */
  .seccion:has(.fila-imagen) { padding-block: 20px; }
  .fila-imagen {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
  .fila-imagen__texto { flex: none; gap: 20px; }
  .fila-imagen .imagen-contenedor { flex: none; order: 2; width: 100%; }
  .imagen,
  .imagen--550 { width: 100%; height: 300px; }
  .imagen--estirada { object-fit: cover; }

  /* Mascotas */
  .mascota--mario { left: -20px; top: 44px; }
  .mascota { right: -28px; top: 49px; }
  .mascota--mario { right: auto; }

  /* SIC */
  main > .seccion:nth-of-type(5) { padding-block: 0 20px; }

  /* Recomendaciones */
  .seccion--alerta { padding-block: 60px; }

  /* Hojas de vida + cierre */
  main > .seccion:nth-of-type(7) { padding-block: 40px; }
  .seccion--cierre { margin-top: 0; padding-block: 0 60px; }

  /* ---------- Pie de página en una columna ---------- */
  .pie-pagina {
    min-height: 0;
    margin-top: 20px;
    padding: 0;
  }
  .pie-pagina::before {
    top: 630px;
    width: 100%;
    border-radius: 30px 30px 0 0;
  }
  .pie-tarjeta {
    max-width: 600px;
    min-height: 700px;
    margin-inline: auto;
    padding: 41px 25px 24px;
    text-align: center;
  }
  .pie-tarjeta__superior {
    flex-direction: column;
    gap: 21px;
  }
  .pie-tarjeta__superior p { flex: none; max-width: 335px; }
  .pie-tarjeta__separador { width: 100%; margin: 26px 0 0; }
  .pie-tarjeta__inferior {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 26px;
    padding-left: 0;
  }
  .pie-tarjeta__ministerio { margin-top: 0; }
  .pie-tarjeta__ministerio img { width: 170px; height: 61px; }
  .enlaces-gobierno {
    display: grid;
    grid-template-columns: 184px 156px;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    gap: 0;
    justify-content: center;
    text-align: left;
  }
  .enlaces-gobierno ul { width: auto !important; min-height: 69px; padding-left: 23px; }
  .pie-tarjeta__decoracion { width: 168px; height: 138px; bottom: 0; }

  .pie-info {
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 46px;
    padding-left: 0;
    text-align: center;
  }
  .pie-info__logos { order: -1; align-items: center; gap: 46px; padding-top: 0; }
  .pie-info__logos img:first-child { margin-right: 0; }
  .pie-info__logos img:last-child { margin-right: 0; width: 336px; height: 101px; }
  .pie-info__principal { display: flex; flex-direction: column; align-items: center; margin-top: 43px; }
  .pie-info__titulo { text-align: left; }
  .pie-info__titulo p { max-width: 248px; }
  .pie-info address { margin-top: 18px; max-width: 390px; }

  .redes-sociales {
    max-width: 345px;
    margin: 23px auto 0;
    gap: 19px 20px;
  }
  .redes-sociales li:nth-child(2) { order: 3; }
  .redes-sociales li:nth-child(3) { order: 2; }
  .redes-sociales li:nth-child(4) { order: 4; }
  .redes-sociales li:nth-child(5) { order: 5; }
  .redes-sociales li:nth-child(6) { order: 6; }

  .enlaces-legales {
    max-width: 400px;
    margin: 43px auto 0;
    padding-left: 0;
    gap: 16px;
    font-size: 16px;
    line-height: 16px;
    text-align: center;
  }

  .pie-inferior {
    position: relative;
    bottom: auto;
    height: auto;
    margin-top: 43px;
  }
  .pie-inferior picture { display: block; }
  .pie-inferior__ciudad {
    position: static;
    width: 100%;
    height: 139px;
    transform: none;
    object-fit: cover;
    object-position: center bottom;
  }
  .pie-inferior::after { display: none; }
  .pie-inferior__derechos {
    position: static;
    min-height: 130px;
    padding: 14px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(270deg, #003155 0%, #013761 100%);
    font-weight: 400;
  }
  .pie-gov { position: static; }
  .pie-gov img { margin-left: 0; }
  .pie-gov__marca-pais,
  .pie-gov__separador,
  .pie-gov__escudo { display: block; }
  .pie-gov__logo { display: none; }
  .pie-gov__separador { width: 1px; height: 24px; background: #fff; }
}

@media (max-width: 599px) {
  :root { --margen: 20px; }

  /* Portada móvil: imagen propia de 440 × 640 */
  .portada { overflow: visible; }
  .portada__escenario {
    aspect-ratio: 440 / 640;
    background: url("../assets/img/portada-movil.png") center top / 100% 100% no-repeat;
  }
  .portada__fondo { display: none; }
  .portada__contenido {
    left: 7.727%;
    top: 4.688%;
    width: 75.909%;
    gap: 8px;
  }
  .portada__icono { width: 72px; }
  .portada__titulo {
    font-size: clamp(20px, 5.455vw, 24px);
    line-height: 1.132;
    letter-spacing: -0.04em;
  }

  .encabezado .contenedor { padding-inline: 20px; }

  .pie-tarjeta { margin-inline: 5px; }
}

/* Saltos de línea propios del diseño móvil */
@media (max-width: 599px) {
  .br-movil { display: inline; }
}

/* Los saltos marcados para escritorio siempre se muestran a 1440px o más
   (algunos también llevan la clase br-movil) */
@media (min-width: 1440px) {
  .br-escritorio { display: inline; }
}

/* ---------- Ajustes de tablet (600px – 1023px) ---------- */
@media (min-width: 600px) and (max-width: 1023px) {
  /* El cierre usa el mismo ancho de lectura que los demás bloques */
  .seccion--cierre .contenedor > .titular { max-width: 640px; margin-inline: auto; }

  /* Pie de página: aprovechar más ancho debajo de la tarjeta */
  .pie-info address { max-width: 560px; }
  .redes-sociales { max-width: 640px; }
  .redes-sociales li { order: 0 !important; }
  .enlaces-legales { max-width: 600px; }
  .pie-inferior__derechos { max-width: none; }

}

/* Tablets grandes (768px – 1023px): textos un poco más grandes */
@media (min-width: 768px) and (max-width: 1023px) {
  .titular { font-size: 30px; line-height: 1.173; }
  .parrafo { font-size: 20px; line-height: 1.173; }
  .informa,
  .fila-imagen,
  .bloque-texto,
  .pila-centrada,
  .seccion--cierre .contenedor > .titular { max-width: 720px; }
  .imagen,
  .imagen--550 { height: 380px; }

  /* Ministerios en 3 columnas: la tarjeta queda más baja y el fondo azul
     empieza 70px antes de su final */
  .enlaces-gobierno { grid-template-columns: repeat(3, 170px); grid-template-rows: repeat(2, auto); }
  .pie-tarjeta { min-height: 620px; }
  .pie-pagina::before { top: 550px; }
}

/* En tablet y móvil no se muestran las mascotas (Mario y María) */
@media (max-width: 1023px) {
  .mascota { display: none; }
}

/* ---------- Pie de página móvil: ajustes finos según Figma ---------- */
@media (max-width: 599px) {
  /* La silueta va estirada a 440 × 139, como en Figma (no recortada) */
  .pie-inferior__ciudad { object-fit: fill; }

  /* Bloque de enlaces legales de 387px de ancho */
  .enlaces-legales { max-width: 387px; }
  .enlaces-legales a + a { margin-left: 2px; }

  /* Barra GOV.CO: Marca País a 36px del borde, línea a 77px y GOV.CO a 88px */
  .pie-gov .contenedor { padding-left: 36px; gap: 0; }
  .pie-gov .pie-gov__marca-pais { margin-right: 15px; }
  .pie-gov .pie-gov__escudo { margin-left: 10px; }
}
