/* Textrinum core: images in the text (figure.tx-figure) and tables. Loaded before the
   design's CSS, so a design can restyle every rule with the same selectors. */
.tx-figure { margin: 1.5rem auto; }
.tx-figure img { display: block; width: 100%; height: auto; }
.tx-figure figcaption { margin-top: .45rem; font-size: .9em; opacity: .8; }
.tx-figure--small { max-width: 33%; }
.tx-figure--medium { max-width: 66%; }
.tx-figure--full { max-width: none; }
.tx-figure--left { float: left; margin: .3rem 1.5rem 1rem 0; }
.tx-figure--right { float: right; margin: .3rem 0 1rem 1.5rem; }
/* Beside the text, "medium" takes half the width, so the text keeps room. */
.tx-figure--left.tx-figure--medium, .tx-figure--right.tx-figure--medium { max-width: 50%; }
@media (max-width: 40rem) {
  .tx-figure--small, .tx-figure--medium { max-width: 100%; }
  .tx-figure--left, .tx-figure--right { float: none; margin: 1.5rem 0; }
}
/* Whatever holds a floating image also holds its end, so the image does not hang out. */
:has(> .tx-figure--left, > .tx-figure--right)::after { content: ""; display: block; clear: both; }

/* Tables in the text: plain defaults without specificity (:where), so any rule of the design wins. */
:where(table) { border-collapse: collapse; margin: 1.5rem 0; max-width: 100%; }
:where(th, td) { padding: .45rem .75rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
:where(th) { font-weight: 600; }
:where(tr:first-child > th) { border-bottom-width: 2px; }
:where(th, td) > :where(p, ul, ol):first-child { margin-top: 0; }
:where(th, td) > :where(p, ul, ol):last-child { margin-bottom: 0; }

/* Forms (core/form). Zurückhaltend, ohne Spezifität: das Design gestaltet sie. */
:where(.tx-form) { display: grid; gap: .9rem; max-width: 36rem; margin: 1.5rem 0; }
:where(.tx-form__field) { display: grid; gap: .3rem; margin: 0; }
:where(.tx-form__field--check) { display: block; }
:where(.tx-form) :is(input:not([type="checkbox"]), select, textarea) { font: inherit; padding: .5rem .6rem; border: 1px solid #b9b0a5; border-radius: 4px; background: #fff; color: inherit; }
:where(.tx-form__help) { font-size: .875em; opacity: .8; }
:where(.tx-form__actions) { margin: .25rem 0 0; }
:where(.tx-form button[type="submit"]) { font: inherit; padding: .6rem 1.2rem; border: 0; border-radius: 4px; background: #333; color: #fff; cursor: pointer; }
:where(.tx-form__note) { margin: 0; font-size: .9em; opacity: .85; }
/* The field for bots stays out of sight and out of reach. */
.tx-form__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* The notice after sending shows through its anchor (#tx-form-<id>-sent). */
.tx-form__sent { display: none; }
.tx-form__sent:target { display: block; padding: .75rem 1rem; border-left: 4px solid currentColor; background: rgba(0, 0, 0, .04); }
