/* =========================================================================
   Documentos de política para el gobierno 2026-2030 — Fedesarrollo
   Sistema de marca compartido (estructura tipo organizedagainstcrime.org,
   identidad visual de fedesarrollo.org.co)
   ========================================================================= */

:root {
  /* Marca Fedesarrollo */
  --blue:        #0F3983;
  --blue-700:    #103a84;
  --blue-900:    #0a2a5f;
  --blue-soft:   #eef2f9;
  --blue-line:   #dae1ec;
  --amber:       #fcb348;
  --amber-600:   #e89a2c;
  --green:       #027948;

  --ink:         #212121;
  --muted:       #5b6573;
  --line:        #e6e9ef;
  --line-strong: #ececee;
  --bg:          #ffffff;
  --bg-soft:     #f6f8fc;

  --maxw:        1140px;
  --reading:     760px;
  --radius:      12px;
  --shadow-sm:   0 1px 3px rgba(15, 57, 131, .06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 10px 30px rgba(15, 57, 131, .10);
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--blue);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.reading { max-width: var(--reading); }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber-600);
  margin: 0 0 .6rem;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--amber); color: #3a2400; }
.btn-primary:hover { background: var(--amber-600); }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-900); color: #fff; }

.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue-line); }
.btn-outline:hover { background: var(--blue-soft); }

.btn-ghost-light { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-light:hover { background: rgba(255,255,255,.22); color:#fff; }

/* ----------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
/* Marca minimalista: botón pill con favicon + texto */
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .95rem .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.brand:hover { background: var(--blue-soft); border-color: var(--blue-line); text-decoration: none; box-shadow: var(--shadow-sm); }
.brand img { height: 26px; width: 26px; object-fit: contain; border-radius: 6px; }

/* Favicon suelto en la esquina (landing) */
.brand-favicon { display: inline-flex; align-items: center; }
.brand-favicon img { height: 52px; width: 52px; object-fit: contain; border-radius: 8px; transition: transform .15s ease; }
.brand-favicon:hover img { transform: scale(1.06); }
.brand .brand-text {
  font-weight: 800;
  font-size: .88rem;
  color: var(--blue);
  line-height: 1.1;
  max-width: 22ch;
}
.brand .brand-text span { display:block; font-weight: 600; font-size: .68rem; color: var(--muted); letter-spacing:.02em; }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  padding: .5rem .8rem;
  border-radius: 8px;
}
.nav a:hover { background: var(--blue-soft); text-decoration: none; }
.nav a.is-active { color: var(--blue); background: var(--blue-soft); }

/* Mobile nav (checkbox hack — sin JS) */
.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 820px) {
  .nav-toggle-label {
    display: inline-flex; flex-direction: column; gap: 5px;
    cursor: pointer; padding: 10px; border-radius: 8px;
  }
  .nav-toggle-label span { width: 24px; height: 2px; background: var(--blue); border-radius: 2px; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav a { padding: .9rem 24px; border-radius: 0; border-top: 1px solid var(--line); }
  .nav-toggle:checked ~ .nav { max-height: 320px; }
}

/* ------------------------------------------------------------------- Hero */
.hero {
  background:
    radial-gradient(1100px 380px at 92% -10%, rgba(252,179,72,.16), transparent 60%),
    linear-gradient(100deg, var(--blue) 0%, var(--blue) 42%, #1c4796 100%);
  color: #fff;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: .4em; max-width: 18ch; }
.hero .eyebrow { color: var(--amber); }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: rgba(255,255,255,.9); max-width: 60ch; margin: 0 0 1.8rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------------------------------------------------------------- Sections */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.section .lead { font-size: 1.18rem; color: var(--muted); }
.section p { margin: 0 0 1.1rem; }
.section-head { margin-bottom: 2rem; }

/* ------------------------------------------------------ Document cards grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
}
.doc-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-line); }

/* Portada generada con CSS (sin dependencia de imagen) */
.doc-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(420px 160px at 110% -20%, rgba(252,179,72,.30), transparent 60%),
    linear-gradient(150deg, var(--blue) 0%, var(--blue-900) 100%);
  overflow: hidden;
}
.doc-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 80% 10%, #000, transparent 75%);
  opacity: .8;
}
.doc-cover .cover-kicker { position: relative; z-index:1; font-size:.7rem; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color: var(--amber); }
.doc-cover .cover-title { position: relative; z-index:1; color:#fff; font-size: 1.35rem; font-weight: 800; line-height: 1.18; margin: 0; }

.doc-card-body { padding: 1.3rem 1.5rem; flex: 1; display:flex; flex-direction:column; }
.doc-card-body h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.doc-card-body h3 a { color: var(--blue); }
.doc-authors { color: var(--muted); font-size: .9rem; font-weight: 600; margin: 0 0 .8rem; }
.doc-desc { color: var(--ink); font-size: .98rem; margin: 0 0 1.2rem; }
.doc-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem .9rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dl-link { display:inline-flex; align-items:center; gap:.4rem; font-size:.86rem; font-weight:700; color: var(--blue); }
.dl-link svg { width: 16px; height: 16px; }

/* Grilla de documentos: preview arriba, texto debajo (sin cuadros) */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2.6rem 1.8rem;
}
.docs-grid-item { display: flex; flex-direction: column; }
.docs-grid-preview { display: block; margin-bottom: 1.1rem; }
.docs-grid-preview img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.docs-grid-preview:hover img { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.docs-grid-item h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.docs-grid-item h2 a { color: var(--blue); }
.docs-grid-item .doc-authors { margin-bottom: .55rem; }
.docs-grid-item .doc-desc { margin-bottom: 0; }

/* ----------------------------------------------- Featured (landing) block */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.featured .featured-cover {
  align-self: stretch;
  min-height: 320px;
  aspect-ratio: auto;
  border-radius: 0;
}
.featured .featured-body { padding: 2.4rem 2.6rem 2.4rem 0; }
.featured h3 { font-size: 1.7rem; margin-bottom:.3rem; }
.featured .doc-authors { font-size: .98rem; }
@media (max-width: 800px) {
  .featured { grid-template-columns: 1fr; }
  .featured .featured-body { padding: 1.8rem; }
  .featured .featured-cover { min-height: 200px; }
}

/* ---------------------------------------------------- Document detail page */
.breadcrumb { padding-top: 1.6rem; font-size: .9rem; color: var(--muted); }
.breadcrumb a { font-weight: 600; }

.doc-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 2.5rem;
  align-items: start;
  padding: 1rem 0 0;
}
.doc-detail-header h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin-bottom: .35rem; }
.doc-detail-header .subtitle { font-size: 1.2rem; color: var(--muted); font-weight: 600; margin: 0 0 1.4rem; }
.doc-note { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: 1.1rem 0 0; max-width: 60ch; }
.doc-watch { margin: 1.5rem 0 0; }

/* Previews del documento y la nota (a la derecha) */
.doc-previews { display: flex; gap: 1.2rem; }
.doc-preview { display: flex; flex-direction: column; gap: .6rem; width: 190px; flex: 0 0 auto; }
.doc-preview-thumb { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.doc-preview img {
  width: 100%; display: block; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.doc-preview-thumb:hover img { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.doc-preview-download { display: inline-flex; align-items: flex-start; gap: .35rem; font-size: .8rem; font-weight: 700; color: var(--blue); line-height: 1.25; }
.doc-preview-download:hover { text-decoration: underline; }
.doc-preview-download svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }

@media (max-width: 820px) {
  .doc-detail-header { grid-template-columns: 1fr; gap: 1.6rem; }
  .doc-preview { width: auto; flex: 1 1 0; max-width: 260px; }
}

.authors-block { display:flex; flex-wrap: wrap; gap: 1.4rem 2.2rem; margin: 0 0 1.6rem; }
.author { font-size: .95rem; }
.author strong { display:block; color: var(--ink); font-weight: 800; }
.author span { color: var(--muted); }
.doc-date { color: var(--muted); font-size:.9rem; font-weight:600; }

.downloads { display:flex; flex-wrap:wrap; gap: .8rem; margin-top: 1.4rem; }

/* Cuerpo del documento (ocupa todo el ancho) */
.doc-body { padding: 2.4rem 0 3rem; }
.doc-body h2 {
  font-size: 1.55rem;
  margin: 2.4rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--blue-line);
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.doc-body p { margin: 0 0 1.15rem; }
.doc-body ul { padding-left: 0; list-style: none; margin: 0 0 1.3rem; }
.doc-body ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: .85rem;
}
.doc-body ul li::before {
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--amber);
}
.doc-body ul li strong, .doc-body ul li b { color: var(--blue-700); }
.doc-body ol { counter-reset: msg; list-style: none; padding-left: 0; margin: 0 0 1.3rem; }
.doc-body ol > li {
  position: relative; counter-increment: msg;
  padding-left: 3rem; margin-bottom: 1rem; min-height: 2rem;
}
.doc-body ol > li::before {
  content: counter(msg);
  position: absolute; left: 0; top: -2px;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--blue); color:#fff; font-weight: 800;
  display:flex; align-items:center; justify-content:center; font-size: .95rem;
}

/* Callout para "La idea central" */
.callout {
  background: var(--blue-soft);
  border-left: 5px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.3rem 1.6rem;
  margin: 0 0 1.8rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-label { font-weight: 800; color: var(--blue); display:block; margin-bottom:.3rem; font-size:.82rem; letter-spacing:.08em; text-transform:uppercase; }

/* Tabla de la agenda secuenciada */
.table-wrap { overflow-x: auto; margin: 0 0 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); }
table.agenda { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
table.agenda th, table.agenda td { text-align: left; padding: .95rem 1.1rem; vertical-align: top; border-bottom: 1px solid var(--line); }
table.agenda thead th { background: var(--blue); color:#fff; font-weight: 700; border-bottom: none; }
table.agenda tbody tr:nth-child(even) { background: var(--bg-soft); }
table.agenda td:first-child { font-weight: 800; color: var(--blue-700); white-space: nowrap; }
table.agenda td:first-child small { display:block; font-weight:600; color: var(--muted); white-space: normal; }
table.agenda ul { margin: 0; }
table.agenda ul li { margin-bottom: .5rem; padding-left: 1.2rem; }
table.agenda ul li::before { top: .55em; width: 6px; height: 6px; }

.source-note {
  font-size: .9rem; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.4rem; margin-top: 2rem;
}

/* ----------------------------------------------------------------- Footer */
.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,.85);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-inner { display:flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; align-items: flex-start; }
.site-footer .brand-text, .site-footer .brand-text span { color: #fff; }
.footer-brand img { height: 100px; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer-brand p { max-width: 38ch; font-size: .9rem; color: rgba(255,255,255,.8); margin:.4rem 0 0; }
.footer-nav { display:flex; flex-direction: column; gap: .55rem; }
.footer-nav a { color: rgba(255,255,255,.88); font-weight: 600; font-size: .95rem; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 2rem; padding-top: 1.4rem; font-size:.84rem; color: rgba(255,255,255,.7); }

/* --------------------------------------------------------------- Utilities */
.mt-0 { margin-top: 0; }
.center { text-align: center; }

/* ------------------------------------------------ Video modal (pop-up) */
.video-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10, 22, 47, .72);
  backdrop-filter: blur(3px);
  zoom: 0.8696;   /* neutraliza el zoom: 1.15 del <html> (1/1.15) para centrar el modal en el viewport real */
}
.video-modal.is-open { display: flex; }
.video-modal-box {
  position: relative;
  width: 100%; max-width: 880px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: video-pop .2s ease;
}
@keyframes video-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.video-modal-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-modal-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; flex-wrap: wrap; }
.video-modal-bar p { margin: 0; font-weight: 800; color: var(--blue); font-size: 1rem; }
.video-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  transition: background .15s ease, transform .15s ease;
}
.video-modal-close:hover { background: #fff; transform: scale(1.06); }

/* Visor de PDF en ventana emergente (páginas de detalle) */
.pdf-modal {
  position: fixed; inset: 0; z-index: 120;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10, 22, 47, .72);
  backdrop-filter: blur(3px);
  zoom: 0.8696;   /* neutraliza el zoom: 1.15 del <html> (1/1.15) para que el overlay use el viewport real y quede centrado */
}
.pdf-modal.is-open { display: flex; }
.pdf-modal-box {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 1000px; height: 90vh;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: video-pop .2s ease;
}
.pdf-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.pdf-modal-title { font-weight: 800; color: var(--blue); font-size: .95rem; }
.pdf-modal-actions { display: inline-flex; align-items: center; gap: .6rem; }
.pdf-modal-download { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; color: var(--blue); }
.pdf-modal-download:hover { text-decoration: underline; }
.pdf-modal-frame { flex: 1 1 auto; width: 100%; border: 0; }
.pdf-modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--blue-soft); color: var(--ink);
  font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.pdf-modal-close:hover { background: var(--blue-line); transform: scale(1.06); }
@media (max-width: 820px) { .pdf-modal-box { height: 92vh; max-width: 100%; } }
