/* ==========================================
   Bookshelf
   ========================================== */
.bookshelf-section {
    margin-bottom: var(--spacing-xl);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.book-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.book-card {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--accent-secondary);
    padding: var(--spacing-md);
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    animation: fadeInUp 0.6s ease-out backwards;
    overflow: hidden;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-tertiary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.book-card-link:hover .book-card {
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 97, 136, 0.15);
}

.book-card-link:hover .book-card::before {
    opacity: 1;
}

.book-badge-small {
    display: inline-block;
    background: var(--accent-secondary);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.book-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    flex-grow: 0;
}

.book-card-link:hover .book-card-title {
    color: var(--accent-secondary);
}

.book-card-author {
    font-size: 0.9rem;
    color: var(--accent-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.book-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: var(--line-height-normal);
    flex-grow: 1;
    margin-bottom: var(--spacing-sm);
}

.book-card-rating {
    display: flex;
    gap: 0.2rem;
    margin-bottom: var(--spacing-sm);
}

.book-card-rating .star {
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.book-card-meta {
    margin-top: auto;
    padding-top: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Book Content Page */
.book-content {
    max-width: 800px;
    margin: 0 auto;
}

.book-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--accent-secondary);
}

.book-badge {
    display: inline-block;
    background: var(--accent-secondary);
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.8rem;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.book-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.book-author {
    font-size: 1.1rem;
    color: var(--accent-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.book-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-tertiary);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.book-rating {
    display: flex;
    gap: 0.2rem;
}

.book-rating .star {
    color: var(--accent-primary);
    font-size: 1rem;
}

.book-body {
    font-size: 1rem;
    line-height: var(--line-height-loose);
}

.book-body h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    letter-spacing: -0.02em;
}

.book-body h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
    letter-spacing: -0.01em;
}

.book-body p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.book-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.book-body a {
    color: var(--accent-tertiary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-tertiary);
    transition: var(--transition-fast);
}

.book-body a:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

.book-body ul,
.book-body ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
}

.book-body li {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.book-body li::marker {
    color: var(--accent-secondary);
}

.book-body code {
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--accent-secondary);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
}

.book-body pre {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-secondary);
    padding: var(--spacing-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.book-body pre code {
    display: block;
    padding: 0;
    background: none;
    color: inherit;
    border: none;
    font-size: 0.9rem;
}

.book-actions {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.book-actions a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
    text-decoration: none;
    border: 1px solid var(--accent-secondary);
    transition: all var(--transition-normal);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.book-actions a:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 97, 136, 0.3);
}

/* Bookshelf Listing Page */
.bookshelf-listing-page {
    max-width: 1200px;
    margin: 0 auto;
}

.bookshelf-listing-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
    letter-spacing: -0.03em;
}

.page-subtitle {
    font-size: 1.1rem;
    line-height: var(--line-height-normal);
    color: var(--text-tertiary);
    max-width: 700px;
}

/* ==========================================
   Responsive Design - Books
   ========================================== */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        min-height: auto;
    }

    .book-title {
        font-size: 1.6rem;
    }
}
