/* ============================================================
   Blog Styles – Index & Post pages
   Optimised for Core Web Vitals (CLS, LCP, readability)
   ============================================================ */

/* ---------- Hero ---------- */
.blog-hero {
    text-align: center;
    padding: 6rem 1rem 3rem;
    background: linear-gradient(135deg, var(--theme-primary-hover) 0%, var(--theme-primary) 50%, var(--theme-primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.15), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.blog-hero > .container {
    position: relative;
    z-index: 2;
}

.blog-hero .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.blog-hero .hero-background::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    top: -400px;
    right: -200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pp-float-orb-1 20s ease-in-out infinite;
    filter: blur(60px);
}

.blog-hero .hero-background::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -300px;
    left: -150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pp-float-orb-2 25s ease-in-out infinite;
    filter: blur(50px);
}

.blog-hero .hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: pp-grid-move 30s linear infinite;
    opacity: 0.6;
}

.blog-hero .hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 5% 90%, rgba(255, 255, 255, 0.4) 0%, transparent 2px),
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.3) 0%, transparent 3px),
        radial-gradient(circle at 25% 95%, rgba(255, 255, 255, 0.5) 0%, transparent 2px),
        radial-gradient(circle at 35% 80%, rgba(255, 255, 255, 0.4) 0%, transparent 3px),
        radial-gradient(circle at 45% 92%, rgba(255, 255, 255, 0.3) 0%, transparent 2px),
        radial-gradient(circle at 55% 88%, rgba(255, 255, 255, 0.5) 0%, transparent 3px),
        radial-gradient(circle at 65% 95%, rgba(255, 255, 255, 0.4) 0%, transparent 2px),
        radial-gradient(circle at 75% 82%, rgba(255, 255, 255, 0.3) 0%, transparent 3px),
        radial-gradient(circle at 85% 90%, rgba(255, 255, 255, 0.5) 0%, transparent 2px),
        radial-gradient(circle at 95% 87%, rgba(255, 255, 255, 0.4) 0%, transparent 3px);
    background-size: 100% 100%;
    animation: pp-particles-rise 8s linear infinite;
}

.blog-hero .hero-gradient::before,
.blog-hero .hero-gradient::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.5),
        100px 50px 0 0 rgba(255, 255, 255, 0.4),
        -80px 30px 0 0 rgba(255, 255, 255, 0.5),
        50px -20px 0 0 rgba(255, 255, 255, 0.3),
        -120px -40px 0 0 rgba(255, 255, 255, 0.6);
    animation: pp-particle-float 10s ease-in-out infinite;
}

.blog-hero .hero-gradient::before {
    top: 80%;
    left: 10%;
}

.blog-hero .hero-gradient::after {
    top: 40%;
    right: 15%;
    animation-delay: -5s;
}

/* Reuse keyframes (duplicated from public-pages.css since blog doesn't load that file) */
@keyframes pp-float-orb-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, 50px) scale(1.1); }
    66% { transform: translate(-50px, 100px) scale(0.9); }
}

@keyframes pp-float-orb-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, -60px) scale(1.15); }
    66% { transform: translate(60px, -80px) scale(0.95); }
}

@keyframes pp-grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes pp-particles-rise {
    0% { background-position: 0% 100%; }
    100% { background-position: 0% -100%; }
}

@keyframes pp-particle-float {
    0% { transform: translate(0, 0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(50px, -300px) scale(1.5); opacity: 0.8; }
    90% { opacity: 0.5; }
    100% { transform: translate(100px, -600px) scale(0.5); opacity: 0; }
}

.blog-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.blog-hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
}

/* 3D theme overrides for blog hero */
[data-theme="3d"] .blog-hero {
    background: linear-gradient(135deg, #060616 0%, #0b0b24 50%, #060616 100%);
}

[data-theme="3d"] .blog-hero::before {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.2), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(34, 211, 238, 0.15), transparent 50%);
}

[data-theme="3d"] .blog-hero .hero-background::before {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
}

[data-theme="3d"] .blog-hero .hero-background::after {
    background: radial-gradient(circle, rgba(34, 211, 238, 0.2) 0%, transparent 70%);
}

[data-theme="3d"] .blog-hero .hero-gradient {
    background: 
        radial-gradient(circle at 5% 90%, rgba(139, 92, 246, 0.6) 0%, transparent 2px),
        radial-gradient(circle at 15% 85%, rgba(34, 211, 238, 0.5) 0%, transparent 3px),
        radial-gradient(circle at 25% 95%, rgba(251, 113, 133, 0.7) 0%, transparent 2px),
        radial-gradient(circle at 35% 80%, rgba(167, 139, 250, 0.6) 0%, transparent 3px),
        radial-gradient(circle at 45% 92%, rgba(139, 92, 246, 0.5) 0%, transparent 2px),
        radial-gradient(circle at 55% 88%, rgba(34, 211, 238, 0.7) 0%, transparent 3px),
        radial-gradient(circle at 65% 95%, rgba(251, 113, 133, 0.6) 0%, transparent 2px),
        radial-gradient(circle at 75% 82%, rgba(167, 139, 250, 0.5) 0%, transparent 3px),
        radial-gradient(circle at 85% 90%, rgba(139, 92, 246, 0.7) 0%, transparent 2px),
        radial-gradient(circle at 95% 87%, rgba(34, 211, 238, 0.6) 0%, transparent 3px);
}

[data-theme="3d"] .blog-hero .hero-gradient::before,
[data-theme="3d"] .blog-hero .hero-gradient::after {
    background: #8b5cf6;
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 0.9),
        0 0 40px rgba(34, 211, 238, 0.6),
        100px 50px 0 0 rgba(34, 211, 238, 0.5),
        -80px 30px 0 0 rgba(251, 113, 133, 0.6);
}

[data-theme="3d"] .blog-hero-title {
    text-shadow: 
        0 0 30px rgba(139, 92, 246, 0.5),
        0 0 60px rgba(34, 211, 238, 0.3);
}

/* ---------- Category Pills ---------- */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.blog-category-pill {
    display: inline-block;
    padding: .4rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: transparent;
    color: inherit;
    text-decoration: none;
    font-size: .875rem;
    transition: all .2s;
}

.blog-category-pill:hover,
.blog-category-pill.active {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border-color: var(--bs-primary, #0d6efd);
}

/* ---------- Featured Post ---------- */
.blog-featured {
    margin-bottom: 2.5rem;
}

.blog-featured-card {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .25s;
}

.blog-featured-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,.1);
}

.blog-featured-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bs-secondary-bg, #e9ecef);
}

.blog-featured-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-featured-body {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured-label {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--bs-primary, #0d6efd);
    margin-bottom: .5rem;
}

.blog-featured-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 .75rem;
    line-height: 1.3;
}

.blog-featured-excerpt {
    font-size: .95rem;
    opacity: .8;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-featured-meta {
    font-size: .8rem;
    opacity: .6;
}

@media (min-width: 768px) {
    .blog-featured-card {
        grid-template-columns: 1fr 1fr;
    }

    .blog-featured-img-wrap {
        aspect-ratio: 3 / 2;
    }

    .blog-featured-title {
        font-size: 1.85rem;
    }
}

/* ---------- Post Card ---------- */
.blog-card-link {
    text-decoration: none;
    color: inherit;
}

.blog-card {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .75rem;
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-4px);
}

/* CLS-safe image container: reserves exact space before image loads */
.blog-card-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bs-secondary-bg, #e9ecef);
}

.blog-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-category {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bs-primary, #0d6efd);
    font-weight: 600;
    margin-bottom: .5rem;
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: .5rem;
    line-height: 1.35;
}

.blog-card-excerpt {
    font-size: .9rem;
    opacity: .8;
    flex: 1;
    line-height: 1.55;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    opacity: .6;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

/* ---------- Pagination ---------- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding-top: 2rem;
}

.blog-pagination .page-link {
    border-radius: .5rem;
    min-width: 2.5rem;
    text-align: center;
}

/* ---------- Single Post Page ---------- */

/* Category pill – above title */
.blog-post-category {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    font-size: .8rem;
    color: var(--bs-primary, #0d6efd);
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 8%, transparent);
    padding: .3rem .75rem;
    border-radius: .35rem;
    margin-bottom: .75rem;
}

.blog-post-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.25;
}

/* Author row – avatar + name / read-time / date */
.blog-post-author-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1.5rem;
}

.blog-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-post-author-info {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.blog-post-author-name {
    font-weight: 600;
    font-size: .95rem;
}

.blog-post-meta-line {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--bs-secondary-color, #6c757d);
}

[data-theme="3d"] .blog-post-meta-line {
    color: rgba(255, 255, 255, .7);
}

[data-theme="3d"] .blog-related {
    border-top-color: var(--theme-border);
}

[data-theme="3d"] .blog-related-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

[data-theme="3d"] .blog-related-card:hover {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

[data-theme="3d"] .blog-related-img {
    background: var(--theme-bg-alt);
}

[data-theme="3d"] .blog-related-title {
    color: var(--theme-text);
}

[data-theme="3d"] .blog-related-excerpt {
    color: var(--theme-text-muted);
}

.blog-post-meta-sep {
    opacity: .5;
}

.blog-post-readtime {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.blog-post-readtime-icon {
    flex-shrink: 0;
    opacity: .7;
}

/* Cover image – below meta, centred with max-width */
.blog-post-cover {
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.blog-post-cover-img {
    width: 100%;
    max-width: 990px;
    height: auto;
    display: block;
    border-radius: .75rem;
}

/* ---------- Breadcrumb ---------- */
.blog-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .85rem;
    gap: .15rem;
}

.blog-breadcrumb li + li::before {
    content: "\203A";
    margin-right: .35rem;
    opacity: .5;
}

.blog-breadcrumb a {
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
}

.blog-breadcrumb a:hover {
    text-decoration: underline;
}

.blog-breadcrumb li[aria-current="page"] {
    opacity: .6;
}

/* ---------- Post Tags ---------- */
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.blog-tag {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: var(--bs-light, #f8f9fa);
    font-size: .8rem;
}

/* Article prose – constrained width for readability */
.blog-post-content {
    max-width: 750px;
    font-size: 1.08rem;
    line-height: 1.85;
    letter-spacing: .01em;
}

.blog-post-content p {
    margin-bottom: 1.35rem;
}

.blog-post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: .85rem;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.3;
}

.blog-post-content h3 {
    margin-top: 2rem;
    margin-bottom: .6rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
}

.blog-post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: .5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    margin: 1.25rem 0;
    display: block;
}

.blog-post-content pre {
    background: var(--bs-light, #f8f9fa);
    padding: 1rem;
    border-radius: .5rem;
    overflow-x: auto;
    font-size: .9rem;
    margin: 1.25rem 0;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--bs-primary, #0d6efd);
    padding: .75rem 1.25rem;
    margin: 1.25rem 0;
    opacity: .85;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.35rem;
    padding-left: 1.5rem;
}

.blog-post-content li {
    margin-bottom: .35rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .blog-hero {
        padding: 2.5rem 1rem 1.5rem;
    }

    .blog-hero-title {
        font-size: 1.75rem;
    }

    .blog-post-title {
        font-size: 1.5rem;
    }

    .blog-post-cover {
        padding: 0;
    }

    .blog-post-cover-img {
        border-radius: 0;
    }

    .blog-post-content {
        font-size: 1rem;
    }

    .blog-featured-title {
        font-size: 1.3rem;
    }
}

/* ---------- Related Articles ---------- */
.blog-related {
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    padding: 3rem 0 4rem;
}

.blog-related-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.blog-related-card {
    display: flex;
    flex-direction: column;
    border-radius: .75rem;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}

.blog-related-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.blog-related-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bs-secondary-bg, #e9ecef);
}

.blog-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-related-body {
    padding: 1rem 1.15rem 1.25rem;
    flex: 1;
}

.blog-related-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .4rem;
    line-height: 1.35;
}

.blog-related-excerpt {
    font-size: .875rem;
    opacity: .75;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 991px) {
    .blog-related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .blog-related-grid {
        grid-template-columns: 1fr;
    }
}













