/* Books and Projects. The original theme owns typography, page width, and navigation. */
.yw-page { --yw-rule: #111; --yw-cover-height: 180px; }
.yw-page .yw-header { padding: 1.5rem; border: 1px solid var(--yw-rule); margin: 0 0 2.5rem; }
.yw-page .yw-header .page-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .75rem; }
.yw-page .yw-intro { font-size: max(16px, .9rem); line-height: 1.55; margin: 0; max-width: 52ch; }
.yw-page .yw-jumps { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 1rem 0 0; margin: 1.25rem 0 0; border-top: 1px solid var(--yw-rule); font-size: max(16px, .9rem); line-height: 1.5; }
.yw-page .yw-jumps a { text-decoration: underline; text-underline-offset: .12em; }
.yw-page .yw-section { margin: 0 0 2.5rem; scroll-margin-top: 5rem; }
.yw-page .yw-section:last-child { margin-bottom: 0; }
.yw-page .yw-section-heading { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin: 0 0 1rem; }
.yw-page .yw-section-intro { font-size: max(16px, .9rem); line-height: 1.55; margin: -.25rem 0 1.25rem; }
.yw-page a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.yw-book-grid .book-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 0; }
.yw-book-grid .book-item { display: flex; flex-direction: column; align-items: stretch; gap: 1.25rem; min-width: 0; margin: 0; padding: 1.25rem; border: 1px solid var(--yw-rule); }
.yw-book-grid .book-item:first-child { border-top: 1px solid var(--yw-rule); }
.yw-book-grid .book-cover { display: block; flex: none; align-self: center; width: max-content; max-width: 100%; height: var(--yw-cover-height); padding: 0; margin: 0 auto; }
.yw-book-grid .book-cover:not(.book-cover-front) img { display: block; width: auto; height: var(--yw-cover-height); max-width: 180px; margin: 0; border: 0; }
.yw-book-grid .book-cover:not(.book-cover-front) img:not(.book-cover-crop) { object-fit: contain; }
.yw-book-grid .book-cover img.book-cover-crop { width: calc(var(--yw-cover-height) * 942 / 1417); }
/* Size the existing cover windows; their source-image offsets stay in books/styles. */
.yw-book-grid .book-cover-front--creative { width: calc(var(--yw-cover-height) * 715 / 1010); }
.yw-book-grid .book-cover-front--anthology { width: calc(var(--yw-cover-height) * 188 / 372); }
.yw-book-grid .book-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.yw-book-grid .book-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin: 0 0 .5rem; }
.yw-book-grid .book-title a { text-decoration: underline; text-underline-offset: .12em; }
.yw-book-grid .book-title a:hover { text-decoration: none; }
.yw-book-grid .book-byline { color: #666; font-size: max(16px, .9rem); line-height: 1.5; margin: 0; }
.yw-book-grid .book-desc { color: inherit; font-size: max(16px, .9rem); line-height: 1.55; margin: 1rem 0; }
.yw-book-grid .book-desc:last-child { margin-bottom: 0; }
.yw-book-grid .book-buy { display: inline-block; align-self: flex-start; font-size: max(16px, .9rem); line-height: 1.5; letter-spacing: 0; text-transform: none; text-decoration: none; color: #111; background: #fff; border: 1px solid var(--yw-rule); padding: .35rem .7rem; margin-top: auto; }
.yw-book-grid .book-buy:hover { color: #fff; background: #111; }
.yw-book-grid .book-links { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: auto; }
.yw-book-grid .book-links .book-buy { margin-top: 0; }
.yw-book-grid .book-about { font-size: max(16px, .9rem); line-height: 1.5; text-decoration: underline; text-underline-offset: .12em; }

.yw-library #yb-books .book-item:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr); gap: 1.5rem; align-items: center; }
.yw-library #yb-books .book-item:first-child .book-title { font-size: 1.5rem; letter-spacing: -.015em; line-height: 1.2; }

@media (max-width: 600px) {
    .yw-page .yw-header { padding: 1.25rem; margin-bottom: 2rem; }
    .yw-page .yw-jumps { gap: .5rem 1.25rem; }
    .yw-book-grid .book-list { grid-template-columns: minmax(0, 1fr); }
    .yw-library #yb-books .book-item:first-child { display: flex; gap: 1.25rem; align-items: stretch; }
    .yw-library #yb-books .book-item:first-child .book-title { font-size: 1.25rem; }
}
