/* Slide «sources»: texto a la izquierda, diagrama y tipos de contenido a la derecha,
   para que la slide entre completa en una pantalla. */
.sources-visual { width: 100%; }

@media (min-width: 861px) {
  .slide--sources .wrap { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr); }

  /* La slide debe entrar completa en una pantalla: el relleno vertical es una variable (la misma que usa .slide en
     pantallas bajas) para poder descontarlo, y la columna visual no pasa de la altura disponible. Dentro de ella el
     diagrama es lo que se encoge (conserva su proporción y queda centrado); los tipos de contenido no cambian. */
  .slide--sources { --pad: clamp(40px, 7vw, 88px); padding-block: var(--pad); }
  .sources-visual {
    display: flex;
    flex-direction: column;
    max-height: calc(100svh - 64px - 2 * var(--pad) - 2px);   /* 2 px: el borde de las slides pares */
  }
  .sources-visual .diagram { flex: 1 1 auto; min-height: 0; }
}
@media (min-width: 861px) and (max-height: 800px) {
  .slide--sources { --pad: 28px; }
}

.types-title {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 8px;
}

.ftypes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ftype {
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 54px;
}
.ft-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--c);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.66rem;
  box-shadow: var(--shadow);
}
.ft-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ftype--audio { --c: #e0568a; }
.ftype--video { --c: #8b5cf6; }
.ftype--text  { --c: #64748b; }
.ftype--pdf   { --c: #e5484d; }
.ftype--photo { --c: #f59e0b; }
.ftype--word  { --c: #2b6cd1; }
.ftype--excel { --c: #1f9d55; }
.ftype--sql   { --c: #0ea5b7; }
.ftype--chat  { --c: #f97316; }

/* Íconos de contenido que salen de cada fuente hacia DalIA: muy pequeños y suaves, para dar vida sin distraer.
   (Las letras de PDF y Word llevan su estilo dentro del ícono: ver Svg::contentIconDefs.) */
.diagram .src-icon, .diagram .comp-item, .diagram .srv-pulse { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .diagram .src-icon, .diagram .comp-item, .diagram .srv-pulse { display: none; }
}

/* Componentes de DalIA (bajo el círculo central). Se distinguen de la entrada de contenido (líneas azules, gruesas y
   píldoras redondeadas) con otro color (verde azulado), líneas finas y punteadas, etiquetas pequeñas y cajas cuadradas
   con rayas, como un servidor en un rack. */
.slide--sources .diagram { --comp: color-mix(in srgb, var(--teal) 78%, var(--ink)); }
.diagram .comp-link {
  fill: none;
  stroke: var(--comp);
  stroke-width: 1.25;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
  opacity: 0.85;
  animation: dash-flow 2s linear infinite;
}
.diagram .chip { fill: color-mix(in srgb, var(--teal) 14%, var(--bg)); stroke: color-mix(in srgb, var(--teal) 55%, transparent); stroke-width: 1; }
.diagram .chip-icon { fill: none; stroke: var(--comp); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.diagram .chip-label { text-anchor: start; font-size: 10px; }
.diagram .srv { fill: var(--bg); stroke: var(--muted); stroke-width: 1.5; }
.diagram .srv-line { fill: none; stroke: var(--line); stroke-width: 1; }
.diagram .srv-slit { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; }
.diagram .srv-led { fill: var(--comp); }
.diagram .srv-badge-text { fill: #fff; font-size: 8px; font-weight: 800; }
.diagram .srv-label { text-anchor: start; font-size: 12px; }

/* Dibujos que viajan hacia los componentes: el color del servidor llega en la variable --c de cada elemento (ver Svg::flowItem). */
.diagram .comp-item .fg-line { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.diagram .comp-item .fg-hollow { fill: var(--bg); stroke: var(--c); }
.diagram .comp-item .fg-solid { fill: var(--c); }
.diagram .comp-item .fg-score { font: 800 6.5px "Plus Jakarta Sans", sans-serif; text-anchor: middle; }

/* Cada caja de componente es clicable: al pulsarla se abre un panel con su función y el valor que aporta a la entidad (js/components.js).
   El panel va encima de la caja, con una flecha que la señala; en pantallas angostas pasa a ser un bloque bajo el diagrama. */
.sources-visual { position: relative; }
.diagram .srv-node { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: center; transition: transform 0.15s; }
.diagram .srv-node:hover, .diagram .srv-node.is-active { transform: scale(1.05); }
.diagram .srv-node:hover .srv, .diagram .srv-node.is-active .srv, .diagram .srv-node:focus-visible .srv { stroke: var(--accent); stroke-width: 2.4; }
.diagram .cmp-hint { fill: var(--muted); font-size: 10.5px; font-weight: 700; text-anchor: middle; }

.cmp-panel {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 18px 44px -12px rgba(15, 23, 42, 0.38);
  animation: cmp-in 0.18s ease-out;
}
.cmp-panel[hidden], .cmp-card[hidden] { display: none; }
@keyframes cmp-in { from { opacity: 0; transform: translateY(6px); } }
/* Flecha que señala la caja elegida (su posición horizontal la pone el script en --caret) */
.cmp-panel::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: var(--caret, 50%);
  width: 14px;
  height: 14px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.cmp-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.cmp-close:hover, .cmp-close:focus-visible { background: var(--bg2); color: var(--ink); }

.cmp-card { padding: 14px 18px 16px; border-top: 4px solid var(--c); border-radius: 14px; }
.cmp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-right: 30px; }
.cmp-badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--c); color: #fff; font-size: 0.7rem; font-weight: 800; }
.cmp-head h3 { margin: 0; font-size: 1.15rem; line-height: 1.2; }
.cmp-kind { margin-left: 2px; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.cmp-body { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); gap: 4px 22px; }
.cmp-body h4 { margin: 0 0 6px; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cmp-body p { margin: 0; color: var(--ink); font-size: 0.84rem; line-height: 1.5; }
.cmp-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cmp-body li { position: relative; padding-left: 20px; font-size: 0.84rem; line-height: 1.45; }
.cmp-body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.3em;
  width: 5px;
  height: 9px;
  border: solid var(--c);
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(45deg);
}

@media (max-width: 720px) {
  .cmp-panel { position: static; width: auto; margin-top: 14px; animation: none; }
  .cmp-panel::after { display: none; }
  .cmp-body { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-panel { animation: none; }
  .diagram .srv-node { transition: none; }
}

/* Stamping: la caja que sella el contenido en la blockchain tiene el borde de su color y dos candados (la blockchain de LNET y el sellado de tiempo) */
.diagram .srv.seal { stroke: var(--lk); stroke-width: 1.8; }
.diagram .seal-lock path { fill: none; stroke: var(--lk); stroke-width: 1.7; stroke-linecap: round; }
.diagram .seal-lock rect { fill: var(--lk); }
.diagram .seal-shield .sh-body { fill: var(--lk); }
.diagram .seal-shield .sh-check { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Si el panel no cabe encima de la caja (Stamping está en el medio del diagrama) se abre por debajo, con la flecha hacia arriba */
.cmp-panel[data-side="below"]::after { top: -8px; bottom: auto; border-right: 0; border-bottom: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }

/* Argos: caja punteada que agrupa los componentes (Milvus, Neo4j, DuckDB y MariaDB). Su pestaña y su leyenda explican que se puede instalar en el servidor del cliente (SaaS u on-premise, con CPU o GPU). */
.diagram .argos-box { fill: color-mix(in srgb, var(--teal) 9%, transparent); stroke: var(--teal); stroke-width: 1.6; stroke-dasharray: 7 6; }
.diagram .argos-tab { fill: var(--teal); }
.diagram .argos-name { fill: #0b1020; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.diagram .argos-sub { fill: var(--ink); text-anchor: start; font-size: 10px; font-weight: 700; opacity: 0.85; }
