/* ═══ Universo Lumbre — hotspots, peek, rails, portal y fichas ═══
   Mobile-first; usa los tokens de app.css (--accent, --surface…); respeta
   prefers-reduced-motion. Los colores de marca NO se hardcodean aquí. */

/* ── Hotspot ✦: sutil en lectura, claro al toque ── */
.kn-hotspot {
    cursor: pointer;
    border-bottom: 1px dotted var(--warm);
    border-radius: 3px;
    transition: background-color .15s;
}
.kn-hotspot:hover, .kn-hotspot:focus-visible { background: var(--accent-soft); outline: none; }
.kn-spark { font-style: normal; font-size: .72em; vertical-align: super; color: var(--warm); margin-inline-start: 1px; }
.main-nav .kn-spark { color: var(--lumbre-amber, var(--warm)); font-size: .9em; vertical-align: baseline; }

/* ── KnowledgePeek: panel flotante que no te saca de la página ── */
.kn-peek {
    position: fixed;
    inset-inline: 12px;
    bottom: 76px;
    z-index: 90;
    max-height: min(72svh, 560px);
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 14px 16px 12px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .18s ease, transform .18s ease;
}
.kn-peek.is-open { opacity: 1; transform: translateY(0); }
@media (min-width: 720px) {
    .kn-peek { inset-inline: auto; right: 20px; bottom: 20px; width: 380px; }
}
.kn-peek-loading { text-align: center; color: var(--warm); font-size: 22px; padding: 18px 0; animation: kn-pulse 1s ease-in-out infinite; }
@keyframes kn-pulse { 50% { opacity: .35; } }
.kn-peek-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kn-peek-kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kn-peek-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 8px; border-radius: var(--radius-sm); }
.kn-peek-close:hover { color: var(--ink); background: var(--accent-soft); }
.kn-peek-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-md); margin: 8px 0 10px; border: 1px solid var(--line); }
.kn-peek-title { display: block; font-size: 17px; font-weight: 700; color: var(--ink); }
.kn-peek-title:hover { color: var(--accent); }
.kn-peek-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.kn-peek-sum { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.kn-peek-period { margin: 6px 0 0; font-size: 12px; color: var(--warm); font-weight: 600; }
.kn-peek-group { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.kn-peek-group h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kn-peek-links { display: grid; gap: 6px; }
.kn-peek-link { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg); }
.kn-peek-link:hover { background: var(--accent-soft); color: var(--accent); }
.kn-peek-link-kind { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.kn-peek-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.kn-peek-open { flex: 1; text-align: center; }
.kn-sound-toggle { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 15px; }

/* ── Rail (RelatedRail): seis verbos, scroll horizontal natural en móvil ── */
.kn-rail-group { margin: 18px 0; }
.kn-rail-head { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kn-verb-conocer .kn-rail-head { color: var(--warm); }
.kn-verb-sorprendeme .kn-rail-head { color: var(--discovery); }
.kn-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.kn-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease;
}
.kn-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.kn-card-poster { display: block; aspect-ratio: 16 / 9; background: var(--bg); position: relative; }
.kn-card-poster img { width: 100%; height: 100%; object-fit: cover; }
.kn-card-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: var(--warm); }
.kn-card-body { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 11px; min-width: 0; }
.kn-card-kind { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kn-card-body strong { font-size: 14px; line-height: 1.35; }
.kn-card-sum { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Prompt de inscripción (§19): tarjeta inferior no bloqueante ── */
.kn-enroll-card {
    position: fixed;
    inset-inline: 12px;
    bottom: 76px;
    z-index: 95;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 14px 16px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .18s ease, transform .18s ease;
}
.kn-enroll-card.is-open { opacity: 1; transform: translateY(0); }
@media (min-width: 720px) { .kn-enroll-card { inset-inline: auto; left: 50%; transform: translateX(-50%) translateY(14px); width: 420px; } .kn-enroll-card.is-open { transform: translateX(-50%) translateY(0); } }
.kn-enroll-msg { margin: 0; font-weight: 600; }
.kn-enroll-who { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.kn-enroll-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Portal /explore ── */
.explore-hero {
    background: linear-gradient(160deg, var(--lumbre-night, #172033), #232f4b);
    color: #F1EDE4;
    border-radius: var(--radius-lg);
    padding: 26px 20px;
    margin: 18px 0 22px;
    display: grid;
    gap: 12px;
}
@media (min-width: 720px) { .explore-hero { padding: 36px 40px; } }
.explore-hero h1 { margin: 0; font-size: clamp(24px, 4.4vw, 38px); }
.explore-hero p { margin: 0; opacity: .85; max-width: 60ch; }
.explore-hero .kn-surge { display: inline-flex; align-items: center; gap: 8px; background: var(--lumbre-amber, var(--warm)); color: #172033; font-weight: 700; border-radius: 999px; padding: 10px 20px; justify-self: start; }
.explore-hero .kn-surge:hover { filter: brightness(1.06); color: #172033; }
.explore-section { margin: 26px 0; }
.explore-section > h2 { margin: 0 0 4px; font-size: 19px; }
.explore-section > .explore-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.explore-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.explore-question {
    border: 1px solid var(--line);
    border-left: 4px solid var(--discovery);
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.explore-question p { margin: 0; font-size: 16px; font-weight: 600; }
.explore-question .kn-q-go { white-space: nowrap; }

/* ── Ficha de entidad /u/{slug} ── */
.entity-page { padding: 18px 0 40px; }
.entity-head { display: grid; gap: 14px; margin-bottom: 20px; }
@media (min-width: 820px) { .entity-head { grid-template-columns: 280px minmax(0, 1fr); align-items: start; } }
.entity-hero-img { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; font-size: 40px; color: var(--warm); }
.entity-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.entity-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warm); margin: 0; }
.entity-head h1 { margin: 2px 0 6px; font-size: clamp(24px, 4.5vw, 36px); }
.entity-period { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.entity-summary { font-size: 16px; line-height: 1.7; margin: 0 0 10px; }
.entity-aliases { font-size: 12px; color: var(--muted); margin: 0; }
.entity-aliases strong { color: var(--ink); }
.entity-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.entity-chips a { font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--surface); }
.entity-chips a:hover { border-color: var(--accent); color: var(--accent); }
.entity-block { margin: 26px 0; }
.entity-block > h2 { font-size: 17px; margin: 0 0 10px; }

/* Puertas del catálogo: la nav muestra poco; aquí está todo a un clic. */
.explore-doors { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.explore-doors a { font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; background: var(--surface); }
.explore-doors a:hover { border-color: var(--accent); color: var(--accent); }

/* ── /explora — navegador estructural de localización rápida ── */
.explora-page { padding-bottom: 40px; }
.explora-page .section-heading { margin-bottom: 18px; }

/* Portada del navegador: hero oscuro con las cifras del catálogo y el buscador dentro. */
.explora-hero {
    background: linear-gradient(160deg, var(--lumbre-night, #172033), #232f4b);
    color: #F1EDE4;
    border-radius: var(--radius-lg);
    padding: 26px 20px;
    margin: 4px 0 26px;
    display: grid;
    gap: 10px;
}
@media (min-width: 720px) { .explora-hero { padding: 38px 44px; gap: 12px; } }
.explora-hero .eyebrow { margin: 0; color: var(--lumbre-amber, var(--warm)); letter-spacing: .12em; font-size: 11px; font-weight: 700; }
.explora-hero h1 { margin: 0; font-size: clamp(24px, 4.4vw, 38px); color: inherit; }
.explora-hero p { margin: 0; opacity: .88; max-width: 64ch; line-height: 1.6; }
.explora-hero-stats { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.explora-hero-stats strong { font-size: 20px; color: var(--lumbre-amber, #f0b429); font-variant-numeric: tabular-nums; }
.explora-hero-search { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.explora-hero-search .circles-search { flex: 1 1 260px; position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 4px 14px; color: #F1EDE4; }
.explora-hero-search .circles-search:focus-within { border-color: var(--lumbre-amber, #f0b429); background: rgba(255,255,255,.12); }
.explora-hero-search input { flex: 1; min-width: 0; border: 0; background: none; color: #F1EDE4; font-size: 15px; padding: 10px 0; outline: none; }
.explora-hero-search input::placeholder { color: rgba(241,237,228,.6); }
.explora-hero-search .button { border-radius: 999px; }
.explora-hero-search .ex-dropdown { color: var(--ink); }

/* Etiquetas grandes de etapa: el eje de entrada, «¿para quién es?». */
.explora-stages { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.explora-stage { display: flex; flex-direction: column; gap: 6px; padding: 16px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.explora-stage:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.explora-stage-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.explora-stage strong { font-size: 16px; }
.explora-stage-count { color: var(--muted); font-size: 12px; }

/* Estante con fichas reales (media-card) dentro del tablero: scroll horizontal natural en móvil. */
.explora-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 176px); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.explora-shelf > .media-card { scroll-snap-align: start; }
@media (min-width: 1100px) { .explora-shelf { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-columns: unset; overflow: visible; } }

/* Puertas a los otros navegadores, al pie del tablero. */
.explora-cross { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.explora-cross h2 { margin: 0 0 12px; font-size: 17px; }
.explora-cross-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.explora-cross-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.explora-cross-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.explora-cross-card > svg { flex-shrink: 0; color: var(--warm); margin-top: 2px; }
.explora-cross-card span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.explora-cross-card strong { font-size: 15px; }
.explora-cross-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* Filas de filtros finos en resultados (formato / ¿para quién?). */
.explora-filterrow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.explora-filterlab { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* Atajo destacado a Educación Oficial México (SEP). */
.explora-sep-hero {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 4px 0 26px; padding: 16px 18px;
    border: 1px solid var(--line); border-left: 4px solid var(--discovery, var(--warm));
    border-radius: var(--radius-lg); background: var(--surface); text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.explora-sep-hero:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.explora-sep-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); }
.explora-sep-copy { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.explora-sep-copy strong { color: var(--ink); font-size: 16px; }
.explora-sep-copy small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.explora-sep-cta { color: var(--accent); display: inline-flex; }

/* Bloque por faceta en el tablero. */
.explora-facet { margin: 22px 0; }
.explora-facet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.explora-facet-head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; }
.explora-facet-head h2 > svg { color: var(--warm); }
.explora-facet .chip-row { flex-wrap: wrap; }

/* Modo faceta: mosaico de valores con conteo. */
.explora-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 14px; }
.explora-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.explora-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.explora-tile strong { color: var(--ink); font-size: 16px; }
.explora-tile-count { color: var(--muted); font-size: 12px; }

/* ── Clasificación técnica en la ficha del objeto (/object) ── */
.lo-taxonomy { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.lo-taxonomy .chip-tax { font-weight: 600; }
.chip-stage { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-subject { border-color: var(--accent); color: var(--accent); }
.chip-field { background: color-mix(in srgb, var(--discovery, var(--warm)) 14%, var(--surface)); }
.chip-difficulty { border-style: dashed; }
.chip-plan { border-style: dotted; }

/* ── Resultados de faceta: conmutador Fichas/Lista + filas de la vista lista ── */
.explora-views { display: inline-flex; gap: 6px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.explora-view { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.explora-view:hover { color: var(--accent); }
.explora-view.active { background: var(--accent); color: #fff; }
.explora-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.explora-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, background .15s; }
.explora-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.explora-row-ico { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.explora-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.explora-row-main strong { font-size: 14px; line-height: 1.35; }
.explora-row-main small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explora-row-arrow { margin-left: auto; flex-shrink: 0; color: var(--muted); }
.explora-row:hover .explora-row-arrow { color: var(--accent); }
/* Móvil: una línea por fila — el meta se oculta y el título respira en dos líneas. */
@media (max-width: 480px) {
    .explora-row-main strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .explora-row-main small { display: none; }
}

/* Movimiento reducido: sin traslados ni pulso, el universo sigue operando. */
@media (prefers-reduced-motion: reduce) {
    .kn-peek, .kn-enroll-card { transition: none; transform: none; opacity: 1; }
    .explora-tile:hover { transform: none; }
    .explora-stage:hover { transform: none; }
    .explora-row { transition: none; }
    .kn-peek-loading { animation: none; }
    .kn-card:hover { transform: none; }
}
