/* ==========================================================================
   OpenKey – estilos
   1 Tokens · 2 Base · 3 Header y menú · 4 Home · 5 Páginas de solución
   6 Páginas de Recursos · 7 Botón flotante y footer · 8 Efectos (entrada y hover)
   9 Responsive · 10 Zonas táctiles · 11 Celular apaisado
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ink: #182f45;
  --acc: #17658a;
  --acc-dark: #0f4d6c;
  --soft: #f5f5f7;
  --line: #0000001a;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --hh: 76px; /* alto del header; lo usan el sub-menú y las anclas */
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hh) + 16px);
}

body {
  margin: 0;
  font-family: Manrope, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

.wrap { max-width: 1280px; margin: auto; padding: 0 24px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}
.skip:focus { top: 12px; }

/* 3. Header y menú --------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffffb8;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #0000000f;
}

.hd {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1280px;
  height: var(--hh);
  margin: auto;
  padding: 0 200px 0 24px; /* espacio a la derecha para el botón "Contactanos" */
}

.logo img { height: 52px; width: auto; mix-blend-mode: multiply; }

.nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
}

.nav a,
.dd-btn {
  padding: 14px 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 13px/1.6 Manrope, Arial, sans-serif;
  letter-spacing: inherit;
  opacity: .75;
  cursor: pointer;
  transition: opacity .3s;
}
.nav a:hover,
.nav a.on,
.dd-btn:hover,
.dd-btn.on,
.dropdown.open .dd-btn { opacity: 1; }

/* Desplegable "Soluciones" */
.dropdown { position: relative; display: flex; align-items: center; }

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  min-width: 180px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}
.dropdown.open .dropdown-content { display: block; }

.dropdown-content a { display: block; padding: 12px 16px; }
.dropdown-content a:hover { background: var(--soft); }

#mb {
  display: none;
  min-width: 44px;
  min-height: 44px;
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* 4. Home ------------------------------------------------------------------ */
.hero { padding: 40px 24px 25px; text-align: center; overflow: hidden; }

.hero h1 {
  margin: 0 0 25px;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
}

/* Cada mosaico crece según la proporción de su imagen */
.hps { display: flex; align-items: flex-start; gap: 10px; max-width: 780px; margin: auto; }
.hp { flex: var(--ratio) 1 0; min-width: 0; text-align: center; }
.hp:nth-child(1) { --ratio: 0.418539; }
.hp:nth-child(2) { --ratio: 0.310490; }
.hp:nth-child(3) { --ratio: 0.370425; }
.hp:nth-child(4) { --ratio: 0.380952; }
.hp:nth-child(5) { --ratio: 0.350133; }
.hp:nth-child(6) { --ratio: 0.422351; }
.hp img { width: 100%; height: auto; }
.hp span {
  display: inline-block;
  margin-top: 14px;
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 600;
}
.hp span::after { content: " ›"; color: var(--acc); }

/* Secciones: título a la izquierda, contenido a la derecha */
.sec { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 30px 0; }

.sec > h2 {
  margin: 0;
  padding-top: 30px;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.sec > div { padding-top: 50px; border-top: 1px solid var(--line); }
.sec h3 { margin: 0 0 12px; font-size: 19px; letter-spacing: -.02em; }

.stack { display: grid; gap: 48px; }

/* Innovación */
.tech { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }

.ti { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; padding: 16px 10px; background: var(--soft); border-radius: 16px; text-align: center; }
.ti img { height: 64px; width: auto; }
.ti b { font-size: 15px; font-weight: 400; line-height: 1.3; }

/* Clientes: el carrusel ocupa todo el ancho, debajo del título */
#clientes > div { grid-column: 1 / -1; padding-top: 0; margin-top: 12px; }
@media (min-width: 861px) {
  #clientes::before { content: ""; grid-column: 2; grid-row: 1; align-self: start; border-top: 1px solid var(--line); }
  #clientes > h2 { grid-column: 1; grid-row: 1; }
  #clientes > div { grid-row: 2; border-top: 0; }
}

/* Recursos */
/* 3 tarjetas = 3 columnas. Si se suma una cuarta (p. ej. Capacitaciones), pasar a repeat(4, 1fr). */
.rg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.rc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: var(--soft);
  border-radius: 22px;
  text-align: center;
}
.rc img { width: 80px; height: 80px; object-fit: cover; border-radius: 14px; }
.rc b { font-size: 14px; font-weight: 600; }

/* Nosotros */
.nos { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.nos.reverse { align-items: center; }

.nos p { max-width: 620px; margin: 0; font-size: 15px; font-weight: 300; line-height: 1.9; }
.nos p + p { margin-top: .8em; }

.nos img { width: 100%; max-width: min(60%, 320px); margin: auto; border-radius: 18px; box-shadow: 0 12px 30px -20px #0003; transition: transform .8s var(--ease); }
.nos.reverse img { max-width: 100%; }
.nos img:hover { transform: scale(1.02); }
#nosotros .stack > .nos:nth-child(3) img { max-width: 180px; }

.valores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.valor { padding: 20px; background: var(--soft); border-radius: 16px; text-align: center; }
.valor strong { font-size: 14px; font-weight: 600; }

/* Contacto */
.ct { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 30px; align-items: start; }
.ct h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .25em; text-transform: uppercase; }
.ct p { margin: 0; font-size: 15px; font-weight: 300; }
.ct a:hover { color: var(--acc); }

.jb {
  padding: 20px 28px;
  border: 1px solid #0003;
  border-radius: 980px;
  font-weight: 300;
  white-space: nowrap;
  transition: .25s;
}
.jb:hover { background: var(--ink); color: #fff; }

/* 5. Páginas de solución --------------------------------------------------- */
.sub {
  position: sticky;
  top: var(--hh);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px max(24px, calc((100% - 1280px) / 2 + 24px));
  background: #ffffffb8;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #0000000f;
}
.sub b { flex: 1; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.sub a {
  flex: none;
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  opacity: .7;
  transition: .3s;
}
.sub a:hover { opacity: 1; background: var(--soft); }
.sub a.on { opacity: 1; background: var(--ink); color: #fff; }

.prod {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) 2fr;
  gap: 40px;
  align-items: start;
  max-width: 1280px;
  margin: auto;
  padding: 40px 24px 64px;
}

.pimg { position: sticky; top: calc(var(--hh) + 80px); }
.pimg img { width: auto; max-height: 400px; margin: 0; }

.ptx h1 {
  margin: 0 0 32px;
  font-size: clamp(26px, 2.8vw, 36px);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.blk { max-width: 680px; margin-bottom: 28px; }
.blk h2 { margin: 0 0 8px; font-size: clamp(17px, 1.5vw, 20px); letter-spacing: -.02em; }
.blk p { margin: 0; font-size: 15.5px; color: #3a4d5f; }

/* "Qué podés hacer": usa la misma grilla que .prod para que el texto quede
   alineado con la columna de contenido de arriba. */
.sol-funciones {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) 2fr;
  column-gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}
.sol-funciones > * { grid-column: 2; max-width: 760px; }

.sol-intro { margin: 0 0 24px; color: #3a4d5f; font-size: 15.5px; font-weight: 600; line-height: 1.55; }

.sol-funciones > h2,
.sol-adicionales > h3 {
  color: var(--ink);
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
}
.sol-funciones > h2 { margin: 0 0 16px; }

.sol-lista { margin: 0; border-bottom: 1px solid var(--line); }
.sol-lista > div {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.sol-lista dt,
.sol-lista dd,
.sol-adicionales p { margin: 0; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.sol-lista dt { color: var(--ink); font-weight: 600; }
.sol-lista dd,
.sol-adicionales p { color: #3a4d5f; font-weight: 400; }

.sol-adicionales { margin: 24px 0 0; }
.sol-adicionales > h3 { margin: 0 0 6px; }

/* 6. Páginas de Recursos (Newsletter, Comunicados, Redes) ------------------ */
.sticky-footer { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.sticky-footer > main { flex: 1; }
body:has(dialog[open]) { overflow: hidden; }

.rpage { padding-block: 16px 56px; }

.volver {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  color: var(--acc);
  font-size: 14px;
  font-weight: 600;
}
.volver:hover { text-decoration: underline; text-underline-offset: 4px; }

.rhead { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; margin-bottom: 36px; }
.rpage h1 {
  max-width: 39ch;
  margin: 0 0 10px;
  font-size: clamp(24px, 2.65vw, 30px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.rhead h1 { margin: 0; }
.rintro { max-width: 62ch; margin: 0 0 32px; color: #4e6274; }

.btn-oscuro {
  flex-shrink: 0;
  padding: 13px 20px;
  border-radius: 980px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background .25s;
}
.btn-oscuro:hover { background: #29465f; }

/* Grilla de miniaturas */
.grilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; margin: 0; padding: 0; list-style: none; }

.abrir {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.miniatura {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1414 / 2000;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.abrir:hover .miniatura { border-color: #7290a9; }
.nombre { font-size: 15px; font-weight: 700; line-height: 1.35; }
.fecha { display: block; margin-top: 4px; color: #4e6274; font-size: 13px; }
.otra {
  margin-top: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: #345c7a;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* Visor (se cierra con el botón, con Esc o tocando el fondo oscuro) */
dialog {
  width: min(820px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
}
dialog::backdrop { background: rgb(14 28 42 / 76%); }
.visor-barra {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #e4e9ed;
  background: #fff;
}
.visor-barra h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.cerrar {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #dce4ea;
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.imagen-completa { display: block; width: 100%; height: auto; }

/* Redes */
.perfiles { max-width: 820px; }
.perfil {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 18px 0;
  border-bottom: 1px solid #e4e9ed;
}
.perfil strong { display: block; font-weight: 700; }
.detalle { display: block; margin-top: 3px; color: #4e6274; font-size: 14px; }
.flecha { font-size: 1.2rem; }
.perfil:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.perfil.destacado {
  padding: 20px 22px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}
.destacado strong { font-size: 1.1rem; }
.destacado .detalle { color: #e4edf5; }
.destacado:hover { background: #29465f; }

/* 7. Botón flotante y footer ----------------------------------------------- */
.fab {
  position: fixed;
  top: 17px;
  right: 18px;
  z-index: 40;
  padding: 10px 24px;
  border-radius: 980px;
  background: var(--acc);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 22px -8px #0007;
  transition: .3s var(--ease);
}
.fab:hover { background: var(--acc-dark); transform: scale(1.05); }

#pg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 2px;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: 0;
}

/* 8. Efectos: entrada y hover ---------------------------------------------- */
/* Para suavizar o quitar la animación de entrada, tocá solo este bloque.
   Los elementos solo parten ocultos si el JS está activo (clase "js"). */
:where(.js) .rv,
:where(.js) .st,
:where(.js) .hp {
  opacity: 0;
  transition: opacity .7s var(--ease), transform .6s var(--ease), box-shadow .5s var(--ease);
}
:where(.js) .rv { transform: translateY(20px); }
:where(.js) .st { transform: translateY(16px); }
:where(.js) .hp { transform: translateY(20px) scale(.98); }

:where(.js) .rv.in,
:where(.js) .st.in,
:where(.js) .hp.in { opacity: 1; transform: none; }

/* Hover (van después de los estados de entrada para ganar la cascada) */
.hp, .ti, .rc { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.hp:hover { transform: translateY(-10px) scale(1.04); }
.ti:hover { transform: scale(1.04); box-shadow: 0 18px 40px -18px #0003; }
.rc:hover { transform: scale(1.02); box-shadow: 0 18px 40px -18px #0003; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  :where(.js) .rv, :where(.js) .st, :where(.js) .hp { opacity: 1; transform: none; }
}

/* 9. Responsive ------------------------------------------------------------ */
@media (max-width: 860px) {
  .hd { padding-right: 130px; }
  .fab { top: 19px; right: 12px; padding: 8px 16px; font-size: 13px; }

  /* Menú desplegable */
  #mb { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - var(--hh));
    padding: 10px 24px 20px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 8px 14px #0002;
  }
  .nav.open { display: flex; }
  .nav a,
  .dd-btn { padding: 12px 0; font-size: 17px; text-align: left; }

  .dropdown { display: block; }
  .dd-btn { width: 100%; }
  .dropdown-content { position: static; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
  .dropdown-content a { padding: 10px 0 10px 16px; }

   /* Home */
  .hps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; max-width: 540px; }
  .hp img { width: 100%; height: clamp(170px, 38vw, 240px); object-fit: contain; }
  .hp span { margin-top: 10px; font-size: 13px; }
  .hp span::after { content: none; }

  .sec, .nos, .prod { grid-template-columns: 1fr; }
  .sec { gap: 0; }
  .sec > h2 { padding: 0 0 10px; }
  .nos.reverse img { order: -1; }

  /* Innovación: 3 arriba y 2 abajo (más anchas) en vez de 5 barras apiladas */
  .tech { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ti { grid-column: span 2; }
  .ti:nth-child(n+4) { grid-column: span 3; }
  .valores { grid-template-columns: repeat(2, 1fr); }

  /* Contacto: email y teléfono lado a lado; dirección y botón a lo ancho */
  .ct { grid-template-columns: 1fr 1fr; gap: 24px 30px; }
  .ct > div:nth-child(3), .jb { grid-column: 1 / -1; }
  .jb { justify-self: start; }

  /* Recursos (listados) */
  .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Soluciones */
  .sub { justify-content: flex-start; padding-inline: 16px; overflow-x: auto; }
  .sub b { display: none; }
  .prod { padding-top: 24px; }
  .pimg { position: static; }
  .pimg img { max-height: 300px; margin-inline: auto; }

  .sol-funciones { grid-template-columns: 1fr; padding-top: 12px; }
  .sol-funciones > * { grid-column: 1; }
}

@media (max-width: 640px) {
  .grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .rhead { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .sol-funciones { padding-block: 8px 36px; }
  .sol-lista > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (max-width: 560px) {
  .tech { grid-template-columns: 1fr; }
  .ti, .ti:nth-child(n+4) { grid-column: auto; flex-direction: row; width: 100%; text-align: left; }

  .ct { grid-template-columns: 1fr; }

  .rg { grid-template-columns: 1fr; gap: 12px; }
  .rc { flex-direction: row; gap: 16px; text-align: left; }
  .rc b { font-size: 15px; }
}

/* Pie de página (el mismo en todas las páginas) */
.footer { margin-top: 24px; padding: 20px 24px; border-top: 1px solid var(--line); background: var(--soft); text-align: center; }
.footer-copy { margin: 0; font-size: 12px; color: #3a4d5f; }

/* 10. Zonas táctiles: mínimo 44 px en pantallas chicas y táctiles ---------- */
@media (pointer: coarse), (max-width: 860px) {
  .sub { padding-block: 6px; }
  .sub a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; }

  /* Email, teléfono y dirección: se agranda la zona de toque sin mover el diseño */
  .ct p a { display: inline-block; padding: 14px 0; margin: -14px 0; }

  .otra { min-height: 44px; padding: 0 4px; }
}

/* 11. Celular apaisado: header más bajo y sub-menú que se va con el scroll -- */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --hh: 56px; }
  .logo img { height: 40px; }
  .fab { top: 10px; padding: 8px 16px; font-size: 13px; }

  .sub { position: static; }
  .pimg { position: static; }
  .pimg img { max-height: 70vh; }
}
