/*
 * Modern Articles Widget CSS
 * Everything in Arabic (RTL)
 */

:root {
    --maw-primary: #0073aa;
    --maw-new: #27ae60;
    --maw-updated: #2980b9;
    --maw-text: #333;
    --maw-bg: #fff;
    --maw-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.maw-container {
    direction: rtl;
    text-align: right;
    margin: 20px 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* Base Post Card */
.maw-post-card {
    background: var(--maw-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--maw-shadow);
    margin-bottom: 15px;
}

.maw-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.maw-post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.maw-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.maw-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.maw-post-card:hover .maw-thumbnail img {
    transform: scale(1.1);
}

/* Badges */
.maw-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 2;
}

.maw-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.maw-badge-new { background-color: var(--maw-new); }
.maw-badge-updated { background-color: var(--maw-updated); }

/* Content */
.maw-content {
    padding: 15px;
}

.maw-title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--maw-text);
    transition: color 0.3s;
}

.maw-post-card:hover .maw-title {
    color: var(--maw-primary);
}

.maw-meta {
    font-size: 0.85rem;
    color: #888;
}

/* --- Layout 1: List (Magazine Style) --- */
.maw-layout-list .maw-post-card {
    flex-direction: row;
    display: flex;
    align-items: center;
}

.maw-layout-list .maw-post-link {
    flex-direction: row;
    width: 100%;
}

.maw-layout-list .maw-thumbnail {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    margin: 10px;
}

.maw-layout-list .maw-content {
    padding: 10px;
}

.maw-layout-list .maw-title {
    font-size: 1rem;
    margin-bottom: 5px;
}

/* --- Layout 2: Carousel (Slider) --- */
.maw-layout-carousel {
    display: block;
}

.maw-layout-carousel .maw-post-card {
    margin: 10px;
    height: 100%;
}

.maw-layout-carousel .slick-dots {
    bottom: -30px;
}

.maw-layout-carousel .slick-prev, 
.maw-layout-carousel .slick-next {
    z-index: 5;
    width: 40px;
    height: 40px;
    background: var(--maw-primary);
    border-radius: 50%;
}

.maw-layout-carousel .slick-prev { left: -45px; }
.maw-layout-carousel .slick-next { right: -45px; }

.maw-layout-carousel .slick-prev:hover, 
.maw-layout-carousel .slick-next:hover {
    background: #333;
}

/* --- Layout 3: Grid --- */
.maw-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .maw-layout-list .maw-post-link {
        flex-direction: column;
    }
    
    .maw-layout-list .maw-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        margin: 0;
        border-radius: 0;
    }
    
    .maw-layout-grid {
        grid-template-columns: 1fr;
    }
}
