/* =============================================
   Prompt Sathi Blog Section — ps-blog.css
   Version: 1.0.0
   ============================================= */

/* ---------- Reset & Base ---------- */
.ps-blog-section *,
.ps-blog-section *::before,
.ps-blog-section *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ps-blog-section {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    padding: 0.75rem 0 1.5rem;
    max-width: 100%;
}

/* ---------- Section Header ---------- */
.ps-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    padding: 0 2px;
}

.ps-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.ps-title-bar {
    width: 36px;
    height: 3px;
    background: #2563EB;
    border-radius: 2px;
    margin-top: 5px;
}

/* Live Badge */
.ps-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #D1FAE5;
    border-radius: 99px;
    padding: 3px 10px;
    letter-spacing: 0.2px;
    margin-top: 2px;
}

.ps-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #059669;
    animation: psb-pulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes psb-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- Post Card ---------- */
.ps-post-card {
    display: flex;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: psb-fadeup 0.35s ease both;
}

.ps-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.09);
    border-color: #DBEAFE;
    text-decoration: none;
    color: inherit;
}

.ps-post-card:nth-child(1) { animation-delay: 0s; }
.ps-post-card:nth-child(2) { animation-delay: 0.06s; }
.ps-post-card:nth-child(3) { animation-delay: 0.12s; }
.ps-post-card:nth-child(4) { animation-delay: 0.18s; }
.ps-post-card:nth-child(5) { animation-delay: 0.24s; }
.ps-post-card:nth-child(6) { animation-delay: 0.30s; }

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

/* ---------- Thumbnail ---------- */
.ps-thumb-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    border-radius: 9px;
    overflow: hidden;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ps-post-card:hover .ps-thumb-wrap img {
    transform: scale(1.06);
}

.ps-thumb-fallback {
    font-size: 28px;
    opacity: 0.45;
    line-height: 1;
}

/* ---------- Card Body ---------- */
.ps-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: space-between;
}

/* Meta Row: Category + Time */
.ps-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1;
}

.ps-cat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: 0.15px;
    line-height: 1.6;
}

/* Category Colors */
.ps-cat-ai-tools      { background: #F0FDF4; color: #14532D; }
.ps-cat-ai-prompts    { background: #EEF2FF; color: #3730A3; }
.ps-cat-student       { background: #EFF6FF; color: #1D4ED8; }
.ps-cat-festival      { background: #FFF1F2; color: #9F1239; }
.ps-cat-photo-editing { background: #FDF4FF; color: #6B21A8; }
.ps-cat-video-editing { background: #FFF7ED; color: #9A3412; }
.ps-cat-productivity  { background: #ECFDF5; color: #065F46; }
.ps-cat-god           { background: #FFFBEB; color: #92400E; }
.ps-cat-default       { background: #EEF2FF; color: #2563EB; }

.ps-meta-sep {
    font-size: 10px;
    color: #CBD5E1;
    margin: 0 5px;
    line-height: 1;
}

.ps-post-time {
    font-size: 10px;
    color: #94A3B8;
    white-space: nowrap;
    line-height: 1.6;
}

/* Post Title */
.ps-post-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
    transition: color 0.15s;
}

.ps-post-card:hover .ps-post-title {
    color: #2563EB;
}

/* Excerpt */
.ps-post-excerpt {
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Skeleton Loader ---------- */
.ps-skeleton-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    margin-bottom: 10px;
}

.ps-sk {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: psb-shimmer 1.4s infinite;
    border-radius: 6px;
}

.ps-sk-thumb {
    width: 100px;
    height: 80px;
    border-radius: 9px;
    flex-shrink: 0;
}

.ps-sk-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.ps-sk-line {
    height: 10px;
}

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

/* ---------- Error Box ---------- */
.ps-error-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #B91C1C;
    margin-bottom: 10px;
}

/* ---------- Read All Button ---------- */
.ps-read-all-wrap {
    text-align: center;
    margin-top: 1.25rem;
}

.ps-read-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563EB;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 28px;
    border-radius: 9px;
    text-decoration: none !important;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    letter-spacing: 0.01em;
    line-height: 1;
}

.ps-read-all-btn:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    color: #ffffff !important;
}

.ps-read-all-btn svg {
    flex-shrink: 0;
}

/* ---------- Responsive: Desktop ---------- */
@media (min-width: 640px) {
    .ps-thumb-wrap {
        width: 120px;
        height: 90px;
    }

    .ps-post-title {
        font-size: 14.5px;
    }

    .ps-post-excerpt {
        font-size: 12.5px;
    }

    .ps-cat-badge {
        font-size: 11px;
        padding: 3px 9px;
    }

    .ps-post-time {
        font-size: 11px;
    }
}

@media (min-width: 1024px) {
    .ps-blog-section {
        padding: 1rem 0 2rem;
    }

    .ps-thumb-wrap {
        width: 130px;
        height: 96px;
    }

    .ps-post-card {
        gap: 14px;
        padding: 12px;
    }
}

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
    .ps-post-card {
        background: #1E293B;
        border-color: #334155;
    }

    .ps-post-card:hover {
        border-color: #3B82F6;
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    }

    .ps-section-title {
        color: #F1F5F9;
    }

    .ps-post-title {
        color: #F1F5F9;
    }

    .ps-post-excerpt {
        color: #94A3B8;
    }

    .ps-thumb-wrap {
        background: #334155;
    }

    .ps-skeleton-card {
        background: #1E293B;
        border-color: #334155;
    }

    .ps-sk {
        background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
        background-size: 200% 100%;
    }

    .ps-read-all-btn {
        background: #2563EB;
    }

    .ps-read-all-btn:hover {
        background: #3B82F6;
    }
}
