/* ==========================================================================
   Abrazo en Red Colombia — hoja de estilos
   ========================================================================== */

:root {
  /* Color */
  --bg:            #FBF8F4;
  --bg-alt:        #F3EFE8;
  --surface:       #FFFFFF;
  --ink:           #1D2A2C;
  --ink-soft:      #46565A;
  --muted:         #6E7C80;
  --line:          #E6E0D6;

  --primary:       #0F6E63;
  --primary-dark:  #0A554C;
  --primary-soft:  #E4F1EE;
  --accent:        #D9873B;
  --accent-soft:   #FBF0E2;
  --wa:            #25D366;
  --wa-dark:       #1EA855;

  /* Forma */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(29, 42, 44, .05), 0 2px 8px rgba(29, 42, 44, .04);
  --shadow-md: 0 2px 4px rgba(29, 42, 44, .05), 0 12px 28px rgba(29, 42, 44, .07);
  --shadow-lg: 0 4px 8px rgba(29, 42, 44, .06), 0 24px 48px rgba(29, 42, 44, .10);

  /* Tipografía */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Lora', Georgia, 'Times New Roman', serif;

  /* Diagramación: dos anchos y un canal lateral fluido.
     --maxw      → rejillas anchas (tarjetas, pasos, header, footer)
     --maxw-text → columnas de lectura; se topa para no pasar de ~75 caracteres
     --gutter    → margen lateral, crece con la pantalla */
  --maxw: 1400px;
  --maxw-text: 740px;
  --gutter: clamp(20px, 3vw, 40px);
  --gap: 26px;

  interpolate-size: allow-keywords; /* permite animar height:auto en el desplegable */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* red de seguridad contra desbordes en móvil */
  -webkit-tap-highlight-color: rgba(15, 110, 99, .12);
}

/* El header fijo no debe tapar el destino de los enlaces ancla */
section[id], [id="top"] { scroll-margin-top: 84px; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ol, ul, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) 0; text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* --- Layout --------------------------------------------------------------- */
.container {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  /* env(): respeta la muesca/bordes curvos en horizontal */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.container.narrow { max-width: calc(var(--maxw-text) + var(--gutter) * 2); }
.center { text-align: center; }

/* Columna de lectura: bloque centrado, texto alineado a la izquierda */
.reading { max-width: var(--maxw-text); margin-inline: auto; }

.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 244, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
/* El emblema del logo va sin fondo ni caja: ya trae su propia forma */
.brand-mark { width: 42px; height: 42px; flex: none; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
.brand-text em {
  font-style: normal; font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  display: inline-flex; align-items: center; white-space: nowrap;
  text-decoration: none; font-size: .93rem; font-weight: 500; color: var(--ink-soft);
  padding: 11px 16px; border-radius: var(--r-pill); transition: background .2s, color .2s;
}
.site-nav a:hover { background: rgba(15, 110, 99, .08); color: var(--primary-dark); }
.site-nav .nav-cta {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.site-nav .nav-cta:hover { background: var(--primary-dark); color: #fff; }

/* --- Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: var(--r-pill);
  font-size: .97rem; font-weight: 600; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-dark); }

/* Semiopaco en vez de transparente: sobre la imagen del hero un botón
   sin fondo se pierde y deja de leerse como botón. */
.btn-ghost {
  background: rgba(255, 255, 255, .78); color: var(--ink); border-color: var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

.btn-wa { background: var(--wa); color: #06301A; width: 100%; box-shadow: 0 8px 20px rgba(37, 211, 102, .28); }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }

/* --- Hero ----------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 88px; }
.hero-inner {
  position: relative; z-index: 1;
  max-width: 860px; margin-inline: auto; text-align: center;
}

/* Imagen de fondo del hero.
   Va en dos capas: la foto atenuada (::before) y un velo del color de la página
   (::after) que se concentra donde cae el texto, para no perder legibilidad. */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.hero-bg::before,
.hero-bg::after { content: ''; position: absolute; inset: 0; }

.hero-bg::before {
  background: url('../img/hero-colombia.webp') center / cover no-repeat;
  opacity: .42;
}
.hero-bg::after {
  background:
    /* halo suave bajo el bloque de texto: deja entrever el mapa sin apagarlo */
    radial-gradient(ellipse 70% 58% at 50% 46%,
      rgba(251, 248, 244, .50), rgba(251, 248, 244, .12) 70%, rgba(251, 248, 244, 0) 100%),
    /* funde hacia el fondo de la página por arriba y por abajo */
    linear-gradient(to bottom,
      rgba(251, 248, 244, .42) 0%, rgba(251, 248, 244, .06) 40%, var(--bg) 100%);
}

/* En móvil se sirve una versión más liviana (41 KB en vez de 104 KB) */
@media (max-width: 700px) {
  .hero-bg::before { background-image: url('../img/hero-colombia-sm.webp'); }
}

.eyebrow {
  font-size: .82rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 18px;
}
.eyebrow.center { text-align: center; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem);
  margin-bottom: 22px;
}
/* "Colombia" con las franjas de la bandera (mitad amarilla, cuarto azul, cuarto rojo).
   El amarillo va oscurecido a oro: el #FCD116 puro es ilegible sobre fondo claro. */
.hero h1 span {
  display: block; font-style: italic;
  color: var(--primary); /* respaldo si background-clip:text no existe */
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1 span {
    /* El degradado cubre toda la caja de línea, pero el trazo va del 14,5% al 83,6%
       (medido con TextMetrics). Estas paradas dan el 50/25/25 sobre las letras. */
    background-image: linear-gradient(
      to bottom,
      #A87400 0 49%,
      #003893 49% 66%,
      #CE1126 66% 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.hero-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--ink-soft);
  max-width: 58ch; margin-inline: auto;
}

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }

.hero-note {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 32px auto 0; font-size: .9rem; color: var(--muted); max-width: 56ch;
  text-align: left;
}
.hero-note svg { width: 17px; height: 17px; flex: none; color: var(--primary); }

/* --- Secciones de texto --------------------------------------------------- */
/* Los títulos siempre van centrados; el cuerpo de texto va alineado
   a la izquierda dentro de una columna centrada. */
.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin-bottom: 12px;
  text-align: center; text-wrap: balance;
  max-width: 24ch; margin-inline: auto;
}
.section-sub {
  color: var(--ink-soft); font-size: 1.04rem; margin-top: 14px;
  max-width: 58ch; margin-inline: auto; text-align: center; text-wrap: pretty;
}

.prose { margin-top: 30px; display: grid; gap: 18px; color: var(--ink-soft); font-size: 1.05rem; }
.prose strong { color: var(--ink); }

.pullquote { margin: 44px 0 0; padding: 28px 30px; background: var(--surface);
  border-left: 4px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0;
  box-shadow: var(--shadow-sm); }
.pullquote blockquote {
  margin: 0; font-family: var(--font-head); font-style: italic;
  font-size: 1.16rem; line-height: 1.55; color: var(--ink);
}

/* --- Pasos ---------------------------------------------------------------- */
/* Flex en vez de grid: así la última fila incompleta queda centrada
   en lugar de pegarse a la izquierda. */
.steps {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--gap); margin-top: 52px;
}
.step {
  flex: 0 1 100%; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px 28px;
}
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-dark);
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; margin-bottom: 16px;
}
.step h3 { font-size: 1.14rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: .96rem; }

/* Nota de convivencia: petición amable, no advertencia.
   Por eso va en el verde de la marca y no en tono de alerta. */
.note {
  display: flex; align-items: flex-start; gap: 13px;
  max-width: 64ch; margin: 30px auto 0;
  padding: 17px 20px; border-radius: var(--r-md);
  background: var(--primary-soft); border: 1px solid #CBE3DD;
  color: var(--primary-dark); font-size: .95rem; line-height: 1.55;
  text-align: left; text-wrap: pretty;
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.note strong { font-weight: 700; }

/* --- Tarjetas de facilitadores -------------------------------------------- */
/* Rejilla de columnas explícitas en flex: todas las tarjetas miden exactamente
   lo mismo y la última fila incompleta queda centrada (grid la dejaría a la izquierda). */
.cards {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--gap); margin-top: 54px;
}

.card {
  flex: 0 1 100%; min-width: 0;                       /* 1 columna por defecto */
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px 28px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #DCD4C7; }

.card-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }

/* Foto circular + bandera */
.avatar { position: relative; flex: none; width: 96px; height: 96px; }
.avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  background: var(--bg-alt);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-soft), var(--shadow-sm);
}
/* Se superpone en lugar de ocupar sitio: así no descuadra la tarjeta
   mientras la foto todavía está cargando. */
.avatar--fallback::before {
  content: attr(data-initials);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--primary-soft), var(--accent-soft));
  color: var(--primary-dark);
  font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-soft), var(--shadow-sm);
}
.flag {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  overflow: hidden; background: #fff;
  box-shadow: 0 0 0 2.5px var(--surface), var(--shadow-sm);
}
.flag svg { width: 100%; height: 100%; }

.card-id { min-width: 0; }
.card-id h3 { font-size: 1.19rem; line-height: 1.25; }
.card-id .role {
  margin-top: 5px; font-size: .88rem; font-weight: 600; color: var(--primary);
}
.card-id .country {
  margin-top: 3px; font-size: .84rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}

/* Descripción desplegable (<details> nativo: funciona sin JS y con teclado) */
.bio {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bio summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; padding: 4px 2px;
  font-size: .92rem; font-weight: 600; color: var(--primary-dark);
  cursor: pointer; list-style: none; -webkit-user-select: none; user-select: none;
  transition: color .2s ease;
}
.bio summary::-webkit-details-marker { display: none; }  /* oculta el triángulo de Safari */
.bio summary::marker { content: ''; }
.bio summary:hover { color: var(--primary); }
.bio .chev { width: 18px; height: 18px; flex: none; transition: transform .25s ease; }
.bio[open] .chev { transform: rotate(180deg); }
.bio p { color: var(--ink-soft); font-size: .97rem; padding: 0 2px 16px; }

/* Apertura animada donde el navegador la soporta; en el resto abre de golpe */
@supports selector(::details-content) {
  .bio::details-content {
    block-size: 0; overflow: hidden;
    transition: block-size .3s ease, content-visibility .3s allow-discrete;
  }
  .bio[open]::details-content { block-size: auto; }
}

.meta {
  margin: 22px 0 24px; padding: 16px 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  display: grid; gap: 12px;
}
.meta-row { display: flex; align-items: flex-start; gap: 12px; }
.meta-row dt { flex: none; color: var(--primary); }
.meta-row dd { margin: 0; font-size: .93rem; color: var(--ink); line-height: 1.5; }
.meta .tz { color: var(--muted); }
.ico { width: 18px; height: 18px; margin-top: 2px; }

.card .btn-wa { margin-top: auto; }

/* --- Cierre --------------------------------------------------------------- */
.closing {
  padding: 84px 0;
  background: linear-gradient(160deg, var(--primary-dark), var(--primary) 55%, #16897C);
  color: #fff;
}
.closing h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); margin-inline: auto; max-width: 24ch; }
.closing p { margin: 18px auto 32px; max-width: 54ch; color: rgba(255, 255, 255, .88); }
.closing .btn-primary { background: #fff; color: var(--primary-dark); }
.closing .btn-primary:hover { background: var(--bg-alt); color: var(--primary-dark); }

/* --- Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg-alt); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
}
.footer-brandblock { display: flex; align-items: center; gap: 20px; }
.footer-logo { width: 132px; height: auto; flex: none; }
.footer-sub, .footer-legal { font-size: .85rem; color: var(--muted); }
.footer-sub { max-width: 32ch; }

/* --- Animación de entrada ------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Responsive ----------------------------------------------------------- */

/* Columnas: 1 → 2 → 3. Con flex-grow en 0, todas las piezas miden lo mismo
   en cualquier fila, incluida la última. */
@media (min-width: 700px) {
  .card { flex-basis: calc((100% - var(--gap)) / 2); }
}
@media (min-width: 900px) {
  .step { flex-basis: calc((100% - var(--gap) * 2) / 3); }
}
@media (min-width: 1080px) {
  .card { flex-basis: calc((100% - var(--gap) * 2) / 3); }
}

@media (max-width: 860px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* Móviles angostos: el header debe caber en una sola línea */
@media (max-width: 430px) {
  .brand-text strong { font-size: .98rem; }
  .brand-text em { font-size: .62rem; letter-spacing: .14em; }
  .brand-mark { width: 36px; height: 36px; }
  .brand { gap: 10px; }
  .site-nav .nav-cta { font-size: .85rem; padding: 11px 13px; }
  .header-inner { gap: 10px; }
}

@media (max-width: 340px) {
  .brand-text { display: none; } /* último recurso: solo el ícono */
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 64px; }
  .section-title, .closing h2 { max-width: none; }
  .hero-lead, .prose { text-wrap: pretty; }
  /* El ícono queda suelto al lado de 3 líneas: pasa a ser inline y todo se centra */
  .hero-note { display: block; text-align: center; }
  .hero-note svg { display: inline-block; vertical-align: -3px; margin-right: 6px; }
  .cards, .steps { --gap: 20px; }
  .card { padding: 26px 22px 24px; }
  .card-head { gap: 16px; }
  .avatar { width: 82px; height: 82px; }
  .avatar--fallback::before { font-size: 1.6rem; }
  .flag { width: 27px; height: 27px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .pullquote { padding: 24px 22px; }
  .closing { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* --- Impresión ------------------------------------------------------------ */
@media print {
  .site-header, .hero-actions, .closing .btn, .hero-bg { display: none; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
