/* Posts by Category Block Styles */
.posts-by-category-block {
    margin: 2rem 0;
}

/* Section Header (Title and Description) */
.posts-section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.posts-section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.posts-section-description {
    font-size: 1.125rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Category Header */
.posts-category-header {
    margin-bottom: 2rem;
    text-align: center;
}

.posts-category-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #555;
    margin: 0;
    line-height: 1.2;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(1, 1fr);
    margin-bottom: 2rem;
}

/* Post Item */
.post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Post Thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-image {
    transform: scale(1.05);
}

.post-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

/* Post Content */
.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-header {
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #0073aa;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.post-date,
.post-author {
    display: flex;
    align-items: center;
}

/* Post Excerpt */
.post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 0.9rem;
}

.post-excerpt p {
    margin: 0;
}

/* Post Footer */
.post-footer {
    margin-top: auto;
}

.read-more-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.read-more-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: #fff;
}

/* Pagination */
.posts-pagination {
    text-align: center;
    margin-top: 3rem;
}

.load-more-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.load-more-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.pagination-links {
    margin-top: 1rem;
}

.pagination-links a,
.pagination-links span {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.pagination-links a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pagination-links .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* No Posts Message */
.no-posts-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-size: 1.1rem;
}

/* Block Placeholder (Editor) */
.block-placeholder {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f9f9f9;
}

.block-placeholder-content h3 {
    margin: 0 0 1rem 0;
    color: #333;
}

.block-placeholder-content p {
    margin: 0;
    color: #666;
}

/* Responsive Design */

/* Tablet */
@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .posts-category-title {
        font-size: 3rem;
    }
    
    .post-title {
        font-size: 1.375rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(var(--grid-columns, 6), 1fr);
    }
}

/* Extra Large Desktop */
@media (min-width: 1400px) {
    .posts-grid {
        gap: 3rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .post-item,
    .post-image,
    .read-more-btn,
    .load-more-btn {
        transition: none;
    }
    
    .post-item:hover {
        transform: none;
    }
    
    .post-item:hover .post-image {
        transform: none;
    }
}

/* Focus styles for accessibility */
.read-more-btn:focus,
.load-more-btn:focus,
.post-title a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .posts-pagination {
        display: none;
    }
    
    .post-item {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}