/* pageText.css */

.content-body.body-text {
  grid-template-rows: minmax(0, 1fr);
}

.content-body .text {
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.page-text {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;

  --topOffset: 18px;
  --sidePad: clamp(10px, 3vw, 22px);

  padding: var(--topOffset) var(--sidePad) 10px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;

  font-size: var(--readerFontSizeFit, var(--readerFontSize, 30px));
  line-height: var(--readerLineHeightFit, var(--readerLineHeight, 1.5));
  color: var(--readerFontColor, #1f2a44);
}

.ptx-p {
  margin: 0 0 0.68em 0;
  font-weight: var(--readerFontWeight, 400);
}

.ptx-p:last-child {
  margin-bottom: 0;
}

.ptx-p[data-indent="1"] {
  text-indent: 0.9em;
}

.ptx-p[data-indent="2"] {
  text-indent: 1.8em;
}

.ptx-p[data-indent="3"] {
  text-indent: 2.7em;
}

.page-text,
.page-text * {
  user-select: text;
  -webkit-user-select: text;
}

.page-text .text-run {
  display: block;
}

.page-text .w {
  display: inline;
  cursor: pointer;
}

.page-text .w.hl {
  border-radius: 6px;
  box-shadow: inset 0 -1.1em 0 rgba(255, 208, 79, 0.55);
}

.page-text .w.tap-hl {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(79, 124, 255, 0.22),
    rgba(147, 98, 232, 0.18)
  );
}

.page-text::selection,
.page-text *::selection {
  background: rgba(79, 124, 255, 0.28);
}

.page-text,
.page-text .w,
.text-run,
.text-run .w {
  touch-action: manipulation;
}
