/* SIPESA — hoja de estilos del sitio
   Colores tomados del logo: azul #083A6F, verde #01754E.
   Tipografía: IBM Plex Sans (SIL Open Font License), servida localmente. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  --navy: #083a6f;
  --navy-deep: #062b53;
  --green: #01754e;
  --ink: #1c2430;
  --muted: #55606e;
  --paper: #ffffff;
  --mist: #f1f4f7;
  --rule: #d8dee5;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 84px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

h1, h2, h3 { color: var(--navy); margin: 0 0 0.6em; font-weight: 600; line-height: 1.2; }
h1 {
  font-size: clamp(2rem, 1.35rem + 2.5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.5rem, 1.25rem + 0.9vw, 1.9rem); letter-spacing: -0.005em; }
h3 { font-size: 1.15rem; line-height: 1.35; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--navy);
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-secondary:hover { background: var(--mist); color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.file-meta { font-weight: 400; color: var(--muted); }
.btn-primary .file-meta { color: #c9d6e6; }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 24px;
}
.brand { display: block; flex: none; }
.brand img { height: 60px; width: auto; }

.nav > ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a,
.nav .sub-toggle {
  display: block;
  font: inherit; font-size: 0.97rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
  padding: 10px 12px; border: 0; border-radius: 3px;
  background: none; cursor: pointer;
}
.nav a:hover,
.nav .sub-toggle:hover { color: var(--navy); background: var(--mist); }
.nav > ul > li > a[aria-current="page"],
.nav .sub-toggle.is-current { color: var(--navy); box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; }
.sub-toggle::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.has-sub { position: relative; }
.sub {
  display: none;
  position: absolute; top: calc(100% + 1px); right: -160px;
  width: 620px;
  grid-template-columns: 1fr 1fr; gap: 0 32px;
  padding: 20px 24px 24px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 14px 30px rgba(8, 58, 111, 0.1);
}
.has-sub.open .sub { display: grid; }
@media (hover: hover) and (min-width: 961px) {
  .has-sub:hover .sub { display: grid; }
}
.sub ul { list-style: none; margin: 0; padding: 0; }
.sub .sub-title { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin: 8px 12px 4px; }
.sub a.sub-title { margin: 8px 0 4px; padding: 0 12px; text-decoration: underline; text-decoration-color: var(--rule); }
.sub a.sub-title:hover { color: var(--navy); background: none; text-decoration-color: currentColor; }
.sub a { font-weight: 400; padding: 7px 12px; }
.sub a[aria-current="page"] { color: var(--navy); font-weight: 600; }

.menu-toggle { display: none; }

@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .brand img { height: 50px; }
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    font: inherit; font-weight: 500; color: var(--navy);
    background: #fff; border: 1px solid var(--rule); border-radius: 3px;
    padding: 9px 14px; cursor: pointer;
  }
  .menu-toggle .bars { width: 18px; height: 12px; position: relative; }
  .menu-toggle .bars::before,
  .menu-toggle .bars::after,
  .menu-toggle .bars span {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor;
  }
  .menu-toggle .bars::before { top: 0; }
  .menu-toggle .bars span { top: 5px; }
  .menu-toggle .bars::after { bottom: 0; }

  .site-header .wrap { flex-wrap: wrap; }
  .js .nav { display: none; }
  .nav { width: 100%; padding: 0 0 16px; }
  .js .nav.is-open { display: block; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav > ul > li { border-top: 1px solid var(--rule); }
  .nav a, .nav .sub-toggle { padding: 13px 4px; width: 100%; text-align: left; }
  .nav > ul > li > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--green); padding-left: 14px; }
  .nav .sub-toggle { cursor: default; color: var(--ink); background: none; }
  .nav .sub-toggle::after { display: none; }
  .nav .sub-toggle.is-current { box-shadow: none; }
  .sub {
    display: block; position: static; width: auto;
    padding: 0 0 8px 16px; border: 0; box-shadow: none;
  }
  .sub .sub-title { margin: 10px 4px 2px; }
  .sub a.sub-title { margin: 10px 0 2px; padding: 0 4px; width: auto; }
  .sub a { padding: 8px 4px; }
}

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero .wrap {
  position: relative;
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: clamp(56px, 8vw, 108px);
}
.hero-text { position: relative; z-index: 1; max-width: 41rem; }
.hero h1 { margin-bottom: 0.55em; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 38rem; }
.globe {
  position: absolute; z-index: 0;
  top: 50%; right: max(-180px, calc((100vw - var(--maxw)) / -2 - 120px));
  width: 600px; height: 600px;
  transform: translateY(-50%);
  color: var(--green);
  opacity: 0.5;
  pointer-events: none;
}
@media (max-width: 1100px) { .globe { right: -240px; opacity: 0.35; } }
@media (max-width: 720px) { .globe { width: 420px; height: 420px; right: -250px; top: 34%; opacity: 0.16; } }

.photo-band { padding-top: clamp(24px, 4vw, 40px); }
.photos { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; margin: 0; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: clamp(220px, 28vw, 360px); object-fit: cover; }
figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 720px) { .photos { grid-template-columns: 1fr; } }

.section { padding: clamp(56px, 8vw, 100px) 0; }
.section-mist { background: var(--mist); }
.section-head { max-width: 44rem; margin-bottom: 36px; }
.section-head p { color: var(--muted); }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (min-width: 861px) { .split > .sticky { position: sticky; top: calc(var(--header-h) + 32px); } }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.services { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.services > li { padding: 20px 0 18px; border-top: 1px solid var(--rule); }
.services h3 { margin: 0 0 0.25em; }
.services h3 a { color: var(--navy); text-decoration: none; }
.services h3 a:hover { text-decoration: underline; }
.services p { margin: 0; color: var(--muted); }
.inline-links { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 10px 0 0; padding: 0; }

.other { margin-top: 36px; }
.other h3 { font-size: 1rem; }
.other ul { columns: 2; column-gap: 32px; padding-left: 1.1em; margin: 0; color: var(--muted); }
.other li { break-inside: avoid; margin: 0.2em 0; }
@media (max-width: 520px) { .other ul { columns: 1; } }

.team-teaser { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.team-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; list-style: none; margin: 0; padding: 0; }
.team-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; }
@media (max-width: 860px) {
  .team-teaser { grid-template-columns: 1fr; }
  .team-strip { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 520px) { .team-strip { grid-template-columns: repeat(4, 1fr); gap: 6px; } }

.clients {
  display: grid; grid-template-columns: repeat(6, 1fr);
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.clients li {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; padding: 16px 22px;
  background: #fff;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.clients img { max-height: 100%; width: auto; max-width: 100%; mix-blend-mode: multiply; }
@media (max-width: 960px) { .clients { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .clients { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 340px) { .clients { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Páginas internas ---------- */
.page-head { border-bottom: 1px solid var(--rule); }
.page-head .wrap {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 64px); align-items: end;
  padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(36px, 5vw, 56px);
}
.page-head.no-image .wrap { grid-template-columns: minmax(0, 1fr); }
.page-head.no-image .page-title { max-width: 46rem; }
.page-head h1 { margin-bottom: 0.45em; }
.page-head .lead { margin: 0; }
.page-head figure { margin: 0; }
.page-head figure img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
@media (max-width: 860px) { .page-head .wrap { grid-template-columns: 1fr; } }

.breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 0 0 18px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--rule); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }

.page-body .wrap {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(56px, 8vw, 96px);
}
.page-body.single .wrap { grid-template-columns: minmax(0, 1fr); }
.page-body .wrap.about { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: start; }
@media (max-width: 860px) {
  .page-body .wrap,
  .page-body .wrap.about { grid-template-columns: 1fr; }
  .page-body .subnav { order: 2; border-top: 1px solid var(--rule); padding-top: 28px; }
}

.subnav { align-self: start; position: sticky; top: calc(var(--header-h) + 24px); font-size: 0.95rem; }
@media (max-width: 860px) { .subnav { position: static; } }
.subnav .subnav-title { font-size: 1rem; font-weight: 600; color: var(--navy); margin: 0 0 10px; }
.subnav ul { list-style: none; margin: 0; padding: 0; }
.subnav li { margin: 0; }
.subnav a { display: block; padding: 6px 0 6px 12px; color: var(--ink); text-decoration: none; border-left: 2px solid var(--rule); }
.subnav a:hover { color: var(--navy); border-left-color: var(--navy); }
.subnav a[aria-current="page"] { color: var(--navy); font-weight: 600; border-left-color: var(--green); }
.subnav .group { display: block; padding: 10px 0 4px 12px; color: var(--muted); border-left: 2px solid var(--rule); }
.subnav a.group:hover { color: var(--navy); }
.subnav ul ul a { padding-left: 24px; }

.prose { max-width: 44rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.4rem; margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--green); }
.prose ol > li::marker { color: var(--navy); font-weight: 600; }
.prose ol.steps > li { padding-left: 0.3em; margin-bottom: 0.8em; }
.prose strong { font-weight: 600; color: var(--navy); }
.prose dl { margin: 0 0 1em; }
.prose .services { padding-left: 0; }
.prose .services > li { margin: 0; }
.prose .services > li::marker { content: none; }
.prose .services h3 { margin: 0 0 0.25em; }
.prose dt { font-weight: 600; color: var(--navy); margin-top: 1em; }
.prose dd { margin: 0.2em 0 0; }
@media (min-width: 720px) {
  .prose .cols-2 { columns: 2; column-gap: 40px; }
  .prose .cols-2 li { break-inside: avoid; margin: 0; padding: 0.2em 0; }
}

blockquote.vision {
  margin: 0.5em 0 1.5em; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--green);
  font-size: 1.3rem; line-height: 1.45; font-style: italic; color: var(--navy);
}

.values-panel { background: var(--mist); padding: 28px 28px 20px; }
.values-panel h2 { font-size: 1.25rem; }
.values { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.values li { padding: 7px 0; border-top: 1px solid var(--rule); break-inside: avoid; }

/* Equipo */
.people {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 40px 48px; list-style: none; margin: 0; padding: 0;
}
@media (max-width: 400px) { .people { grid-template-columns: 1fr; } }
.person { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 20px; align-items: start; }
.person img { width: 104px; height: 104px; object-fit: cover; }
.avatar {
  display: flex; align-items: center; justify-content: center;
  background: var(--mist); color: var(--navy); font-weight: 500; letter-spacing: 0.02em;
  border: 1px solid var(--rule);
}
.person .avatar { width: 104px; height: 104px; font-size: 1.6rem; }
.team-teaser > a { text-decoration: none; }
.team-strip .avatar { width: 100%; aspect-ratio: 1; font-size: clamp(0.8rem, 1.6vw, 1.2rem); }
.person h2 { font-size: 1.08rem; margin: 2px 0 6px; }
.person ul { list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.95rem; color: var(--muted); line-height: 1.45; }
.person li { margin: 0 0 4px; }
.person .cv { font-size: 0.92rem; }
.collaborators { margin-top: clamp(56px, 7vw, 88px); }
.collaborators img { width: 100%; }

/* ---------- Contacto y pie ---------- */
.contact { background: var(--navy); color: #e6edf5; }
.contact .wrap { padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 88px); }
.contact h2 { color: #fff; }
.contact a { color: #fff; }
.contact a:hover { color: #cfe8dc; }
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); }
.contact-intro p { max-width: 30rem; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; margin: 0; }
.contact-list div { border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 12px; }
.contact-list dt { font-size: 0.9rem; color: #b9c9db; margin-bottom: 4px; }
.contact-list dd { margin: 0; font-size: 1.1rem; }
.contact-list dd + dd { margin-top: 4px; }
.contact .btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.contact .btn-light:hover { background: #e6edf5; color: var(--navy); }
.contact .btn-light .file-meta { color: var(--muted); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .contact-list { grid-template-columns: 1fr; } }

.site-footer { font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 28px; padding-bottom: 28px;
}
.site-footer img { height: 44px; width: auto; }
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .subnav, .contact .btn, .globe { display: none !important; }
  .contact { background: none; color: var(--ink); }
  .contact h2, .contact a { color: var(--ink); }
}
