/* Home */

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 6%;
  align-items: center;
  padding: 70px 0 90px;
}

.hero h1, .page-heading h1, .detail-copy h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -2.5px;
}

.hero h1 {
  font-size: clamp(52px, 5.4vw, 84px);
  line-height: 1.12;
  margin: 26px 0;
}

.hero h1 em { color: #77736b; }

.hero-lead {
  max-width: 460px;
  font-size: 16px;
  line-height: 1.85;
  color: #66635e;
}

.hero-actions {
  display: flex;
  gap: 25px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 35px;
}

.hero-small {
  font-size: 14px;
  color: var(--muted);
}

.hero-art {
  min-height: 400px;
  background: #e8e6df;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.hero-art::before {
  content: "";
  position: absolute;
  right: -130px;
  top: -210px;
  width: 450px;
  height: 450px;
  border: 1px solid #d5d2ca;
  border-radius: 50%;
}

.book-art {
  width: 225px;
  height: 310px;
  padding: 28px;
  background: #383c38;
  color: #f1eee6;
  transform: rotate(-7deg);
  box-shadow: 15px 17px 30px #3333;
  display: flex;
  flex-direction: column;
}

.book-art-mark {
  font: italic 35px var(--serif);
}

.book-art-rule {
  border-top: 1px solid #ffffff44;
  margin-top: 24px;
}

.book-art-title {
  font: 30px/1.1 var(--serif);
  margin-top: 30px;
}

.book-art-footer {
  margin-top: auto;
  font-size: 8px;
  letter-spacing: 2px;
}

.hero-art-caption {
  position: absolute;
  bottom: 15px;
  right: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* Books */

.section { padding: 45px 0 55px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font: 38px var(--serif);
  letter-spacing: -1px;
}

.book-carousel { position: relative; }

.book-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.book-row::-webkit-scrollbar { display: none; }

.book-row .book-card {
  flex: 0 0 auto;
  width: min-content;
}

.book-row .book-cover img {
  width: auto;
  height: 240px;
  max-width: none;
}

.book-carousel-arrow {
  position: absolute;
  top: 120px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px #19141122;
  font: 30px/1 var(--body-font);
}

.book-carousel-arrow[hidden] { display: none; }
.book-carousel-prev { left: 6px; }
.book-carousel-next { right: 6px; }
.book-carousel-arrow:hover { color: var(--brand-red); }

.book-more {
  display: grid;
  place-items: center;
  flex: 0 0 160px;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: 600 18px var(--serif);
}

.book-more:hover { border-color: var(--brand-red); color: var(--brand-red); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 20px;
}

.book-card { min-width: 0; }

.book-grid .book-cover {
  height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.book-grid .book-cover img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.book-cover img { border-radius: 8px; }

.book-card:hover .book-cover img {
  filter: brightness(.95);
}

.book-card h3 {
  font: 22px/1.25 var(--serif);
  margin: 8px 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-author {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-row .book-card h3,
.book-row .book-author { width: 0; min-width: 100%; }

.empty-state {
  text-align: center;
  padding: 70px 15px;
  border: 1px dashed #d6d2cb;
}

.empty-state h3 {
  font: 26px var(--serif);
  margin: 0;
}

.empty-state p {
  color: var(--muted);
  font-size: 16px;
}

.bottom-statement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 30px 0;
}

.bottom-statement p {
  font: 22px var(--serif);
  margin: 0;
}

.bottom-statement span {
  color: var(--muted);
  font-size: 15px;
}

/* Catalog */

.page-heading { padding: 55px 0 30px; }

.page-heading h1 {
  font-size: clamp(31px, 3.3vw, 43px);
  letter-spacing: -1.2px;
  margin: 0;
}

.page-heading p:last-child {
  font-size: 14px;
  color: var(--muted);
}

.period { color: #8f8c83; }

.catalog-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 48px;
}

.filter-panel {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-form label {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
}

.filter-form input, .filter-form select {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #d9d6d0;
  color: var(--ink);
  font-size: 16px;
  border-radius: 0;
}

.filter-form [hidden] { display: none !important; }
.catalog-picker { position: relative; }
.catalog-picker-options { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; max-height: 220px; overflow-y: auto; margin-top: 4px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 6px 18px #19141120; }
.catalog-picker-option { display: block; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; font: 16px var(--body-font); cursor: pointer; }
.catalog-picker-option:hover, .catalog-picker-option[aria-selected="true"] { background: #f1e6e4; }
.catalog-picker-empty { display: block; padding: 10px 12px; color: var(--muted); font-size: 15px; }
.filter-form input:disabled, .filter-form select:disabled { opacity: .6; cursor: not-allowed; }
.filter-search-status { color: var(--muted); font-size: 14px; }
.filter-search-status:empty { display: none; }
.filter-form .button { margin-top: 13px; }

.reset-link {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  text-decoration: underline;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  padding-bottom: 20px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
  color: #696660;
  font-size: 15px;
}

.results-summary { display: flex; flex-wrap: wrap; gap: 12px 24px; }

.catalog-sort { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.catalog-sort label { font-weight: 600; }
.catalog-sort select { max-width: 100%; padding: 10px 30px 10px 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 16px; }

.catalog-main .book-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-top: 35px;
  font-size: 15px;
}

.pagination a {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}

.pagination span { color: var(--muted); }

/* Reader */

.reader-top {
  border-bottom: 1px solid var(--line);
}

.reader-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  font-size: 15px;
}

.reader-mode {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}

.reader-container {
  width: min(730px, calc(100% - 48px));
  margin: auto;
  padding: 80px 0 95px;
}

.reader-head {
  margin-bottom: 60px;
  text-align: center;
}

.reader-head h1 {
  font: 48px var(--serif);
}

.reader-line {
  width: 45px;
  border-top: 1px solid #aca9a0;
  margin: 30px auto;
}

.reading-content {
  font: 20px/1.95 var(--body-font);
  overflow-wrap: anywhere;
}

.reading-content p { margin: 0 0 1.3em; }

.reading-content blockquote {
  margin-left: 0;
  padding-left: 24px;
  border-left: 2px solid #c8c4bc;
  color: #6e6b64;
}

.reading-content a { text-decoration: underline; }

.reading-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #ebe8e0;
  padding: 20px;
  font-size: 15px;
}

.reader-pagination {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding-top: 30px;
}

.reader-pagination a {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.reader-pagination small {
  color: var(--muted);
  font-size: 14px;
}

.reader-pagination span {
  font: 17px var(--serif);
}

/* Responsive */

@media(max-width: 950px) {
  .hero { gap: 3%; }

  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-layout {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 25px;
  }

  .catalog-main .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width: 650px) {
  .container { width: calc(100% - 36px); }
  .nav-bar { gap: 22px; min-height: 66px; }
  .wordmark { font-size: 21px; }
  .main-nav { gap: 15px; }
  .nav-note { display: none; }

  .hero { display: block; padding: 50px 0; }
  .hero h1 { font-size: 55px; }

  .hero-art {
    min-height: 300px;
    margin-top: 40px;
  }

  .book-art {
    transform: rotate(-6deg) scale(.8);
  }

  .book-grid, .catalog-main .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 27px 14px;
  }

  .book-grid .book-cover { height: 210px; }
  .book-row .book-cover img, .book-more { height: 210px; }
  .book-carousel-arrow { top: 105px; }
  .book-card h3 { font-size: 19px; }
  .catalog-layout { display: block; }
  .filter-panel { margin-bottom: 35px; }
  .page-heading { padding: 48px 0 30px; }

  .reader-container { padding-top: 45px; }
  .reading-content { font-size: 18px; }
  .reader-mode { display: none; }

  .bottom-statement, .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Platform layout and home */
.home-latest.container, .catalog-heading.container, .catalog-layout.container, .book-page.container, .library-page.container {
  width: min(1440px, calc(100% - 56px));
}

/* ==========================================
   HOME
   ========================================== */

.home-latest {
  padding-top: 55px;
  padding-bottom: 85px;
}

.home-shelf + .home-shelf {
  margin-top: 56px;
}

.home-heading {
  margin-bottom: 24px;
}

.home-heading h1,
.home-heading h2 {
  margin: 0;

  color: var(--brand-black);

  font-family: var(--serif);
  font-size: clamp(23px, 2.2vw, 30px);
  font-weight: 400;

  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Book cards */

.book-card:hover h3 {
  color: var(--brand-red);
}


@media (max-width: 800px) {
  .home-latest { padding-top: 40px; padding-bottom: 55px; }
}

@media (max-width: 650px) {
  .home-latest.container, .catalog-heading.container, .catalog-layout.container, .book-page.container, .library-page.container { width: calc(100% - 36px); }
}
