/**
 * Mag Posts Integration Styles
 * Modern, responsive design for displaying magazine posts
 */

/* Grid Layout */
.mag-recent-posts.mag-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

/* List Layout */
.mag-recent-posts.mag-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.mag-posts-list .mag-post {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

/* Individual Post Card */
.mag-post {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mag-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* Thumbnail */
.mag-post-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.mag-posts-grid .mag-post-thumbnail {
    height: 220px;
}

.mag-posts-list .mag-post-thumbnail {
    height: 100%;
    min-height: 200px;
}

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

.mag-post:hover .mag-post-thumbnail img {
    transform: scale(1.05);
}

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

/* Content Area */
.mag-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Title */
.mag-post-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 700;
}

.mag-post-title a {
    text-decoration: none;
    color: #111827;
    transition: color 0.2s ease;
}

.mag-post-title a:hover {
    color: #2563eb;
}

/* Meta Information */
.mag-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.875rem;
    color: #6b7280;
}

.mag-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mag-post-meta svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Excerpt */
.mag-post-excerpt {
    font-size: 0.938rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

.mag-post-excerpt p {
    margin: 0 0 10px 0;
}

.mag-post-excerpt p:last-child {
    margin-bottom: 0;
}

/* Read More Link */
.mag-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.938rem;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.mag-read-more:hover {
    gap: 8px;
    color: #1d4ed8;
}

/* Error Message */
.mag-posts-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mag-recent-posts.mag-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mag-posts-list .mag-post {
        grid-template-columns: 1fr;
    }
    
    .mag-posts-list .mag-post-thumbnail {
        height: 200px;
        min-height: auto;
    }
    
    .mag-post-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .mag-post-content {
        padding: 15px;
    }
    
    .mag-post-meta {
        font-size: 0.813rem;
        gap: 10px;
    }
}

/* Widget Specific Styles */
.widget .mag-recent-posts {
    margin: 15px 0;
}

.widget .mag-post {
    margin-bottom: 15px;
}

.widget .mag-posts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
}

.widget .mag-post-thumbnail {
    height: 150px;
}

.widget .mag-post-title {
    font-size: 1rem;
}

.widget .mag-post-content {
    padding: 15px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .mag-post {
        background: #1f2937;
        border-color: #374151;
    }
    
    .mag-post:hover {
        border-color: #4b5563;
    }
    
    .mag-post-title a {
        color: #f9fafb;
    }
    
    .mag-post-title a:hover {
        color: #60a5fa;
    }
    
    .mag-post-excerpt {
        color: #d1d5db;
    }
    
    .mag-post-meta {
        color: #9ca3af;
    }
    
    .mag-read-more {
        color: #60a5fa;
    }
    
    .mag-read-more:hover {
        color: #93c5fd;
    }
}
