/**
 * Book Pages Styles
 * Book Archive (/{lang}/books/) & Book Detail Page (/{lang}/book/{slug})
 *
 * Based on BUCH-SEITEN-KONZEPT.md
 */

/* ==========================================================================
   WordPress Global Style Overrides
   Neutralize WP flow-layout margins, constrained max-widths,
   global heading/button/link styles that break our custom layout.
   ========================================================================== */

/* Reset flow-layout gap (WP adds margin-block-start: 30px to all children) */
.book-detail-page.is-layout-flow > *,
.book-detail-page.is-layout-flow > * > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

.book-detail-page > .book-detail,
.book-detail-page > .book-archive {
    margin-block-start: 0 !important;
}

/* Prevent WP constrained layout from capping width at 640px */
.book-detail-page .book-detail,
.book-detail-page .book-archive {
    max-width: none;
}

/* Reset WP global heading styles inside our components */
.book-detail :where(h1, h2, h3),
.book-archive :where(h1, h2, h3) {
    font-weight: inherit;
    line-height: inherit;
    font-size: inherit;
    margin: 0;
}

/* Reset WP global link underlines inside our components */
.book-detail a:not(.wp-element-button),
.book-archive a:not(.wp-element-button) {
    text-decoration: none;
    text-decoration-thickness: initial;
    background: none;
    background-size: initial;
}

/* Reset WP global button styles that leak into our custom buttons.
   Use :where() for zero-specificity element selector so component classes win. */
.book-detail :where(button),
.book-archive :where(button) {
    background-color: initial;
    border-radius: initial;
    border-width: initial;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    padding: initial;
    letter-spacing: inherit;
    line-height: inherit;
}

/* Prevent WP paragraph styles from applying to our elements */
.book-detail p,
.book-archive p {
    margin: 0;
}

/* Prevent WP figure margin from affecting our elements */
.book-detail figure {
    margin: 0;
}

/* Reset WP select input styles inside our components */
.book-detail :where(select),
.book-archive :where(select) {
    width: auto;
    border-radius: 0;
    padding: initial;
    font-family: inherit;
}

/* Reset WP list styles */
.book-detail ol,
.book-detail ul,
.book-archive ol,
.book-archive ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Colors – Part C.1 */
    --book-bg: var(--kuehn-site-bg, #ffffff);
    --book-bg-alt: var(--kuehn-site-bg-alt, #fafafa);
    --book-text-primary: var(--kuehn-site-text, #1c2024);
    --book-text-secondary: var(--kuehn-site-muted, #6c7075);
    --book-accent: var(--kuehn-accent, #8b6f5a);
    --book-border: var(--kuehn-site-border, #e9e9ec);
    --book-border-light: var(--kuehn-site-border-subtle, #f0f0f3);
    --book-author-note-bg: #f8f6f3;
    --book-hero-text: #ffffff;

    /* Status colors */
    --status-ongoing-bg: #e6f7ed;
    --status-ongoing-text: #1d6b3d;
    --status-ongoing-dot: #1d6b3d;
    --status-hiatus-bg: #fef3e0;
    --status-hiatus-text: #8a6514;
    --status-hiatus-dot: #8a6514;
    --status-completed-bg: #e8f0fe;
    --status-completed-text: #1a4d8f;
    --status-completed-dot: #1a4d8f;
    --market-announced-bg: rgba(255, 255, 255, 0.16);
    --market-announced-text: #f5f3ff;
    --market-preorder-bg: rgba(251, 191, 36, 0.18);
    --market-preorder-text: #fde68a;
    --market-available-bg: rgba(74, 222, 128, 0.16);
    --market-available-text: #bbf7d0;
    --market-unavailable-bg: rgba(248, 113, 113, 0.18);
    --market-unavailable-text: #fecaca;

    /* Badge colors */
    --badge-genre-bg: #eef3f8;
    --badge-genre-text: #243446;
    --badge-free-bg: #ebf5ef;
    --badge-free-text: #1d5d3d;
    --badge-supporter-bg: #fef7ec;
    --badge-supporter-text: #7a5c1d;
    --badge-premium-bg: #f3eefa;
    --badge-premium-text: #4c2b8a;

    /* Spacing tokens now defined in site-theme.css via --space-* variables.
       Legacy aliases (--section-gap, --section-padding, etc.) are kept there
       for backward compatibility during migration. */
}

/* ==========================================================================
   Status Badges (shared between pages)
   ========================================================================== */

.book-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.book-status-badge--ongoing {
    background: var(--status-ongoing-bg);
    color: var(--status-ongoing-text);
}

.book-status-badge--hiatus {
    background: var(--status-hiatus-bg);
    color: var(--status-hiatus-text);
}

.book-status-badge--completed {
    background: var(--status-completed-bg);
    color: var(--status-completed-text);
}

.book-status-badge__dot {
    flex-shrink: 0;
    font-size: 0.65em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.book-status-badge--ongoing .book-status-badge__dot {
    color: var(--status-ongoing-dot);
}

.book-status-badge--hiatus .book-status-badge__dot {
    color: var(--status-hiatus-dot);
}

.book-status-badge--completed .book-status-badge__dot {
    color: var(--status-completed-dot);
}

/* Hero variant (dark background) */
.book-status-badge--hero {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.book-status-badge--hero .book-status-badge__dot {
    color: currentColor;
}

.book-status-badge--hero.book-status-badge--ongoing .book-status-badge__dot {
    color: #4ade80;
}

.book-status-badge--hero.book-status-badge--hiatus .book-status-badge__dot {
    color: #fbbf24;
}

.book-status-badge--hero.book-status-badge--completed .book-status-badge__dot {
    color: #60a5fa;
}

.book-market-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.book-market-badge--announced {
    background: var(--market-announced-bg);
    color: var(--market-announced-text);
}

.book-market-badge--preorder {
    background: var(--market-preorder-bg);
    color: var(--market-preorder-text);
}

.book-market-badge--available {
    background: var(--market-available-bg);
    color: var(--market-available-text);
}

.book-market-badge--sold_out_external {
    background: var(--market-unavailable-bg);
    color: var(--market-unavailable-text);
}

/* Genre Badges */
.genre-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.genre-badge:hover {
    opacity: 0.8;
}

.genre-badge--light {
    background: var(--badge-genre-bg);
    color: var(--badge-genre-text);
}

.genre-badge--hero {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Access Level Badges */
.access-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.access-badge--free {
    background: var(--badge-free-bg);
    color: var(--badge-free-text);
}

.access-badge--supporter,
.access-badge--paid {
    background: var(--badge-supporter-bg);
    color: var(--badge-supporter-text);
}

.access-badge--premium {
    background: var(--badge-premium-bg);
    color: var(--badge-premium-text);
}

/* ==========================================================================
   PART A: Book Archive Page (/{lang}/books/)
   ========================================================================== */

/* A.2 – Hero / Page Header */
.book-archive {
    background: var(--book-bg);
}

.book-archive__header {
    text-align: left;
}

.book-archive__header-inner {
    width: min(var(--layout-wide), calc(100% - var(--space-page-gutter) * 2));
    margin-inline: auto;
}

.book-archive__header.kuehn-page-intro--embedded .book-archive__header-inner.kuehn-page-intro__inner {
    width: min(var(--layout-wide), calc(100% - var(--space-page-gutter) * 2));
    margin-inline: auto;
}

.book-archive__title {
    margin: 0;
    text-align: left;
}

.book-archive__subtitle {
    margin: 12px 0 0;
    text-align: left;
}

/* A.3 – Filter Bar */
.book-archive__filters {
    position: sticky;
    top: 0;
    z-index: 50;
    background: transparent;
    border-bottom: 0;
    padding: var(--space-compact) 0;
    transition: box-shadow 0.2s ease;
}

.book-archive__filters.is-sticky {
    box-shadow: none;
}

.book-archive__filters.is-sticky .book-archive__filters-inner {
    box-shadow: 0 14px 30px rgba(18, 24, 33, 0.09);
}

.book-archive__filters-inner {
    max-width: var(--layout-wide);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid var(--kuehn-site-border);
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(139, 111, 90, 0.04), rgba(139, 111, 90, 0)),
        var(--kuehn-site-surface);
    box-shadow: 0 10px 28px rgba(18, 24, 33, 0.04);
}

.book-archive__genre-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}

.book-archive__genre-chips::-webkit-scrollbar {
    display: none;
}

.genre-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid var(--kuehn-site-border);
    background: color-mix(in srgb, var(--kuehn-site-bg) 70%, var(--kuehn-site-surface));
    color: var(--kuehn-site-text);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
    white-space: nowrap;
    user-select: none;
}

.genre-chip:hover {
    border-color: color-mix(in srgb, var(--kuehn-accent) 24%, var(--kuehn-site-border));
    background: var(--kuehn-hover-bg);
}

.genre-chip[aria-pressed="true"],
.genre-chip.is-active {
    background: var(--kuehn-accent);
    color: #fff;
    border-color: var(--kuehn-accent);
}

.book-archive__dropdowns {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.book-archive__select {
    min-height: 34px;
    padding: 0 32px 0 10px;
    border: 1px solid var(--kuehn-site-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    background: color-mix(in srgb, var(--kuehn-site-bg) 70%, var(--kuehn-site-surface)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c7075' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    color: var(--kuehn-site-text);
    cursor: pointer;
    min-width: 120px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.book-archive__select:focus-visible {
    outline: 2px solid var(--kuehn-focus-ring);
    outline-offset: 2px;
    border-color: var(--kuehn-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kuehn-accent) 14%, transparent);
}

.book-archive__view-toggle {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.book-archive__view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--kuehn-site-border);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--kuehn-site-bg) 70%, var(--kuehn-site-surface));
    color: var(--kuehn-site-muted);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.book-archive__view-btn:hover {
    border-color: color-mix(in srgb, var(--kuehn-accent) 24%, var(--kuehn-site-border));
    background: var(--kuehn-hover-bg);
    color: var(--kuehn-site-text);
}

.book-archive__view-btn.is-active {
    background: var(--kuehn-accent);
    color: #fff;
    border-color: var(--kuehn-accent);
}

/* Filter panel – desktop layout */
.book-archive__filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Mobile filter toggle */
.book-archive__filter-toggle {
    display: none;
}

.book-archive__filter-toggle {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--kuehn-site-border);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--kuehn-site-bg) 70%, var(--kuehn-site-surface));
    color: var(--kuehn-site-text);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.book-archive__filter-toggle:hover {
    border-color: color-mix(in srgb, var(--kuehn-accent) 24%, var(--kuehn-site-border));
    background: var(--kuehn-hover-bg);
}

.book-archive__filter-toggle:focus-visible,
.book-archive__view-btn:focus-visible,
.genre-chip:focus-visible {
    outline: 2px solid var(--kuehn-focus-ring, var(--book-accent));
    outline-offset: 2px;
}

[data-site-theme-resolved="dark"] .book-archive__filters-inner {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
        color-mix(in srgb, var(--kuehn-site-surface) 95%, #0a0d12);
    border-color: color-mix(in srgb, var(--kuehn-site-border) 92%, #3b4657);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

[data-site-theme-resolved="dark"] .book-archive__filters,
[data-site-theme-resolved="dark"] .book-archive__filters.is-sticky {
    background: transparent;
    background-color: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
}

[data-site-theme-resolved="dark"] .book-archive__filters.is-sticky .book-archive__filters-inner {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
}

[data-site-theme-resolved="dark"] .genre-chip,
[data-site-theme-resolved="dark"] .book-archive__select,
[data-site-theme-resolved="dark"] .book-archive__view-btn,
[data-site-theme-resolved="dark"] .book-archive__filter-toggle {
    background-color: color-mix(in srgb, var(--kuehn-site-bg) 84%, #000);
    border-color: color-mix(in srgb, var(--kuehn-site-border) 90%, #394454);
}

[data-site-theme-resolved="dark"] .book-archive__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a8b5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-site-theme-resolved="dark"] .genre-chip:hover,
[data-site-theme-resolved="dark"] .book-archive__view-btn:hover,
[data-site-theme-resolved="dark"] .book-archive__filter-toggle:hover {
    background: color-mix(in srgb, var(--kuehn-hover-bg) 80%, transparent);
}

@media (max-width: 768px) {
    .book-archive__filters-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .book-archive__dropdowns {
        flex-wrap: wrap;
    }

    .book-archive__filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        justify-content: center;
    }

    .book-archive__filter-panel {
        display: none;
    }

    .book-archive__filter-panel.is-open {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

/* A.4 – Book Grid */
.book-archive__grid-container {
    max-width: var(--layout-wide);
    margin: 0 auto;
    padding: var(--space-block) var(--space-page-gutter);
}

.book-archive__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-group) var(--space-grid-gap);
}

@media (max-width: 600px) {
    .book-archive__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Book Card */
.book-card {
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-card__cover-wrap {
    position: relative;
    aspect-ratio: 16 / 25;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover .book-card__cover-wrap,
.book-card:focus-within .book-card__cover-wrap {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.book-card__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-card__badge {
    display: inline-flex;
    margin-bottom: 4px;
}

.book-card__badge .book-status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.book-card__badge .book-status-badge--ongoing {
    background: var(--status-ongoing-bg);
    color: var(--status-ongoing-text);
}

.book-card__badge .book-status-badge--hiatus {
    background: var(--status-hiatus-bg);
    color: var(--status-hiatus-text);
}

.book-card__badge .book-status-badge--completed {
    background: var(--status-completed-bg);
    color: var(--status-completed-text);
}

.book-card__badge .book-status-badge__dot {
    color: inherit;
}

/* Language-only badge for untranslated books */
.book-card__language-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
}

.language-only-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(100, 100, 120, 0.9);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Bookmark icon for logged-in users */
.book-card__bookmark {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-round);
    color: #fff;
}

/* Hover Overlay Actions */
.book-card__hover-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.book-card:hover .book-card__hover-actions {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .book-card__hover-actions {
        display: none;
    }
}

.book-card__hover-btn {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.book-card__hover-btn--primary {
    background: #fff;
    color: var(--book-text-primary);
}

.book-card__hover-btn--secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Card Info (below cover) */
.book-card__info {
    padding-top: 10px;
}

.book-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--book-text-primary);
}

.book-card__series {
    font-size: 0.8rem;
    color: var(--book-text-secondary);
    font-style: italic;
    margin: 0 0 4px;
    line-height: 1.3;
}

.book-card__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.book-card__genres .genre-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.book-card__genres .genre-badge--more {
    background: transparent;
    color: var(--book-text-secondary);
    padding: 2px 4px;
}

/* Progress bar on card */
.book-card__progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.book-card__progress-bar {
    flex: 1;
    height: 4px;
    background: var(--book-border);
    border-radius: 2px;
    overflow: hidden;
}

.book-card__progress-fill {
    height: 100%;
    background: var(--book-accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.book-card__progress-text {
    font-size: 0.75rem;
    color: var(--book-text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

/* A.4b – Series View */
.book-archive__series-section {
    margin-bottom: var(--space-section);
}

.book-archive__series-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--book-border);
}

.book-archive__series-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--book-text-primary);
    margin: 0;
}

.book-archive__series-link {
    font-size: 0.85rem;
    color: var(--book-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.book-archive__series-link:hover {
    color: var(--book-text-primary);
}

.book-archive__series-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.book-archive__series-scroll::-webkit-scrollbar {
    display: none;
}

.book-archive__series-scroll .book-card {
    flex: 0 0 180px;
}

/* Empty state */
.book-archive__empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--book-text-secondary);
}

.book-archive__empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--book-text-primary);
}

.book-archive__empty-text {
    font-size: 0.95rem;
    margin: 0;
}

/* Pagination */
.book-archive__pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: var(--space-block) var(--space-page-gutter);
}

.book-archive__pagination a,
.book-archive__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--book-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--book-text-primary);
    transition: all 0.2s ease;
}

.book-archive__pagination a:hover {
    background: var(--book-bg-alt);
    border-color: var(--book-text-secondary);
}

.book-archive__pagination .current {
    background: var(--book-text-primary);
    color: #fff;
    border-color: var(--book-text-primary);
}

/* ==========================================================================
   PART B: Book Detail Page (/{lang}/book/{slug})
   ========================================================================== */

/* B.2 – Hero Header */
.book-hero {
    position: relative;
    overflow: hidden;
    padding: var(--space-hero) 0;
    color: var(--book-hero-text);
}

.book-hero__bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(40px) saturate(1.2);
    z-index: 0;
}

.book-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.book-hero__content {
    position: relative;
    z-index: 2;
    max-width: var(--layout-content);
    margin: 0 auto;
    padding: 0 var(--space-page-gutter);
    display: grid !important;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: center;
}

/* Ensure grid children are properly assigned */
.book-hero__content > * {
    margin: 0;
    min-width: 0;
}

/* Breadcrumb */
.book-hero__breadcrumb {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: -20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

.book-hero__breadcrumb a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.book-hero__breadcrumb a:hover {
    opacity: 1;
}

.book-hero__breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* Cover in Hero */
.book-hero__cover-wrap {
    aspect-ratio: 16 / 25;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    max-width: 260px;
}

.book-hero__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text content in Hero */
.book-hero__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-hero__title {
    font-family: var(--wp--preset--font-family--serif, Georgia, serif);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: #fff;
}

.book-hero__series-info {
    font-size: 0.95rem;
    opacity: 0.8;
}

.book-hero__series-info a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.book-hero__series-info em {
    font-style: italic;
}

.book-hero__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.book-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.85;
}

.book-hero__meta-sep {
    opacity: 0.4;
}

.book-hero__hiatus-notice {
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
    margin-top: -4px;
}

.book-hero__buy-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

.book-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.book-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
    line-height: 1.4;
    box-sizing: border-box;
    height: auto;
    vertical-align: middle;
    font-family: inherit;
    letter-spacing: normal;
}

.book-hero__btn svg {
    flex-shrink: 0;
}

.book-hero__btn--primary {
    background: #fff !important;
    color: var(--book-text-primary) !important;
}

.book-hero__btn--primary:hover {
    background: #f0f0f3;
    transform: translateY(-1px);
}

.book-hero__btn--secondary {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.book-hero__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Hero Progress */
.book-hero__progress {
    margin-top: 8px;
}

.book-hero__progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.book-hero__progress-fill {
    height: 100%;
    background: var(--book-accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.book-hero__progress-text {
    font-size: 0.8rem;
    opacity: 0.7;
}

.book-hero__bonus-teaser {
    margin-top: 12px;
}

.book-hero__bonus-teaser-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    text-decoration: none;
}

.book-hero__bonus-teaser-title {
    font-weight: 600;
}

.book-hero__bonus-teaser-cta {
    opacity: 0.85;
}

/* Translation link */
.book-hero__translation {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.book-hero__translation-label {
    opacity: 0.7;
}

.book-hero__translation-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-weight: 500;
    transition: background 0.2s;
}

.book-hero__translation-link:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Responsive Hero */
@media (max-width: 900px) {
    .book-hero__content {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .book-hero__breadcrumb {
        text-align: left;
        justify-self: start;
    }

    .book-hero__cover-wrap {
        max-width: 180px;
    }

    .book-hero__genres,
    .book-hero__meta,
    .book-hero__actions {
        justify-content: center;
    }
}

/* B.2b – Sticky Anchor Navigation */
.book-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--book-border);
}

.book-nav__inner {
    max-width: var(--layout-content);
    margin: 0 auto;
    padding: 0 var(--space-page-gutter);
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.book-nav__inner::-webkit-scrollbar {
    display: none;
}

.book-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--book-text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.book-nav__link:hover {
    color: var(--book-text-primary);
}

.book-nav__link.is-active {
    color: var(--book-accent);
    border-bottom-color: var(--book-accent);
}

.book-nav__count {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.6;
}

/* B.2c – Fan Art Subpage */
.book-fan-art-page {
    max-width: var(--layout-content);
    margin: 0 auto;
    padding: var(--space-block) var(--space-page-gutter) var(--space-section);
}

.book-fan-art-page__heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--book-text-primary);
}

.book-fan-art-page__intro {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--book-text-secondary);
    margin: 0 0 20px;
    max-width: 760px;
}

.book-fan-art-page .kuehn-fan-art,
.book-fan-art-page .kuehn-fan-art-submit {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .book-fan-art-page {
        padding-top: 28px;
    }

    .book-fan-art-page__heading {
        font-size: 1.25rem;
    }

    .book-fan-art-page__intro {
        font-size: 1rem;
        margin-bottom: 14px;
    }
}

/* B.3 – Book Description */
.book-description {
    max-width: var(--layout-narrow);
    margin: 0 auto;
    padding: var(--space-block) var(--space-page-gutter);
}

.book-description__heading {
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--book-text-primary);
}

.book-description__content {
    font-family: var(--wp--preset--font-family--serif, Georgia, serif);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--book-text-primary);
}

.book-description__content.is-truncated {
    position: relative;
    max-height: 250px;
    overflow: hidden;
}

.book-description__content.is-truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--book-bg));
    pointer-events: none;
}

.book-description__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--book-accent);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.book-description__toggle:hover {
    opacity: 0.7;
}

.book-product-panel {
    max-width: var(--layout-narrow);
    margin: 0 auto;
    padding: 0 var(--space-page-gutter) var(--space-block);
}

.book-product-panel__inner {
    display: grid;
    gap: 20px;
    padding: var(--space-group);
    border-radius: var(--radius-lg);
    border: 1px solid var(--book-border);
    background: linear-gradient(180deg, rgba(250, 247, 243, 0.9), rgba(255, 255, 255, 0.98));
    box-shadow: 0 18px 40px rgba(28, 32, 36, 0.08);
}

.book-product-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.book-product-panel__heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--book-text-primary);
}

.book-product-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.book-product-panel .book-hero__btn--primary {
    background: var(--book-text-primary) !important;
    color: #fff !important;
}

.book-product-panel .book-hero__btn--primary:hover {
    background: #2d3338 !important;
}

.book-product-panel .book-hero__btn--secondary {
    border-color: var(--book-border);
    color: var(--book-text-primary) !important;
}

.book-product-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.book-product-meta__item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid var(--book-border-light);
}

.book-product-meta__item dt {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--book-text-secondary);
    margin-bottom: 6px;
}

.book-product-meta__item dd {
    margin: 0;
    font-size: 1rem;
    color: var(--book-text-primary);
}

[data-site-theme-resolved="dark"] .book-product-panel__inner {
    border-color: var(--book-border);
    background:
        linear-gradient(180deg, rgba(23, 28, 37, 0.98), rgba(17, 19, 23, 0.98));
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
}

[data-site-theme-resolved="dark"] .book-product-panel .book-hero__btn--primary {
    background: var(--kuehn-site-text, #e7eaf0) !important;
    color: var(--kuehn-site-bg, #111317) !important;
}

[data-site-theme-resolved="dark"] .book-product-panel .book-hero__btn--primary:hover {
    background: #f3f6fb !important;
}

[data-site-theme-resolved="dark"] .book-product-panel .book-hero__btn--secondary {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--book-border) !important;
    color: var(--book-text-primary) !important;
}

[data-site-theme-resolved="dark"] .book-product-panel .book-hero__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #465062 !important;
}

[data-site-theme-resolved="dark"] .book-product-meta__item {
    background: var(--book-bg-alt);
    border-color: var(--book-border);
}

[data-site-theme-resolved="dark"] .book-product-meta__item dt {
    color: var(--book-text-secondary);
}

[data-site-theme-resolved="dark"] .book-product-meta__item dd,
[data-site-theme-resolved="dark"] .book-product-panel__heading {
    color: var(--book-text-primary);
}

/* B.4 – Author's Note */
.book-author-note {
    max-width: var(--layout-narrow);
    margin: 0 auto;
    padding: 0 var(--space-page-gutter) var(--space-block);
}

.book-author-note__inner {
    background: var(--book-author-note-bg);
    border-radius: var(--radius-md);
    padding: var(--space-group);
    border-left: 4px solid var(--book-accent);
}

.book-author-note__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--book-text-primary);
}

.book-author-note__icon {
    font-size: 1.1em;
}

.book-author-note__text {
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--book-text-primary);
    opacity: 0.9;
}

.book-author-note__text p:first-child {
    margin-top: 0;
}

.book-author-note__text p:last-child {
    margin-bottom: 0;
}

/* B.5 – Chapter List */
.book-chapters {
    max-width: var(--layout-narrow);
    margin: 0 auto;
    padding: 0 var(--space-page-gutter) var(--space-section);
}

.book-chapters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.book-chapters__heading {
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 600;
    margin: 0;
    color: var(--book-text-primary);
}

.book-chapters__heading-count {
    font-weight: 400;
    color: var(--book-text-secondary);
    margin-left: 8px;
}

.book-chapters__sort {
    padding: 4px 24px 4px 8px;
    border: 1px solid var(--book-border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236c7075' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

.book-chapters__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--book-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Reset margin on li elements inside chapter list */
.book-chapters__list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.book-chapter-row {
    display: flex !important;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--book-border-light);
    text-decoration: none !important;
    color: inherit;
    transition: background 0.2s ease;
    cursor: pointer;
}

.book-chapter-row:last-child {
    border-bottom: none;
}

.book-chapter-row:hover {
    background: var(--book-bg-alt);
}

.book-chapter-row--locked {
    opacity: 0.7;
}

.book-chapter-row--upcoming {
    opacity: 0.5;
    cursor: default;
}

.book-chapter-row__number {
    font-family: var(--kuehn-font-mono);
    font-size: 0.85rem;
    color: var(--book-text-secondary);
    min-width: 32px;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}

.book-chapter-row__content {
    flex: 1;
    min-width: 0;
}

.book-chapter-row__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--book-text-primary);
    margin: 0 0 4px;
}

.book-chapter-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--book-text-secondary);
}

.book-chapter-row__meta-sep {
    opacity: 0.4;
}

.book-chapter-row__early-access {
    font-size: 0.8rem;
    color: var(--book-text-secondary);
    margin-top: 4px;
    font-style: italic;
}

.book-chapter-row__status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.book-chapter-row__status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-round);
    font-size: 0.75rem;
}

.book-chapter-row__status-icon--completed {
    background: var(--status-completed-bg);
    color: var(--status-completed-text);
}

.book-chapter-row__status-icon--reading {
    background: var(--status-ongoing-bg);
    color: var(--status-ongoing-text);
    font-size: 0.65rem;
    font-weight: 700;
}

.book-chapter-row__status-icon--locked {
    color: var(--book-text-secondary);
    opacity: 0.6;
}

/* Chapter list expand/collapse */
.book-chapters__toggle {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.book-chapters__toggle-btn {
    padding: 8px 20px;
    border: 1px solid var(--book-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--book-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.book-chapters__toggle-btn:hover {
    border-color: var(--book-text-secondary);
    color: var(--book-text-primary);
}

/* B.6 – Characters */
.book-characters {
    padding: 0 var(--space-page-gutter) var(--space-section);
    max-width: var(--layout-content);
    margin: 0 auto;
}

.book-characters__heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--book-text-primary);
}

.book-characters__grid {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.book-characters__grid::-webkit-scrollbar {
    display: none;
}

.book-character-card {
    flex: 0 0 140px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.book-character-card:hover {
    transform: translateY(-2px);
}

.book-character-card__avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    border-radius: var(--radius-round);
    overflow: hidden;
    background: var(--book-bg-alt);
}

.book-character-card__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spoiler character */
.book-character-card--spoiler .book-character-card__avatar {
    filter: blur(20px) saturate(0.3);
}

.book-character-card__spoiler-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-round);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    font-size: 0.7rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 8px;
}

.book-character-card--spoiler:hover .book-character-card__spoiler-overlay {
    opacity: 1;
}

.book-character-card--spoiler.is-revealed .book-character-card__avatar {
    filter: none;
}

.book-character-card--spoiler.is-revealed .book-character-card__spoiler-overlay {
    display: none;
}

.book-character-card__name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 2px;
    color: var(--book-text-primary);
}

.book-character-card__species {
    font-size: 0.8rem;
    color: var(--book-text-secondary);
    margin: 0;
}

/* B.7 – Bonus Material */
.book-bonus {
    padding: 0 var(--space-page-gutter) var(--space-section);
    max-width: var(--layout-content);
    margin: 0 auto;
}

.book-bonus__heading {
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--book-text-primary);
}

.book-bonus__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.book-bonus-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--book-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-bonus-card:hover {
    border-color: var(--book-text-secondary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.book-bonus-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--book-bg-alt);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.book-bonus-card__content {
    flex: 1;
    min-width: 0;
}

.book-bonus-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--book-text-primary);
}

.book-bonus-card__type {
    font-size: 0.8rem;
    color: var(--book-text-secondary);
    margin: 0 0 6px;
}

/* B.8 – Recommendations */
.book-recommendations {
    padding: var(--space-section) var(--space-page-gutter);
    max-width: var(--layout-content);
    margin: 0 auto;
    background: var(--book-bg-alt);
}

.book-recommendations__heading {
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--book-text-primary);
}

.book-recommendations__grid {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.book-recommendations__grid::-webkit-scrollbar {
    display: none;
}

.book-recommendations__grid .book-card {
    flex: 0 0 200px;
}

/* B.10.1 – Sticky "Lesen" Button (Mobile) */
.book-detail__sticky-cta {
    display: none;
}

@media (max-width: 900px) {
    .book-detail__sticky-cta {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: #fff;
        border-top: 1px solid var(--book-border);
        padding: 12px var(--space-page-gutter);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(100%);
        transition: transform 0.2s ease;
    }

    .book-detail__sticky-cta.is-visible {
        transform: translateY(0);
    }

    .book-detail__sticky-cta .book-hero__btn {
        width: 100%;
        justify-content: center;
        background: var(--book-text-primary);
        color: #fff;
    }

    .book-detail__sticky-cta .book-hero__btn svg {
        color: currentColor;
    }
}

/* B.10.3 – Share Options */
.book-share {
    display: inline-flex;
    position: relative;
}

.book-share__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--radius-sm);
    background: transparent !important;
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    box-sizing: border-box;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: normal;
}

.book-share__toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.book-share__dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    min-width: 180px;
    z-index: 10;
}

.book-share__dropdown.is-open {
    display: block;
}

.book-share__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--book-text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.book-share__link:hover {
    background: var(--book-bg-alt);
}

/* Bookshelf Dropdown */
.bookshelf-dropdown {
    position: relative;
    display: inline-block;
}

.bookshelf-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 6px;
    display: none;
    min-width: 200px;
    z-index: 10;
}

.bookshelf-dropdown__menu.is-open {
    display: block;
}

.bookshelf-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--book-text-primary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s ease;
}

.bookshelf-dropdown__item:hover {
    background: var(--book-bg-alt);
}

.bookshelf-dropdown__item.is-active {
    font-weight: 600;
    color: var(--book-accent);
}

.bookshelf-dropdown__item--danger {
    color: #c53030;
}

/* ==========================================================================
   Scroll Animations – Part C.4
   ========================================================================== */

.book-section-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.book-section-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Accessibility – Part C.5
   ========================================================================== */

.book-card:focus-visible .book-card__cover-wrap,
.book-chapter-row:focus-visible,
.genre-chip:focus-visible,
.book-nav__link:focus-visible,
.book-hero__btn:focus-visible,
.book-character-card:focus-visible .book-character-card__avatar-wrap {
    outline: 2px solid var(--kuehn-focus-ring, var(--book-accent));
    outline-offset: 2px;
}

/* Skip link */
.book-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 1000;
    padding: 12px 20px;
    background: var(--book-text-primary);
    color: #fff;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.book-skip-link:focus {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.book-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Filter transition animation */
.book-card--fade-enter {
    opacity: 0;
    transform: scale(0.95);
}

.book-card--fade-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
