/* Guías de UllU — estilos compartidos.
   Tokens, navegación y footer replican los de la landing (index.html). */

:root {
  color-scheme: light;
  --plum: #1c1030;
  --plum-2: #271641;
  --grape: #7038e4;
  --grape-lite: #b39cff;
  --glow: #ffc247;
  --glow-deep: #f59e0b;
  --glow-ink: #b45309;
  --cream: #faf5ec;
  --cream-2: #f3ebdd;
  --paper: #ffffff;
  --ink: #241c33;
  --ink-soft: #6c6684;
  --line: #e7ddcb;

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --wrap: 1120px;
  --r: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, table { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

.u-page {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; line-height: 1.12; }

.u-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.u-eyebrow {
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--glow-ink); display: inline-flex; align-items: center; gap: 9px;
}
.u-eyebrow.on-dark { color: var(--glow); }
.u-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; opacity: .6; }

/* Botones */
.u-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  padding: 14px 24px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.u-btn:active { transform: translateY(1px); }
.u-btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 8px; }
.u-btn-glow { background: var(--glow); color: #3a2408; box-shadow: 0 10px 30px -8px rgba(255,194,71,.55); }
.u-btn-glow:hover { background: #ffcf68; }

/* Navegación */
.u-nav { position: sticky; top: 0; z-index: 50; background: rgba(28,16,48,.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); }
.u-nav .u-wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.u-brand { display: flex; align-items: center; gap: 11px; color: var(--cream); }
.u-brand img { width: 34px; height: 34px; }
.u-wordmark { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; white-space: nowrap; }
.u-wordmark span { color: var(--grape-lite); }
.u-navlinks { display: flex; align-items: center; gap: 6px; }
.u-navlink { color: #cfc6e6; font-weight: 500; font-size: 15px; padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.u-navlink:hover, .u-navlink[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); }
.u-nav-cta { margin-left: 8px; padding: 10px 18px; font-size: 15px; }
.u-burger {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: none; border: 1.5px solid rgba(255,255,255,.25); border-radius: 12px;
  color: var(--cream); font-size: 20px; line-height: 1; cursor: pointer;
}
.u-mobile-menu { display: none; flex-direction: column; gap: 4px; padding: 10px 24px 20px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(28,16,48,.98); }
.u-mnav { color: #cfc6e6; font-weight: 500; font-size: 16px; padding: 12px 8px; border-radius: 10px; }
.u-mnav:hover { color: #fff; background: rgba(255,255,255,.07); }
.u-mobile-menu .u-btn { margin-top: 8px; width: 100%; justify-content: center; }

/* Cabecera de guía */
.g-hero { position: relative; background: var(--plum); color: var(--cream); overflow: hidden; }
.g-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 380px at 86% 20%, rgba(255,194,71,.14), transparent 60%),
    radial-gradient(520px 460px at 8% 100%, rgba(112,56,228,.34), transparent 62%);
}
.g-hero .u-wrap { position: relative; padding: 52px 24px 64px; }
.g-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: #a99fc4; list-style: none; padding: 0; }
.g-crumbs li:not(:last-child)::after { content: "›"; margin-left: 8px; opacity: .6; }
.g-crumbs a:hover { color: #fff; }
.g-hero h1 { margin-top: 22px; font-size: clamp(32px, 5vw, 54px); max-width: 22ch; }
.g-lead { margin-top: 18px; font-size: 19px; line-height: 1.6; color: #d7cfe8; max-width: 60ch; }
.g-meta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.g-chip { font-size: 13px; font-weight: 600; color: #e6ddf6; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); padding: 6px 13px; border-radius: 999px; }

/* Cuerpo: artículo + índice lateral */
.g-layout { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 64px; padding: 64px 0 40px; align-items: start; }
.g-toc { position: sticky; top: 100px; font-size: 14px; }
.g-toc-lab, .g-lab { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.g-toc ol { list-style: none; padding: 0; margin-top: 12px; }
.g-toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--ink-soft); line-height: 1.4; }
.g-toc a:hover { color: var(--grape); border-color: var(--grape); }
.g-toc .u-btn { margin-top: 22px; width: 100%; justify-content: center; font-size: 14.5px; padding: 11px 16px; }

.g-article { min-width: 0; max-width: 72ch; }
.g-article > section + section { margin-top: 56px; }
.g-article h2 { font-size: clamp(25px, 3vw, 33px); margin-bottom: 16px; }
.g-article h3 { font-size: 20px; margin: 28px 0 8px; }
.g-article p { margin-bottom: 16px; }
.g-article ul, .g-article ol { margin: 0 0 18px; padding-left: 22px; }
.g-article li { margin: 7px 0; }
.g-article li::marker { color: var(--grape); }
.g-link { color: var(--grape); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.g-link:hover { color: #5a28c4; }

.g-def { font-size: 19px; line-height: 1.6; border-left: 3px solid var(--glow); padding: 2px 0 2px 20px; margin-bottom: 22px; }

/* Pasos numerados (secuencia real) */
.g-steps { list-style: none; padding: 0 !important; margin: 26px 0 !important; counter-reset: paso; }
.g-steps > li { counter-increment: paso; position: relative; padding: 0 0 24px 62px; margin: 0; }
.g-steps > li::before {
  content: counter(paso); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 13px;
  background: var(--grape); color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px;
  display: grid; place-items: center; box-shadow: 0 10px 22px -10px rgba(112,56,228,.6);
}
.g-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 50px; bottom: 6px; width: 2px; background: var(--line); }
.g-steps h3 { margin: 8px 0 6px; font-size: 18.5px; }
.g-steps p { margin-bottom: 0; color: var(--ink-soft); }

/* Tarjetas y ejemplos */
.g-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; margin: 26px 0; }
.g-card > .g-lab { display: block; margin-bottom: 10px; color: var(--glow-ink); }
.g-card p:last-child, .g-card ul:last-child { margin-bottom: 0; }
.g-tip { background: #f1eafe; border: 1px solid #ddd0fb; border-radius: 16px; padding: 16px 20px; margin: 22px 0; font-size: 16px; }
.g-tip strong { color: #4b1fb0; }

/* Lista de definiciones (datos del responsable, definiciones legales) */
.g-dl { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.g-dl dt, .g-dl dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; }
.g-dl dt { font-weight: 600; background: var(--cream-2); }
.g-dl dt:last-of-type, .g-dl dd:last-of-type { border-bottom: 0; }
@media (max-width: 620px) {
  .g-dl { grid-template-columns: 1fr; }
  .g-dl dt { border-bottom: 0; padding-bottom: 2px; }
}

/* Marcador pendiente de completar (documentos legales) */
.g-todo { background: #fff0a8; color: #7a4a00; font-weight: 600; padding: 1px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px #f2d15b; }

/* Rejilla genérica de bloques (mapa de empatía, SCAMPER…) */
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.g-cell { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.g-cell h3, .g-cell h4 { font-family: var(--display); font-size: 16px; margin: 0 0 6px; letter-spacing: -0.01em; }
.g-cell p, .g-cell ul { font-size: 15px; line-height: 1.55; margin: 0; color: var(--ink); }
.g-cell ul { padding-left: 18px; }
.g-cell li { margin: 4px 0; }
.g-cell.accent { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.g-cell.accent p, .g-cell.accent li { color: #e6ddf6; }
.g-cell.span2 { grid-column: span 2; }

/* Lean Canvas — 3 columnas que conservan su lógica: problema a la izquierda,
   propuesta de valor al centro, cliente a la derecha y economía abajo.
   Se adapta al ancho del artículo (container query), no al de la pantalla. */
.g-article { container-type: inline-size; }
.g-canvas {
  display: grid; gap: 10px; margin: 22px 0;
  grid-template-columns: 1fr;
  grid-template-areas: "prob" "seg" "pvu" "sol" "can" "ing" "cost" "met" "vent";
}
@container (min-width: 540px) {
  .g-canvas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "prob pvu  seg"
      "sol  pvu  can"
      "met  vent vent"
      "cost cost ing";
  }
}
.g-canvas .g-cell { padding: 14px; }
.g-canvas .g-cell h4 { font-size: 14.5px; }
.g-canvas .g-cell p, .g-canvas .g-cell li { font-size: 13.5px; }
.g-canvas .g-cell b { display: inline-block; font-family: var(--display); color: var(--grape); margin-right: 4px; }

/* Cadena de porqués */
.g-chain { list-style: none; padding: 0 !important; margin: 24px 0 !important; }
.g-chain li { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 0 0 26px; }
.g-chain li:not(:last-child)::after { content: "↓"; position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); color: var(--grape); font-weight: 700; }
.g-chain .q { display: block; font-size: 13px; font-weight: 700; color: var(--grape); letter-spacing: .02em; }
.g-chain li.root { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.g-chain li.root .q { color: var(--glow); }

/* Tablas */
.g-table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.g-table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
.g-table th, .g-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.g-table thead th { font-family: var(--display); font-size: 14px; background: var(--cream-2); }
.g-table tbody th { font-weight: 600; white-space: nowrap; color: var(--ink-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.g-table tr:last-child th, .g-table tr:last-child td { border-bottom: 0; }
.g-table.wide { min-width: 720px; }

/* Llamado a UllU */
.g-cta { position: relative; overflow: hidden; background: var(--plum); color: var(--cream); border-radius: 26px; padding: 34px 32px; margin: 56px 0 0; }
.g-cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 260px at 90% 0%, rgba(255,194,71,.2), transparent 65%); pointer-events: none; }
.g-cta > * { position: relative; }
.g-cta h2 { font-size: clamp(23px, 3vw, 30px); margin: 12px 0 10px; }
.g-cta p { color: #d7cfe8; margin-bottom: 22px; max-width: 58ch; }
.g-cta-row { display: flex; align-items: center; gap: 22px; }
.g-cta-row img { width: 86px; height: 86px; flex: none; }

/* Preguntas frecuentes */
.g-faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 2px 20px; margin-bottom: 10px; }
.g-faq details[open] { border-color: var(--grape); }
.g-faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-family: var(--display); font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; flex: none; color: var(--grape); font-size: 22px; line-height: 1; transition: transform .2s; }
.g-faq details[open] summary::after { transform: rotate(45deg); }
.g-faq details p { color: var(--ink-soft); font-size: 16px; }

/* Guías relacionadas */
.g-related { padding: 24px 0 88px; }
.g-related h2 { font-size: clamp(24px, 3vw, 30px); margin-top: 14px; }
.g-cards { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.g-tile { display: flex; flex-direction: column; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.g-tile:hover { border-color: var(--grape); transform: translateY(-3px); box-shadow: 0 22px 40px -28px rgba(28,16,48,.45); }
.g-tile .g-lab { color: var(--glow-ink); }
.g-tile h3 { font-size: 19px; }
.g-tile p { font-size: 15px; color: var(--ink-soft); line-height: 1.55; }
.g-tile .g-more { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 14.5px; color: var(--grape); }

/* Footer */
.u-foot { background: var(--plum-2); color: #b3a9cd; }
.u-foot .u-wrap { padding: 40px 24px; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between; }
.u-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; width: 100%; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.u-foot-links a:hover { color: #fff; }
.u-foot small { font-size: 13.5px; }

/* Responsive */
@media (max-width: 1000px) {
  .g-layout { grid-template-columns: 1fr; gap: 0; padding-top: 48px; }
  .g-toc { display: none; }
  .g-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .u-navlinks { display: none; }
  .u-burger { display: inline-flex; }
  .u-mobile-menu.open { display: flex; }
}
@media (max-width: 620px) {
  .u-page { font-size: 16px; }
  .g-grid { grid-template-columns: 1fr; }
  .g-cell.span2 { grid-column: auto; }
  .g-cards { grid-template-columns: 1fr; }
  .g-cta { padding: 28px 22px; }
  .g-cta-row img { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .g-tile, .g-tile:hover { transition: none; transform: none; }
}
