@font-face {
  font-family: "AtkinsonHyperlegible";
  src: url("../../fonts/AtkinsonHyperlegibleNext-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: "AtkinsonHyperlegible";
  src: url("../../fonts/AtkinsonHyperlegibleNext-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
}

.library-reader__content,
.editor-styles-wrapper {
  color: var(--color-text, #83796d);
  font-family: "AtkinsonHyperlegible", sans-serif;
  /* The admin page and frontend can use different root font sizes. */
  font-size: clamp(17.28px, 1.6vw, 19.2px);
  line-height: 1.65;
}

.wp-block-paragraph:empty {
  min-height: 1lh;
}

/* The editor hint must not make an empty paragraph taller than one line. */
.editor-styles-wrapper .wp-block-paragraph[data-empty="true"] [data-rich-text-placeholder] {
  position: absolute;
  inset: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.library-reader__content, .editor-styles-wrapper) :is(p, pre.wp-block-verse, figure.wp-block-table) {
  margin-block: 0;
}

figure.wp-block-table {
  color: inherit;
  font: inherit;
  margin-inline: 0;
}

figure.wp-block-table table {
  border-collapse: collapse;
}

/* Fit the available width while keeping short tables compact. */
.wp-block-table table:not(.has-fixed-layout) {
  width: auto;
}

.wp-block-table table:not(.has-fixed-layout) :is(th, td):not(:last-child) {
  white-space: nowrap;
}

.wp-block-table table:not(.has-fixed-layout) :is(th, td):not(:last-child) > .rich-text {
  min-width: max-content;
}

.wp-block-table table:not(.has-fixed-layout) :is(th, td):last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.wp-block-table table:not(.has-fixed-layout) :is(th, td):last-child > .rich-text {
  overflow-wrap: inherit;
}

/* Also allow wrapping when the first column is the only column in the editor. */
.wp-block-table table:not(.has-fixed-layout) :is(th, td):only-child > .rich-text {
  white-space: pre-wrap !important;
}

figure.wp-block-table :is(table, th, td) {
  border: 0;
}

figure.wp-block-table :is(th, td) {
  /* Keep empty rows editable and visible after removing the vertical padding. */
  height: 1lh;
  padding: 0 0.5em 0 0;
  vertical-align: top;
}

.editor-styles-wrapper figure.wp-block-table:is(.is-selected, :focus-within) :is(th, td) {
  outline: 1px dashed currentColor;
  outline-offset: -1px;
}
