/**
 * Sidebar Articles Widget — v1.0 Styles
 * ──────────────────────────────────────
 * Vertical thumbnail list for WordPress sidebars.
 * Each card: small square thumbnail (left) + title (right).
 * Includes skeleton loading animation for AJAX (random) rows.
 */

/* ─────────────────────────────────────────────
   List Container
   ───────────────────────────────────────────── */
.sw-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
}

/* Fade-in after AJAX load */
.sw-list--loaded {
    animation: swFadeIn 0.35s ease-out;
}

@keyframes swFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────
   Card  (link wrapper — horizontal row)
   ───────────────────────────────────────────── */
.sw-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

.sw-card:first-child {
    padding-top: 0;
}

.sw-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sw-card:hover,
.sw-card:focus-visible {
    background-color: rgba(0, 0, 0, 0.02);
    outline: none;
}

.sw-card:hover .sw-thumb {
    transform: scale(1.06);
}

/* ─────────────────────────────────────────────
   Thumbnail Wrapper  (1 : 1 square)
   ───────────────────────────────────────────── */
.sw-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f0f0f0;
}

/* ─────────────────────────────────────────────
   Thumbnail Image
   ───────────────────────────────────────────── */
.sw-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

/* ─────────────────────────────────────────────
   No-thumbnail Placeholder
   ───────────────────────────────────────────── */
.sw-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8e8e8;
}

.sw-no-thumb-icon {
    color: #b0b0b0;
    line-height: 0;
}

/* ─────────────────────────────────────────────
   Title
   ───────────────────────────────────────────── */
.sw-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sw-card:hover .sw-title {
    color: #0073aa;
}

/* ═════════════════════════════════════════════
   Skeleton Loading  (for AJAX rows)
   ═════════════════════════════════════════════ */
.sw-skeleton {
    pointer-events: none;
}

.sw-skeleton-thumb {
    background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
    background-size: 200% 100%;
    animation: swShimmer 1.4s ease-in-out infinite;
}

.sw-skeleton-title {
    flex: 1;
    height: 14px;
    margin: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
    background-size: 200% 100%;
    animation: swShimmer 1.4s ease-in-out infinite;
}

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