/* The schools page is a room and a grade book. It does not use the home
   beats, the feature grid, or the dark closing band. */

body.is-schools {
  background: #e4c49a;
  overflow-x: clip;
}

.room {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #e4c49a;
  overflow: hidden;
}

.room-wall {
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(220px, 52vh, 520px);
  object-fit: cover;
  object-position: center 82%;
}

.room-title {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(34rem, 92vw);
  padding: 16px 22px 14px;
  text-align: center;
  background: rgba(255, 247, 238, .94);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(42, 33, 64, .12);
}

.room-kicker {
  margin: 0 0 4px;
  font-family: "Baloo 2", Nunito, sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .78rem;
  color: #096477;
}

.room-title h1 {
  margin: 0;
  font-family: "Baloo 2", Nunito, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
  color: #096477;
}

.room-title p:last-child {
  margin: 8px 0 0;
  color: #2A2140;
}

.room-cast {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  column-gap: 18px;
  width: min(1080px, 94vw);
  margin: -200px auto 0;
  padding: 0 8px 6px;
}

/* The figure is not a box, so the line and the person can share one grid:
   every speech slip on the first row, every character on the second. */
.room-person { display: contents; }

.room-slip {
  grid-row: 1;
  position: relative;
  width: min(280px, 100%);
  margin: 0 0 12px;
  padding: 12px 14px 14px;
  background: #fffaf3;
  color: #2A2140;
  font-size: .9rem;
  line-height: 1.35;
  border-radius: 3px 14px 14px 14px;
  box-shadow: 0 8px 18px rgba(42, 33, 64, .12);
  overflow-wrap: break-word;
}

.room-slip::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 18px;
  width: 34px;
  height: 12px;
  background: #f07d20;
  opacity: .85;
  transform: rotate(-3deg);
  border-radius: 2px;
}

.room-person:nth-child(2) .room-slip { transform: rotate(.4deg); }
.room-person:nth-child(3) .room-slip { transform: rotate(-.4deg); }

.room-hear { grid-row: 2; }

.room-hear {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  font: inherit;
}

.room-art {
  width: min(220px, 28vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 0 rgba(90, 52, 18, .08));
  transform-origin: 50% 100%;
  animation: room-breathe 3.6s ease-in-out infinite;
}

.room-person:nth-child(2) .room-art { animation-delay: .4s; }
.room-person:nth-child(3) .room-art { animation-delay: .8s; }

.room-person.is-talking .room-art {
  animation: none;
  filter: drop-shadow(0 14px 0 rgba(240, 125, 32, .28));
}

.room-person.is-talking .room-slip {
  outline: 2px solid #f07d20;
}

.room-who {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
  line-height: 1.1;
}

.room-who strong {
  font-family: "Baloo 2", Nunito, sans-serif;
  font-size: 1.25rem;
  color: #096477;
}

.room-who em {
  font-style: normal;
  font-size: .82rem;
  color: #8a5a32;
}

@keyframes room-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.book {
  width: min(980px, 92vw);
  margin: 28px auto 56px;
  padding: 8px 0 22px;
  background:
    linear-gradient(#e7d3b4, #e7d3b4) 0 0 / 28px 100% no-repeat,
    #fff7ee;
  border-radius: 8px 18px 18px 8px;
  box-shadow: 0 16px 40px rgba(90, 52, 18, .16);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8px;
}

.book-page {
  padding: 28px 28px 8px 36px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    rgba(9, 100, 119, .13) 31px 32px
  );
  background-position: 0 46px;
}

.book-page h2 {
  margin: 0 0 10px;
  font-family: "Baloo 2", Nunito, sans-serif;
  font-size: 1.7rem;
  color: #096477;
  background: #fff7ee;
}

.book-lead {
  margin: 0 0 14px;
  color: #2A2140;
  background: #fff7ee;
}

.book-lines {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: kept;
}

.book-lines li {
  counter-increment: kept;
  min-height: 32px;
  padding: 4px 0 4px 28px;
  position: relative;
  color: #2A2140;
}

.book-lines li::before {
  content: counter(kept);
  position: absolute;
  left: 0;
  color: #f07d20;
  font-family: "Baloo 2", Nunito, sans-serif;
  font-weight: 700;
}

.book-assign {
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-assign li {
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: #2A2140;
}

.book-assign li span:last-child {
  color: #096477;
  font-weight: 700;
}

.book-note {
  grid-column: 1 / -1;
  margin: 18px 36px 0 64px;
  padding-top: 12px;
  border-top: 1px dashed rgba(9, 100, 119, .35);
  color: #2A2140;
}

.book-note a {
  color: #c45e12;
  font-weight: 700;
}

@media (max-width: 800px) {
  .room-title {
    position: static;
    transform: none;
    width: auto;
    margin: 16px 16px 0;
    text-align: start;
  }

  .room-wall {
    height: 210px;
  }

  .room-cast {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
    margin-top: 8px;
    row-gap: 22px;
  }

  .room-slip,
  .room-hear { grid-row: auto; }

  .room-slip { width: 100%; margin: 0; }

  .room-person:nth-child(2) .room-slip,
  .room-person:nth-child(3) .room-slip { transform: none; }

  .room-art { width: min(180px, 46vw); }

  .book {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .book-note { margin-left: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .room-art { animation: none; }
}
