/* blog.css - Styles for the Baca blog page */

.blog-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
}

.blog-container {
    position: relative;
    z-index: 1;
}

/* === HERO === */
.blog-hero {
    text-align: center;
    padding: 2rem 1rem 1rem;
    position: relative;
}

.blog-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(120deg, #34d399, #10b981, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.blog-hero-subtitle {
    font-size: 1.05rem;
    color: var(--text, #94a3b8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* === FILTERS === */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}

.blog-filter-btn {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: transparent;
    color: var(--text, #94a3b8);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.blog-filter-btn:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}
.blog-filter-btn.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

/* === BLOG GRID === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.blog-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text, #64748b);
}
.blog-loading i { font-size: 1.5rem; color: #10b981; margin-bottom: 0.5rem; display: block; }

/* === BLOG CARD === */
.blog-card {
    background: var(--dark-light, #1e293b);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(16, 185, 129, 0.25);
}

.blog-card-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.blog-card-category.hadith { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.blog-card-category.sabab-nuzul { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.blog-card-category.fasting { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.blog-card-category.features { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.blog-card-category.reflection { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.blog-card-category.dua { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.blog-card-category.stories { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.blog-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white, #f0f5f0);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-card-excerpt {
    font-size: 0.85rem;
    color: var(--text, #94a3b8);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text, #64748b);
}

.blog-card-meta i { font-size: 0.7rem; }

.blog-card-readmore {
    margin-top: 0.75rem;
    padding: 6px 12px;
    border: none;
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    transition: all 0.2s ease;
}
.blog-card-readmore:hover {
    background: rgba(16, 185, 129, 0.18);
    transform: translateX(2px);
}

/* === PAGINATION === */
.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 2.5rem;
}
.blog-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--dark-light, #1e293b);
    color: var(--text, #94a3b8);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.blog-page-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}
.blog-page-btn.active {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.6);
    color: #10b981;
}
.blog-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* === EMPTY STATE === */
.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text, #64748b);
}
.blog-empty i { font-size: 2.5rem; color: #10b981; margin-bottom: 1rem; display: block; opacity: 0.5; }
.blog-empty h3 { font-size: 1.25rem; color: var(--white, #f0f5f0); margin-bottom: 0.5rem; }

/* === MODAL === */
.blog-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9000;
}
.blog-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.blog-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    background: var(--dark-light, #1e293b);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 18px;
    padding: 2.25rem 2rem 2rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9001;
    scrollbar-width: thin;
}
.blog-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.blog-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--text, #94a3b8);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.blog-modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: var(--white, #f0f5f0);
}
.blog-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white, #f0f5f0);
    line-height: 1.3;
    margin: 0.75rem 0 0.4rem;
    padding-right: 2.5rem;
}
.blog-modal-date {
    font-size: 0.78rem;
    color: var(--text, #64748b);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.blog-modal-body {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text, #cbd5e1);
}
.blog-modal-body p {
    margin: 0 0 1rem;
}
.blog-modal-body p:first-letter {
    font-weight: 700;
    color: #10b981;
}

/* === LIGHT MODE === */
body.light-mode .blog-card {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.light-mode .blog-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
body.light-mode .blog-card-title { color: #0f172a; }
body.light-mode .blog-card-excerpt { color: #64748b; }
body.light-mode .blog-card-meta { color: #94a3b8; }
body.light-mode .blog-hero-subtitle { color: #64748b; }
body.light-mode .blog-modal {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .blog-modal-title { color: #0f172a; }
body.light-mode .blog-modal-body { color: #334155; }
body.light-mode .blog-modal-date { color: #64748b; }
body.light-mode .blog-modal-close {
    background: rgba(0,0,0,0.04);
    color: #475569;
}
body.light-mode .blog-modal-close:hover {
    background: rgba(0,0,0,0.08);
    color: #0f172a;
}
body.light-mode .blog-filter-btn {
    color: #64748b;
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .blog-filter-btn:hover {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}
body.light-mode .blog-filter-btn.active {
    background: rgba(16, 185, 129, 0.16);
    color: #059669;
}
body.light-mode .blog-page-btn {
    background: #fff;
    color: #64748b;
    border-color: rgba(0,0,0,0.08);
}
body.light-mode .blog-page-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
body.light-mode .blog-page-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; gap: 1rem; }
    .blog-hero { padding: 2rem 0.5rem 1rem; }
    .blog-modal {
        padding: 1.75rem 1.25rem 1.5rem;
        top: 50%;
        max-height: calc(100vh - 2rem);
    }
    .blog-modal-title { font-size: 1.25rem; }
    .blog-modal-body { font-size: 0.9rem; line-height: 1.7; }
}
