/* ==========================================================================
   FLEXDEMAND · estilos
   Paleta tomada del logotipo del proyecto. Los logotipos oficiales
   (UE, MITECO/IDAE, PRTR, Nuevos Modelos de Negocio) se muestran siempre
   sobre fondo blanco, sin recolorear ni deformar.
   ========================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../assets/fonts/inter-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../assets/fonts/inter-medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../assets/fonts/inter-semibold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../assets/fonts/inter-bold.woff2") format("woff2"); }

:root {
  --navy: #1F3864;
  --navy-900: #13284d;
  --teal: #188A80;
  --teal-700: #0E6B63;      /* texto sobre blanco: contraste AA */
  --amber: #F4B740;
  --amber-700: #7a5200;
  --ink: #18212f;
  --muted: #4b5666;
  --line: #dde4ec;
  --bg: #f4f7fa;
  --white: #fff;
  --ue-blue: #003399;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 40, 77, .06), 0 8px 24px rgba(19, 40, 77, .07);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --lh: 40px;               /* altura común de la fila de logos oficiales */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font: 400 1.0625rem/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "kern", "calt"; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--teal-700); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.015em; margin: 0; color: var(--navy); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barra de logotipos oficiales ---------------------------------- */
.fundbar { background: #fff; border-bottom: 1px solid var(--line); }
.fundbar__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 40px; padding-block: 14px; }
.fundbar__inst { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 28px; }
.lg { height: var(--lh); width: auto; max-width: none; }
.fundbar a { display: inline-flex; line-height: 0; }

/* ---------- Navegación ---------------------------------------------------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; color: var(--navy); }
.brand img { width: 38px; height: 38px; }
.brand b { color: var(--teal); font-weight: 700; }
.nav__links { display: flex; flex-wrap: wrap; gap: 2px 4px; list-style: none; }
.nav__links a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .95rem; font-weight: 500; }
.nav__links a:hover, .nav__links a[aria-current="true"] { background: var(--bg); color: var(--navy); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; color: var(--navy); }
.nav__toggle svg { margin: auto; }

/* ---------- Hero ---------------------------------------------------------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #1F3864 0%, #1b5670 55%, #188A80 100%); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 82% 40%, rgba(255, 255, 255, .10), transparent 70%); pointer-events: none; }
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center; padding-block: clamp(40px, 6vw, 72px) clamp(36px, 5vw, 56px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-700); margin-bottom: 14px; }
.hero .eyebrow { color: #cfe9e6; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); padding: 7px 14px; border-radius: 999px; margin-bottom: 22px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(244, 183, 64, .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(244, 183, 64, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 183, 64, 0); } }
.hero h1 { color: #fff; font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700; letter-spacing: .005em; line-height: 1; }
.hero h1 span { color: var(--amber); }
.hero__sub { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 500; margin: 14px 0 22px; color: #e8f4f2; }
.hero__lead { max-width: 56ch; font-size: 1.125rem; color: #dbe8ee; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn--amber { background: var(--amber); color: #2a1d00; }
.btn--amber:hover { background: #ffc958; color: #2a1d00; }
.btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.hero__art { justify-self: center; width: min(100%, 440px); }
.hero__art svg { width: 100%; height: auto; overflow: visible; }
.art-flow { stroke-dasharray: 5 9; animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }

.hero__fund { position: relative; margin: 0; padding: 0 0 clamp(96px, 9vw, 112px); }
.hero__fund a { display: inline-block; color: #fff; text-decoration: none; font-size: .95rem; line-height: 1.45; border-left: 3px solid var(--amber); padding: 2px 0 2px 14px; max-width: 70ch; }
.hero__fund a:hover { color: var(--amber); }
.hero__fund strong { font-weight: 600; }

/* ---------- Datos clave (solapa sobre el hero) ---------------------------- */
.facts { position: relative; margin-top: -64px; z-index: 2; }
.facts__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.fact { padding: 22px 24px; border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; }
.fact__k { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fact__v { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.15; letter-spacing: -.02em; }
.fact__v small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fact p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); line-height: 1.4; }

/* ---------- Secciones ----------------------------------------------------- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--alt { background: var(--bg); }
.section__head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section__head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section__head .lead { margin-top: 16px; font-size: 1.15rem; color: var(--muted); }
.h3 { font-size: 1.25rem; margin-bottom: 14px; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.section--alt .card { box-shadow: none; }

.prose p { color: #2a3547; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.prose h3:first-child { margin-top: 0; }

/* Esquema de agregación */
.flow { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 12px; }
.flow__col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flow__col .flow__h { grid-column: 1 / -1; }
.flow__h { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-700); margin: 0 0 2px; }
.node { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .92rem; line-height: 1.3; font-weight: 500; color: var(--navy); }
.flow__hub { width: min(100%, 300px); justify-self: center; text-align: center; display: grid; gap: 6px; justify-items: center; padding: 18px 12px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--teal)); min-width: 128px; }
.flow__hub img { width: 56px; height: 56px; background: #fff; border-radius: 50%; padding: 3px; }
.flow__hub b { font-size: 1rem; }
.flow__hub small { font-size: .78rem; opacity: .85; line-height: 1.25; }
.flow figcaption { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }
.flow__arrow { display: block; justify-self: center; color: var(--teal); transform: rotate(90deg); }

.callout { border-left: 4px solid var(--amber); background: #fffaf0; padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.1rem; color: var(--ink); margin: 0; }
.callout strong { color: var(--navy); }

.objs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; list-style: none; counter-reset: o; }
.objs li { counter-increment: o; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.objs li::before { content: counter(o); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: .9rem; }
.objs b { color: var(--navy); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: .92rem; color: var(--navy); }
.section--alt .chips li { background: #fff; }

/* Consorcio */
.partners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.partner { display: flex; flex-direction: column; gap: 6px; }
.partner__role { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-700); }
.partner h3 { font-size: 1.35rem; }
.partner p { margin: 0; color: var(--muted); font-size: .98rem; }

/* Actividades */
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.act { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.act::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c, var(--navy)); }
.act--uv { --c: var(--teal); }
.act__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 10px; margin-top: 6px; }
.act__n { white-space: nowrap; font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.act h3 { font-size: 1.25rem; }
.act p { margin: 0; color: #2a3547; font-size: .98rem; }
.act__meta { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.act__meta b { color: var(--ink); font-weight: 600; }
.act ul { list-style: none; display: grid; gap: 8px; font-size: .93rem; }
.act ul li { padding-left: 18px; position: relative; color: #2a3547; }
.act ul li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--navy)); opacity: .85; }
.act ul li span { color: var(--muted); white-space: nowrap; }
.hitos { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.hitos strong { color: var(--ink); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef2f6; color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip[data-s="en-curso"] { background: #e3f4f2; color: var(--teal-700); }
.chip[data-s="en-curso"]::before { opacity: 1; animation: pulse 2.4s infinite; }
.chip[data-s="completada"], .chip[data-s="finalizada"], .chip[data-s="disponible"] { background: #e8f1e3; color: #2f6a1f; }
.chip[data-s="esperado"] { background: #eef2f6; color: var(--muted); }


/* Resultados */
.res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.res__col h3 { font-size: 1.1rem; margin-bottom: 4px; }
.res__col > p { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.res ol { list-style: none; display: grid; gap: 12px; }
.res li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; font-size: .95rem; line-height: 1.45; color: #2a3547; }
.rid { font-weight: 700; font-size: .78rem; color: var(--teal-700); background: #e3f4f2; border-radius: 6px; padding: 3px 0; text-align: center; margin-top: 2px; }
.res li > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.res li a { font-weight: 600; }
.entreg { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: .9rem; }
.entreg b { color: var(--navy); }

/* Novedades */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button { font: inherit; font-size: .9rem; font-weight: 500; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.news { list-style: none; display: grid; gap: 16px; }
.new { display: grid; grid-template-columns: 150px 1fr; gap: 8px 28px; padding: 24px 28px; }
.new time { font-size: .92rem; font-weight: 600; color: var(--navy); line-height: 1.3; }
.new time small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; }
.new h3 { font-size: 1.3rem; margin-bottom: 8px; }
.new p { margin: 0 0 10px; color: #2a3547; }
.new .more { font-weight: 600; }


/* Financiación */
.fin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.fin__statement { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; color: var(--ue-blue); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 18px; }
.fin__eu { height: 72px; width: auto; margin-bottom: 22px; }
.dl { display: grid; margin: 0; }
.dl div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.dl div:last-child { border-bottom: 1px solid var(--line); }
.dl dt { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.dl dd { margin: 0; font-size: .98rem; color: var(--ink); }

/* Contacto */
.contact { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }

/* Pie */
.footer { background: var(--navy-900); color: #c9d5e6; }
.footer__logos { background: #fff; border-top: 1px solid var(--line); }
.footer__logos .fundbar__in { padding-block: 22px; }
.footer__body { padding-block: 40px 28px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px 56px; font-size: .9rem; line-height: 1.6; }
.footer h2 { color: #fff; font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 10px; }
.footer a { color: #fff; }
.footer p { margin: 0 0 .8em; }
.footer__base { border-top: 1px solid rgba(255, 255, 255, .14); padding-block: 18px 28px; font-size: .84rem; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; color: #9fb0c8; }
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer__brand .logo-card { background: #fff; border-radius: 12px; padding: 10px 16px; }
.footer__brand img { height: 52px; width: auto; }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 1080px) {
  .acts { grid-template-columns: 1fr; }
  .res { grid-template-columns: 1fr; }
  .facts__grid { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  :root { --lh: 32px; }
  .hero__in { grid-template-columns: 1fr; }
  .hero__art { width: min(72%, 320px); order: -1; justify-self: start; }
  .cols, .fin, .footer__body, .partners, .objs { grid-template-columns: 1fr; }
  .fundbar__in { justify-content: center; }
  .fundbar__inst { justify-content: center; }
  .js .nav__toggle { display: inline-flex; }
  .js .nav__links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px var(--gutter) 16px; }
  .js .nav__links.open { display: flex; }
  .nav__in { position: relative; }
  .nav__links a { padding: 12px; }
}
@media (max-width: 640px) {
  :root { --lh: 26px; }
  body { font-size: 1rem; }
  .facts { margin-top: -48px; }
  .fact { padding: 16px 18px; }
  .fact__v { font-size: 1.35rem; }
  .card { padding: 22px; }
  .new { grid-template-columns: 1fr; padding: 20px; }
  .dl div { grid-template-columns: 1fr; gap: 4px; }
  .flow__col { grid-template-columns: 1fr; }
  .fundbar__in { gap: 12px; }
  .fundbar__inst { gap: 10px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .art-flow, .chip[data-s="en-curso"]::before { animation: none; }
  }
@media print {
  .nav, .hero__art, .hero__cta { display: none; }
  .hero { background: #fff; color: #000; }
  .hero h1, .hero__lead, .hero__sub { color: #000; }
}

.plink { color: inherit; text-decoration: none; border-bottom: 2px solid var(--amber); }
.plink::after { content: " \2197"; font-size: .8em; color: var(--teal-700); }
.plink:hover { color: var(--teal-700); }
