/* Blog Page Professional Styles - Flat Compact Version */

/* Hide particle animation canvas on blog pages */
body:not(.home) #tech-canvas {
    display: none !important;
}

/* Blog Page Background - Dark Mode (Default) */
body.blog,
body.single-post,
body.archive,
body.category,
body.tag,
body.search {
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 101, 253, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(138, 43, 226, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(0, 191, 255, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 60%, rgba(16, 24, 48, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(10, 20, 40, 0.6) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #0f0f1e 50%, #0a0a0a 100%);
    background-attachment: fixed;
    background-size: 100% 100%;
    position: relative;
    animation: backgroundShift 20s ease-in-out infinite;
}

/* Animated gradient shift */
@keyframes backgroundShift {

    0%,
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 30% 60%, 70% 40%, 0% 0%;
    }

    50% {
        background-position: 10% 10%, 90% 90%, 45% 55%, 35% 55%, 65% 45%, 100% 100%;
    }
}

/* Add premium grain texture overlay */
body.blog::before,
body.single-post::before,
body.archive::before,
body.category::before,
body.tag::before,
body.search::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        radial-gradient(rgba(0, 101, 253, 0.02) 2px, transparent 2px);
    background-size: 4px 4px, 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

/* Blog Page Background - Light Mode */
[data-theme="light"] body.blog,
[data-theme="light"] body.single-post,
[data-theme="light"] body.archive,
[data-theme="light"] body.category,
[data-theme="light"] body.tag,
[data-theme="light"] body.search {
    background:
        radial-gradient(circle at 15% 25%, rgba(0, 101, 253, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 85% 75%, rgba(138, 43, 226, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(255, 182, 193, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 25% 70%, rgba(135, 206, 250, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 30%, rgba(221, 160, 221, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #ffffff 100%);
    background-attachment: fixed;
    background-size: 100% 100%;
    animation: backgroundShiftLight 20s ease-in-out infinite;
}

/* Light mode animation */
@keyframes backgroundShiftLight {

    0%,
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 25% 70%, 75% 30%, 0% 0%;
    }

    50% {
        background-position: 8% 8%, 92% 92%, 48% 52%, 28% 65%, 72% 35%, 100% 100%;
    }
}

/* Light mode - subtle sparkle effect */
[data-theme="light"] body.blog::before,
[data-theme="light"] body.single-post::before,
[data-theme="light"] body.archive::before,
[data-theme="light"] body.category::before,
[data-theme="light"] body.tag::before,
[data-theme="light"] body.search::before {
    background-image:
        radial-gradient(rgba(0, 101, 253, 0.03) 1px, transparent 1px),
        radial-gradient(rgba(138, 43, 226, 0.02) 2px, transparent 2px);
    background-size: 6px 6px, 80px 80px;
    opacity: 0.6;
}

/* Header Section */
.blog-header {
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-paper));
    padding: 120px 0 20px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

/* Ensure all blog pages have proper top spacing */
body.blog main,
body.archive main,
body.category main,
body.tag main,
body.search main {
    padding-top: 0;
    /* Header already has padding */
}

/* Single post should have spacing */
body.single-post main {
    padding-top: 0;
    /* Single post header has its own padding */
}

.blog-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.blog-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Layout Grid */
.blog-grid-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

/* Post Cards */
.blog-post-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    /* No shadow */
}

.blog-post-card.blog-post-horizontal {
    flex-direction: row;
    align-items: stretch;
    gap: 1.25rem;
    padding: 0;
}

.blog-post-card:hover {
    border-color: rgba(0, 101, 253, 0.3);
    /* No transform, No shadow */
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.blog-post-card.blog-post-horizontal .post-thumbnail {
    flex: 0 0 260px;
    max-width: 260px;
    aspect-ratio: auto;
    height: clamp(140px, 16vw, 180px);
    display: flex;
    margin: 0;
    padding: 0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* No scale effect on hover */
}

.blog-post-card.blog-post-horizontal .post-thumbnail img {
    height: 100%;
    display: block;
    border-radius: 0;
    object-fit: cover;
}

.blog-post-card.blog-post-horizontal .post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-content {
    padding: 0.8rem;
}

.blog-post-card.blog-post-horizontal .post-content {
    padding: 0.8rem 1rem 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 0.35rem;
}

.post-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    justify-content: flex-start;
}

.post-meta span {
    display: flex;
    align-items: center;
}

.post-meta i {
    color: var(--primary-color);
    margin-right: 3px;
    font-size: 0.75rem;
}

.post-title {
    font-size: clamp(1.1rem, 1vw + 0.9rem, 1.5rem);
    margin: 0rem;
    line-height: 1.2;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    line-height: 1.45;
    font-size: clamp(0.9rem, 0.4vw + 0.85rem, 1rem);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    padding-bottom: 1px;
    border-bottom: 1px solid transparent;
}

.read-more-btn i {
    margin-left: 4px;
}

.read-more-btn:hover {
    border-bottom-color: var(--primary-color);
}

.post-meta .read-more-btn {
    margin-left: auto;
    white-space: nowrap;
    order: 99;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    /* No shadow or transform */
}

/* Sidebar Styles */
.blog-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.widget {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    /* No shadow */
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 25px;
    height: 1px;
    background: var(--primary-color);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.widget ul li a:hover {
    color: var(--primary-color);
}

/* Search Widget */
.search-form {
    display: flex;
    gap: 5px;
}

.search-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.7rem;
    border-radius: 4px;
    color: #fff;
    outline: none;
    font-size: 0.8rem;
}

.search-field:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.search-submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

.search-submit:hover {
    filter: brightness(1.1);
}

/* Responsive */
@media (max-width: 991px) {
    .blog-grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .blog-header {
        padding: 90px 0 0px;
    }

    .blog-title {
        font-size: 1.8rem;
    }

    .post-content {
        padding: 0.8rem;
    }

    .single-post-header {
        padding: 90px 0 0px;
    }



}

/* =========================================
   SINGLE POST PAGE STYLES - FLAT COMPACT
   ========================================= */

/* Hero Header */
.single-post-header {
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-paper));
    padding: 120px 0 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.single-post-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 1.2vw + 0.9rem, 2rem);
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1.15;
    color: var(--text-primary);
}

.post-meta-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.meta-sep {
    opacity: 0.5;
    color: var(--text-secondary);
}

.post-author-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 0.8rem;
}

.post-author-meta img {
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    width: 32px;
    height: 32px;
}

.post-author-meta .author-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Featured Image */
.single-featured-image {
    margin: 1rem 0;
    border-radius: 4px;
    overflow: hidden;
    /* No shadow */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content Body */
.single-post-article {
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    /* No shadow */
}

.post-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.post-body p {
    margin-bottom: 0.8rem;
}

.post-body h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 1.2rem 0 0.8rem;
    font-weight: 700;
}

.post-body h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 1rem 0 0.6rem;
    font-weight: 600;
}

.post-body ul,
.post-body ol {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
}

.post-body blockquote {
    border-left: 2px solid var(--primary-color);
    padding-left: 0.8rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.05rem;
}

/* Tags */
.post-tags {
    margin-top: 1.2rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tags-label {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 4px;
    font-size: 0.9rem;
}

.post-tags a {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: 0.3s;
}

.post-tags a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.2rem;
    gap: 10px;
}

.post-navigation a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    background: var(--bg-paper);
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: center;
    font-size: 0.85rem;
}

.post-navigation a:hover {
    border-color: var(--primary-color);
    /* No transform */
}

/* Comments */
.comments-area {
    margin-top: 1.5rem;
}

.comments-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list li {
    margin-bottom: 1rem;
}

.comment-body {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-author {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.comment-metadata {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.reply a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 991px) {
    .blog-menu-wrapper {
        display: none;
        /* Hide desktop menu */
    }

    .mobile-menu-toggle {
        display: block !important;
    }
}

/* =========================================
   BLOG NAVIGATION MENU STYLES
   ========================================= */

.blog-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(var(--bg-dark-rgb, 5, 5, 5), 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

[data-theme="light"] .blog-nav-bar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.blog-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Logo */
.blog-logo a {
    display: block;
}

.blog-brand-img {
    height: 40px;
    /* Adjust height as needed */
    width: auto;
    display: block;
}

/* Menu Wrapper */
.blog-menu-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.blog-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-menu li {
    position: relative;
}

.blog-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between icon and text */
}

.blog-menu a:hover,
.blog-menu .current-menu-item>a {
    color: var(--primary-color);
}

/* Sub Menu (Dropdown) */
.blog-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.blog-menu li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.blog-menu .sub-menu li {
    display: block;
}

.blog-menu .sub-menu a {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.blog-menu .sub-menu li:last-child a {
    border-bottom: none;
}

.blog-menu .sub-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 1.5rem;
}

/* Nav Controls (Right Side) */
.blog-nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.blog-nav-controls .lang-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 20px;
}

.blog-nav-controls .lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
}

.blog-nav-controls .lang-btn.active {
    background: var(--primary-color);
    color: #fff;
}


/* Responsive */
@media (max-width: 991px) {
    .blog-menu-wrapper {
        display: none;
        /* Hide desktop menu */
    }

    /* Mobile Menu Logic would go here - simplified for now */
    .blog-nav-controls {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .blog-grid-layout {
        grid-template-columns: 1fr;
    }

    .blog-post-card.blog-post-horizontal {
        flex-direction: column;
    }

    .blog-post-card.blog-post-horizontal .post-thumbnail {
        max-width: 100%;
        flex-basis: auto;
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        border-radius: 0;
    }

    .blog-post-card.blog-post-horizontal .post-content {
        padding: 0.8rem;
    }

    .blog-post-card.blog-post-horizontal .post-thumbnail img {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
