/**
 * Display Posts by Author - Modern Card Design
 * Version: 2.0.2
 */

/* Main container */
.posts-by-author {
    margin: 40px 0;
    padding: 0;
}

/* Grid Layout */
.dpba-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    align-items: stretch;
}

/* Individual post card */
.dpba-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dpba-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Post image */
.dpba-post-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f8f9fa;
}

.dpba-post-image a {
    display: block;
    height: 100%;
    position: relative;
}

.dpba-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dpba-card:hover .dpba-thumbnail {
    transform: scale(1.05);
}

/* Content image extracted from post */
.dpba-content-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dpba-card:hover .dpba-content-image {
    transform: scale(1.05);
}

/* Fallback image */
.dpba-fallback-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.dpba-card:hover .dpba-fallback-image {
    transform: scale(1.05);
}

/* LIVITI overlay */
.dpba-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    z-index: 10;
    transition: all 0.3s ease;
}

.dpba-logo {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dpba-card:hover .dpba-overlay {
    background: rgba(0, 0, 0, 0.9);
}

/* Post content */
.dpba-post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Post meta */
.dpba-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6c757d;
    flex-wrap: wrap;
}

.dpba-post-date {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #495057;
}

.dpba-post-author {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #495057;
}

.dpba-post-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Post title */
.dpba-post-title {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 600;
}

.dpba-post-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dpba-post-title a:hover {
    color: #1976d2;
}

/* Post excerpt */
.dpba-post-excerpt {
    line-height: 1.6;
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 0;
    margin-top: auto;
}

/* Pagination */
.dpba-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 20px;
}

.dpba-pagination .page-numbers {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
    align-items: center;
}

.dpba-pagination .page-numbers li {
    margin: 0;
}

.dpba-pagination .page-numbers a,
.dpba-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #1976d2;
    transition: all 0.3s ease;
}

.dpba-pagination .page-numbers a:hover {
    background: #f5f5f5;
    color: #1976d2;
}

.dpba-pagination .page-numbers .current {
    background: #1976d2;
    color: #ffffff;
    font-weight: 500;
}

.dpba-pagination .page-numbers .prev,
.dpba-pagination .page-numbers .next {
    font-size: 14px;
    padding: 0 12px;
    color: #1976d2;
}

.dpba-pagination .page-numbers .prev:hover,
.dpba-pagination .page-numbers .next:hover {
    background: #f5f5f5;
}

.dpba-pagination .page-numbers .dots {
    background: transparent;
    color: #6c757d;
    cursor: default;
}

.dpba-pagination .page-numbers .dots:hover {
    background: transparent;
}

/* Layout variations */
.dpba-layout-list .dpba-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.dpba-layout-list .dpba-card {
    display: flex;
    flex-direction: row;
    height: 180px;
}

.dpba-layout-list .dpba-post-image {
    width: 280px;
    height: 100%;
    flex-shrink: 0;
}

.dpba-layout-list .dpba-post-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dpba-layout-compact .dpba-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dpba-layout-compact .dpba-card {
    border-radius: 8px;
}

.dpba-layout-compact .dpba-post-image {
    height: 150px;
}

.dpba-layout-compact .dpba-post-content {
    padding: 16px;
}

.dpba-layout-compact .dpba-post-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

/* Error and no posts messages */
.dpba-error,
.dpba-no-posts {
    padding: 24px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.dpba-error {
    background: #fff5f5;
    border-color: #fed7d7;
    color: #c53030;
}

.dpba-no-posts {
    color: #6c757d;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 1200px) {
    .dpba-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .dpba-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dpba-layout-list .dpba-card {
        flex-direction: column;
        height: auto;
    }
    
    .dpba-layout-list .dpba-post-image {
        width: 100%;
        height: 200px;
    }
    
    .dpba-post-content {
        padding: 20px;
    }
    
    .dpba-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .dpba-post-title {
        font-size: 1.1rem;
    }
    
    .dpba-pagination .page-numbers a,
    .dpba-pagination .page-numbers span {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .posts-by-author {
        margin: 20px 0;
    }
    
    .dpba-posts-grid {
        gap: 15px;
    }
    
    .dpba-post-content {
        padding: 16px;
    }
    
    .dpba-post-title {
        font-size: 1rem;
    }
    
    .dpba-post-excerpt {
        font-size: 0.9rem;
    }
    
    .dpba-pagination .page-numbers {
        gap: 4px;
    }
    
    .dpba-pagination .page-numbers a,
    .dpba-pagination .page-numbers span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .dpba-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dpba-layout-compact .dpba-posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .dpba-card {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .dpba-post-title a {
        color: #e0e0e0;
    }
    
    .dpba-post-title a:hover {
        color: #4fc3f7;
    }
    
    .dpba-post-meta {
        color: #bbb;
    }
    
    .dpba-post-date,
    .dpba-post-author {
        color: #ccc;
    }
    
    .dpba-post-category {
        background: #1976d2;
        color: #ffffff;
    }
    
    .dpba-post-excerpt {
        color: #ccc;
    }
    
    .dpba-fallback-image {
        background: linear-gradient(135deg, #434343 0%, #000000 100%);
    }
    
    .dpba-overlay {
        background: rgba(255, 255, 255, 0.9);
        color: #000;
    }
    
    .dpba-card:hover .dpba-overlay {
        background: rgba(255, 255, 255, 1);
    }
    
    .dpba-pagination .page-numbers a,
    .dpba-pagination .page-numbers span {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .dpba-pagination .page-numbers a:hover,
    .dpba-pagination .page-numbers .current {
        background: #1976d2;
        color: #ffffff;
        border-color: #1976d2;
    }
    
    .dpba-error,
    .dpba-no-posts {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .dpba-error {
        background: #2d1b1b;
        border-color: #d32f2f;
        color: #f44336;
    }
}

/* Loading animation */
.dpba-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1976d2;
    border-radius: 50%;
    animation: dpba-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes dpba-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects */
.dpba-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(25, 118, 210, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dpba-card:hover::before {
    opacity: 1;
}

/* Focus styles for accessibility */
.dpba-post-title a:focus,
.dpba-pagination .page-numbers a:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .dpba-pagination {
        display: none;
    }
    
    .dpba-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .dpba-post-title a {
        color: #000;
        text-decoration: underline;
    }
} 