/**
 * WEEU RSS Feed Widget Styles
 * Responsive mosaic layouts for RSS feed display
 */

/* ==========================================
   Base Container Styles
   ========================================== */
.weeu-rss-feed {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* ==========================================
   Individual Item Styles
   ========================================== */
.weeu-rss-item {
    position: relative;
    background: #ffffff;
    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;
}

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

/* Image Container */
.weeu-rss-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.weeu-rss-image a {
    display: block;
    position: relative;
    padding-bottom: 60%;
    overflow: hidden;
}

.weeu-rss-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.weeu-rss-item:hover .weeu-rss-image img {
    transform: scale(1.05);
}

/* Content Container */
.weeu-rss-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.weeu-rss-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

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

.weeu-rss-title a:hover {
    color: #F80000;
}

/* Date */
.weeu-rss-date {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

/* Excerpt */
.weeu-rss-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    flex: 1;
}

/* ==========================================
   GRID LAYOUT (Even Columns)
   ========================================== */
.weeu-rss-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ==========================================
   MASONRY LAYOUT (Pinterest Style)
   ========================================== */
.weeu-rss-layout-masonry {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 10px;
}

.weeu-rss-layout-masonry .weeu-rss-item {
    grid-row-end: span 30;
}

.weeu-rss-layout-masonry .weeu-rss-item:nth-child(3n+1) {
    grid-row-end: span 35;
}

.weeu-rss-layout-masonry .weeu-rss-item:nth-child(3n+2) {
    grid-row-end: span 28;
}

/* ==========================================
   FEATURED LAYOUT (First Large)
   ========================================== */
.weeu-rss-layout-featured {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.weeu-rss-layout-featured .weeu-rss-featured {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .weeu-rss-layout-featured {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .weeu-rss-layout-featured .weeu-rss-featured {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
    }
    
    .weeu-rss-layout-featured .weeu-rss-featured .weeu-rss-image a {
        padding-bottom: 65%;
    }
    
    .weeu-rss-layout-featured .weeu-rss-featured .weeu-rss-title {
        font-size: 28px;
    }
    
    .weeu-rss-layout-featured .weeu-rss-featured .weeu-rss-excerpt {
        font-size: 16px;
    }
}

/* ==========================================
   AUTO LAYOUT (Smart Sizing)
   ========================================== */
.weeu-rss-layout-auto {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(150px, auto);
}

/* Large items */
.weeu-rss-layout-auto .weeu-rss-large {
    grid-column: span 12;
}

/* Medium items */
.weeu-rss-layout-auto .weeu-rss-medium {
    grid-column: span 12;
}

/* Small items */
.weeu-rss-layout-auto .weeu-rss-small {
    grid-column: span 12;
}

/* Featured item (full width, extra large) */
.weeu-rss-layout-auto .weeu-rss-featured {
    grid-column: 1 / -1;
    grid-row: span 2;
}

.weeu-rss-layout-auto .weeu-rss-featured .weeu-rss-title {
    font-size: 32px;
}

.weeu-rss-layout-auto .weeu-rss-featured .weeu-rss-excerpt {
    font-size: 18px;
}

/* Tablet and up */
@media (min-width: 768px) {
    .weeu-rss-layout-auto .weeu-rss-large {
        grid-column: span 6;
    }
    
    .weeu-rss-layout-auto .weeu-rss-medium {
        grid-column: span 6;
    }
    
    .weeu-rss-layout-auto .weeu-rss-small {
        grid-column: span 4;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .weeu-rss-layout-auto .weeu-rss-large {
        grid-column: span 6;
        grid-row: span 2;
    }
    
    .weeu-rss-layout-auto .weeu-rss-medium {
        grid-column: span 4;
    }
    
    .weeu-rss-layout-auto .weeu-rss-small {
        grid-column: span 3;
    }
    
    .weeu-rss-layout-auto .weeu-rss-large .weeu-rss-title {
        font-size: 24px;
    }
    
    .weeu-rss-layout-auto .weeu-rss-medium .weeu-rss-title {
        font-size: 18px;
    }
    
    .weeu-rss-layout-auto .weeu-rss-small .weeu-rss-title {
        font-size: 16px;
    }
}

/* ==========================================
   LIST LAYOUT (Vertical List)
   ========================================== */
.weeu-rss-layout-list {
    grid-template-columns: 1fr;
    gap: 15px;
}

.weeu-rss-layout-list .weeu-rss-item {
    flex-direction: row;
}

.weeu-rss-layout-list .weeu-rss-image {
    width: 200px;
    flex-shrink: 0;
}

.weeu-rss-layout-list .weeu-rss-image a {
    padding-bottom: 0;
    height: 100%;
}

.weeu-rss-layout-list .weeu-rss-image img {
    position: relative;
}

.weeu-rss-layout-list .weeu-rss-content {
    padding: 15px 20px;
}

@media (max-width: 767px) {
    .weeu-rss-layout-list .weeu-rss-item {
        flex-direction: column;
    }
    
    .weeu-rss-layout-list .weeu-rss-image {
        width: 100%;
    }
    
    .weeu-rss-layout-list .weeu-rss-image a {
        padding-bottom: 60%;
    }
    
    .weeu-rss-layout-list .weeu-rss-image img {
        position: absolute;
    }
}

/* ==========================================
   Error & Empty States
   ========================================== */
.weeu-rss-error,
.weeu-rss-empty {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
}

.weeu-rss-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ==========================================
   Loading State
   ========================================== */
.weeu-rss-loading {
    text-align: center;
    padding: 40px 20px;
}

.weeu-rss-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #F80000;
    border-radius: 50%;
    animation: weeu-rss-spin 1s linear infinite;
}

@keyframes weeu-rss-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */

/* Mobile Small */
@media (max-width: 480px) {
    .weeu-rss-feed {
        gap: 15px;
    }
    
    .weeu-rss-content {
        padding: 15px;
    }
    
    .weeu-rss-title {
        font-size: 16px;
    }
    
    .weeu-rss-excerpt {
        font-size: 13px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .weeu-rss-feed {
        gap: 18px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .weeu-rss-feed {
        gap: 24px;
    }
    
    .weeu-rss-layout-auto {
        grid-template-columns: repeat(12, 1fr);
    }
}

/* ==========================================
   Dark Mode Support
   ========================================== */
@media (prefers-color-scheme: dark) {
    .weeu-rss-item {
        background: #1a1a1a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .weeu-rss-item:hover {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    }
    
    .weeu-rss-title a {
        color: #ffffff;
    }
    
    .weeu-rss-title a:hover {
        color: #F80000;
    }
    
    .weeu-rss-date {
        color: #aaa;
    }
    
    .weeu-rss-excerpt {
        color: #ccc;
    }
    
    .weeu-rss-image {
        background: #2a2a2a;
    }
}

/* ==========================================
   Accessibility
   ========================================== */
.weeu-rss-item:focus-within {
    outline: 2px solid #F80000;
    outline-offset: 2px;
}

.weeu-rss-title a:focus,
.weeu-rss-image a:focus {
    outline: 2px solid #F80000;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .weeu-rss-item,
    .weeu-rss-image img,
    .weeu-rss-title a {
        transition: none;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .weeu-rss-feed {
        display: block;
    }
    
    .weeu-rss-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .weeu-rss-item:hover {
        transform: none;
    }
    
    .weeu-rss-image a {
        padding-bottom: 0;
        height: auto;
    }
}
