/* ================================================================
   ESTILOS PRINCIPALES PARA EL LIBRO BLANCO CENICYT
   (Versión con mejoras visuales y gadgets)
   ================================================================ */

/* ================================================================
   1.  VARIABLES GLOBALES
   ================================================================ */
:root {
  --navy: #07345d;
  --navy2: #0b4f83;
  --orange: #c77a2a;
  --gold: #b58a42;
  --ink: #24313c;
  --muted: #647180;
  --paper: #fff;
  --bg: #eef2f5;
  --line: #d8e0e7;
  --green: #16633b;
  --shadow: 0 18px 48px rgba(7, 52, 93, 0.13);
}

/* ================================================================
   2.  RESET Y ESTILOS BASE
   ================================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.72;
}

/* ================================================================
   3.  BARRA DE PROGRESO DE LECTURA (NUEVO)
   ================================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--orange);
  width: 0%;
  z-index: 999;
  transition: width 0.1s ease;
  box-shadow: 0 0 8px rgba(199, 122, 42, 0.4);
}

/* ================================================================
   4.  ENLACE SALTAR NAVEGACIÓN
   ================================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 99;
  background: #fff;
  padding: 0.7rem 1rem;
}

/* ================================================================
   5.  BARRA SUPERIOR
   ================================================================ */
.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 4rem);
  background: rgba(5, 43, 78, 0.96);
  backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.brand {
  font: 700 1rem Inter, Arial, sans-serif;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.08em;
}

.brand span {
  font-weight: 400;
  opacity: 0.72;
  margin-left: 0.7rem;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 1rem;
}

.top-actions a {
  color: #fff;
  text-decoration: none;
  font: 600 0.82rem Inter, Arial, sans-serif;
}

.top-actions a:hover {
  color: #f0c68e;
}

/* ================================================================
   6.  PORTADA
   ================================================================ */
.cover {
  max-width: 1500px;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: minmax(360px, 42%) 1fr;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
  /*
.cover-image-wrap {
  background: #f6f6f4;
  min-height: 720px;
}
*/
.cover-image-wrap {
  min-height: 720px; /* o el alto que quieras */
}

.cover-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left top; /* cambia de center a left */
}

/*
.cover-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left top; /* cambia de center a left *mmm/
}

.cover-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-fit: contain;
  object-position: center top;
}
*/

.cover-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-fit: contain;
  object-position: center;
  }

.cover-copy {
  position: relative;
  padding: clamp(2.3rem, 5vw, 5.5rem);
  background: linear-gradient(145deg, #fff 0%, #fbfcfd 67%, #e8f0f7 100%);
}

.cover-copy:before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 11px;
  background: url('azul.png') center/cover;
}

.kicker,
.eyebrow {
  font: 700 0.8rem Inter, Arial, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
}

.cover h1 {
  font-size: clamp(2.3rem, 4vw, 4.5rem);
  line-height: 1.08;
  color: var(--navy);
  margin: 0.7rem 0 1.2rem;
  letter-spacing: -0.025em;
}

.lead {
  font-size: 1.22rem;
  color: #53606e;
  max-width: 820px;
}

.architecture-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin: 2rem 0;
}

.architecture-strip div {
  border-left: 4px solid var(--orange);
  padding: 0.65rem 1rem;
  background: #f7f9fb;
  border-radius: 0 10px 10px 0;
}

.architecture-strip strong {
  display: block;
  font: 800 0.95rem Inter, Arial, sans-serif;
  color: var(--navy);
}

.architecture-strip span {
  font-size: 0.92rem;
  color: #5b6875;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.button {
  display: inline-block;
  border: 1px solid var(--navy);
  border-radius: 9px;
  padding: 0.72rem 1.1rem;
  color: var(--navy);
  text-decoration: none;
  font: 700 0.88rem Inter, Arial, sans-serif;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.button:hover {
  background: var(--navy);
  color: #fff;
  transform: scale(1.02);
}

.button.primary {
  background: var(--navy);
  color: #fff;
}

.button.primary:hover {
  background: #0a4a7a;
}

.meta {
  display: flex;
  gap: 0.55rem 1.4rem;
  flex-wrap: wrap;
  color: #667584;
  font: 500 0.82rem Inter, Arial, sans-serif;
}

.meta span {
  border-left: 2px solid var(--gold);
  padding-left: 0.6rem;
}

/* ================================================================
   7.  BANDA DE DECISIONES
   ================================================================ */
.decision-band {
  max-width: 1500px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.decision-band article {
  background: #fff;
  padding: 1.3rem 1.5rem;
}

.decision-band span {
  display: block;
  color: var(--orange);
  font: 800 0.75rem Inter, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.decision-band strong {
  font-size: 1rem;
  color: var(--navy);
}

/* ================================================================
   8.  LAYOUT E ÍNDICE
   ================================================================ */
.layout {
  max-width: 1500px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2rem;
}

.toc-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 105px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.1rem;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.06);
  font-family: Inter, Arial, sans-serif;
}

.toc-panel h2 {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0.2rem 0.45rem 0.8rem;
}

.toc-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-panel li {
  margin: 0.08rem 0;
}

.toc-panel a {
  display: block;
  text-decoration: none;
  color: #40505e;
  font-size: 0.76rem;
  line-height: 1.3;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.toc-panel a i {
  margin-right: 0.4rem;
  font-size: 0.6rem;
  color: var(--orange);
  opacity: 0.6;
}

.toc-panel a:hover,
.toc-panel a.active {
  background: #edf4fa;
  color: var(--orange);
}

.toc-panel a:hover i,
.toc-panel a.active i {
  opacity: 1;
}

/* ================================================================
   9.  DOCUMENTO PRINCIPAL
   ================================================================ */
.document {
  background: #fff;
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 4rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  min-width: 0;
}

.document-intro {
  background: linear-gradient(90deg, #f2f6fa, #fff);
  border-left: 5px solid var(--orange);
  padding: 1rem 1.3rem;
  margin-bottom: 2rem;
}

.document h1,
.document h2,
.document h3,
.document h4 {
  font-family: Inter, Arial, sans-serif;
  line-height: 1.25;
  scroll-margin-top: 92px;
}

.document h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  color: var(--navy);
  margin: 3.4rem 0 1.3rem;
  padding-bottom: 0.55rem;
  border-bottom: 3px solid var(--orange);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document h1 .section-top {
  margin-left: auto;
  font-size: 1rem;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.document h1 .section-top:hover {
  opacity: 1;
  color: var(--orange);
}

.document h1:first-of-type {
  margin-top: 0.5rem;
}

.document h2 {
  font-size: 1.42rem;
  color: var(--navy2);
  margin: 2.25rem 0 0.7rem;
}

.document h3 {
  font-size: 1.12rem;
  color: var(--orange);
  margin: 1.7rem 0 0.5rem;
}

.document p {
  margin: 0.65rem 0 1.15rem;
}

.document li {
  margin: 0.35rem 0;
}

.document blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.4rem;
  border-left: 5px solid var(--orange);
  background: #fbf6ef;
  border-radius: 0 10px 10px 0;
}

.document table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.document th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  font-family: Inter, Arial, sans-serif;
}

.document td,
.document th {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

.document tr:nth-child(even) td {
  background: #f8fafc;
}

/* ================================================================
   10. FIGURAS Y CAJAS
   ================================================================ */
.chapter-figure {
  margin: 1.6rem 0 2rem;
  padding: 1rem;
  background: #f5f8fb;
  border: 1px solid #dfe7ed;
  border-radius: 14px;
  text-align: center;
}

.chapter-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: auto;
  border-radius: 8px;
}

.chapter-figure figcaption {
  margin-top: 0.7rem;
  color: #63717e;
  font: 500 0.82rem Inter, Arial, sans-serif;
}

.ideabox,
.decisionbox,
.lawbox,
.riskbox {
  border-radius: 12px;
  padding: 1.2rem 1.8rem;
  margin: 1.8rem 0;
  border-left: 6px solid var(--orange);
  background: #f8fafc;
}

/* ================================================================
   11. BANDA DE DOCUMENTOS
   ================================================================ */
.documents-band {
  max-width: 1500px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  font-family: Inter, Arial, sans-serif;
}

.documents-band strong {
  color: var(--navy);
  margin-right: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.documents-band a {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--navy);
  border-radius: 8px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}

.documents-band a:hover {
  background: var(--navy);
  color: #fff;
}

/* ================================================================
   12. PIE Y BOTÓN DE SUBIR
   ================================================================ */
footer {
  max-width: 1500px;
  margin: 0 auto 3rem;
  padding: 1.4rem 2rem;
  border-top: 1px solid #ccd5dc;
  display: flex;
  justify-content: space-between;
  color: #677582;
  font: 500 0.82rem Inter, Arial, sans-serif;
}

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  border: 0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: var(--navy);
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.to-top:hover {
  background: var(--orange);
  transform: scale(1.05);
}

/* ================================================================
   13. RESPONSIVE
   ================================================================ */
@media (max-width: 1050px) {
  .cover {
    grid-template-columns: 1fr;
    margin: 1rem;
  }
  .cover-image-wrap {
    min-height: 0;
    max-height: 720px;
  }
  .cover-image-wrap img {
    object-fit: contain;
  }
  .layout {
    grid-template-columns: 1fr;
    margin: 0 1rem;
  }
  .toc-panel {
    position: relative;
    top: 0;
    max-height: none;
  }
  .decision-band {
    grid-template-columns: 1fr;
    margin: 0 1rem 1.5rem;
  }
  .top-actions {
    display: none;
  }
  .documents-band {
    margin: 0 1rem 1.5rem;
  }
}

@media (max-width: 650px) {
  .topbar {
    height: 56px;
  }
  .brand span {
    display: none;
  }
  .cover-copy {
    padding: 1.6rem;
  }
  .cover h1 {
    font-size: 2.15rem;
  }
  .architecture-strip {
    grid-template-columns: 1fr;
  }
  .document {
    padding: 1.2rem;
  }
  .document h1 {
    font-size: 1.7rem;
  }
  .document h1 .section-top {
    font-size: 0.8rem;
  }
  .decision-band article {
    padding: 1rem;
  }
  footer {
    display: block;
    margin: 0 1rem 2rem;
  }
  footer span {
    display: block;
    margin-top: 0.35rem;
  }
}

/* ================================================================
   14. IMPRESIÓN
   ================================================================ */
@media print {
  .topbar,
  .toc-panel,
  .to-top,
  .hero-actions,
  .progress-bar {
    display: none;
  }
  .cover,
  .layout,
  .decision-band {
    display: block;
    box-shadow: none;
    margin: 0;
  }
  .document {
    box-shadow: none;
    padding: 0;
  }
  .cover-image-wrap {
    display: none;
  }
  .cover-copy {
    min-height: 95vh;
  }
  .document h1 {
    break-after: avoid;
  }
  .document table,
  .chapter-figure {
    break-inside: avoid;
  }
}
