/* Reading settings (static/readprefs.js puts the classes on <html>): bigger words, clearer letters, more space.
   Used by the book viewer, "Read it myself", bedtime stories and the app's reader. */
@font-face { font-family: "Lexend"; src: url("fonts/Lexend-var.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
/* OpenDyslexic by Abbie Gonzalez, SIL Open Font License 1.1 (static/fonts/OFL-OpenDyslexic.txt) */
@font-face { font-family: "OpenDyslexic"; src: url("fonts/opendyslexic-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("fonts/opendyslexic-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---- size ---- */
html.rp-s1 .v-card p { font-size: 1.92rem; font-size: clamp(1.92rem, 4.32vw, 3.6rem); }
html.rp-s1 .reader .words .rline { font-size: 1.74rem; font-size: clamp(1.74rem, 3.84vw, 2.4rem); }
html.rp-s1 #reader.screen .words { font-size: 1.26rem; font-size: clamp(1.26rem, 3.12vw, 1.92rem); }
html.rp-s1 .bt-line { font-size: 1.5rem; }
html.rp-s1 .rp-sample { font-size: 1.44rem; }
html.rp-s2 .v-card p { font-size: 2.32rem; font-size: clamp(2.32rem, 5.22vw, 4.35rem); }
html.rp-s2 .reader .words .rline { font-size: 2.103rem; font-size: clamp(2.103rem, 4.64vw, 2.9rem); }
html.rp-s2 #reader.screen .words { font-size: 1.522rem; font-size: clamp(1.522rem, 3.77vw, 2.32rem); }
html.rp-s2 .bt-line { font-size: 1.812rem; }
html.rp-s2 .rp-sample { font-size: 1.74rem; }
@media (max-width: 700px) {
  html.rp-s1 .v-card p { font-size: 1.8rem; }
  html.rp-s2 .v-card p { font-size: 2.175rem; }
}
@media (orientation: landscape) and (max-height: 520px) {
  html.rp-s1 .v-card p { font-size: 1.26rem; font-size: clamp(1.26rem, 4.08vh, 1.8rem); }
  html.rp-s2 .v-card p { font-size: 1.522rem; font-size: clamp(1.522rem, 4.93vh, 2.175rem); }
}
@media (max-height: 520px) {
  html.rp-s1 #reader.screen .words { font-size: 1.14rem; font-size: clamp(1.14rem, 5.04vh, 1.5rem); }
  html.rp-s2 #reader.screen .words { font-size: 1.377rem; font-size: clamp(1.377rem, 6.09vh, 1.812rem); }
}

/* ---- letters ---- */
html.rp-clear .v-card p, html.rp-clear .reader .words, html.rp-clear .reader .words .rline, html.rp-clear #reader.screen .words, html.rp-clear .bt-line, html.rp-clear .rp-sample { font-family: "Lexend", "Andika", system-ui, sans-serif !important; }
html.rp-dys .v-card p, html.rp-dys .reader .words, html.rp-dys .reader .words .rline, html.rp-dys #reader.screen .words, html.rp-dys .bt-line, html.rp-dys .rp-sample { font-family: "OpenDyslexic", "Lexend", "Andika", system-ui, sans-serif !important; }
html.rp-dys .v-card p { font-weight: 700; }

/* ---- space ---- */
html.rp-space .v-card p, html.rp-space .reader .words, html.rp-space .reader .words .rline, html.rp-space #reader.screen .words, html.rp-space .bt-line, html.rp-space .rp-sample { letter-spacing: .05em; word-spacing: .22em; line-height: 1.6; }

/* OpenDyslexic's letters already stand well apart, so roomy only widens the gaps between words and lines */
html.rp-dys.rp-space .v-card p, html.rp-dys.rp-space .reader .words, html.rp-dys.rp-space .reader .words .rline, html.rp-dys.rp-space #reader.screen .words, html.rp-dys.rp-space .bt-line, html.rp-dys.rp-space .rp-sample { letter-spacing: 0; word-spacing: .25em; }

/* "Read it myself" already keeps its words a little apart (each word can be tapped) */
html.rp-space .reader .words .rline, html.rp-dys.rp-space .reader .words .rline { word-spacing: .1em; }

/* ---- the settings box ---- */
.rp-pop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 850; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px 14px;
  background: rgba(24, 14, 56, .55); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rp-pop.rp-top { padding-top: 74px; background: rgba(24, 14, 56, .25); }
/* (.rp-pop > .rp-box so it also wins over the app's own pop-up box) */
.rp-pop > .rp-box { width: 100%; max-width: 480px; margin: 0 auto; padding: 18px 20px 14px; border-radius: 26px; background: #fffaf0; color: #352363; text-align: left;
  box-shadow: 0 8px 0 rgba(43, 35, 80, .25), 0 24px 60px rgba(0, 0, 0, .4); font-family: "Nunito", "Andika", system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
.rp-h { margin: 0 0 8px; font: 600 1.35rem/1.1 "Fredoka", system-ui, sans-serif; color: #7f52aa; text-align: center; }
.rp-sample { margin: 14px 0 0; padding: 10px 14px; border-radius: 16px; background: #f4ecfb; color: #352363; text-align: center;
  font: 600 1.2rem/1.35 "Fredoka", system-ui, sans-serif; }
.rp-row { margin: 0 0 10px; }
.rp-l { display: block; margin: 0 0 5px 4px; font-weight: 800; font-size: .88rem; color: #6e5f99; }
.rp-opts { display: flex; margin: 0 -4px; }
.rp-b { flex: 1 1 0; min-width: 0; min-height: 52px; margin: 0 4px; padding: 8px 6px; border-radius: 16px; border: 3px solid #e2d6f3; background: #fff; color: #352363;
  font: 700 .95rem/1.15 "Nunito", "Andika", system-ui, sans-serif; cursor: pointer; }
.rp-b[aria-pressed="true"] { border-color: #7f52aa; background: #7f52aa; color: #fff; }
.rp-b:focus-visible, .rp-done:focus-visible { outline: 4px solid #ffd65c; outline-offset: 2px; }
.rp-size-0 { font-size: .9rem; } .rp-size-1 { font-size: 1.08rem; } .rp-size-2 { font-size: 1.28rem; }
.rp-font-story { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; }
.rp-font-clear { font-family: "Lexend", "Andika", system-ui, sans-serif; font-weight: 600; }
.rp-font-dys { font-family: "OpenDyslexic", "Lexend", system-ui, sans-serif; font-size: .82rem; }
.rp-space-1 { letter-spacing: .08em; word-spacing: .2em; }
.rp-done { display: block; width: 100%; min-height: 50px; margin: 14px 0 0; border: 0; border-radius: 99px; background: #ffd65c; color: #352363;
  font: 600 1.1rem "Fredoka", system-ui, sans-serif; box-shadow: 0 5px 0 #c9931a; cursor: pointer; }
.rp-fine { margin: 12px 0 0; text-align: center; font-size: .8rem; font-weight: 700; color: #6e5f99; }
@media (max-height: 520px) {
  .rp-pop, .rp-pop.rp-top { padding: 8px; }
  .rp-pop > .rp-box { max-width: 620px; padding: 10px 16px; }
  .rp-h { display: none; } .rp-fine { display: none; }
  .rp-sample { margin-top: 6px; padding: 6px 12px; }
  .rp-row { display: flex; align-items: center; margin-bottom: 6px; }
  .rp-l { flex: none; width: 118px; margin: 0 8px 0 0; }
  .rp-opts { flex: 1; } .rp-b { min-height: 42px; padding: 4px 6px; }
  .rp-done { min-height: 42px; margin-top: 6px; }
}
/* the "Aa" button that opens it */
.rp-aa { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .18); color: #fff;
  font: 600 1rem/1 "Fredoka", system-ui, sans-serif; cursor: pointer; }
.rp-aa:focus-visible { outline: 3px solid #ffd65c; outline-offset: 2px; }
.rp-aa.light { border: 0; background: rgba(255, 255, 255, .92); color: #352363; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.rd-top .rp-aa { margin-left: auto; }
.rd-top .rp-aa + .rd-stars { margin-left: 0; }
.rp-pop.mk-qr { display: flex; z-index: 30; }
