/* =========================================================
   Pathway: rutas de carrera, mapa de habilidades y catálogo
   ========================================================= */
:root { --lv-origen: #94a3b8; --lv-inicial: #3b82f6; --lv-intermedio: #a855f7; --lv-avanzado: #14b8a6; }
.lv-origen { --lv: var(--lv-origen); } .lv-inicial { --lv: var(--lv-inicial); }
.lv-intermedio { --lv: var(--lv-intermedio); } .lv-avanzado { --lv: var(--lv-avanzado); }

.pw-tabs { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 22px; flex-wrap: wrap; }
.pw-tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.pw-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); }

.pw-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pw-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--lv); display: inline-block; }

/* ---------- Tablero de rutas (estilo limpio: texto + bolitas + flechas) ---------- */
.pw-board-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--raised); box-shadow: 0 1px 0 var(--line); }
.pw-board { position: relative; display: grid; grid-template-columns: 1fr 1.15fr 1.15fr 1.15fr; column-gap: 40px; padding: 28px 32px 36px; min-width: 980px; }
.pw-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.pw-lines path.ln { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.st-origen { stop-color: var(--lv-origen); } .st-inicial { stop-color: var(--lv-inicial); }
.st-intermedio { stop-color: var(--lv-intermedio); } .st-avanzado { stop-color: var(--lv-avanzado); }
.st-map { stop-color: var(--accent); }
.mk-origen { fill: var(--lv-origen); } .mk-inicial { fill: var(--lv-inicial); }
.mk-intermedio { fill: var(--lv-intermedio); } .mk-avanzado { fill: var(--lv-avanzado); }
@media (prefers-reduced-motion: no-preference) {
  .pw-lines path.ln { stroke-dasharray: 900; stroke-dashoffset: 900; animation: pw-draw .5s ease-out forwards; }
}
@keyframes pw-draw { to { stroke-dashoffset: 0; } }

.pw-col { display: flex; flex-direction: column; position: relative; z-index: 1; }
.pw-col-h { text-align: center; margin-bottom: 18px; }
.pw-col-h span { display: inline-block; font: 600 17px var(--f-display); letter-spacing: -.01em; padding: 0 6px 10px; border-bottom: 2px solid var(--fg); }
.pw-col.feeder .pw-col-h { text-align: left; }

.pw-feeder, .pw-node { background: none; border: 0; cursor: pointer; color: var(--fg); transition: opacity .25s ease; }
.pw-feeder { height: 50px; text-align: left; font-size: 14.5px; padding: 0 4px; display: flex; align-items: center; }
.pw-feeder .pw-name { border-bottom: 1px dashed transparent; }
.pw-feeder:hover .pw-name, .pw-feeder.sel .pw-name { border-bottom-color: var(--accent); }
.pw-node { height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 6px 4px; font-size: 14.5px; text-align: center; }
.pw-node .pw-name { line-height: 1.3; max-width: 230px; }
.pw-pill { display: inline-flex; align-items: center; justify-content: center; width: 62px; height: 25px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); transition: box-shadow .2s, transform .2s; }
.pw-node:hover .pw-pill, .pw-node.sel .pw-pill { transform: scale(1.08); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lv) 25%, transparent); }
.pw-node.sel .pw-name, .pw-feeder.sel .pw-name { font-weight: 700; }
.pw-board.activo .pw-feeder:not(.sel):not(.rel), .pw-board.activo .pw-node:not(.sel):not(.rel) { opacity: .2; }
.pw-dots { display: inline-flex; gap: 5px; }
.pw-dots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--lv) 20%, var(--line)); }
.pw-dots i.on { background: var(--lv); }

/* ---------- Detalle del rol ---------- */
.pw-detail { margin-top: 28px; scroll-margin-top: calc(var(--header-h) + 16px); }
.pw-empty { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.pw-empty .ico { color: var(--accent); width: 22px; height: 22px; margin-top: 2px; }
.pw-empty b { color: var(--fg); }
.pw-empty p { margin-top: 4px; font-size: 14px; }
.pw-d-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; align-items: flex-start; animation: fade .25s ease-out; }
.pw-d-lv { display: inline-flex; align-items: center; gap: 10px; font: 600 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pw-d-head h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; }
.pw-d-head p { color: var(--muted); max-width: 70ch; font-size: 16.5px; }
.pw-d-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; animation: fade .3s ease-out; }
.pw-box { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--raised); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pw-box h4 { font: 600 18px var(--f-display); letter-spacing: -.01em; }
.pw-box ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.mt-s { margin-top: 10px; }
.pw-certs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pw-cert { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--fg); }
.pw-cert .ico { width: 14px; height: 14px; color: var(--muted); }
button.pw-cert { cursor: pointer; }
button.pw-cert:hover { border-color: var(--accent); color: var(--accent); }
button.pw-cert:hover .ico { color: var(--accent); }
.pw-chip { border: 1px solid var(--lv); background: color-mix(in srgb, var(--lv) 10%, var(--raised)); color: var(--fg); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pw-chip:hover { background: color-mix(in srgb, var(--lv) 22%, var(--raised)); }
@media (max-width: 1100px) { .pw-d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pw-d-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Mapa de habilidades y certificaciones (estilo limpio) ---------- */
.pw-hint { color: var(--muted); margin-bottom: 14px; }
.pw-map-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--raised); }
.pw-map { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: 120px; padding: 28px 32px 32px; min-width: 900px; }
.pw-mcol { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.pw-mcol .pw-col-h { margin-bottom: 14px; }
.pw-mcol.left { align-items: flex-end; } .pw-mcol.left .pw-col-h { text-align: right; }
.pw-mcol.right { align-items: flex-start; } .pw-mcol.right .pw-col-h { text-align: left; }
.pw-mcol.mid { align-items: center; }
.pw-item { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 7px 0; cursor: pointer; color: var(--fg); transition: opacity .25s ease; min-height: 44px; }
.pw-item .pw-t { display: flex; flex-direction: column; }
.pw-mcol.left .pw-t { text-align: right; align-items: flex-end; }
.pw-mcol.mid .pw-t { text-align: center; align-items: center; }
.pw-item b { font-size: 14px; font-weight: 600; }
.pw-item small { font-size: 11.5px; color: var(--muted); max-width: 220px; line-height: 1.3; }
.pw-item .tick { width: 3px; height: 22px; border-radius: 2px; background: var(--fg); flex: none; opacity: .55; }
.pw-item.role .tick { background: var(--lv); opacity: .9; }
.pw-item.sel b { color: var(--accent); }
.pw-item.sel .tick, .pw-item.rel .tick { opacity: 1; }
.pw-map.activo .pw-item:not(.sel):not(.rel) { opacity: .22; }
.pw-item:hover b { color: var(--accent); }

/* ---------- Catálogo ---------- */
.pw-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.pw-filters .input { max-width: 380px; }
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pw-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--raised); display: flex; flex-direction: column; gap: 8px; scroll-margin-top: calc(var(--header-h) + 24px); }
.pw-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pw-sigla { font: 700 20px var(--f-display); letter-spacing: -.01em; }
.pw-card h3 { font-size: 15px; font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
.pw-card p { font-size: 14px; color: var(--muted); }
.pw-card.nv-fundamentos .pill { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pw-card.nv-intermedio .pill { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pw-card.nv-avanzado .pill { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pw-util { display: flex; flex-direction: column; gap: 6px; }
.pw-card.flash { animation: pw-flash 1.6s ease-out; }
@keyframes pw-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.pw-fuente { margin-top: 28px; padding-bottom: 56px; font-size: 12.5px; color: var(--muted); }

/* Las líneas pasan por detrás de los nombres sin taparlos */
.pw-node .pw-name, .pw-feeder .pw-name { position: relative; padding: 1px 6px; }

/* Las líneas van por encima de los nombres: ningún texto las tapa */
.pw-board .pw-lines, .pw-map .pw-lines { z-index: 3; }
