/*
 * The Translate control on text people typed (public/js/i18n/auto.js): the small button after the text, the caption under a
 * translation, the original kept under a safety instruction's translation, and paper, which never shows a machine translation: in
 * print the button, the caption and the translation are hidden and the text shows as it was typed. Logical sides only, so the control
 * sits after the text in either direction.
 */
.tx-btn {
  font: inherit; font-size: 12px; line-height: 1; color: var(--link); background: none; border: 0; padding: 0 4px; margin-inline-start: 4px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; vertical-align: baseline;
}
.tx-btn[hidden] { display: none; }
/* While it works the button stays focusable (aria-disabled), so keyboard focus is still on it when the translation arrives. */
.tx-btn:hover:not([aria-disabled="true"]) { color: var(--primary-hover); }
.tx-btn[aria-disabled="true"] { color: var(--text-3); cursor: progress; text-decoration: none; }
.tx-btn:focus-visible, .tx-cap:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: var(--radius-sm); }

/* After inline text the button and caption keep to the line's own height, so the lines around them do not move. */
.tx-cap { font-size: 11.5px; line-height: 1; color: var(--text-3); margin-inline-start: 4px; }
div.tx-cap { line-height: 1.4; margin-inline-start: 0; margin-block-start: 2px; }
.tx-cap[hidden] { display: none; }
.tx-cap > span + span { margin-inline-start: 0.35em; }
.tx-prog { inline-size: 80px; block-size: 8px; margin-inline-start: 6px; vertical-align: middle; }

.tx-out { white-space: pre-line; }
.tx:not([data-tx-shown]) > .tx-out, .tx:not([data-tx-shown]) > .tx-label { display: none; }
.tx[data-tx-shown] > .tx-orig { display: none; }
/* A safety instruction keeps the text as typed under its translation, with a rule between them. */
.tx[data-tx-shown][data-tx-class="safety"] > .tx-label { display: block; margin-block-start: 4px; padding-block-start: 3px; border-block-start: 1px dashed var(--border-strong); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.tx[data-tx-shown][data-tx-class="safety"] > .tx-orig { display: block; }

@media print {
  .tx-btn, .tx-cap, .tx-out, .tx-label { display: none !important; }
  .tx > .tx-orig { display: revert !important; }
}
