/* Library pages: /books, /books/<slug>, /read/<language>. Loaded after site.css; the homepage doesn't use it. */

/* ---------- Breadcrumb ---------- */
.crumbs { padding-top: 20px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font: 500 13px/1.4 var(--sans); color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink-3); }

.count { font: 600 13px/1 var(--sans); color: var(--ink-3); vertical-align: middle; margin-left: 4px; }
.kicker + .display, .kicker + .book__title { margin-top: 16px; }

/* ---------- Covers ---------- */
.cover { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--paper-2); box-shadow: var(--shadow); }
.cover--blank {
  display: flex; align-items: flex-end; padding: 12% 10%;
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%); color: var(--on-blue);
  font: italic 450 clamp(15px, 1.4vw, 19px)/1.15 var(--serif); text-wrap: balance; overflow: hidden;
  border-left: 6px solid var(--orange);
}
.cover--blank span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Book page ---------- */
.book__hero { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 72px); }
.book__cover .cover--blank { font-size: clamp(18px, 2vw, 24px); }
.book__title { font-weight: 450; font-size: clamp(34px, 4.2vw, 60px); line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; font-variation-settings: "opsz" 60; }
.book__title cite { font-style: normal; }
.book__title em { display: block; margin-top: .12em; font-style: italic; font-weight: 400; font-size: .62em; color: var(--accent-text); }
.book__alt { margin-top: 14px; color: var(--ink-2); }
.book__by { margin-top: 10px; font: 500 15px/1.4 var(--sans); color: var(--ink-2); }
.book__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.hero__note { font: 500 13px/1.4 var(--sans); color: var(--ink-3); }

.book__body { padding-bottom: clamp(64px, 8vw, 112px); }
.book__section { padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
.book__h2 { font-weight: 450; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -.015em; margin-bottom: 22px; text-wrap: balance; }
.book__h2 a { text-decoration: none; }
.book__h2 a:hover { color: var(--accent-text); }
.book__h2 cite { font-style: italic; }

.prose { max-width: 40em; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1em; }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }
.book__hook { font-weight: 500; font-size: 1.12em; line-height: 1.4; }
.ticks li { position: relative; padding-left: 24px; margin-top: 6px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

.facts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 28px; max-width: 52em; margin-top: 32px; }
.facts-list div { padding: 12px 0; border-top: 1px solid var(--line); }
.facts-list dt { font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.facts-list dd { margin: 0; }
.facts-list a { color: var(--accent-text); text-underline-offset: 3px; }

.excerpt { max-width: 40em; }
.excerpt blockquote { margin: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--orange); font-size: 1.08em; font-style: italic; }
.excerpt blockquote p + p { margin-top: .8em; }
.excerpt figcaption { margin-top: 14px; font: 500 13px/1.5 var(--sans); color: var(--ink-3); }
.excerpt figcaption cite { font-style: italic; font-family: var(--serif); font-size: 15px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 22px; }
.card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.card .cover { margin-bottom: 10px; transition: transform .25s var(--ease); }
.card:hover .cover { transform: translateY(-3px); }
.card__title { font-weight: 500; line-height: 1.2; font-size: 17px; }
.card:hover .card__title { color: var(--accent-text); }
.card__meta { font: 500 12px/1.4 var(--sans); color: var(--ink-3); }
.more { margin-top: 26px; font: 600 14px/1 var(--sans); }
.more a { color: var(--accent-text); text-decoration: none; }

/* ---------- Hubs and index ---------- */
.hub__hero { padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 5vw, 56px); }
.hub__hero .display { font-size: clamp(40px, 4.6vw, 70px); }
.hub__hero .lede { max-width: 38em; }
.hub__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.hub__jump { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { padding: 10px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font: 500 14px/1 var(--sans); text-decoration: none; color: var(--ink); }
.chip-link:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hub { padding-bottom: clamp(64px, 8vw, 112px); }
.hub__guide, .hub__level, .hub__faq, .lib__lang { padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.cards--hub { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }

.qa { max-width: 44em; }
.qa details { border-top: 1px solid var(--line); }
.qa details:last-child { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 500; font-size: 1.08em; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2); transform: translateY(-3px) rotate(45deg); transition: transform .3s var(--ease); }
.qa details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.qa details p { padding: 0 0 22px; color: var(--ink-2); }

.hubcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 14px; padding-bottom: clamp(36px, 5vw, 56px); }
.hubcard { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; transition: transform .25s var(--ease); }
.hubcard:hover { transform: translateY(-3px); }
.hubcard__lang { font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--orange-ink); }
.hubcard__title { font-size: 28px; line-height: 1.1; }
.hubcard__meta { font: 500 13px/1.4 var(--sans); color: var(--ink-3); }
.lib__levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 40px; }
.titles li { padding: 6px 0; border-bottom: 1px solid var(--line); line-height: 1.3; }
.titles a { text-decoration: none; font-weight: 500; }
.titles a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.titles span { display: block; font: 500 12px/1.4 var(--sans); color: var(--ink-3); }

@media (max-width: 640px) {
  .book__hero { grid-template-columns: 1fr; }
  .book__cover { width: min(56vw, 220px); }
  .cards, .cards--hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
}
