/* Nounou: header, footer and the stories reader. Tokens and components come from oou.css. */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.6rem 0;
  background: rgba(253, 248, 236, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(234, 223, 200, 0.7);
}
.site-header .oou-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .oou-lockup img {
  height: 3.25rem;
}
.site-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-link {
  display: none;
  color: var(--oou-ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 0;
}
.site-link:hover {
  color: var(--oou-teal-700);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
@media (min-width: 40rem) {
  .site-link {
    display: inline-block;
  }
}
@media (max-width: 23.5rem) {
  .site-header .oou-lockup img {
    height: 2.5rem;
  }
  .oou-lockup__sub {
    font-size: 0.9rem;
    padding-inline: 0.6rem;
  }
}

.lang {
  position: relative;
}
.lang summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--oou-radius-pill);
  border: 2px solid var(--oou-line);
  background: var(--oou-white);
  color: var(--oou-teal-900);
  font-weight: 800;
  font-size: 0.95rem;
}
.lang summary::-webkit-details-marker {
  display: none;
}
.lang summary svg {
  width: 1.15rem;
  height: 1.15rem;
}
.lang[open] summary,
.lang summary:hover {
  border-color: var(--oou-teal-700);
}
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 5;
  min-width: 11rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--oou-white);
  border: 2px solid var(--oou-line);
  border-radius: var(--oou-radius-sm);
  box-shadow: var(--oou-shadow);
  animation: lang-in var(--oou-dur) var(--oou-ease-bounce);
}
@keyframes lang-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}
.lang a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  color: var(--oou-ink);
  font-weight: 700;
  text-decoration: none;
}
.lang a:hover,
.lang a[aria-current] {
  background: var(--oou-teal-100);
  color: var(--oou-teal-900);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--oou-space-8);
  padding: 3rem 0 2rem;
  background: var(--oou-white);
  border-top: 2px solid var(--oou-line);
  color: var(--oou-muted);
}
.site-footer .oou-wrap {
  display: grid;
  gap: 2rem;
}
@media (min-width: 48rem) {
  .site-footer .oou-wrap {
    grid-template-columns: 2fr 1fr 1fr;
  }
}
.site-footer__brand img {
  height: 3rem;
  width: auto;
  margin-bottom: 0.9rem;
}
.site-footer__brand p {
  max-width: 22rem;
}
.site-footer h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer nav a {
  display: inline-block;
  padding: 0.55rem 0;
  font-weight: 700;
  text-decoration: none;
}
.site-footer nav a:hover,
.site-footer nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.site-footer__legal {
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid var(--oou-line);
  font-size: var(--oou-text-sm);
}


/* ---------- Library ---------- */
.library-hero {
  padding: 3rem 0 2rem;
  position: relative;
}
.library-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin: 1rem 0;
}
.library-hero .oou-lead {
  max-width: 42rem;
}
.library-hero .oou-wrap {
  position: relative;
}
.library-hero__star {
  position: absolute;
  width: 2.2rem;
  right: 8%;
  top: 2.5rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.filters .oou-chip {
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.filters .oou-chip[aria-pressed='true'] {
  background: var(--oou-teal-700);
  border-color: var(--oou-teal-700);
  color: var(--oou-white);
}
.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 40rem) {
  .shelf {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 64rem) {
  .shelf {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
  }
}
.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.book-card[hidden] {
  display: none;
}
.book-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 6px 16px 16px 6px;
  overflow: hidden;
  background: var(--oou-teal-100);
  box-shadow: 0 10px 24px rgba(12, 66, 68, 0.22), 0 2px 4px rgba(12, 66, 68, 0.15);
  transition: transform var(--oou-dur) var(--oou-ease), box-shadow var(--oou-dur) var(--oou-ease);
}
/* The spine of the book. */
.book-card__cover::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.7rem;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.18) 55%, rgba(0, 0, 0, 0));
}
.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-card:hover .book-card__cover,
.book-card:focus-within .book-card__cover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 18px 34px rgba(12, 66, 68, 0.28), 0 2px 4px rgba(12, 66, 68, 0.15);
}
.book-card__body {
  padding: 0.9rem 0.25rem 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--oou-text-muted);
}
.book-card h2 {
  font-size: 1.2rem;
  line-height: 1.25;
}
.book-card h2 a {
  color: var(--oou-teal-900);
  text-decoration: none;
}
/* The whole card is one link, through the title. */
.book-card h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
}
.book-card:hover h2 a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.book-card__text {
  margin-top: 0.4rem;
  color: var(--oou-text-muted);
  font-size: 0.975rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card__more {
  margin-top: auto;
  padding-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--oou-primary);
  font-family: var(--oou-font-display);
  font-weight: 600;
}
.book-card__more svg {
  width: 1.1rem;
  height: 1.1rem;
}

.mood {
  display: inline-block;
  padding: 0.05rem 0.65rem;
  border-radius: var(--oou-radius-pill);
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--oou-teal-900);
}
.mood--calm {
  background: var(--oou-teal-100);
}
.mood--funny {
  background: var(--oou-coral-100);
}
.mood--adventurous {
  background: var(--oou-sun-100);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--oou-radius);
  background: var(--oou-sky-100);
}
.empty-state .oou-star {
  width: 3rem;
  margin: 0 auto 1rem;
}

/* ---------- A story ---------- */
.story {
  --story-size: 1.2rem;
  padding-bottom: 2rem;
  transition: background-color 0.4s var(--oou-ease), color 0.4s var(--oou-ease);
}
.story[data-size='1'] {
  --story-size: 1.0625rem;
}
.story[data-size='3'] {
  --story-size: 1.5rem;
}
.story[data-size='4'] {
  --story-size: 1.8rem;
}
.story-hero {
  padding: 1.5rem 0 1rem;
}
.story-hero__wrap {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}
@media (min-width: 64rem) {
  .story-hero__wrap {
    grid-template-columns: 1fr 1.15fr;
    gap: 3rem;
  }
}
.story-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.5rem 0 1rem;
}
.story-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 0;
}
.story-hero .oou-lead {
  margin-bottom: 0.75rem;
}
.story-hero__actions {
  margin-top: 1.25rem;
}
.story-hero__actions [hidden] {
  display: none;
}
.story-hero__art {
  margin: 0;
}
.story-hero__art img {
  width: 100%;
  height: auto;
  border-radius: var(--oou-radius);
  box-shadow: var(--oou-shadow-lg);
}
.story-synopsis {
  max-width: 46rem;
  padding-block: 1.5rem 0.5rem;
  color: var(--oou-text-muted);
}
.theme-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
}

.reader-bar {
  position: fixed;
  left: 50%;
  bottom: 0.9rem;
  z-index: 45;
  transform: translate(-50%, 6rem);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100vw - 1.25rem);
  padding: 0.4rem 0.5rem;
  border-radius: var(--oou-radius-pill);
  background: var(--oou-white);
  border: 2px solid var(--oou-line);
  box-shadow: var(--oou-shadow-lg);
  transition: transform 0.35s var(--oou-ease-bounce), opacity 0.25s;
}
.reader-bar[hidden] {
  display: none;
}
.reader-bar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.reader-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: var(--oou-radius-pill);
  background: transparent;
  color: var(--oou-teal-900);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.reader-bar button:hover {
  background: var(--oou-teal-100);
}
.reader-bar button[disabled] {
  opacity: 0.35;
  cursor: default;
}
.reader-bar svg {
  width: 1.3rem;
  height: 1.3rem;
}
.reader-bar button span {
  display: none;
}
@media (min-width: 52rem) {
  .reader-bar button span {
    display: inline;
  }
}
.reader-bar__page {
  min-width: 5.5rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--oou-teal-900);
}
.reader-bar__sep {
  width: 2px;
  align-self: stretch;
  margin: 0.4rem 0.15rem;
  background: var(--oou-line);
}

.book {
  padding-bottom: 5rem;
}
.spread {
  max-width: 72rem;
  margin: 0 auto 3.5rem;
  padding: 0 1.25rem;
  scroll-margin-top: 5rem;
}
.spread[hidden] {
  display: none;
}
@media (min-width: 64rem) {
  .spread {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: 2.25rem;
    align-items: center;
  }
}
.spread__art {
  margin: 0;
}
.spread__art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--oou-radius);
  box-shadow: var(--oou-shadow);
  background: var(--oou-teal-100);
}
.spread__text {
  max-width: 40rem;
  margin: 1.25rem auto 0;
}
@media (min-width: 64rem) {
  .spread__text {
    margin: 0;
  }
}
.spread__no {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--oou-text-muted);
}
.spread__text h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin-bottom: 0.9rem;
}
.spread__body {
  font-size: var(--story-size);
  line-height: 1.75;
}
.spread__body p {
  margin: 0 0 1.1em;
}
.pause {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--oou-radius-sm);
  background: var(--oou-sun-100);
  border-left: 6px solid var(--oou-sun-400);
  color: var(--oou-teal-900);
}
.pause svg {
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--oou-teal-700);
  animation: none;
}
.pause p {
  margin: 0.15rem 0 0;
}
.book--paged .spread.is-turning {
  animation: page-in 0.4s var(--oou-ease);
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}

.story-end {
  max-width: 46rem;
  text-align: center;
}
.story-end__title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin-bottom: 1.5rem;
}
.story-end__card {
  text-align: left;
  border-radius: var(--oou-radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  color: var(--oou-ink);
}
.story-end__card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.story-end__card p {
  margin: 0;
  font-size: 1.1rem;
}
.story-end__card ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 1.1rem;
}
.story-end__card li + li {
  margin-top: 0.4rem;
}
.story-end__nav {
  justify-content: center;
  margin-top: 1.5rem;
}
.story-credits {
  margin-top: 2rem;
}

/* Night mode: warm, dim, easy on tired eyes. */
.story--night {
  background: #10262a;
  color: #e8f3f2;
}
.story--night h1,
.story--night h2,
.story--night h3 {
  color: #fdf8ec;
}
.story--night .oou-lead,
.story--night .oou-muted,
.story--night .spread__no,
.story--night .story-synopsis,
.story--night a:not(.oou-btn) {
  color: #b9d3d1;
}
.story--night .spread__art img,
.story--night .story-hero__art img {
  filter: brightness(0.88) saturate(0.95);
  box-shadow: none;
}
.story--night .pause {
  background: #1b3b40;
  border-left-color: var(--oou-sun-400);
  color: #fdf8ec;
}
.story--night .pause svg {
  color: var(--oou-sun-400);
}
.story--night .oou-btn--ghost {
  color: #fdf8ec;
  border-color: #7fb0ad;
}
.story--night .oou-btn--ghost:hover {
  background: #1b3b40;
  color: #fdf8ec;
}
.story--night .oou-pill--outline {
  color: #fdf8ec;
  box-shadow: inset 0 0 0 2px #fdf8ec;
}

.about {
  max-width: 46rem;
  padding-block: 2rem 1rem;
}
.about h1 {
  margin-bottom: 1rem;
}
.about h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.6rem;
}
.about p {
  margin-bottom: 0.9rem;
}
.about__links {
  margin-top: 2rem;
}
.not-found {
  padding-block: 3rem;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0;
  padding: 0;
  font-size: var(--oou-text-sm);
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
  text-decoration: none;
}

@media print {
  .site-header,
  .site-footer,
  .reader-bar,
  .story-hero__actions,
  .filters,
  .breadcrumb,
  .story-end__nav,
  .pause svg {
    display: none !important;
  }
  .story,
  .story--night {
    background: #fff;
    color: #000;
  }
  .book--paged .spread[hidden] {
    display: block !important;
  }
  .spread {
    display: block;
    break-after: page;
    page-break-after: always;
    margin: 0;
    padding: 0;
  }
  .spread__art img {
    max-height: 48vh;
    width: auto;
    margin: 0 auto;
    box-shadow: none;
    filter: none;
  }
  .spread__body {
    font-size: 13.5pt;
  }
}
