/* SW Publisher — استایل شورت‌کد [sw_feed] — نسخه 1.0.7 */
.swp-feed-wrap {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    color: #212529;
    margin: 20px 0;
    font-weight: 500;
}

.swp-feed { margin: 0; }

.swp-feed.swp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.swp-feed.swp-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.swp-loading,
.swp-empty {
    padding: 24px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 10px;
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 600;
}

.swp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ced4da;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: swp-spin .7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes swp-spin {
    to { transform: rotate(360deg); }
}

.swp-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}

.swp-list .swp-card { flex-direction: row; }

.swp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.07);
}

.swp-card-thumb {
    display: block;
    overflow: hidden;
    background: #f1f3f5;
    position: relative;
    cursor: zoom-in;
}

.swp-grid .swp-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
}

.swp-list .swp-card-thumb {
    flex: 0 0 220px;
    aspect-ratio: 4 / 3;
}

.swp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.swp-card:hover .swp-card-thumb img { transform: scale(1.03); }

.swp-card-zoom {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.6);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.swp-card-thumb:hover .swp-card-zoom { opacity: 1; }

.swp-card-body {
    padding: 14px 16px 16px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.swp-card-title {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.6;
    font-weight: 800;
    color: #212529;
}

.swp-card-excerpt {
    font-size: 15px;
    line-height: 1.9;
    color: #343a40;
    flex: 1 1 auto;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.swp-card-meta {
    margin-top: auto;
    font-size: 13px;
    color: #868e96;
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 600;
}

.swp-load-more-wrap {
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.swp-load-more {
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .12s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(13,110,253,.25);
}

.swp-load-more:hover:not(:disabled) {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13,110,253,.35);
}

.swp-load-more:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.swp-load-status { font-size: 14px; font-weight: 700; }

/* ---------- Lightbox ---------- */
.swp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
    animation: swp-lb-fade .18s ease;
}

@keyframes swp-lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.swp-lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    cursor: default;
    object-fit: contain;
    animation: swp-lb-zoom .22s ease;
}

@keyframes swp-lb-zoom {
    from { transform: scale(.92); opacity: .6; }
    to   { transform: scale(1);   opacity: 1; }
}

.swp-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: background .15s;
    z-index: 1;
}

.swp-lightbox-close:hover { background: rgba(255,255,255,.3); }

.swp-lightbox-caption {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 88vw;
    color: rgba(255,255,255,.95);
    background: rgba(0,0,0,.55);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

.swp-lightbox-caption:empty { display: none; }

body.swp-lightbox-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .swp-list .swp-card { flex-direction: column; }
    .swp-list .swp-card-thumb { flex: none; width: 100%; aspect-ratio: 16 / 10; }

    .swp-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .swp-lightbox-img {
        max-width: 96vw;
        max-height: 82vh;
    }

    .swp-lightbox-caption {
        bottom: 12px;
        font-size: 13px;
        padding: 8px 16px;
    }
}
