/* =========================================================
   Armazón de documentación (barra superior + menú lateral + índice)
   ========================================================= */
body.docs { background: #fff; font-family: "Roboto", "Inter", system-ui, sans-serif; }
body.docs h1, body.docs h2, body.docs h3 { font-family: "Roboto", "Inter", sans-serif; font-weight: 400; color: #1f2937; letter-spacing: 0; }
body.docs h3 { font-weight: 500; }

/* Barra superior */
.appbar { position: sticky; top: 0; z-index: 60; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: #fff; border-bottom: 1px solid #e5e7eb; }
.appbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #111827; font: 500 1.15rem "Roboto", sans-serif; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--azul); display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 7px 6px; }
.logo-mark i { width: 4px; background: #fff; border-radius: 2px; }
.logo-mark i:nth-child(1) { height: 8px; } .logo-mark i:nth-child(2) { height: 16px; } .logo-mark i:nth-child(3) { height: 11px; }
.appbar-sub { color: #6b7280; font-size: .92rem; padding-left: 14px; border-left: 1px solid #e5e7eb; }
.appbar-link { margin-left: auto; text-decoration: none; color: #fff; background: var(--azul); padding: 8px 16px; border-radius: 4px; font: 500 .9rem "Roboto", sans-serif; letter-spacing: .03em; }
.nav-btn { display: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #374151; cursor: pointer; place-items: center; }
.nav-btn .ic { width: 24px; height: 24px; }
.nav-btn:hover { background: #f3f4f6; }

/* Tres columnas */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 200px; max-width: 1480px; margin: 0 auto; }
.sidenav { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 20px 0 40px; border-right: 1px solid #e5e7eb; }
.nav-group { margin: 18px 0 6px; padding: 0 24px; font: 500 .95rem "Roboto", sans-serif; color: #111827; }
.nav-group:first-child { margin-top: 4px; }
.sidenav a { display: block; padding: 9px 24px 9px 32px; color: #4b5563; text-decoration: none; font-size: .9rem; border-radius: 0 20px 20px 0; margin-right: 12px; }
.sidenav a:hover { background: #f3f4f6; color: #111827; }
.sidenav a[aria-current="page"] { background: #e8eefc; color: var(--azul); font-weight: 500; }
.sidenav a:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }

/* Contenido */
body.docs .doc-main { min-width: 0; padding: 32px 48px 60px; }
.crumbs { margin: 0 0 6px; color: #6b7280; font-size: .85rem; }
body.docs .doc-head h1 { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 400; margin: 0 0 14px; }
body.docs .doc-head .lead { font-size: 1.12rem; color: #374151; max-width: 760px; }
body.docs .doc-sec { padding-top: 48px; }
body.docs .doc-sec > h2 { font-size: 1.9rem; font-weight: 400; border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
body.docs .doc-sec > p, body.docs .doc-sec > ul { max-width: 780px; }
.toc { position: sticky; top: 64px; align-self: start; height: auto; max-height: calc(100vh - 64px); overflow-y: auto; padding: 36px 16px 20px 0; display: flex; flex-direction: column; gap: 0; }
body.docs .toc-title { margin: 0 0 8px; font: 500 .8rem "Roboto", sans-serif; color: #111827; text-transform: none; letter-spacing: 0; }
body.docs .toc a { font-size: .85rem; padding: 6px 12px; border-left: 2px solid #e5e7eb; color: #4b5563; text-decoration: none; }
body.docs .toc a.active { border-left-color: var(--azul); color: var(--azul); background: none; font-weight: 500; }

/* Anterior / siguiente */
.pager-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid #e5e7eb; }
.pn { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid #e5e7eb; border-radius: 8px; text-decoration: none; color: var(--azul); font-weight: 500; }
.pn span { font-size: .78rem; color: #6b7280; font-weight: 400; }
.pn.next { text-align: right; }
.pn:hover { border-color: var(--azul); background: #f8faff; }

/* Ajustes de piezas reutilizadas */
.doc-slider .slider { height: 440px; min-height: 0; border-radius: 12px; }
.doc-slider .slide-content { padding: 0 64px; }
.doc-slider .h1like { color: #fff; font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0 0 14px; line-height: 1.15; }
.doc-slider .slide-content h2 { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; color: #fff; }
.doc-main .slider-css { margin-left: 0; }
.doc-main .demo-block { margin-top: 0; }
.doc-main .cards { margin-top: 10px; }
.doc-main .spec-figs.one, .doc-main .anat-grid.one, .doc-main .place-grid.one { grid-template-columns: minmax(0, 520px); }
.doc-main .place-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-main .scale { margin-left: 0; }
.dd-stage.center { justify-content: center; gap: 14px; }
.hero-buttons .fab .ic, .hero-buttons .mb-toggle .ic { width: 24px; height: 24px; }

/* Resumen de componentes */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cg { display: flex; flex-direction: column; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .2s, border-color .2s; }
.cg:hover { border-color: #c7d2fe; box-shadow: 0 8px 20px -12px rgba(29,78,216,.35); }
.cg h3 { margin: 14px 16px 4px; font-size: 1.02rem; color: #111827; }
.cg p { margin: 0 16px 16px; font-size: .88rem; color: #6b7280; }
.cg-prev { height: 120px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #f3f6fb; pointer-events: none; }
.cg-car i { width: 46px; height: 60px; border-radius: 6px; background: #c7d2fe; }
.cg-car i:nth-child(2) { width: 66px; height: 76px; background: var(--azul); }
.cg-med b { font: 300 2.4rem "Roboto", sans-serif; color: var(--azul); } .cg-med span { color: #6b7280; }
.cg-code { font: 400 2rem var(--mono); color: var(--azul); }
.mini-range { position: relative; width: 140px; height: 4px; border-radius: 2px; background: #c7d2fe; }
.mini-range i { position: absolute; left: 0; top: 0; bottom: 0; width: 60%; background: var(--azul); border-radius: 2px; }
.mini-range b { position: absolute; left: 60%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--azul); }

/* Responsive del armazón */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-btn { display: grid; }
  .appbar-sub { display: none; }
  .sidenav { position: fixed; z-index: 70; top: 64px; left: 0; bottom: 0; width: 280px; height: auto; background: #fff; transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .sidenav.open { transform: none; }
  body.docs .doc-main { padding: 24px 16px 48px; }
  .doc-main .place-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .appbar { padding: 0 8px; gap: 6px; }
  .appbar-brand span:last-child { font-size: 1rem; }
  .appbar-link { padding: 7px 10px; font-size: .8rem; }
  .doc-slider .slider { height: 480px; }
  .doc-slider .slide-content { padding: 0 20px 72px; }
  .pager-nav { grid-template-columns: 1fr; }
}

/* Encabezado institucional */
.inst { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px 12px; border-top: 6px solid #4c3821; border-bottom: 1px solid #e5e7eb; background: #fff; }
.inst-logos { display: flex; align-items: center; gap: 26px; }
.inst-logos img { height: 92px; width: auto; display: block; }
.inst-sep { width: 1px; height: 72px; background: #d1d5db; }
.inst-subject { text-align: right; display: flex; flex-direction: column; }
.inst-subject span { font: 600 .95rem "Poppins", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #4b5563; }
.inst-subject strong { font: 800 clamp(1.5rem, 3vw, 2.4rem)/1.1 "Poppins", sans-serif; color: #4f46e5; }
@media (max-width: 680px) {
  .inst { padding: 10px 16px; gap: 10px; }
  .inst-logos { gap: 12px; }
  .inst-logos img { height: 52px; }
  .inst-sep { height: 40px; }
  .inst-subject span { font-size: .7rem; }
  .inst-subject strong { font-size: 1.2rem; }
}

/* Índice de componentes en la introducción */
.comp-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.comp-index a { display: block; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 8px; text-decoration: none; color: #1f2937; font-size: .92rem; transition: border-color .15s, background .15s; }
.comp-index a b { font-weight: 500; }
.comp-index a:hover { border-color: var(--azul); background: #f8faff; color: var(--azul); }
@media (max-width: 900px) {
  .sidenav { top: 0; z-index: 90; padding-top: 16px; }
}
