/**
 * Widget Thumbnail Styles - PROFESSIONAL QUALITY WITH BRAND COLORS
 * Version: 2.3
 * Date: 2025-11-04
 * Description: Professional widget thumbnails meeting 100-point checklist standards
 * Changes: Added .trending-date styling to match .buzz-date for horizontal layout
 */

/* ========================================
   WIDGET THUMBNAIL CONTAINER
   ======================================== */

/* Widget item with thumbnail - HORIZONTAL LAYOUT */
.widget-item-with-thumb {
    display: block;
    margin-bottom: 16px;  /* Changed from 20px to 16px for 8px grid compliance */
    transition: all 0.3s ease;
}

.widget-item-with-thumb:last-child {
    margin-bottom: 0;
}

/* Widget thumbnail link container - FLEXBOX HORIZONTAL */
.widget-thumb-link {
    display: flex;
    align-items: flex-start;
    gap: 16px;  /* 8px grid compliance - proper spacing between image and text */
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    padding: 8px;  /* 8px grid compliance */
    border-radius: 8px;
    background: #ffffff;
}

.widget-thumb-link:hover {
    text-decoration: none;
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(95, 37, 111, 0.1);
    transform: translateY(-2px);
}

/* ========================================
   THUMBNAIL IMAGE - MAKE IT PROMINENT
   ======================================== */

/* Widget thumbnail image - PROFESSIONAL SIZE PER CHECKLIST */
.widget-thumb {
    width: 110px;  /* Checklist requirement: 110px minimum for desktop */
    height: 110px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 2px solid transparent;
}

.widget-thumb-link:hover .widget-thumb {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(95, 37, 111, 0.25);
    border-color: #5F256F;
}

/* ========================================
   TEXT CONTENT - BETTER TYPOGRAPHY
   ======================================== */

/* Widget text content container */
.widget-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 4px 0;
}

/* Widget title - BIGGER, BOLDER FONT */
.widget-title {
    font-size: 16px;
    line-height: 1.4;
    color: #1a1a1a;
    font-weight: 600;
    font-family: 'Roboto', 'Arial', sans-serif;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s ease;

    /* Text overflow handling - 2 lines max */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.widget-thumb-link:hover .widget-title {
    color: #5F256F;
}

/* ========================================
   TRENDING IN CATEGORY WIDGET
   ======================================== */

/* Update trending list for thumbnail layout */
.widget-trending-category .trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: none;
}

.widget-trending-category .trending-item.widget-item-with-thumb {
    padding: 0;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 16px;  /* Changed from 20px to 16px for 8px grid */
    margin-bottom: 16px;  /* Changed from 20px to 16px for 8px grid */
}

.widget-trending-category .trending-item.widget-item-with-thumb:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Remove numbered bullets when using thumbnails */
.widget-trending-category .trending-item.widget-item-with-thumb::before {
    display: none;
}

/* ========================================
   RELATED BUZZ WIDGET
   ======================================== */

/* Buzz list container */
.buzz-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Buzz item with thumbnail */
.buzz-item.widget-item-with-thumb {
    padding: 0;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 16px;  /* Changed from 20px to 16px for 8px grid */
    margin-bottom: 16px;  /* Changed from 20px to 16px for 8px grid */
}

.buzz-item.widget-item-with-thumb:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Buzz date styling - BETTER TYPOGRAPHY */
.buzz-date,
.trending-date {
    font-size: 13px;
    color: #888888;
    display: block;
    margin-top: 4px;
    font-weight: 400;
    font-family: 'Roboto', 'Arial', sans-serif;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 991px) */
@media only screen and (max-width: 991px) {
    .widget-thumb {
        width: 96px;  /* Proportional reduction from 110px (8px grid: 12x8) */
        height: 96px;
    }

    .widget-title {
        font-size: 15px;
        line-height: 1.3;
    }

    .widget-thumb-link {
        gap: 16px;  /* Maintain 8px grid */
        padding: 8px;
    }
}

/* Mobile (max-width: 767px) */
@media only screen and (max-width: 767px) {
    .widget-thumb {
        width: 88px;  /* Checklist: 80px minimum for mobile (using 88px = 11x8 for 8px grid) */
        height: 88px;
    }

    .widget-title {
        font-size: 14px;
        line-height: 1.3;
    }

    .widget-thumb-link {
        gap: 16px;  /* Maintain 8px grid */
        padding: 8px;
    }

    .widget-item-with-thumb {
        margin-bottom: 16px;
    }
}

/* Small mobile (max-width: 575px) */
@media only screen and (max-width: 575px) {
    .widget-thumb {
        width: 80px;  /* Checklist minimum: 80px for mobile (10x8 for 8px grid) */
        height: 80px;
    }

    .widget-title {
        font-size: 13px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }

    .widget-thumb-link {
        gap: 8px;  /* Reduce gap on very small screens */
    }

    .buzz-date {
        font-size: 12px;
    }
}

/* ========================================
   FALLBACK / NO IMAGE STATE
   ======================================== */

/* Style for fallback/default images */
.widget-thumb[src*="default/logo150x130"] {
    background-color: #f0f0f0;
    border: 2px solid #e0e0e0;
    padding: 10px;
}

/* ========================================
   LOADING STATE
   ======================================== */

/* Placeholder for lazy-loaded images */
.widget-thumb[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus states for keyboard navigation */
.widget-thumb-link:focus {
    outline: 3px solid #5F256F;
    outline-offset: 3px;
    box-shadow: 0 4px 12px rgba(95, 37, 111, 0.2);
}

.widget-thumb-link:focus .widget-thumb {
    transform: scale(1.02);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .widget-thumb,
    .widget-title,
    .widget-thumb-link,
    .widget-item-with-thumb {
        transition: none;
        animation: none;
    }

    .widget-thumb-link:hover .widget-thumb {
        transform: none;
    }

    .widget-thumb-link:hover {
        transform: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .widget-thumb {
        max-width: 110px;
        max-height: 110px;
        box-shadow: none;
    }

    .widget-thumb-link {
        padding: 0;
        background: transparent;
    }

    .widget-thumb-link:hover {
        box-shadow: none;
        transform: none;
    }
}

/* ========================================
   ADDITIONAL VISUAL ENHANCEMENTS
   ======================================== */

/* Add subtle gradient overlay on hover */
.widget-thumb-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(95, 37, 111, 0) 0%, rgba(95, 37, 111, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 8px;
}

.widget-thumb-link:hover::after {
    opacity: 1;
}

/* Position for gradient */
.widget-thumb-link {
    position: relative;
}
