/* Blog pages — dark tech theme prose & layout helpers */

/* Clearance for fixed floating header */
:root {
    --blog-header-clearance: 180px;
    --blog-header-clearance-mobile: 140px;
    /* Post detail hero uses tighter clearance */
    --blog-post-hero-clearance: 140px;
    --blog-post-hero-clearance-mobile: 110px;
}

.bg-dark-body {
    background-color: #0f172a;
    color: #e2e8f0;
}

.blog-page {
    --blog-accent: #818cf8;
    --blog-accent-soft: rgba(129, 140, 248, 0.15);
    --blog-surface: rgba(15, 23, 42, 0.6);
    --blog-border: rgba(148, 163, 184, 0.12);
}

/* Index page hero — large, generous spacing */
.blog-page-hero {
    position: relative;
    padding-top: var(--blog-header-clearance);
    padding-bottom: 3rem;
}

@media (max-width: 768px) {
    .blog-page-hero {
        padding-top: var(--blog-header-clearance-mobile);
        padding-bottom: 2.5rem;
    }
}

/* Post detail hero — compact, editorial */
.blog-post-hero {
    position: relative;
    padding-top: var(--blog-post-hero-clearance);
    padding-bottom: 2.25rem;
}

@media (max-width: 768px) {
    .blog-post-hero {
        padding-top: var(--blog-post-hero-clearance-mobile);
        padding-bottom: 1.75rem;
    }
}

/* Post title — responsive fluid scale, never huge */
.blog-post-title {
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    /* clamp(min, preferred, max): 1.65rem on small phones → ~2.75rem on wide screens */
    font-size: clamp(1.65rem, 4.5vw, 2.75rem);
    max-width: 44rem;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 480px) {
    .blog-post-title {
        font-size: 1.5rem;
        letter-spacing: -0.01em;
        line-height: 1.25;
    }
}

.blog-hero-glow {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.35), transparent),
        radial-gradient(ellipse 50% 40% at 90% 20%, rgba(56, 189, 248, 0.12), transparent),
        linear-gradient(180deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
}

/* Featured image — capped like project-details hero (max-height: 420px, object-fit: cover) */
.blog-featured-image {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    padding: 0 1.5rem;
}

.blog-featured-image__frame {
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--blog-border);
    background: rgba(15, 23, 42, 0.5);
    max-height: 420px;
}

.blog-featured-image__frame img {
    display: block;
    width: 100%;
    height: 420px;
    max-height: 420px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 640px) {
    .blog-featured-image__frame img {
        height: 240px;
        max-height: 240px;
    }
}

/* Article body — comfortable reading width, centered */
.blog-article-section {
    padding: 0 1.5rem 4rem;
}

.blog-article {
    max-width: 48rem;
    margin: 0 auto;
}


.blog-card-glow {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(145deg, rgba(30, 27, 75, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--blog-border);
    border-radius: 1rem; /* أو 1.25rem حسب ما تحب */
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-card-glow:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 24px 48px -12px rgba(79, 70, 229, 0.35);
}

.blog-prose {
    color: #d1d5db;
    font-size: 1.0625rem;
    line-height: 1.75;
    max-width: none;
}

.blog-prose-article p {
    margin-bottom: 1.5rem;
    color: #d1d5db;
}

.blog-prose-article p:last-child {
    margin-bottom: 0;
}

.blog-prose-article strong,
.blog-prose-article b {
    color: #f3f4f6;
    font-weight: 600;
}

.blog-prose-article em,
.blog-prose-article i {
    color: #e5e7eb;
}

.blog-page-hero h1 {
    font-size: 2.25rem !important; /* أو المقاس اللي تحبه */
    max-width: 650px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

@media (max-width: 768px) {
    .blog-page-hero h1 {
        font-size: 1.75rem !important;
        max-width: 90% !important;
    }
}


.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
    color: #f1f5f9;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.blog-prose h2 { font-size: 1.75rem; }
.blog-prose h3 { font-size: 1.375rem; }

.blog-prose p {
    margin-bottom: 1.35em;
}

.blog-prose a {
    color: var(--blog-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-prose ul,
.blog-prose ol {
    margin-bottom: 1.35em;
    padding-inline-start: 1.5em;
}

.blog-prose li {
    margin-bottom: 0.5em;
}

.blog-prose img {
    border-radius: 1rem;
    margin: 2em 0;
}

.blog-prose blockquote {
    border-inline-start: 4px solid var(--blog-accent);
    padding-inline-start: 1.25rem;
    margin: 1.75em 0;
    color: #94a3b8;
    font-style: italic;
}

.blog-prose code {
    background: rgba(99, 102, 241, 0.15);
    padding: 0.15em 0.4em;
    border-radius: 0.375rem;
    font-size: 0.9em;
}

.blog-prose pre {
    background: #0f172a;
    border: 1px solid var(--blog-border);
    border-radius: 1rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.75em 0;
}

.blog-prose pre code {
    background: none;
    padding: 0;
}

.blog-pagination .pagination {
    justify-content: center;
    gap: 0.5rem;
}

.blog-pagination .page-link {
    background: rgba(30, 27, 75, 0.8);
    border: 1px solid var(--blog-border);
    color: #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
}

.blog-pagination .page-item.active .page-link {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.blog-pagination .page-link:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Recent articles grid (post page footer) */
.blog-recent-section {
    padding: 3rem 1.5rem 5rem;
    border-top: 1px solid var(--blog-border);
    background: rgba(15, 23, 42, 0.5);
}

.blog-recent-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.blog-recent-heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 1.75rem;
}

.blog-recent-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .blog-recent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-recent-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-recent-card {
    display: flex;
    flex-direction: column;
    background: rgba(30, 27, 75, 0.6);
    border: 1px solid var(--blog-border);
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.25s ease;
}

.blog-recent-card:hover {
    transform: translateY(-3px);
    border-color: rgba(129, 140, 248, 0.35);
}

.blog-recent-card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1e293b;
}

.blog-recent-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-recent-card-body {
    padding: 1.25rem;
}

.blog-recent-card-body time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.blog-recent-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #f3f4f6;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.blog-recent-card-body p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}
