:root {
  --warm-white: #f7f3e9;
  --gray: #77746e;
  --sage-bg: #e5ebd9;
  --sage-ink: #354437;
  --sage-title: #304b38;
  --gold-muted: #b59a62;
}

html {
  scroll-behavior: auto;
  background: #ece8df;
}

body {
  background: #ece8df;
  color: #77746e;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.site-shell {
  max-width: 3600px;
  width: 100%;
  padding: 0 4.2%;
}

.site-header {
  height: 92px;
  border-bottom-color: #d7d2c8;
}

.main-nav a.active:after {
  background: #77746e;
}

.page-hero {
  min-height: 280px;
  display: grid;
  place-content: center;
  padding: 54px 0 32px;
}

.page-hero h1 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(3.6rem, 4.1vw, 4.2rem);
  line-height: 1.15;
  letter-spacing: .02em;
  color: #5f5d58;
  margin: 12px 0 18px;
}

.page-hero p {
  color: #77746e;
  font-size: 18.5px;
  letter-spacing: .04em;
}

.library-tools {
  max-width: 3600px;
  background: #f7f3e9;
  border: 1px solid #ddd7ca;
  border-radius: 2px;
  margin: 12px 0 54px;
  padding: 18px 22px;
}

.library-tools input,
.library-tools select {
  background: #fdfbf6;
  border-color: #d8d2c5;
  color: #77746e;
  height: 48px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
}

.library-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 28px;
  margin-bottom: 80px;
}

.library-card {
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  align-items: start;
  min-height: 420px;
  background: #f7f3e9;
  border: 1px solid #d8d3c8;
  border-radius: 2px;
  padding: 26px;
  transition: none;
}

.library-card:hover {
  border-color: #aaa58f;
}

.library-cover-link {
  display: block;
  width: 100%;
}

.book-cover,
.library-card .book-cover {
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 2 / 3;
  box-shadow: 9px 12px 22px rgba(73, 67, 57, .18);
  border-radius: 2px 4px 4px 2px;
}

.cover-title {
  white-space: normal;
  font-size: clamp(12px, .85vw, 16px);
  line-height: 1.35;
  bottom: 34px;
  left: 18px;
  right: 14px;
}

.cover-author {
  font-size: 10px;
  bottom: 10px;
}

.cover-glyph {
  font-size: 4.6rem;
}

.cover-category {
  font-size: 11px;
}

.library-info {
  min-width: 0;
}

.library-info h2 {
  color: #4f4e49;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 22px;
  line-height: 1.45;
  margin: 12px 0 8px;
}

.library-info > p,
.library-info .book-description,
.category-label,
.result-count,
.reading-status {
  color: #77746e;
}

.library-info .book-description {
  min-height: 72px;
  font-size: 14px;
  line-height: 1.95;
}

.category-label {
  letter-spacing: .12em;
  font-size: 12px;
}

.reading-status {
  background: #efebe1;
  border-color: #cfc8ba;
}

.library-card .text-link {
  color: #77746e;
  border-bottom-color: #aaa58f;
}

/* Reading room */
.reader-top {
  min-height: 86px;
  align-items: center;
  border-bottom: 1px solid #ddd7ca;
  padding: 0;
}

.reader-layout {
  display: block;
  min-height: 1100px;
  max-width: 3600px;
  margin: 0 auto;
  padding: 46px 0 70px;
}

.reader-aside,
.reader-heading,
.toc,
.reader-end,
.site-footer {
  display: none;
}

.reader-main {
  max-width: 3600px;
  width: 100%;
  min-height: 1000px;
  margin: 0;
  padding: 0;
  background: #f9f6ed;
  border: 1px solid #ddd6c8;
  box-shadow: 0 18px 50px rgba(73, 67, 57, .08);
}

.reading-content {
  --reader-size: 18.5px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
  min-height: 1000px;
  padding: 98px 7.5% 82px;
  gap: 0;
  color: #77746e;
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: var(--reader-size);
  line-height: 1.95;
  letter-spacing: .01em;
  background: transparent;
}

.reading-content:before {
  content: "";
  position: absolute;
  top: 70px;
  bottom: 58px;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, #bfb8a9 12%, #bfb8a9 88%, transparent);
}

.reader-page {
  min-width: 0;
  padding: 0 7.2%;
  align-content: start;
}

.reader-page:first-child {
  padding-left: 0;
}

.reader-page:last-child {
  padding-right: 0;
}

.reader-page h2,
.reader-page h3 {
  color: inherit;
  text-indent: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 500;
  margin: 0 0 42px;
}

.reader-page p {
  margin: 0 0 26px;
  text-indent: 2em;
  line-height: 1.95;
}

.reader-page-number {
  position: absolute;
  bottom: 22px;
  color: #77746e;
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: .08em;
}

.reader-page.left .reader-page-number {
  left: 7.5%;
}

.reader-page.right .reader-page-number {
  right: 7.5%;
}

.reader-pagination {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid #ddd7ca;
  background: #f7f3e9;
  color: #77746e;
}

.reader-pagination button {
  width: 46px;
  height: 46px;
  border: 1px solid #cbc5b7;
  background: transparent;
  color: inherit;
  font-family: Georgia, serif;
  font-size: 18px;
}

.reader-pagination button:disabled {
  opacity: .35;
  cursor: default;
}

.reader-pagination span {
  min-width: 150px;
  text-align: center;
  font-size: 13px;
  letter-spacing: .12em;
}

.reader-layout[data-theme="classic"] .reader-main {
  background: #e9ddc5;
  border-color: #d4c49e;
  color: #46382b;
}

.reader-layout[data-theme="classic"] .reading-content,
.reader-layout[data-theme="classic"] .reader-pagination {
  color: #46382b;
  background: #e9ddc5;
}

.reader-layout[data-theme="classic"] .reading-content:before {
  background: #b59a62;
  opacity: .8;
}

.reader-layout[data-theme="classic"] .reader-page h2,
.reader-layout[data-theme="classic"] .reader-page h3 {
  font-family: Georgia, "Noto Serif SC", serif;
  color: #46382b;
  border-bottom: 1px solid #b59a62;
  padding-bottom: 16px;
}

.reader-layout[data-theme="paper"] .reader-main,
.reader-layout[data-theme="paper"] .reading-content,
.reader-layout[data-theme="paper"] .reader-pagination {
  background: #f7f3e9;
  color: #39372f;
}

.reader-layout[data-theme="night"] .reader-main,
.reader-layout[data-theme="night"] .reading-content,
.reader-layout[data-theme="night"] .reader-pagination {
  background: #18251f;
  color: #d9d6c8;
  border-color: #314138;
}

.reader-layout[data-theme="night"] .reader-page h2,
.reader-layout[data-theme="night"] .reader-page h3 {
  color: #d2c18c;
}

.reader-layout[data-theme="night"] .reading-content:before {
  background: #536154;
}

.reader-layout[data-theme="immersive"] .reader-main,
.reader-layout[data-theme="immersive"] .reading-content,
.reader-layout[data-theme="immersive"] .reader-pagination {
  background: #fffefa;
  color: #3f3f3c;
  border-color: transparent;
  box-shadow: none;
}

.reader-layout[data-theme="immersive"] .reader-top {
  border: 0;
}

.reader-layout[data-theme="sage"] .reader-main,
.reader-layout[data-theme="sage"] .reading-content,
.reader-layout[data-theme="sage"] .reader-pagination {
  background: #e5ebd9;
  color: #354437;
  border-color: #ced7bf;
}

.reader-layout[data-theme="sage"] .reader-page h2,
.reader-layout[data-theme="sage"] .reader-page h3 {
  color: #304b38;
}

.reader-layout[data-theme="sage"] .reading-content:before {
  background: #b59a62;
  opacity: .55;
}

@media (max-width: 1800px) {
  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .library-card {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-layout {
    min-height: 800px;
  }
  .reading-content {
    min-height: 800px;
    padding: 64px 5%;
  }
}

@media (max-width: 760px) {
  .site-shell {
    padding: 0 4%;
  }
  .library-grid {
    grid-template-columns: 1fr;
  }
  .library-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .page-hero h1 {
    font-size: 3.2rem;
  }
  .reading-content {
    grid-template-columns: 1fr;
  }
  .reading-content:before {
    display: none;
  }
  .reader-page.right {
    display: none;
  }
  .reader-page.left {
    padding: 0;
  }
}
