/* EXPLORAR POR CONCEPTOS — nube semántica global de Lumbre (§28 diseño limpio y explorables).
   Colores SEMÁNTICOS (tokens de app.css) para que claro y oscuro se lean igual de bien.
   Tipografía uniforme, variación MODERADA de tamaño, animaciones suaves, touch-friendly. Nada de WordArt. */
.cc-hero { padding-top: 28px; }
.cc-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 6px 0; }
.cc-sub { color: var(--muted); max-width: 62ch; }
.cc-search { display: flex; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.cc-search-field { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--surface); }
.cc-search-field input { border: 0; outline: 0; padding: 12px 0; flex: 1; background: transparent; font-size: 1rem; color: var(--ink); }

.cc-modes { display: inline-flex; gap: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; padding: 4px; }
.cc-mode { padding: 8px 16px; border-radius: 9px; text-decoration: none; color: inherit; font-weight: 600; font-size: .92rem; }
.cc-mode.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.14); }

.cc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: inherit; text-decoration: none; font-size: .86rem; border: 1px solid transparent; transition: background .18s, border-color .18s; }
.cc-chip:hover { background: color-mix(in srgb, var(--ink) 13%, transparent); }
.cc-chip.on { background: var(--ink); color: var(--bg); }
.cc-chip.static { cursor: default; }
.cc-rel { opacity: .6; font-size: .74rem; text-transform: lowercase; }
/* Contador del chip: cuántos conceptos hay DE VERDAD tras cada puerta. Con el número a la vista,
   filtrar deja de ser una apuesta y una categoría vacía no se cuela como liga muerta. */
.cc-chip-n { font-variant-numeric: tabular-nums; opacity: .6; font-weight: 600; font-size: .78rem; }
.cc-chip.on .cc-chip-n { opacity: .78; }

/* Recuento y páginas de la nube: la nube tiene miles de conceptos, así que la página dice
   hasta dónde se ve y ofrece seguir, en vez de cortar en seco y parecer corta. */
.cc-pager { padding-bottom: 34px; }
.cc-pager .pagination { justify-content: center; }
.cc-count { text-align: center; margin: 0 0 12px; }
.cc-density { text-align: center; margin-top: 12px; }
.cc-density a { color: var(--accent); font-weight: 600; text-decoration: none; }
.cc-density a:hover { text-decoration: underline; }

/* NUBE — compacta y legible: rampa MODERADA (de .78rem a 1.6rem), frases largas que se envuelven
   sin romper el layout, entrada escalonada. Nada de WordArt. */
.cc-cloud { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 3px 11px; padding: 14px 6px; max-width: 1000px; margin: 0 auto; }
.cc-word { display: inline-block; line-height: 1.15; padding: 2px 8px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .1px; max-width: 100%; overflow-wrap: anywhere; transition: transform .2s cubic-bezier(.2,.7,.2,1), background .2s, color .2s, box-shadow .2s; }
.cc-word[data-size="1"] { font-size: .78rem; color: var(--muted); font-weight: 500; }
.cc-word[data-size="2"] { font-size: .86rem; color: var(--muted); font-weight: 550; }
.cc-word[data-size="3"] { font-size: .95rem; color: var(--ink); }
.cc-word[data-size="4"] { font-size: 1.06rem; color: var(--ink); }
.cc-word[data-size="5"] { font-size: 1.2rem; color: var(--accent); }
.cc-word[data-size="6"] { font-size: 1.38rem; color: var(--accent); }
.cc-word[data-size="7"] { font-size: 1.6rem; color: var(--accent); font-weight: 720; }
.cc-word[data-featured] { color: var(--warm); }
.cc-word:hover, .cc-word:focus-visible { transform: translateY(-1px) scale(1.04); background: var(--accent-soft); color: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,.12); outline: none; }
.cc-cloud[data-enter] .cc-word { animation: cc-pop .5s backwards; }
.cc-cloud[data-enter] .cc-word:nth-child(2) { animation-delay: .04s; }
.cc-cloud[data-enter] .cc-word:nth-child(3) { animation-delay: .08s; }
.cc-cloud[data-enter] .cc-word:nth-child(4) { animation-delay: .12s; }
.cc-cloud[data-enter] .cc-word:nth-child(5) { animation-delay: .16s; }
.cc-cloud[data-enter] .cc-word:nth-child(6) { animation-delay: .2s; }
.cc-cloud[data-enter] .cc-word:nth-child(7) { animation-delay: .24s; }
.cc-cloud[data-enter] .cc-word:nth-child(n+8) { animation-delay: .28s; }
@keyframes cc-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.cc-legend { text-align: center; margin-top: 10px; }

/* LISTA */
.cc-list { list-style: none; padding: 0; margin: 0; }
.cc-list li { border-bottom: 1px solid var(--line); padding: 4px 0; }
.cc-list-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 8px; text-decoration: none; color: inherit; border-radius: 10px; }
.cc-list-row:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.cc-list-name { font-weight: 600; font-size: 1.06rem; flex: 1; }
.cc-list-type { font-size: .78rem; color: var(--bg); background: var(--ink); padding: 2px 8px; border-radius: 999px; }
.cc-list-count { font-size: .82rem; color: var(--muted); min-width: 92px; text-align: right; }
.cc-list-desc { margin: 0 8px 10px; max-width: 70ch; }

/* MAPA */
.cc-map { position: relative; min-height: 460px; display: flex; align-items: center; justify-content: center; }
.cc-node { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); transition: transform .18s, box-shadow .18s; }
.cc-node:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.18); color: var(--accent); }
.cc-node-center { background: var(--ink); color: var(--bg); font-size: 1.4rem; z-index: 2; }
.cc-node-ring { position: absolute; inset: 0; pointer-events: none; }
.cc-node-ring .cc-node { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); }
.cc-map-hint { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; }

/* FICHA DEL CONCEPTO */
.cc-concept { padding-top: 22px; }
.cc-c-head h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 4px 0; }
.cc-c-def { font-size: 1.08rem; max-width: 64ch; }
.cc-c-actions { display: flex; align-items: center; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.cc-count { color: var(--muted); font-size: .9rem; }
.cc-fav { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.cc-fav.on { background: var(--warm); color: var(--bg); border-color: var(--warm); }
.cc-block { margin: 26px 0; }
.cc-block-title { font-size: 1.2rem; margin: 0 0 12px; }
.cc-block-title .cc-n { color: var(--muted); font-weight: 400; font-size: .9rem; }
.cc-wordline { display: flex; flex-wrap: wrap; gap: 8px; }

.cc-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cc-card { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: inherit; height: 100%; transition: box-shadow .18s, transform .18s; }
.cc-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.14); transform: translateY(-2px); }
.cc-card-thumb { width: 44px; height: 60px; object-fit: cover; border-radius: 6px; background: color-mix(in srgb, var(--ink) 8%, transparent); flex: none; }
.cc-card-body { display: flex; flex-direction: column; gap: 3px; }
.cc-card-area { color: var(--muted); }
.cc-discover { background: var(--accent-soft); border-radius: 14px; padding: 18px; }

/* CONECTAR (ficha) */
.cc-attach { display: flex; flex-direction: column; gap: 8px; }
.cc-attach-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-attach select, .cc-attach input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); }
.cc-attach .cc-attach-id { flex: 1 1 200px; }

/* ADMIN */
.cc-table-wrap { overflow-x: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cc-table th, .cc-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cc-table-actions { white-space: nowrap; }
.cc-dups { list-style: none; padding: 0; display: grid; gap: 8px; }
.cc-dup { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); flex-wrap: wrap; }
.cc-relate { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-relate input, .cc-relate select { padding: 9px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); }

/* Editor de chips en fichas de contenido (OA/curso/…) */
.cc-editor { margin: 18px 0; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.cc-editor[hidden] { display: none; }
.cc-editor h3 { margin: 0 0 8px; font-size: 1.02rem; }
.cc-editor-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cc-edit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .84rem; text-decoration: none; }
/* El chip es además un enlace a /conceptos/{slug}: realce sólo al hover/foco, sin perder su forma de etiqueta. */
a.cc-edit-chip:hover { text-decoration: underline; filter: brightness(1.15); }
a.cc-edit-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cc-edit-chip button { border: 0; background: transparent; color: var(--bg); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.cc-editor-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; position: relative; }
.cc-editor-form input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; flex: 1 1 180px; background: var(--surface); color: var(--ink); }
.cc-editor-form input[type="number"] { flex: 0 0 78px; }
.cc-editor-form select { padding: 9px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); }
.cc-suggest { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 30; max-height: 260px; overflow: auto; list-style: none; margin: 4px 0 0; padding: 4px; }
.cc-suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.cc-suggest li:hover, .cc-suggest li[aria-selected="true"] { background: var(--accent-soft); }
.cc-suggest .cc-sug-type { color: var(--muted); font-size: .78rem; margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
    .cc-word, .cc-cloud[data-enter] .cc-word, .cc-node, .cc-card { animation: none !important; transition: none !important; }
}
@media (max-width: 560px) {
    .cc-cloud { gap: 3px 8px; padding: 10px 2px; }
    .cc-word[data-size="7"] { font-size: 1.3rem; }
    .cc-word[data-size="6"] { font-size: 1.16rem; }
    .cc-word[data-size="5"] { font-size: 1.04rem; }
    .cc-map { min-height: 400px; }
}
