/* Library pages (/library/ and /ar/library/): a shelf of cards, one per work. */

.lib-nav { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 0 .4rem; max-width: 980px; margin: 0 auto; }
.lib-back { color: var(--sub); text-decoration: none; font-size: .78rem; font-weight: 600; transition: color .2s; }
.lib-back:hover { color: var(--btc); }
.lib-lang { color: var(--sub); text-decoration: none; font-size: .76rem; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 100px; padding: .34rem .9rem; background: var(--card); transition: color .2s, border-color .2s; }
.lib-lang:hover { color: var(--btc); border-color: var(--btc); }

.lib { max-width: 980px; margin: 0 auto; padding-bottom: 2.5rem; }
.lib-hero { padding: 1.8rem 0 1.2rem; }
.lib-kicker { display: inline-block; background: #faf3e3; border: 1px solid #ecdcb4; color: var(--gold); border-radius: 100px; padding: .3rem .95rem; font-size: .66rem; font-weight: 700; letter-spacing: .5px; margin-bottom: .9rem; }
.lib-hero h1 { font-family: var(--serif); font-size: 2.15rem; line-height: 1.2; color: var(--ink); margin: 0 0 .55rem; font-weight: 700; }
.lib-hero p { color: var(--sub); font-size: 1rem; line-height: 1.75; max-width: 620px; margin: 0; }

.lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 1rem; }
.bk { background: var(--card); border: 1px solid var(--line-strong); border-radius: 16px; padding: 1.1rem; display: grid; grid-template-columns: 118px 1fr; gap: 1rem; align-items: start; box-shadow: 0 1px 2px rgba(28, 31, 40, .04); }
.bk-body { min-width: 0; }
.bk h2 { font-family: var(--serif); font-size: 1.18rem; line-height: 1.3; margin: 0 0 .2rem; color: var(--ink); font-weight: 700; }
.bk-by { color: var(--sub); font-size: .8rem; line-height: 1.5; margin: 0 0 .5rem; }
.bk-d { color: var(--ink); font-size: .88rem; line-height: 1.7; margin: 0 0 .7rem; }
.bk-meta { color: var(--dim); font-size: .68rem; font-weight: 600; letter-spacing: .2px; margin-bottom: .7rem; }
.bk-tag { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--gold); background: #faf3e3; border: 1px solid #ecdcb4; border-radius: 100px; padding: .16rem .6rem; margin-bottom: .5rem; }

.bk-btns { display: flex; flex-wrap: wrap; gap: .45rem; }
.bk-btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--btc); color: #fff; text-decoration: none; font-weight: 700; font-size: .78rem; border-radius: 100px; padding: .5rem .95rem; white-space: nowrap; border: 1px solid var(--btc); transition: background .2s, border-color .2s, transform .15s; }
.bk-btn:hover { background: var(--btc-deep); border-color: var(--btc-deep); transform: translateY(-1px); }
.bk-btn small { font-weight: 500; opacity: .85; font-size: .68rem; }
.bk-btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.bk-btn.ghost:hover { background: var(--card); border-color: var(--btc); color: var(--btc-deep); }
.bk-btn.ext { background: var(--ink); border-color: var(--ink); }
.bk-btn.ext:hover { background: #000; border-color: #000; }
.bk-note { color: var(--sub); font-size: .74rem; line-height: 1.65; margin: .7rem 0 0; }
.bk-note a { color: var(--cy); text-decoration: none; }
.bk-note a:hover { text-decoration: underline; }

/* The typographic covers (.cover) live in /css/style.css: the dashboard shelf uses them too. */

.lib-foot { color: var(--dim); font-size: .72rem; line-height: 1.7; border-top: 1px solid var(--line-strong); margin-top: 2rem; padding-top: 1rem; }
.app-footer { color: var(--dim); font-size: .68rem; text-align: center; padding: 1rem 0 2rem; }
.app-footer a { color: inherit; }

/* Arabic */
[dir="rtl"] body, [dir="rtl"] .lib-hero p, [dir="rtl"] .bk-by, [dir="rtl"] .bk-d, [dir="rtl"] .bk-meta, [dir="rtl"] .bk-btn, [dir="rtl"] .bk-note, [dir="rtl"] .bk-tag, [dir="rtl"] .lib-kicker, [dir="rtl"] .lib-back, [dir="rtl"] .lib-foot, [dir="rtl"] .app-footer { font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, sans-serif; }
[dir="rtl"] .lib-hero h1, [dir="rtl"] .bk h2 { font-family: 'Amiri', 'IBM Plex Sans Arabic', serif; }
[dir="rtl"] .lib-hero h1 { font-size: 2.3rem; line-height: 1.4; }
[dir="rtl"] .bk h2 { font-size: 1.3rem; line-height: 1.45; }
[dir="rtl"] .bk-d { line-height: 1.85; }
[dir="rtl"] .bk-tag { text-transform: none; letter-spacing: 0; font-size: .66rem; }
[dir="rtl"] .lib-kicker { letter-spacing: 0; font-size: .72rem; }

@media (max-width: 760px) {
    body { padding: 0 1.1rem 2rem; }
    .lib-hero h1 { font-size: 1.7rem; }
    [dir="rtl"] .lib-hero h1 { font-size: 1.9rem; }
    .lib-grid { grid-template-columns: 1fr; }
    .bk { grid-template-columns: 96px 1fr; }
    .bk h2 { font-size: 1.06rem; }
    [dir="rtl"] .bk h2 { font-size: 1.18rem; }
}
