/* Componentes compartidos — prensa + FOSS */

/* —— Accesibilidad —— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: var(--emphasis, #fff);
  color: var(--inverse, #000);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  text-decoration: none;
  border: 2px solid var(--border, #333);
}

.skip-link:focus {
  left: 0.5rem;
}

/* —— Tablas de datos —— */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  margin: 0.75rem 0 1.25rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--rule, var(--border));
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table thead th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.data-table tbody tr:nth-child(even) {
  background: var(--surface-2);
}

/* —— Ficha dl/dt —— */
.ficha-dl {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  background: var(--surface);
}

.ficha-dl dt {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ficha-dl dd {
  margin: 0;
}

/* —— Acciones de ficha —— */
.card-actions {
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
}

.card-actions a {
  margin-right: 1rem;
  text-decoration: none;
  font-weight: 700;
}

.card-actions a:hover { text-decoration: underline; }

.card-actions a.ext::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.75;
}

/* —— Enlace telemetría (fichas prensa) —— */
.telemetry-link-wrap {
  margin: 1rem 0 0.5rem;
}

.telemetry-link {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface-2);
  letter-spacing: 0.02em;
}

.telemetry-link:hover {
  background: var(--surface);
  text-decoration: underline;
}

.telemetry-link.ext::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.75;
}

/* —— Panel de fuerzas (engines index) —— */
.forces-panel {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.force-card {
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: var(--surface);
}

.force-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.force-card .force-role {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.force-card .force-lore {
  margin: 0;
  font-size: 0.88rem;
}

.force-card a.force-name {
  text-decoration: none;
  color: inherit;
}

.force-card a.force-name:hover {
  text-decoration: underline;
}

/* —— Dimensiones corpus —— */
.corpus-dimensions {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.corpus-dim-card {
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: var(--surface);
}

.corpus-dim-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.corpus-dim-card .dim-label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.corpus-dim-card p {
  margin: 0;
  font-size: 0.88rem;
}

.corpus-dim-card a {
  text-decoration: none;
  color: inherit;
}

.corpus-dim-card a:hover {
  text-decoration: underline;
}

/* —— Acciones catálogo —— */
.catalog-actions {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  border-top: 2px solid var(--border);
}

.catalog-actions li {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.catalog-actions a {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
}

.catalog-actions a:hover {
  text-decoration: underline;
}

.catalog-actions .action-detail {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

/* —— Asentamiento —— */
.asentamiento-dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8.5rem) 1fr;
  gap: 0.4rem 1rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.asentamiento-dl dt {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.asentamiento-dl dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.asentamiento-dl .asentamiento-line {
  grid-column: 1 / -1;
}

.asentamiento {
  font-family: var(--font, ui-monospace, "Cascadia Code", monospace);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 1rem;
  overflow-x: auto;
}

/* —— Secciones de contenido (prensa, fuera del grid .cards) —— */
.content-section {
  margin: 1.5rem 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.content-section:first-of-type {
  border-top: 2px solid var(--border);
  margin-top: 1.25rem;
}

.content-section h2 {
  margin-top: 0;
}

/* —— Loadout grid —— */
.loadout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.loadout-grid .loadout-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
}

.loadout-grid .loadout-cell strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* —— Diagrama equipamiento (3 columnas) —— */
.equip-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 0 0 1.5rem;
  border: 2px solid var(--border);
}

.equip-flow-col {
  padding: 0.75rem 0.65rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.equip-flow-col:last-child { border-right: none; }

.equip-flow-col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
}

.equip-flow-svg {
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto;
  display: block;
  color: var(--text);
}

.equip-flow-label {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* —— Diagrama tablero —— */
.diagram-wrap {
  margin: 0.75rem 0 1rem;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
}

.diagram-wrap svg {
  width: 100%;
  height: auto;
  font-family: var(--font, system-ui, sans-serif);
}

.diagram-box {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.diagram-label {
  fill: currentColor;
  font-size: 12px;
  font-weight: 700;
}

.diagram-sublabel {
  fill: currentColor;
  font-size: 10px;
}

.diagram-arrow {
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
}

.diagram-caption {
  fill: currentColor;
  font-size: 10px;
}

/* —— Fallback logo —— */
.provenance-logo[src$=".png"] {
  object-fit: contain;
}

.provenance-logo.logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 560px) {
  .loadout-grid,
  .equip-flow {
    grid-template-columns: 1fr;
  }

  .equip-flow-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .equip-flow-col:last-child { border-bottom: none; }

  .ficha-dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .asentamiento-dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .asentamiento-dl dt { margin-top: 0.35rem; }

  .ficha-dl dt { margin-top: 0.35rem; }
}
