/* Carried over from the Rails app's app/frontend/stylesheet.scss, plus the static
   site's reader, cast editor and stats bars. */

html,
body {
  background-color: #ffffff;
}

main {
  /* Subtract margin-bottom plus height of footer and header */
  min-height: calc(100vh - 100px);
  margin-bottom: 20px;
}

.margin-bottom-1 {
  margin-bottom: 1em;
}

/* AWESOME LANDING HERO */
#repaper-hero {
  background-color: #ffc107;
  animation: background-colors 55s ease infinite;
  cursor: default;
}
#repaper-hero h1 {
  font-size: 6em;
}
#repaper-hero .repaper-hero-tagline {
  font-size: 2em;
  margin-bottom: 0;
}

@keyframes background-colors {
  0% { background-color: #ffc107; }
  20% { background-color: #e81d1d; }
  40% { background-color: #6610f2; }
  60% { background-color: #fd7e14; }
  80% { background-color: #007bff; }
  100% { background-color: #ffc107; }
}

@media (max-width: 610px) {
  #repaper-hero h1 {
    font-size: 2.5em;
  }
  #repaper-hero .repaper-hero-tagline {
    font-size: 1.5em;
  }
}

@media (prefers-reduced-motion: reduce) {
  #repaper-hero {
    animation: none;
  }
}

/* Bulma's columns have negative side margins, which scroll sideways on phones when
   the container has no padding. */
.rp-page > .columns {
  margin-left: 0;
  margin-right: 0;
}

/* Book covers and character avatars */
.rp-cover {
  max-height: 300px;
}
.rp-cover-placeholder {
  color: #b5b5b5;
  padding: 2rem 0;
}
.rp-avatar {
  background-color: var(--rp-color);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 48px;
  width: 48px;
}
.rp-dot {
  background-color: var(--rp-color);
  border-radius: 50%;
  display: inline-block;
  height: 0.75em;
  margin-right: 0.35em;
  width: 0.75em;
}

/* Cast editor rows */
.rp-character {
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
}
.rp-character-name {
  flex: 1 1 10rem;
  min-width: 0;
}
.rp-character-name .title {
  margin-bottom: 0.25rem;
}
.rp-character-meta {
  color: #7a7a7a;
  font-size: 0.875rem;
  min-width: 9rem;
}

/* Stats: one 100% stacked bar per measure, 2px surface gaps between segments */
.rp-stat + .rp-stat {
  margin-top: 1.25rem;
}
.rp-stat-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.rp-bar {
  background-color: #f5f5f5;
  border-radius: 4px;
  display: flex;
  gap: 2px;
  height: 14px;
  overflow: hidden;
}
.rp-bar-segment {
  background-color: var(--rp-color);
  min-width: 2px;
}
.rp-legend {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  gap: 0.25rem 1rem;
  margin-top: 0.4rem;
}
.rp-legend-item {
  color: #4a4a4a;
  white-space: nowrap;
}

/* Gendered words: highlighted in the reader and the landing page demo */
mark.rp-word {
  background-color: transparent;
  border-radius: 3px;
  color: inherit;
  padding: 0 1px;
  transition: background-color 1s linear;
}
.rp-highlighting mark.rp-word,
mark.rp-word.rp-flash {
  background-color: color-mix(in srgb, var(--rp-color) 45%, transparent);
}

/* Reader */
.rp-reading {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 38em;
}
.rp-reader-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.rp-cast-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Keeps long selects from pushing the page wider than a phone screen */
.select,
.select select {
  max-width: 100%;
}
.rp-reading h1 {
  font-size: 1.6rem;
  text-align: center;
}

/* Covers on the landing page's book cards */
.rp-card-cover {
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.15);
  margin-bottom: 1rem;
  max-height: 220px;
}
.rp-cover {
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.15);
}

/* Verse, adapted from the Rails app's ebook stylesheet. Chapters use Project
   Gutenberg's poem/stanza markup with i0–i4 indent classes; a few of Pooh's songs
   are bare nested <div>s (top-level <div>s in chapters are only ever verse); and
   Peter Pan's pirate songs are <pre>. */
.rp-reading .poem,
.rp-reading > div,
.rp-reading pre {
  margin: 1.25em 0 1.25em 2em;
  text-align: left;
}
.rp-reading .stanza,
.rp-reading > div > div:not(:last-child) {
  margin-bottom: 1em;
}
.rp-reading .poem br {
  display: none;
}
.rp-reading .poem span.i0,
.rp-reading .poem span.i1,
.rp-reading .poem span.i2,
.rp-reading .poem span.i4 {
  display: block;
  padding-left: 3em;
  text-indent: -3em;
}
.rp-reading .poem span.i1 { margin-left: 1em; }
.rp-reading .poem span.i2 { margin-left: 2em; }
.rp-reading .poem span.i4 { margin-left: 4em; }
.rp-reading pre {
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  overflow-x: visible;
  padding: 0;
  white-space: pre-wrap;
}
.rp-reading .smcap {
  font-variant: small-caps;
}

/* Toad's printed programme (Wind in the Willows, ch. XII) is laid out in columns with
   spaces, so it keeps a fixed-width font and scrolls sideways on narrow screens. */
.rp-reading pre.bbox2 {
  border: 1px solid #dbdbdb;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  overflow-x: auto;
  padding: 1em;
  white-space: pre;
}
.rp-reading .stanza:empty {
  display: none;
}
@media (max-width: 550px) {
  .rp-reading pre.bbox2 {
    font-size: 0.62em;
  }
}

/* Read-aloud: the player bar and the paragraph being read */
.rp-player {
  align-items: center;
  background-color: #ffffff;
  bottom: 0;
  box-shadow: 0 -2px 8px rgba(10, 10, 10, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  left: 0;
  padding: 0.75rem 16px;
  position: fixed;
  right: 0;
  z-index: 30;
}
.rp-player .select select {
  max-width: 14rem;
}
body.rp-player-open {
  padding-bottom: 7rem;
}
.rp-reading .rp-speaking {
  background-color: #fff6d6;
  border-radius: 4px;
  box-shadow: 0 0 0 0.35em #fff6d6;
}
.rp-player-open .rp-reading p,
.rp-player-open .rp-reading .stanza {
  cursor: pointer;
}

/* Illustrations inside chapters */
.content figure.rp-illustration {
  margin: 2em 0;
  text-align: center;
}
.rp-illustration img {
  border-radius: 2px;
  height: auto;
  max-height: 80vh;
  max-width: 100%;
  width: auto;
}
