/* Recursos: the library of models and settings (cards, the form and the detail). */
.recursos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recurso {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--linea);
  border-radius: var(--radio-tarjeta);
  background: var(--blanco);
  box-shadow: var(--sombra-tarjeta);
}

.recurso--archivado {
  background: #f6f7fb;
}

.recurso--archivado .recurso__foto {
  opacity: 0.6;
}

.recurso__foto,
.recurso-detalle__foto {
  display: block;
  width: 100%;
  background: var(--fondo);
  object-fit: cover;
  object-position: top;
}

.recurso__foto {
  aspect-ratio: 4 / 3;
}

.recurso-detalle__foto {
  max-height: 320px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: contain;
}

.recurso__foto--vacia,
.recurso-detalle__foto--vacia {
  display: grid;
  place-items: center;
  color: var(--apagado);
  font-size: 13px;
}

.recurso__cuerpo {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.recurso__nombre {
  font-size: 16px;
}

.recurso__ver {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-oscuro);
  font-size: inherit;
  font-weight: 750;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--borde-control);
  text-underline-offset: 3px;
}

.recurso__ver:hover {
  text-decoration-color: var(--color-primario);
}

.recurso__categoria {
  padding: 2px 10px;
  border: 1px solid var(--borde-control);
  border-radius: 999px;
  color: var(--apagado);
  font-size: 12px;
}

.recurso__uso {
  font-size: 13px;
}

.recursos__archivados {
  align-items: center;
  min-height: var(--alto-control);
}

.recursos__cantidad {
  margin: 0;
}

.recursos__cantidad:focus {
  outline: none;
}

.recurso-versiones {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recurso-versiones li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding: 8px 12px;
  border: 1px solid var(--linea);
  border-radius: 12px;
}

/* A group of fields inside a form: a fieldset without the browser's frame. */
.grupo-campos {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.grupo-campos legend {
  padding: 0;
}

.grupo-campos:disabled .campo__entrada {
  background: #eef0f7;
}

.campo__error {
  color: var(--error-texto);
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 480px) {
  .recursos {
    grid-template-columns: minmax(0, 1fr);
  }

  .recurso__ver {
    min-height: 44px;
  }

  .grupo-campos .casilla-linea {
    align-items: center;
    min-height: 44px;
  }
}

#formulario-recurso,
.recurso-detalle {
  margin-top: 14px;
}

/* A long name without spaces breaks inside the card, the detail and the dialogs (also the cards
   of Preparar and the lines that show a name) instead of pushing the screen sideways. */
.recurso__cuerpo,
.recurso__nombre,
.recurso__ver,
.recurso__uso,
.recurso-detalle .cifras dd,
.recurso-versiones li,
.dialogo h2,
.tarjeta-sel__titulo,
.tarjeta-sel__detalle {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recurso-detalle .cifras div {
  min-width: 0;
}

.recurso--ilegible {
  border-color: var(--error-borde, var(--linea));
}

.recurso-form__uso {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fondo);
  overflow-wrap: anywhere;
}

.recurso-form__principal {
  align-items: center;
  min-width: 0;
}

.recurso-form__principal span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recurso-form__vista {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.tarjetas > * {
  min-width: 0;
}

/* Revocation: the list of what it does, and the hashes of the report (they have no spaces). */
.recurso-revocar__lista {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.impacto__hash {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.recurso-revocacion .cifras dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The report on a phone: the product (first column) stays in view while the rest slides. */
.impacto .tabla th[scope="row"] {
  position: sticky;
  left: 0;
  background: var(--blanco);
}
