/* Library-only presentation. Preserve the shared frame and other catalogues. */
.library-title-card{display:flex;flex-direction:column;justify-content:space-between;gap:18px;box-sizing:border-box;width:100%;min-height:270px;height:100%;padding:24px 18px;border:1px solid #bfae89;border-inline-start:6px solid #286d6b;background:#fffcf4;color:#25344a;text-align:start;overflow-wrap:anywhere}
.library-title-card strong{font-size:20px;line-height:1.6;font-weight:700}
.library-title-card strong{margin-block:auto}
.library-title-category{color:#286d6b;font-size:12px;line-height:1.6}
.library-title-publisher{font-size:12px;line-height:1.6;color:#62645e}
@media(max-width:700px){.library-title-card{min-height:235px;padding:16px 11px;gap:12px}.library-title-card strong{font-size:15px;line-height:1.55}.library-title-category,.library-title-publisher{font-size:11px}}
.portal[lang] #workspace .library-page .library-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;grid-auto-rows:auto;align-items:stretch}
.portal[lang] #workspace .library-page .book-card{display:flex;flex-direction:column;gap:0;padding:0;min-width:0;height:100%;background:#fffdf8;border:1px solid #ded5c5;border-radius:12px;overflow:hidden;box-shadow:0 3px 12px #25344a08;transition:border-color .2s,box-shadow .2s}
.portal[lang] #workspace .library-page .book-card:hover{border-color:#a88c52;box-shadow:0 6px 20px #25344a12;transform:none}
.portal[lang] #workspace .library-page .book-card[data-featured]{border-color:#a88c52}
.portal[lang] #workspace .library-page .library-cover{display:flex;align-items:center;justify-content:center;aspect-ratio:4/5;padding:20px;background:#f0ece3;box-sizing:border-box;min-width:0}
.portal[lang] #workspace .library-page .library-cover img{display:block;width:100%;height:100%;max-height:290px;object-fit:contain;filter:drop-shadow(0 4px 5px #26334425);border-radius:0;background:transparent}
.portal[lang] #workspace .library-page .book-details{display:flex;flex-direction:column;gap:9px;padding:18px;flex:1;min-width:0}
.portal[lang] #workspace .library-page .book-type{color:#71603e;font-size:12px;font-weight:700;letter-spacing:0;min-height:18px}
.portal[lang] #workspace .library-page .book-details h2{font-size:17px;line-height:1.5;margin:0;word-break:normal;overflow-wrap:anywhere}
.portal[lang] #workspace .library-page .book-details .book-publisher{font-size:12px;line-height:1.6;color:#68665f;margin:0}
.portal[lang] #workspace .library-page .library-card-action{margin-top:auto;padding-top:13px;border-top:1px solid #e9e2d6;color:#246e6c;font-size:14px;font-weight:700;display:flex;justify-content:space-between;gap:8px}
.portal[lang] #workspace .library-page .library-credit{font-size:13px;line-height:1.8;margin:26px 0;color:#68665f}
.portal[lang] #workspace .library-page .library-empty{grid-column:1/-1;padding:30px;text-align:center;border:1px dashed #cabc9f;border-radius:10px}
.portal[lang] #workspace .library-book-detail{max-width:1080px;margin:8px auto 48px;line-height:1.8}
.portal[lang] #workspace .library-book-detail .library-back{display:inline-block;margin-bottom:28px;color:#246e6c;font-weight:700;text-decoration:underline;text-underline-offset:4px}
.portal[lang] #workspace .library-book-detail .library-book-layout{display:grid;grid-template-columns:minmax(220px,340px) minmax(0,1fr);gap:48px;align-items:start}
.portal[lang] #workspace .library-book-detail .library-detail-cover{background:#f0ece3;padding:24px;border:1px solid #ded5c5;border-radius:12px}
.portal[lang] #workspace .library-book-detail .library-detail-cover img{display:block;width:100%;height:auto;max-height:490px;object-fit:contain;filter:drop-shadow(0 6px 8px #26334425)}
.portal[lang] #workspace .library-book-detail h1{font-size:clamp(26px,3vw,38px);line-height:1.3;margin:8px 0 16px;overflow-wrap:anywhere;color:#25344a}
.portal[lang] #workspace .library-book-detail .library-subtitle{font-size:17px;color:#68665f;line-height:1.6}
.portal[lang] #workspace .library-book-detail .library-book-facts{display:flex;flex-wrap:wrap;gap:18px 30px;padding:20px 0;margin:16px 0 24px;border-block:1px solid #ded5c5}
.portal[lang] #workspace .library-book-detail .library-book-facts div{min-width:75px;max-width:100%}
.portal[lang] #workspace .library-book-detail dt{font-size:12px;color:#68665f}
.portal[lang] #workspace .library-book-detail dd{margin:4px 0 0;font-weight:700;overflow-wrap:anywhere}
.portal[lang] #workspace .library-book-detail h2{font-size:20px;margin:0 0 10px}
.portal[lang] #workspace .library-book-detail .library-book-description p{font-size:17px;line-height:1.9;margin:0}
.portal[lang] #workspace .library-book-detail .library-book-actions{display:flex;flex-wrap:wrap;gap:12px;margin:26px 0}
.portal[lang] #workspace .library-book-detail .library-book-actions a{min-height:46px;white-space:normal;text-align:center}
.portal[lang] #workspace .library-book-detail .library-rights{font-size:13px;color:#68665f;border-top:1px solid #ded5c5;padding-top:16px;line-height:1.8}
.portal[lang] #workspace .library-book-detail .library-rights p{margin:0 0 8px}
.portal[lang] #workspace .library-book-detail .library-rights a{color:#246e6c;text-decoration:underline}
@media(max-width:1099px){.portal[lang] #workspace .library-page .library-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.portal[lang] #workspace .library-book-detail .library-book-layout{gap:28px;grid-template-columns:minmax(190px,280px) minmax(0,1fr)}}
@media(max-width:700px){.portal[lang] #workspace .library-page .library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.portal[lang] #workspace .library-page .library-cover{padding:14px;aspect-ratio:3/4}.portal[lang] #workspace .library-page .book-details{padding:12px;gap:7px}.portal[lang] #workspace .library-page .book-details h2{font-size:14px;line-height:1.5}.portal[lang] #workspace .library-page .book-details .book-publisher{font-size:11px}.portal[lang] #workspace .library-page .book-type{font-size:10px}.portal[lang] #workspace .library-page .library-card-action{font-size:12px;padding-top:10px}.portal[lang] #workspace .library-book-detail .library-book-layout{grid-template-columns:minmax(0,1fr);gap:26px}.portal[lang] #workspace .library-book-detail .library-detail-cover{width:min(100%,280px);box-sizing:border-box;margin:auto}.portal[lang] #workspace .library-book-detail .library-book-actions a{flex:1}.portal[lang] #workspace .library-book-detail .library-back{margin-bottom:20px}}
@media(max-width:340px){.portal[lang] #workspace .library-page .library-grid{grid-template-columns:minmax(0,1fr)}.portal[lang] #workspace .library-page .library-cover{height:270px;aspect-ratio:auto}}
@media(prefers-reduced-motion:reduce){.portal[lang] #workspace .library-page .book-card{transition:none}}

/* Compact cover-only cards; descriptive text stays on the detail page. */
.portal[lang] #workspace .library-page .book-details{flex:none;padding:0 14px;gap:0}
.portal[lang] #workspace .library-page .book-details>.card-destination-link{display:block;text-decoration:none}
.portal[lang] #workspace .library-page .library-card-action{min-height:48px;align-items:center;margin:0;padding:0;border-top:0;font-size:14px}
.portal[lang] #workspace .library-page .library-cover{flex:1;aspect-ratio:auto;min-height:310px}
.portal[lang] #workspace .library-page .library-cover img{height:290px}
.portal[lang] #workspace .library-page .book-details{margin-top:auto}
@media(max-width:700px){.portal[lang] #workspace .library-page .library-cover{min-height:270px;padding:12px}.portal[lang] #workspace .library-page .library-cover img{height:246px}.library-title-card{padding:14px 10px}}

/* The same metadata rows and copyright section for every publication. */
.portal[lang] #workspace .library-book-detail .library-book-facts{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.portal[lang] #workspace .library-book-detail .library-book-facts>div{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,3fr);gap:16px;align-items:baseline}
.portal[lang] #workspace .library-book-detail .library-book-facts dd{margin:0;font-size:16px;line-height:1.7}
.portal[lang] #workspace .library-book-detail .library-rights h2{font-size:16px;margin:0 0 10px}
@media(max-width:700px){.portal[lang] #workspace .library-book-detail .library-book-facts>div{grid-template-columns:minmax(0,1fr);gap:4px}}

/* Keep the library heading and filters close to the books. */
.portal[lang]:not([data-page=home]) #workspace .library-page .library-head{display:block;margin:0 0 10px;padding:0;max-width:none}
.portal[lang]:not([data-page=home]) #workspace .library-page .library-head h1{margin:0;font-size:26px;line-height:1.4}
.portal[lang] #workspace .library-page .library-controls{margin:0 0 14px;gap:10px 16px}
.portal[lang] #workspace .library-page .library-controls label{margin:0 0 4px}
.portal[lang] #workspace .library-page .voice-search-status{margin:2px 0 0;font-size:11px;line-height:1.4}
@media(max-width:600px){.portal[lang]:not([data-page=home]) #workspace .library-page .library-head h1{font-size:23px}.portal[lang] #workspace .library-page .library-controls{gap:8px;margin-bottom:12px}}

.book-edition-language{display:block;color:var(--teal,#286d6b);font-size:13px;margin-block-end:6px}.library-editions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-block:14px 22px}.library-editions>span{flex-basis:100%;font-weight:600}.library-editions a{padding:7px 11px;border:1px solid #b6c8c5;border-radius:6px;line-height:1.8}.library-editions a[aria-current="page"]{background:#286d6b;color:white}.library-editions a:focus-visible{outline:2px solid currentColor;outline-offset:3px}

.portal[lang] #workspace .library-page .library-grid{grid-template-columns:repeat(calc(var(--balanced-columns) * 2),minmax(0,1fr))}
@media(min-width:701px) and (max-width:1099px){
 .portal[lang] #workspace .library-page .library-grid{--balanced-columns:3}
 .portal[lang] #workspace .library-page .library-grid>:nth-child(n){grid-column-start:auto}
 .portal[lang] #workspace .library-page .library-grid>:nth-child(3n+1):nth-last-child(1){grid-column-start:3}
 .portal[lang] #workspace .library-page .library-grid>:nth-child(3n+1):nth-last-child(2){grid-column-start:2}
}
@media(min-width:341px) and (max-width:600px){
 .portal[lang] #workspace .library-page .library-grid{--balanced-columns:2}
 .portal[lang] #workspace .library-page .library-grid>:nth-child(2n+1):last-child{grid-column-start:2}
}
