/**
 * VH360 Widget Styles
 *
 * Styles for custom widgets including the Latest Posts widget
 *
 * @package Videohub360_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   Latest Posts Widget
   ========================================================================== */

.vh360-latest-posts-widget {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.vh360-latest-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vh360-latest-post-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.vh360-latest-post-item:first-child {
    padding-top: 0;
}

.vh360-latest-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vh360-latest-post-content {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.875rem;
    align-items: start;
}

/* Thumbnail Styles */
.vh360-latest-post-thumbnail {
    flex-shrink: 0;
}

.vh360-latest-post-thumbnail a {
    display: block;
    width: 140px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vh360-latest-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.vh360-latest-post-thumbnail a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vh360-latest-post-thumbnail a:hover img {
    opacity: 0.9;
}

/* Post Details */
.vh360-latest-post-details {
    flex: 1;
    min-width: 0; /* Allows text truncation if needed */
}

.vh360-latest-post-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
}

.vh360-latest-post-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vh360-latest-post-title a:hover {
    color: #3b82f6;
}

.vh360-latest-post-date {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.vh360-latest-post-excerpt {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #4b5563;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and below */
@media (max-width: 768px) {
    .vh360-latest-post-content {
        grid-template-columns: 80px 1fr;
        gap: 0.75rem;
    }

    .vh360-latest-post-thumbnail a {
        width: 80px;
        border-radius: 6px;
    }

    .vh360-latest-post-title {
        font-size: 0.9rem;
    }

    .vh360-latest-post-date {
        font-size: 0.75rem;
    }

    .vh360-latest-post-excerpt {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .vh360-latest-post-item {
        padding: 0.75rem 0;
    }

    .vh360-latest-post-content {
        grid-template-columns: 70px 1fr;
        gap: 0.625rem;
    }

    .vh360-latest-post-thumbnail a {
        width: 70px;
    }

    .vh360-latest-post-title {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .vh360-latest-post-date {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }

    .vh360-latest-post-excerpt {
        font-size: 0.775rem;
        line-height: 1.4;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .vh360-latest-post-item {
        border-bottom-color: #374151;
    }

    .vh360-latest-post-title a {
        color: #f9fafb;
    }

    .vh360-latest-post-title a:hover {
        color: #60a5fa;
    }

    .vh360-latest-post-date {
        color: #9ca3af;
    }

    .vh360-latest-post-excerpt {
        color: #d1d5db;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .vh360-latest-post-thumbnail a:hover {
        transform: none;
        box-shadow: none;
    }
}
