/* Paleta derivada de la marca original (azul #1356A1 + rojo de la flecha). */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eaf0f8;
  --ink: #0b1b33;
  --muted: #4a5a73;
  --line: #d6dfeb;
  --brand: #1356a1;
  --brand-strong: #0b3c78;
  --accent: #d7262e;
  /* Rojo fijo de botón: mantiene contraste AA con texto blanco en ambos temas. */
  --btn: #c81f28;
  --btn-hover: #a8171f;
  --on-brand: #ffffff;
  --navy: #071a33;
  --navy-2: #0b2a52;
  --on-navy: #e9f0fa;
  --on-navy-muted: #a9bbd6;
  --sky: #6aa6ec;
  /* Naranja del subrayado del menú: ~8:1 de contraste sobre el azul del encabezado. */
  --nav-mark: #ff9f43;

  --radius: 14px;
  --shadow: 0 1px 2px rgb(11 27 51 / .06), 0 8px 24px rgb(11 27 51 / .06);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 10vw, 120px);
  color-scheme: light;
}

/* Claro por defecto; el oscuro solo si el visitante lo elige (ver theme.js). */
:root[data-theme="dark"] {
  --bg: #06101e;
  --surface: #0d1b2f;
  --surface-alt: #0a1627;
  --ink: #e8eef7;
  --muted: #a3b3ca;
  --line: #1d324f;
  --brand: #6aa6ec;
  --brand-strong: #9cc5f4;
  --accent: #ff5d63;
  --on-brand: #06101e;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(16px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 .5em; font-stretch: 85%; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; max-width: 22ch; }
p { margin: 0 0 1em; }
a { color: var(--brand); }

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

/* Mantiene juntos códigos como el número de certificación OEA. */
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--surface); color: var(--ink); border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9em;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.3em;
  background: var(--btn); color: #fff; border: 2px solid transparent; border-radius: 999px;
  font-weight: 700; text-decoration: none; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--btn-hover); }
.btn-ghost { background: transparent; border-color: currentColor; color: var(--on-navy); }
.btn-ghost:hover { background: rgb(255 255 255 / .1); }
.btn-sm { min-height: 40px; padding: .4em 1.1em; font-size: .95rem; }

/* Encabezado claro: el logotipo oficial es un PNG con texto oscuro y no se lee sobre azul marino. */
/* Encabezado azul marino, como en la versión aprobada por el cliente (97cf101). */
.site-header {
  position: sticky; top: 0; z-index: 50;
  --header-tint: rgb(7 26 51 / .82);
  background: var(--header-tint); color: var(--on-navy);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgb(255 255 255 / .08);
}
:root[data-theme="dark"] .site-header { --header-tint: rgb(6 16 30 / .9); }
/* Escritorio: blanco detrás del logo que se funde con el azul antes del menú.
   El logo termina en max(0, 50% − 590px) + gutter + 168px (ancho máximo de .wrap y placa del logo);
   la transición acaba antes de «Inicio» en todo ancho > 1000px, así el texto del menú queda sobre azul pleno.
   En móvil los íconos quedan pegados al logo y no hay espacio para la transición: se mantiene el azul. */
@media (min-width: 1001px) {
  .site-header {
    --header-white: calc(max(0px, 50% - 590px) + var(--gutter) + 172px);
    background: linear-gradient(to right, #fff var(--header-white),
      var(--header-tint) calc(var(--header-white) + clamp(80px, 12vw - 40px, 240px)));
  }
}
.header-inner { display: flex; align-items: center; min-height: 72px; gap: 12px; }
/* El logotipo oficial tiene texto oscuro: va sobre una placa blanca para leerse sobre azul. */
.brand { display: inline-flex; align-items: center; border-radius: 10px; background: #fff; padding: 3px 10px; }
.brand-logo { width: auto; height: 44px; }

.nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.nav a:not(.btn) {
  color: var(--on-navy); font-weight: 500; white-space: nowrap; opacity: .85;
  text-decoration: none; text-decoration-color: var(--nav-mark); text-decoration-thickness: 2px; text-underline-offset: 6px;
}
/* aria-current lo pone main.js en la opción de la sección visible. */
.nav a:not(.btn):hover, .nav a:not(.btn)[aria-current] { opacity: 1; text-decoration-line: underline; }

/* Escritorio: marca | menú | Instagram | tema. Móvil: marca | Instagram | tema | hamburguesa. */
.brand { margin-right: auto; }
.nav { order: 1; }
.social-link { order: 2; }
.theme-toggle { order: 3; }
.nav-toggle { order: 4; }

/* Instagram y el cambio de tema comparten forma: botón circular de 44 px. */
.theme-toggle, .social-link {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  background: none; color: inherit; cursor: pointer; text-decoration: none;
  border: 1px solid rgb(255 255 255 / .2); border-radius: 999px;
}
.theme-toggle:hover, .social-link:hover { background: rgb(255 255 255 / .08); }
.theme-toggle svg, .social-link svg { width: 20px; height: 20px; }
.icon-sun, :root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 8px; }
.bars, .bars::before, .bars::after { display: block; width: 22px; height: 2px; background: currentColor; margin: auto; position: relative; transition: transform .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; } .bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; inset: 72px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--navy);
    border-bottom: 1px solid rgb(255 255 255 / .1); box-shadow: var(--shadow);
  }
  .nav:not(.is-open) { display: none; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid rgb(255 255 255 / .08); }
  .nav .btn { margin-top: 16px; }
}
@media (max-width: 400px) { .brand-logo { height: 38px; } }
/* Con Instagram en el encabezado, los teléfonos más angostos (320 px) necesitan piezas algo menores. */
@media (max-width: 360px) {
  .header-inner { gap: 6px; }
  .theme-toggle, .social-link, .nav-toggle { width: 40px; height: 40px; }
  .brand-logo { height: 34px; }
}

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 10%, var(--navy-2), var(--navy) 60%);
  color: var(--on-navy);
  padding-block: clamp(64px, 10vw, 120px) clamp(56px, 8vw, 96px);
}
.hero-media { position: absolute; inset: 0 0 0 45%; z-index: -1; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(.9);
  mix-blend-mode: luminosity; opacity: .45;
  mask-image: linear-gradient(90deg, transparent, #000 45%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.hero::after {
  /* Arco rojo que remite a la flecha del logotipo original. */
  content: ""; position: absolute; z-index: -1;
  width: 900px; height: 900px; right: -420px; bottom: -640px;
  border: 3px solid var(--accent); border-radius: 50%; opacity: .55;
}
@media (max-width: 760px) { .hero-media { inset: 0; } .hero-media img { opacity: .22; mask-image: none; -webkit-mask-image: none; } }

.hero .eyebrow { color: #ff8a8f; }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); font-weight: 800; font-stretch: 78%; letter-spacing: -.02em; max-width: 17ch; }
.hero h1 span { color: #ff6a70; }
.lead { font-size: clamp(1rem, 1.3vw, 1.18rem); color: var(--on-navy-muted); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Flex para que los datos pasen a otra línea solo cuando no caben. */
.hero-facts {
  display: flex; flex-wrap: wrap; column-gap: clamp(20px, 5vw, 56px); row-gap: 24px;
  margin: clamp(40px, 6vw, 72px) 0 0; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / .14);
}
.hero-facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--on-navy-muted); }
.hero-facts dd { margin: 4px 0 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; font-stretch: 80%; }
@media (max-width: 480px) { .hero-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; } }

/* Secciones */
.section { padding-block: var(--section); }
.section-alt { background: var(--surface-alt); }
.section-dark { background: var(--navy); color: var(--on-navy); }
.section-dark .eyebrow { color: #ff8a8f; }
.intro { color: var(--muted); max-width: 60ch; font-size: 1.08em; }
.sub { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 800; margin-top: clamp(48px, 7vw, 80px); }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }


.photo { margin: 0; }
.photo img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Grupos de 4 elementos: 4 → 2 → 1 columnas, para no dejar huérfanos. */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .grid-4 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }


/* Servicios */
.cards { margin-top: 40px; }
.card {
  position: relative; padding: 28px 24px 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--brand); }
.card-num { display: block; font-size: .85rem; font-weight: 800; color: var(--accent); letter-spacing: .1em; margin-bottom: 20px; }
.card h3 { font-size: 1.3rem; font-weight: 800; }
.card p { color: var(--muted); margin: 0; }

/* Misión / visión / valores */
.mv { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-top: clamp(48px, 7vw, 80px); }
@media (max-width: 860px) { .mv { grid-template-columns: 1fr; } }
.mv-text { font-size: clamp(1.05rem, 1.5vw, 1.2rem); }

/* Tarjetas de declaración: Misión, Visión y Política de Gestión comparten formato. */
.mv article, .policy {
  padding: clamp(24px, 4vw, 44px);
  border-left: 6px solid var(--sky);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--navy-2); color: #fff;
}
.mv article .eyebrow, .policy h3 { color: var(--sky); }
.mv-text, .policy p { margin: 0; font-style: italic; line-height: 1.7; color: #fff; }

.values { margin-top: 28px; }
.values article { padding: 24px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line); }
.values h4 { font-size: 1.2rem; font-weight: 800; color: var(--brand-strong); }
.values p { margin: 0; color: var(--muted); }

/* Seguridad OEA */
.oea { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .oea { grid-template-columns: 1fr; } }
/* Placa blanca en ambos temas: el sello oficial es un PNG pensado para fondo claro. */
.oea-seal { margin: 0; padding: clamp(20px, 3vw, 32px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.oea-seal img { width: 100%; max-width: 300px; height: auto; margin-inline: auto; }
@media (max-width: 860px) { .oea-seal { max-width: 360px; } }

.policy { margin-top: clamp(48px, 7vw, 80px); }
.policy h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 800; }
.policy p { max-width: 90ch; }

/* Cobertura: tres zonas, cada una con su color en la lista y en el mapa. */
.section-dark .intro { color: var(--on-navy-muted); }
.coverage { align-items: start; }
.zone-sea { --zone: #ff6a70; }
.zone-land { --zone: #7db4f2; }
.zone-air { --zone: #f2c14e; }
.zones { display: grid; gap: 28px; margin-top: 32px; }
.zone h3 {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0;
  font-size: .85rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.zone h3::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--zone); align-self: center; }
.zone h3 span { color: var(--on-navy-muted); font-weight: 500; letter-spacing: .04em; text-transform: none; font-size: .95rem; }
.ports { list-style: none; padding: 0; margin: 6px 0 0; }
.ports li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 12px 22px; border-bottom: 1px solid rgb(255 255 255 / .12); }
.ports strong { font-size: 1.08rem; }
.ports span { color: var(--on-navy-muted); font-size: .92rem; }

.map { margin: 0; }
@media (min-width: 861px) { .map { position: sticky; top: 100px; } }
.map svg { width: 100%; height: auto; display: block; }
.map-neighbors path { fill: rgb(255 255 255 / .05); stroke: rgb(255 255 255 / .14); stroke-width: 1.5; }
.map-country { fill: #12315c; stroke: #3a6db0; stroke-width: 2; }
.map-labels text { font-size: 20px; letter-spacing: .14em; fill: var(--on-navy-muted); }
.map-labels .sea { font-style: italic; letter-spacing: .08em; opacity: .7; }
.map-labels .country-label { fill: #c9d6e8; font-size: 26px; font-weight: 700; letter-spacing: .4em; opacity: .55; }
.pt circle { stroke: var(--navy); stroke-width: 4; }
.pt-sea circle { fill: #ff6a70; }
.pt-land circle { fill: #7db4f2; }
.pt-air circle { fill: #f2c14e; }
.pt text { font-size: 25px; font-weight: 700; fill: var(--on-navy); paint-order: stroke; stroke: var(--navy); stroke-width: 6px; stroke-linejoin: round; }
/* En pantallas angostas los nombres serían ilegibles: quedan los puntos y la lista. */
@media (max-width: 600px) { .pt text, .map-labels .sea, .map-labels .country-label { display: none; } .pt circle { r: 15px; } }

/* Enlaces */
.links { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.links a {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; transition: border-color .15s;
}
.links a:hover { border-color: var(--brand); }
.links a span { color: var(--brand); font-weight: 500; font-size: .88rem; }
.links a span::after { content: " ↗"; }

/* Contacto */
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s;
}
/* Solo las tarjetas que son enlaces reaccionan al pasar el mouse. */
a.contact-card:hover { border-color: var(--accent); }
.contact-wide { grid-column: 1 / -1; }
.contact-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.contact-value { font-size: clamp(1.1rem, 1.6vw, 1.25rem); font-weight: 800; font-stretch: 85%; }
.contact-wide .contact-value { font-size: 1.1rem; font-weight: 600; font-stretch: 100%; }
.contact-more { color: var(--brand); font-weight: 600; margin-top: 6px; }

/* Formulario de contacto (aún sin envío; ver main.js) */
.contact-form {
  padding: clamp(22px, 3.5vw, 36px); background: var(--surface);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.contact-form h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 800; margin-bottom: .2em; }
.form-note { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-bottom: 22px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field label span, .form-note span { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--accent); }
.field-error { margin: 0; color: var(--accent); font-size: .88rem; font-weight: 600; }
.field-error:empty { display: none; }
.form-status { margin: 16px 0 0; }
.form-status:empty { display: none; }
.form-status:not(:empty) { padding: 14px 16px; border-radius: 10px; background: var(--surface-alt); border-left: 4px solid var(--brand); }

/* Pie */
.site-footer { background: var(--navy); color: var(--on-navy-muted); padding-block: 32px; font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner strong { color: var(--on-navy); }
