/*
 * library.css — Public-facing styles for the Nuvvel Library.
 *
 * All selectors live under `.library-page` to keep scope tight and prevent
 * leakage onto the rest of the site. BEM-style naming. No utility framework.
 */

/* ============================================================================
   Tokens (page-scoped — no globals leaked)
   ============================================================================ */
.library-page {
    --lib-bg: #ffffff;
    --lib-surface: #fafafa;
    --lib-surface-warm: #fbf9f6;
    --lib-border: #e6e2dc;
    --lib-border-soft: #efeae3;
    --lib-text: #1a1a1f;
    --lib-text-muted: #5a5a64;
    --lib-text-soft: #7c7c86;
    --lib-accent: #2f1f6e;
    --lib-accent-hover: #41318f;
    --lib-rule: #d8d3cc;
    --lib-disclosure-bg: #f5f1ea;
    --lib-disclosure-border: #d9d0c1;
    --lib-archived-bg: #fff4d8;
    --lib-archived-border: #e8c97a;
    --lib-corrections-bg: #fcf5f5;
    --lib-corrections-border: #d6a5a5;
    --lib-radius: 6px;
    --lib-radius-lg: 10px;
    --lib-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .04);
    --lib-font-serif: Georgia, 'Iowan Old Style', 'Source Serif Pro', Cambria, serif;
    --lib-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --lib-prose-max: 720px;

    color: var(--lib-text);
    font-family: var(--lib-font-sans);
    line-height: 1.6;
}

.library-page .library-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 24px 72px;
}

.library-page .library-main a {
    color: var(--lib-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.library-page .library-main a:hover {
    color: var(--lib-accent-hover);
}

.library-page .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================================
   Sub-nav
   ============================================================================ */
.library-page .library-sub-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 12px 0 20px;
    border-bottom: 1px solid var(--lib-border-soft);
    margin-bottom: 32px;
}
.library-page .library-sub-nav__link {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--lib-text-muted);
    letter-spacing: .01em;
}
.library-page .library-sub-nav__link:hover {
    color: var(--lib-accent);
}
.library-page .library-search-form {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.library-page .library-search-form input[type="search"] {
    border: 1px solid var(--lib-border);
    background: var(--lib-bg);
    border-radius: var(--lib-radius);
    padding: 7px 12px;
    font: inherit;
    color: var(--lib-text);
    min-width: 220px;
}
.library-page .library-search-form button {
    border: 1px solid var(--lib-accent);
    background: var(--lib-accent);
    color: #fff;
    padding: 7px 14px;
    border-radius: var(--lib-radius);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
}
.library-page .library-search-form button:hover {
    background: var(--lib-accent-hover);
    border-color: var(--lib-accent-hover);
}
.library-page .library-search-form--page {
    margin-left: 0;
    margin-top: 12px;
}
.library-page .library-search-form--page input[type="search"] {
    flex: 1;
    min-width: 0;
}

/* ============================================================================
   Hero (home page)
   ============================================================================ */
.library-page .library-hero {
    padding: 24px 0 36px;
    border-bottom: 1px solid var(--lib-border-soft);
    margin-bottom: 36px;
}
.library-page .library-hero__headline {
    font-family: var(--lib-font-serif);
    font-size: clamp(34px, 4.8vw, 56px);
    line-height: 1.1;
    margin: 0 0 14px;
    letter-spacing: -.01em;
}
.library-page .library-hero__standfirst {
    font-size: clamp(17px, 1.4vw, 20px);
    color: var(--lib-text-muted);
    line-height: 1.55;
    max-width: 760px;
    margin: 0 0 22px;
}
.library-page .library-hero__cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.library-page .library-hero__cta {
    display: inline-block;
    background: var(--lib-accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--lib-radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}
.library-page .library-hero__cta:hover {
    background: var(--lib-accent-hover);
    color: #fff;
}
.library-page .library-hero__cta--ghost {
    background: transparent;
    color: var(--lib-accent);
    border: 1px solid var(--lib-accent);
}
.library-page .library-hero__cta--ghost:hover {
    background: var(--lib-accent);
    color: #fff;
}

/* ============================================================================
   Sections
   ============================================================================ */
.library-page .library-section {
    margin: 0 0 48px;
}
.library-page .library-section__heading {
    font-family: var(--lib-font-serif);
    font-size: 24px;
    margin: 0 0 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--lib-border-soft);
}
.library-page .library-empty-state {
    color: var(--lib-text-muted);
    padding: 24px 0;
    font-style: italic;
}

/* ============================================================================
   Pillar / cluster cards
   ============================================================================ */
.library-page .library-pillar-grid,
.library-page .library-cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.library-page .library-pillar-card,
.library-page .library-cluster-card {
    display: block;
    background: var(--lib-surface);
    border: 1px solid var(--lib-border-soft);
    border-radius: var(--lib-radius-lg);
    padding: 20px 20px 22px;
    text-decoration: none;
    color: var(--lib-text);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.library-page .library-pillar-card:hover,
.library-page .library-cluster-card:hover {
    border-color: var(--lib-accent);
    transform: translateY(-1px);
    box-shadow: var(--lib-shadow);
}
.library-page .library-pillar-card__number,
.library-page .library-cluster-card__number {
    font-size: 12px;
    color: var(--lib-text-soft);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.library-page .library-pillar-card__name,
.library-page .library-cluster-card__name {
    font-family: var(--lib-font-serif);
    font-size: 19px;
    margin: 6px 0 8px;
    line-height: 1.25;
}
.library-page .library-pillar-card__description,
.library-page .library-cluster-card__description {
    font-size: 14px;
    color: var(--lib-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================================================================
   Piece cards (used on home, hubs, archives, search)
   ============================================================================ */
.library-page .library-piece-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.library-page .library-piece-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.library-page .library-piece-grid--reports {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.library-page .library-piece-card {
    background: var(--lib-bg);
    border: 1px solid var(--lib-border-soft);
    border-radius: var(--lib-radius-lg);
    overflow: hidden;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.library-page .library-piece-card:hover {
    border-color: var(--lib-accent);
    transform: translateY(-1px);
    box-shadow: var(--lib-shadow);
}
.library-page .library-piece-card__link {
    display: block;
    text-decoration: none;
    color: var(--lib-text);
}
.library-page .library-piece-card__image {
    aspect-ratio: 16 / 9;
    background: var(--lib-surface);
    overflow: hidden;
}
.library-page .library-piece-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.library-page .library-piece-card__body {
    padding: 16px 18px 18px;
}
.library-page .library-piece-card__title {
    font-family: var(--lib-font-serif);
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 8px;
}
.library-page .library-piece-card__standfirst {
    font-size: 14px;
    color: var(--lib-text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}
.library-page .library-piece-card__meta {
    font-size: 12px;
    color: var(--lib-text-soft);
}
.library-page .library-piece-card__meta-sep {
    margin: 0 6px;
    color: var(--lib-rule);
}
.library-page .library-piece-card__pillar {
    color: var(--lib-accent);
    font-weight: 600;
}

/* ============================================================================
   Per-pillar section (home page latest-in-each-pillar)
   ============================================================================ */
.library-page .library-pillar-section {
    margin: 0 0 36px;
}
.library-page .library-pillar-section__heading {
    font-family: var(--lib-font-serif);
    font-size: 20px;
    margin: 0 0 14px;
}
.library-page .library-pillar-section__heading a {
    text-decoration: none;
    color: var(--lib-text);
}
.library-page .library-pillar-section__heading a:hover {
    color: var(--lib-accent);
}

/* ============================================================================
   Hub headers (pillar / cluster / glossary / corrections / tag / reports)
   ============================================================================ */
.library-page .library-hub-header {
    margin: 8px 0 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--lib-border-soft);
}
.library-page .library-hub-header__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lib-accent);
    font-weight: 600;
    margin-bottom: 6px;
}
.library-page .library-hub-header__title {
    font-family: var(--lib-font-serif);
    font-size: clamp(28px, 3.6vw, 42px);
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -.005em;
}
.library-page .library-hub-header__description {
    font-size: 17px;
    color: var(--lib-text-muted);
    margin: 0;
    max-width: var(--lib-prose-max);
    line-height: 1.55;
}

/* ============================================================================
   Article surface — the reading view
   ============================================================================ */
.library-page .library-article {
    max-width: var(--lib-prose-max);
    margin: 0 auto;
}
.library-page .library-report-page .library-article {
    max-width: 820px;
}
.library-page .library-article__header {
    margin: 16px 0 28px;
}
.library-page .library-article__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--lib-accent);
    font-weight: 600;
    margin-bottom: 10px;
}
.library-page .library-article__eyebrow--retracted {
    color: #a33;
}
.library-page .library-article__title {
    font-family: var(--lib-font-serif);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.12;
    margin: 0 0 16px;
    letter-spacing: -.012em;
}
.library-page .standfirst {
    font-family: var(--lib-font-serif);
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.45;
    color: var(--lib-text-muted);
    margin: 0 0 24px;
    font-style: italic;
}
.library-page .library-article__hero {
    margin: 28px 0;
}
.library-page .library-article__hero img {
    width: 100%;
    height: auto;
    border-radius: var(--lib-radius-lg);
    display: block;
}
.library-page .library-article__body {
    font-family: var(--lib-font-serif);
    font-size: 18px;
    line-height: 1.75;
}

/* ============================================================================
   Prose typography (article body, hub intros, methodology)
   ============================================================================ */
.library-page .library-prose {
    color: var(--lib-text);
}
.library-page .library-prose p {
    margin: 0 0 1.1em;
}
.library-page .library-prose h2 {
    font-family: var(--lib-font-serif);
    font-size: 26px;
    line-height: 1.25;
    margin: 1.8em 0 .6em;
    letter-spacing: -.005em;
}
.library-page .library-prose h3 {
    font-family: var(--lib-font-serif);
    font-size: 21px;
    line-height: 1.3;
    margin: 1.5em 0 .5em;
}
.library-page .library-prose h4 {
    font-family: var(--lib-font-sans);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 1.5em 0 .4em;
    color: var(--lib-text-muted);
}
.library-page .library-prose ul,
.library-page .library-prose ol {
    margin: 0 0 1.2em 1.4em;
    padding: 0;
}
.library-page .library-prose li {
    margin-bottom: .35em;
}
.library-page .library-prose blockquote {
    margin: 1.5em 0;
    padding: .25em 1.25em;
    border-left: 3px solid var(--lib-accent);
    color: var(--lib-text-muted);
    font-style: italic;
}
.library-page .library-prose pre,
.library-page .library-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}
.library-page .library-prose pre {
    background: var(--lib-surface);
    border: 1px solid var(--lib-border-soft);
    border-radius: var(--lib-radius);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 1.4em 0;
}
.library-page .library-prose code {
    background: var(--lib-surface);
    padding: 1px 6px;
    border-radius: 4px;
}
.library-page .library-prose pre code {
    background: transparent;
    padding: 0;
}
.library-page .library-prose hr {
    border: 0;
    border-top: 1px solid var(--lib-rule);
    margin: 2em 0;
}
/* Tables — editorial treatment, not a spreadsheet.
   Solid top + bottom rule on the table itself, a clear header row with a
   tinted background and a bottom rule, and zebra-striping on body rows to
   help the eye scan across wide rows. The container wraps the table in a
   horizontally scrollable region on narrow viewports so wide tables don't
   force the whole page to scroll. */
.library-page .library-prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.75em 0;
    font-family: var(--lib-font-sans);
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid var(--lib-border-soft);
    border-radius: var(--lib-radius);
    overflow: hidden;
}
.library-page .library-prose th,
.library-page .library-prose td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--lib-border-soft);
}
.library-page .library-prose tr:last-child td {
    border-bottom: 0;
}
.library-page .library-prose th {
    font-family: var(--lib-font-sans);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lib-text-muted);
    background: var(--lib-surface);
    border-bottom: 2px solid var(--lib-rule);
}
.library-page .library-prose tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--lib-surface) 55%, transparent);
}
.library-page .library-prose tbody tr:hover td {
    background: color-mix(in srgb, var(--lib-accent) 6%, transparent);
}

/* Definition lists — used in glossary-style sections inside long pieces. */
.library-page .library-prose dl {
    margin: 1.4em 0;
}
.library-page .library-prose dt {
    font-family: var(--lib-font-sans);
    font-weight: 600;
    color: var(--lib-text);
    margin-top: 1em;
}
.library-page .library-prose dt:first-child {
    margin-top: 0;
}
.library-page .library-prose dd {
    margin: 0.2em 0 0 1.25em;
    color: var(--lib-text);
}

/* Inline emphasis — keep strong distinct without going jarring. */
.library-page .library-prose strong {
    font-weight: 650;
    color: var(--lib-text);
}
.library-page .library-prose em {
    font-style: italic;
}

/* Body links — underline-on-rest editorial style; brighter on hover. */
.library-page .library-prose a:not(.glossary-link):not(.btn) {
    color: var(--lib-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: color-mix(in srgb, var(--lib-accent) 45%, transparent);
}
.library-page .library-prose a:not(.glossary-link):not(.btn):hover {
    text-decoration-color: var(--lib-accent);
}

/* Images that appear in the body (not the hero) — figure-style framing. */
.library-page .library-prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.75em auto;
    border-radius: var(--lib-radius);
}
.library-page .library-prose figure {
    margin: 1.75em 0;
}
.library-page .library-prose figcaption {
    font-family: var(--lib-font-sans);
    font-size: 14px;
    color: var(--lib-text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Comfortable measure — keep body text in the 65–75ch readability sweet
   spot regardless of how wide the surrounding column grows. Tables, figures,
   and pull quotes opt out via :not(). */
.library-page .library-prose > p,
.library-page .library-prose > ul,
.library-page .library-prose > ol,
.library-page .library-prose > dl,
.library-page .library-prose > blockquote:not(.pull-quote) {
    max-width: 68ch;
}

/* Pull-quote (BlockQuoteExtension output) */
.library-page .pull-quote {
    font-family: var(--lib-font-serif);
    font-size: 24px;
    line-height: 1.4;
    border: 0;
    border-top: 2px solid var(--lib-accent);
    border-bottom: 2px solid var(--lib-accent);
    padding: 20px 0;
    margin: 32px 0;
    font-style: italic;
    color: var(--lib-text);
    text-align: center;
}

/* Glossary auto-linked terms */
.library-page .glossary-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--lib-text-soft);
}
.library-page .glossary-link:hover {
    color: var(--lib-accent);
    border-bottom-color: var(--lib-accent);
}

/* ============================================================================
   TL;DR block
   ============================================================================ */
.library-page .tldr-block {
    background: var(--lib-surface-warm);
    border: 1px solid var(--lib-border);
    border-left: 4px solid var(--lib-accent);
    border-radius: var(--lib-radius);
    padding: 18px 22px;
    margin: 24px 0 32px;
    font-family: var(--lib-font-sans);
    font-size: 16px;
}
.library-page .tldr-block__heading {
    font-family: var(--lib-font-sans);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lib-accent);
    margin: 0 0 10px;
}
.library-page .tldr-block__list {
    margin: 0;
    padding-left: 18px;
}
.library-page .tldr-block__list li {
    margin-bottom: 6px;
}

/* ============================================================================
   FAQ block
   ============================================================================ */
.library-page .faq-block {
    background: var(--lib-bg);
    border-top: 1px solid var(--lib-border-soft);
    padding-top: 28px;
    margin: 40px 0 0;
}
.library-page .faq-block__heading {
    font-family: var(--lib-font-serif);
    font-size: 24px;
    margin: 0 0 16px;
}
.library-page .faq-block__list {
    margin: 0;
}
.library-page .faq-block__q {
    font-family: var(--lib-font-sans);
    font-weight: 600;
    font-size: 17px;
    margin: 16px 0 6px;
    color: var(--lib-text);
}
.library-page .faq-block__a {
    font-family: var(--lib-font-serif);
    font-size: 17px;
    line-height: 1.65;
    color: var(--lib-text-muted);
    margin: 0 0 12px;
    padding-left: 0;
}

/* ============================================================================
   Byline + AI-authorship disclosure
   ============================================================================ */
.library-page .library-byline-block {
    margin: 16px 0 28px;
}
.library-page .library-byline {
    font-family: var(--lib-font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--lib-text);
}
.library-page .library-byline__meta {
    font-size: 13px;
    color: var(--lib-text-soft);
    margin-top: 4px;
}
.library-page .library-byline__sep {
    margin: 0 6px;
    color: var(--lib-rule);
}
.library-page .library-disclosure {
    background: var(--lib-disclosure-bg);
    border: 1px solid var(--lib-disclosure-border);
    border-radius: var(--lib-radius);
    padding: 14px 18px;
    margin-top: 14px;
    font-family: var(--lib-font-sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--lib-text);
}
.library-page .library-disclosure p {
    margin: 0;
}
.library-page .library-disclosure p + p {
    margin-top: 8px;
}
.library-page .library-disclosure__meta {
    color: var(--lib-text-muted);
    font-size: 13px;
    font-style: italic;
}

/* ============================================================================
   Archived banner / retracted style
   ============================================================================ */
.library-page .archived-banner {
    background: var(--lib-archived-bg);
    border: 1px solid var(--lib-archived-border);
    border-radius: var(--lib-radius);
    padding: 12px 18px;
    margin: 0 0 22px;
    font-size: 14px;
    color: #5a4400;
}
.library-page .library-retracted .library-article__title {
    color: #8a2929;
}

/* ============================================================================
   Corrections note (end-of-piece) + corrections-log page
   ============================================================================ */
.library-page .corrections-note {
    background: var(--lib-corrections-bg);
    border: 1px solid var(--lib-corrections-border);
    border-radius: var(--lib-radius);
    padding: 16px 20px;
    margin: 40px 0 24px;
    font-family: var(--lib-font-sans);
    font-size: 15px;
}
.library-page .corrections-note h2 {
    font-family: var(--lib-font-sans);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 8px;
    color: #8a2929;
}
.library-page .corrections-note__list {
    margin: 0;
    padding-left: 18px;
}
.library-page .corrections-note__list li {
    margin-bottom: 6px;
    line-height: 1.55;
}
.library-page .library-corrections-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 820px;
}
.library-page .library-correction-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--lib-border-soft);
}
.library-page .library-correction-row__date {
    font-size: 14px;
    color: var(--lib-text-soft);
    font-family: var(--lib-font-sans);
    padding-top: 2px;
}
.library-page .library-correction-row__piece {
    font-family: var(--lib-font-serif);
    font-size: 18px;
    margin: 0 0 6px;
}
.library-page .library-correction-row__piece a {
    color: var(--lib-text);
    text-decoration: none;
}
.library-page .library-correction-row__piece a:hover {
    color: var(--lib-accent);
}
.library-page .library-correction-row__text {
    margin: 0;
    color: var(--lib-text-muted);
    line-height: 1.55;
}

/* ============================================================================
   Related pieces / glossary related
   ============================================================================ */
.library-page .library-related {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--lib-border-soft);
}
.library-page .library-related__heading {
    font-family: var(--lib-font-serif);
    font-size: 22px;
    margin: 0 0 16px;
}
.library-page .library-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.library-page .library-related__list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--lib-border-soft);
    font-family: var(--lib-font-sans);
}

/* ============================================================================
   Article footer
   ============================================================================ */
.library-page .library-article__footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--lib-border-soft);
}

/* ============================================================================
   Breadcrumbs
   ============================================================================ */
.library-page .breadcrumbs {
    font-size: 13px;
    color: var(--lib-text-soft);
    margin-bottom: 12px;
}
.library-page .breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.library-page .breadcrumbs__item {
    display: inline-flex;
    align-items: center;
}
.library-page .breadcrumbs a {
    color: var(--lib-text-muted);
    text-decoration: none;
}
.library-page .breadcrumbs a:hover {
    color: var(--lib-accent);
    text-decoration: underline;
}
.library-page .breadcrumbs__sep {
    margin: 0 6px;
    color: var(--lib-rule);
}

/* ============================================================================
   Pagination
   ============================================================================ */
.library-page .library-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 32px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--lib-border-soft);
}
.library-page .library-pagination__link {
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--lib-accent);
    color: var(--lib-accent);
    border-radius: var(--lib-radius);
    font-size: 14px;
    font-weight: 500;
}
.library-page .library-pagination__link:hover {
    background: var(--lib-accent);
    color: #fff;
}
.library-page .library-pagination__status {
    font-size: 14px;
    color: var(--lib-text-muted);
}

/* ============================================================================
   Glossary index + entry
   ============================================================================ */
.library-page .library-glossary-jumpnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
}
.library-page .library-glossary-jumpnav__link {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    border: 1px solid var(--lib-border);
    border-radius: var(--lib-radius);
    text-decoration: none;
    color: var(--lib-text-muted);
    font-weight: 600;
    font-size: 13px;
}
.library-page .library-glossary-jumpnav__link:hover {
    border-color: var(--lib-accent);
    color: var(--lib-accent);
}
.library-page .library-glossary-section {
    margin: 32px 0;
}
.library-page .library-glossary-section__heading {
    font-family: var(--lib-font-serif);
    font-size: 28px;
    margin: 0 0 14px;
    color: var(--lib-accent);
}
.library-page .library-glossary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.library-page .library-glossary-list__item {
    padding: 10px 0;
    border-bottom: 1px solid var(--lib-border-soft);
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: baseline;
}
.library-page .library-glossary-list__term {
    font-family: var(--lib-font-serif);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    color: var(--lib-text);
}
.library-page .library-glossary-list__term:hover {
    color: var(--lib-accent);
    text-decoration: underline;
}
.library-page .library-glossary-list__definition {
    color: var(--lib-text-muted);
    font-size: 15px;
    line-height: 1.5;
}
.library-page .library-glossary-entry__alts {
    color: var(--lib-text-soft);
    font-size: 14px;
    margin: 0 0 12px;
}
.library-page .library-glossary-entry__example {
    margin: 28px 0;
    padding: 18px 20px;
    background: var(--lib-surface-warm);
    border-left: 3px solid var(--lib-accent);
    border-radius: var(--lib-radius);
}
.library-page .library-glossary-entry__example-heading {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 8px;
    color: var(--lib-accent);
}
.library-page .library-glossary-entry__example blockquote {
    margin: 0;
    font-style: italic;
    color: var(--lib-text);
    border: 0;
    padding: 0;
}

/* ============================================================================
   Author archive
   ============================================================================ */
.library-page .library-author-header {
    display: flex;
    gap: 22px;
    align-items: center;
    margin: 8px 0 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--lib-border-soft);
}
.library-page .library-author-header__avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.library-page .library-author-header__name {
    font-family: var(--lib-font-serif);
    font-size: 30px;
    margin: 0 0 4px;
}
.library-page .library-author-header__title {
    color: var(--lib-text-muted);
    margin: 0;
    font-size: 15px;
}
.library-page .library-author-bio {
    max-width: var(--lib-prose-max);
    margin: 0 0 32px;
}

/* ============================================================================
   Citations
   ============================================================================ */
.library-page .library-citations {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--lib-border-soft);
}
.library-page .library-citations__list {
    font-size: 14px;
    color: var(--lib-text-muted);
    padding-left: 20px;
}
.library-page .library-citations__publisher {
    font-style: italic;
}

/* ============================================================================
   Search-results summary
   ============================================================================ */
.library-page .library-search-summary {
    margin: 18px 0 22px;
    color: var(--lib-text-muted);
}

/* ============================================================================
   Hub intro
   ============================================================================ */
.library-page .library-hub-intro {
    max-width: var(--lib-prose-max);
    margin: 0 0 36px;
    font-family: var(--lib-font-serif);
    font-size: 17px;
    line-height: 1.65;
    color: var(--lib-text);
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 640px) {
    .library-page .library-main {
        padding: 16px 16px 56px;
    }
    .library-page .library-sub-nav {
        gap: 12px;
    }
    .library-page .library-search-form {
        margin-left: 0;
        width: 100%;
    }
    .library-page .library-search-form input[type="search"] {
        flex: 1;
        min-width: 0;
    }
    .library-page .library-correction-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .library-page .library-glossary-list__item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .library-page .library-article__body {
        font-size: 17px;
    }
}
