/* Library Page Styles */
.library-header {
    text-align: center;
    padding: 60px 0 40px;
    background: var(--gray-light);
}

.library-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.library-header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.library-content {
    padding: 60px 0;
}

/* Blog Cards Grid - 2 per row */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--text-color);
}

.blog-card-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: var(--primary-color);
}

.blog-card-excerpt {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-card-topic {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(31, 54, 211, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-border);
}

.read-more-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.read-more-link:hover {
    gap: 0.75rem;
}

.read-more-link::after {
    content: '→';
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 2rem;
}

/* Sorting Controls */
.library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-count {
    color: #666;
    font-size: 0.95rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.sort-select {
    padding: 10px 36px 10px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.sort-select:hover {
    border-color: var(--primary-color);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 54, 211, 0.1);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #1629a8;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Author credit in card meta */
.card-author {
    margin-left: 8px;
}

.card-author-link {
    color: var(--primary-color);
    text-decoration: none;
}

.card-author-link:hover {
    text-decoration: underline;
}

/* Private post badge */
.badge-private {
    margin-left: 8px;
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

    .library-header h1 {
        font-size: 2rem;
    }

    .library-content {
        padding: 40px 0;
    }

    .library-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-form {
        max-width: 100%;
    }

    .controls-right {
        justify-content: space-between;
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}
