:is(.catalog-book-page, .release-identity) {
  --book-cover-accent: #557060;
  --book-cover-wash: #eef1e7;
}
[data-cover-theme="terracotta"] {
  --book-cover-accent: #a44835;
  --book-cover-wash: #f4e8dc;
}
[data-cover-theme="blue"] {
  --book-cover-accent: #26677d;
  --book-cover-wash: #e6f0ef;
}
[data-cover-theme="plum"] {
  --book-cover-accent: #714163;
  --book-cover-wash: #f1e8ed;
}
.book-cover-stage {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
}
.book-cover-stage[hidden],
.book-cover-stage:has(.book-cover[hidden]) { display: none; }
.catalog-book-page .book-cover-stage #catalog-book-cover,
.release-identity .ed-page .book-cover-stage .book-cover {
  display: block;
  width: min(100%, 226px);
  height: auto;
  max-height: 350px;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
  background: transparent;
  border-radius: 0;
}
.catalog-book-page .catalog-book-intro:has(.book-cover-stage:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
}
.catalog-book-page .catalog-book-actions { gap: .5rem .6rem; }
.catalog-book-page #catalog-book-search,
.release-identity .ed-page .kb-cover-actions .library-search-primary {
  color: #fff;
  border-color: #253c32;
  background: #253c32;
}
:is(.catalog-book-page, .release-identity) .book-sample {
  border-inline-start: 3px solid var(--book-cover-accent);
  background: var(--book-cover-wash);
}
.release-identity .ed-page .book-cover-box:has(.book-cover-stage) {
  width: 100%;
  max-width: none;
}
.release-identity .ed-page .kb-cover-actions {
  width: min(100%, 15rem);
  margin: 10px auto 0;
}
@media (max-width: 700px) {

  .catalog-book-page .book-cover-stage #catalog-book-cover,
  .release-identity .ed-page .book-cover-stage .book-cover {
    width: min(63vw, 194px);
    max-height: 295px;
  }
  .release-identity .ed-page .kb-cover-actions { width: auto; justify-content: center; }
  .release-identity .ed-page .kb-cover-actions .library-search-primary { padding-inline: 14px; }
}

@media (max-width: 899px) {
  .release-identity .ed-page .book-layout:has(.book-cover:not([hidden])) {
    grid-template-columns: minmax(0, min(42%, 156px)) minmax(0, 1fr);
    column-gap: clamp(10px, 3vw, 20px);
  }
  .release-identity .ed-page .book-layout .book-cover-stage {
    grid-area: 1 / 1;
    align-self: center;
    margin: 14px 0 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  .release-identity .ed-page .book-layout .book-cover-stage .book-cover:not([hidden]) {
    grid-area: auto;
    width: 100%;
    max-height: 205px;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
  }
  .release-identity .ed-page .book-layout:has(.book-cover:not([hidden])) .ed-book-identity {
    grid-area: 1 / 2;
    padding: 14px 12px 0 0;
  }
  .release-identity .ed-page .book-layout:has(.book-cover:not([hidden])) .kb-cover-actions {
    grid-area: 2 / 1 / 3 / -1;
    width: min(calc(100% - 24px), 17rem);
    margin: 10px auto 12px;
    justify-content: stretch;
  }
  .release-identity .ed-page .book-layout .kb-cover-actions .library-search-primary {
    width: fit-content;
    justify-self: center;
    padding-inline: 13px;
    font-size: .84rem;
  }
  .release-identity .ed-page .book-layout [data-ed-reader-home] {
    grid-row: 3;
    margin-top: 10px;
  }
}

.catalog-book-page .catalog-book-trail {
  margin-bottom: .8rem;
  overflow-wrap: anywhere;
}
.catalog-book-page .catalog-book-hero:has(.book-cover-stage:not([hidden])) {
  border: 0;
  background: transparent;
}
.catalog-book-page #catalog-book-stage {
  padding: 0;
  border: 0;
  background: none;
}
.catalog-book-page #catalog-book-isbn {
  color: #385647;
  font: 500 .78rem/1.4 ui-monospace, monospace;
}
.catalog-book-page .catalog-book-actions { justify-content: center; }
.catalog-book-page #catalog-book-search { width: fit-content; padding-inline: .72rem; font-size: .82rem; }
@media (max-width: 899px) {
  .catalog-book-page .catalog-book-intro:has(.book-cover-stage:not([hidden])) {
    grid-template-columns: minmax(0, min(42%, 156px)) minmax(0, 1fr);
    gap: clamp(10px, 3vw, 19px);
  }
  .catalog-book-page .book-cover-stage #catalog-book-cover {
    width: 100%;
    max-height: 225px;
  }
  .catalog-book-page .catalog-book-identity h1 {
    font-size: clamp(1.27rem, 5.35vw, 2.1rem);
  }
  .catalog-book-page .catalog-book-identity p { margin-top: .32rem; }
}

.release-identity .ed-page .kb-cover-actions .kb-sample-jump {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:7px 12px;
  border:1px solid #cddbd0;
  border-radius:8px;
  background:#e9f1eb;
  color:#205648;
  font:650 .84rem/1.2 system-ui,sans-serif;
  text-align:center;
  text-decoration:none;
}
.release-identity .ed-page .kb-cover-actions .kb-sample-jump:hover {text-decoration:underline}
@media (max-width:899px) {
  .release-identity .ed-page .book-layout:has(.book-cover:not([hidden])) .kb-cover-actions:has(.kb-sample-jump) {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    width:calc(100% - 24px);
  }
}
