/*
 * The columns the journal has to decrypt to show, marked so that they do not
 * read as the others that carry nothing personal. The warning register is what
 * says it: the value is not an error, it is one to handle with care.
 *
 * Colours come from the DSFR's own tokens and never from a literal — the layout
 * sets `data-fr-scheme="system"`, so the dark theme is reachable.
 */
.decrypted-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  color: var(--text-default-warning);
  background-color: var(--background-contrast-warning);
}

/*
 * The DSFR fixes 1.5 rem, which towers over the value beside it. Resized through
 * `--icon-size` and not through `width`/`height`, because the same variable also
 * feeds the `vertical-align` the DSFR computes: overriding the box alone would
 * leave the icon aligned for a size it no longer has.
 */
.decrypted-value__icon::before {
  --icon-size: 1rem;
}

/*
 * A value that renders as a block — the RegRep document, folded — puts the
 * padlock beside the first line of the box rather than halfway down it.
 *
 * On the baseline and not on the top edge: that first line is a button, whose
 * padding makes its box taller than its text, so aligning the boxes leaves the
 * padlock riding above the wording it marks. Nor on the centre, which the
 * unfolded document would drag hundreds of pixels down.
 */
.decrypted-value--block {
  display: flex;
  align-items: baseline;
}

/*
 * A flex item never shrinks below its own content unless told to (`min-width` is
 * `auto` by default), so a value wider than the cell — a subject read back field
 * by field, an identifier with nothing to break at — pushed the padlock's box
 * past the edge of the table instead of wrapping inside it. The padlock keeps
 * its own size, being the one part that must not be squeezed.
 */
.decrypted-value__icon {
  flex: none;
}

.decrypted-value > :not(.decrypted-value__icon) {
  min-width: 0;
}
