/* Matriz de películas y conceptos (/matriz/, a trial next to /mapa/): rows are films with their still,
   columns are the tags; a dot marks a relation. Tokens come from prototype/css/tokens.css. */

.matriz-orden {
  display: flex;
  gap: var(--l-mitad);
  margin-bottom: var(--l-2);
  font-size: var(--fs-chico);
  letter-spacing: var(--ls-etiqueta);
  text-transform: uppercase;
}

.matriz-orden a {
  color: var(--color-acento);
  text-decoration: none;
}

.matriz-orden a[aria-current="true"] {
  color: var(--color-texto);
  border-bottom: 1px solid currentColor;
}

.matriz {
  --ancho-columna: 24px;
  --alto-fila: 56px;
}

/* the head: an empty box over the films, then one narrow column per tag, the label standing up */
.matriz-cabecera {
  display: flex;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-block: var(--l-mitad);
  background: var(--color-fondo);
}

.matriz-cabecera-ficha {
  flex: 1;
  min-width: 0;
}

.matriz-columnas {
  display: grid;
  grid-template-columns: repeat(var(--columnas), var(--ancho-columna));
  flex: none;
}

/* countries and concepts are two blocks of columns, each under its own caption */
.matriz-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

.matriz-grupo + .matriz-grupo,
.matriz-fila > .matriz-columnas + .matriz-columnas {
  margin-left: 12px;
}

.matriz-grupo-titulo {
  font-size: 9px;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-tinta-suave);
  opacity: .75;
  white-space: nowrap;
}

.matriz-etiqueta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* the labels sit just above the first row */
  align-items: center;
  gap: 3px;
  height: 128px;
  color: var(--c-tinta-suave);
  text-decoration: none;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .04em;
}

.matriz-etiqueta span {
  writing-mode: vertical-rl;
  rotate: 180deg;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 108px;
}

.matriz-etiqueta b {
  font-weight: 400;
  opacity: .5;
}

/* a faint band on alternate columns, so a column can be followed down the page */
.matriz-columnas .matriz-etiqueta:nth-child(odd),
.matriz-columnas .matriz-celda:nth-child(odd) {
  background: rgba(34, 34, 34, .035);
}

.matriz-etiqueta:hover,
.matriz-etiqueta:hover b,
.matriz-etiqueta.activa,
.matriz-etiqueta.activa b {
  color: var(--color-acento);
  opacity: 1;
}

/* the tag a film sent us with stays marked once the pointer leaves */
.matriz-etiqueta.activa b { opacity: .8; }

/* rows */
.matriz-fila {
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: var(--alto-fila);
  color: inherit;
  text-decoration: none;
  border-top: 1px solid rgba(34, 34, 34, .15);
}

.matriz-fila:hover {
  background: var(--color-superficie);
}

.matriz-ficha {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--l-mitad);
}

.matriz-still {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: cover;
  background: var(--color-superficie);
}

.matriz-still-vacia { display: block; }

.matriz-texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.matriz-texto strong {
  font-weight: 400;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matriz-texto small {
  font-size: var(--fs-chico);
  line-height: var(--lh-chico);
  color: var(--c-tinta-suave);
}

/* the dots */
.matriz-celda {
  width: var(--ancho-columna);
  height: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matriz-celda::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.matriz-celda.on::before {
  background: var(--color-acento);
}

/* a lit column (toggled from js when a label is hovered) */
.matriz.columna .matriz-celda { opacity: .18; }

.matriz.columna .matriz-celda.on-col { opacity: 1; }

/* the lit column carries a band the height of the matrix, as a film row does */
.matriz.columna .matriz-celda.en-columna { background: var(--color-superficie); }

/* a lit row (hover), the dots of the other columns stay out of the way */
.matriz-fila:hover .matriz-celda { opacity: .35; }

.matriz-fila:hover .matriz-celda.on { opacity: 1; }

@media (max-width: 991.98px) {
  .matriz { overflow-x: auto; }

  .matriz-columnas { min-width: calc(var(--columnas) * var(--ancho-columna)); }

  .matriz-cabecera,
  .matriz-fila { min-width: max-content; }
}
