/**
 * blog.css — Chaltakhali R.G.B.C. Institution Blog Styles
 * Dedicated styling for pages/blog.php
 */

/* ===================================================
   1. Utility & Tailwind Fallback Classes
   =================================================== */
.bg-slate-50 {
    background-color: #f8fafc !important;
}
.border-slate-100 {
    border-color: #f1f5f9 !important;
}
.border-slate-200 {
    border-color: #e2e8f0 !important;
}
.shadow-xs {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.fs-7 {
    font-size: 0.875rem !important;
}
.fs-8 {
    font-size: 0.775rem !important;
}
.text-xs {
    font-size: 0.75rem !important;
}
.fw-extrabold {
    font-weight: 800 !important;
}
.letter-spacing-1 {
    letter-spacing: 0.06em;
}
.tracking-wider {
    letter-spacing: 0.05em;
}
.max-w-700 {
    max-width: 700px;
}
.min-h-300 {
    min-height: 320px;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hover-primary {
    transition: color 0.2s ease;
}
.hover-primary:hover {
    color: #2563eb !important;
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===================================================
   2. Hero Banner
   =================================================== */
.blog-hero-banner {
    background: linear-gradient(135deg, #091a3e 0%, #0f3871 50%, #1e3a8a 100%);
    padding: 4rem 0 3.5rem 0;
    position: relative;
    overflow: hidden;
}

.blog-hero-banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.blog-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ===================================================
   3. Search & Filter Bar
   =================================================== */
.blog-search-card {
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
}

.blog-search-group {
    border-radius: 50rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.blog-search-group .input-group-text,
.blog-search-group .form-control,
.blog-search-group .btn {
    border: 1px solid #e2e8f0;
}

.blog-search-group .form-control:focus {
    box-shadow: none;
    background-color: #ffffff !important;
}

/* Category Filter Pills */
.category-filter-btn {
    border-radius: 50rem;
    padding: 0.45rem 1.05rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    white-space: nowrap;
}

.category-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    color: #0f172a;
}

.category-filter-btn .cat-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    transition: all 0.2s ease;
}

/* Specific Active Colors */
.category-filter-btn.cat-btn-all.active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25) !important;
}

.category-filter-btn.cat-btn-academic.active {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

.category-filter-btn.cat-btn-science.active {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}

.category-filter-btn.cat-btn-sports.active {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3) !important;
}

.category-filter-btn.cat-btn-arts.active {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3) !important;
}

.category-filter-btn.cat-btn-student.active {
    background: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.3) !important;
}

.category-filter-btn.active .cat-count-pill {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* ===================================================
   4. Category Themes & Color Gradients
   =================================================== */
.cat-gradient-academic {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #ffffff;
}
.cat-pill-academic {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.category-filter-btn.cat-btn-academic:not(.active) i {
    color: #2563eb;
}

.cat-gradient-science {
    background: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
    color: #ffffff;
}
.cat-pill-science {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}
.category-filter-btn.cat-btn-science:not(.active) i {
    color: #7c3aed;
}

.cat-gradient-sports {
    background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
    color: #ffffff;
}
.cat-pill-sports {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.category-filter-btn.cat-btn-sports:not(.active) i {
    color: #059669;
}

.cat-gradient-arts {
    background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%);
    color: #ffffff;
}
.cat-pill-arts {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.category-filter-btn.cat-btn-arts:not(.active) i {
    color: #d97706;
}

.cat-gradient-student {
    background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%);
    color: #ffffff;
}
.cat-pill-student {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}
.category-filter-btn.cat-btn-student:not(.active) i {
    color: #0891b2;
}

.cat-gradient-default {
    background: linear-gradient(135deg, #334155 0%, #64748b 100%);
    color: #ffffff;
}
.cat-pill-default {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.category-filter-btn.cat-btn-default:not(.active) i {
    color: #475569;
}

/* Category Badge Pill */
.blog-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ===================================================
   5. Featured Story Hero Spotlight
   =================================================== */
.featured-story-card {
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.featured-story-card:hover {
    box-shadow: 0 15px 40px -8px rgba(15, 23, 42, 0.12);
}

.featured-story-card .blog-cover-placeholder {
    height: 100%;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.featured-story-card .blog-cover-placeholder i.featured-bg-icon {
    font-size: 5rem;
    opacity: 0.85;
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
}

.featured-story-card:hover .blog-cover-placeholder i.featured-bg-icon {
    transform: scale(1.1);
}

.btn-featured-story-read {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-featured-story-read:hover {
    background: linear-gradient(135deg, #172554 0%, #1d4ed8 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35) !important;
}

/* ===================================================
   6. Blog Cards Grid
   =================================================== */
.blog-card {
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.blog-card-cover {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f1f5f9;
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-card-img {
    transform: scale(1.06);
}

/* Cover Placeholder for posts without images */
.blog-cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.blog-cover-placeholder i {
    font-size: 3.5rem;
    opacity: 0.85;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.blog-card:hover .blog-cover-placeholder i {
    transform: scale(1.12);
    opacity: 1;
}

.blog-cover-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

/* Card Button */
.blog-card-btn {
    transition: all 0.2s ease;
}
.blog-card:hover .blog-card-btn {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* ===================================================
   7. Author Avatar Badges
   =================================================== */
.blog-author-avatar-badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    user-select: none;
    border: 2px solid #ffffff;
}

.blog-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ===================================================
   8. Responsive Adjustments
   =================================================== */
@media (max-width: 768px) {
    .blog-hero-banner {
        padding: 2.75rem 0 2.25rem 0;
    }
    .featured-story-card .blog-cover-placeholder {
        min-height: 240px;
    }
    .category-filter-btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.8rem;
    }
}
