/* blog.css */
/* Styles for the blog page */

/* Add padding to the main content area to clear the fixed header */
.blog-page {
    padding-top: 100px; /* Adjust to be slightly more than your header height */
    padding-bottom: 40px; /* Add some padding at the bottom */
    min-height: 100vh; /* Ensure page takes at least full viewport height */
    position: relative; /* Needed for particle container */
    overflow: hidden; /* Hide particles extending beyond the page bounds */
    z-index: 1; /* Ensure blog content is above body background */
    background-color: var(--background-color); /* Use base background */
    transition: background-color 0.5s ease; /* Smooth transition */
    display: flex; /* Use flex to help center content if needed, though container handles width */
    flex-direction: column; /* Stack content vertically */
}

/* Target the particle container SPECIFICALLY on the blog page */
.blog-page .section-particle-container {
    position: absolute; /* Position relative to .blog-page */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind the blog content */
    pointer-events: none;
    overflow: hidden;
}

/* Ensure the main content container is above the particles */
.blog-page .container {
    position: relative; /* Establish stacking context */
    z-index: 2; /* Above particles */
    width: 90%; /* Maintain standard container width */
    max-width: 1200px; /* Maintain standard container max-width */
    margin-left: auto; /* Center the container */
    margin-right: auto;
    /* Remove padding from container if .blog-page provides it */
    padding-top: 0;
    padding-bottom: 0;
}


/* Adjust heading margin for the blog page title */
.blog-page h1 {
    font-size: 3em; /* Match main page h2 size */
    margin-top: 0; /* Remove default h1 margin-top */
    margin-bottom: 40px; /* Add space below the title */
    color: var(--primary-color);
    font-weight: 700;
    text-align: center; /* Center the blog title */
}

/* Adjust padding for the blog posts section itself if needed */
/* The .section class has padding, but we might not need it if the parent handles spacing */
#blog-posts.section {
    padding-top: 0; /* Remove top padding from the section */
    padding-bottom: 0; /* Remove bottom padding from the section */
    background-color: transparent; /* Make section background transparent */
    border: none; /* Remove section border */
    box-shadow: none; /* Remove section shadow */
    text-align: left; /* Reset text-align if needed, grid handles items */
}
/* Override potential even/odd background rules */
.blog-page #blog-posts.section {
     background-color: transparent;
}


#blog-posts {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* --- Style the <a> tag which IS the blog post card --- */
a.blog-post.glow-card { /* Target the link specifically */
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack image and content vertically */
    background-color: var(--card-background);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: var(--card-default-shadow);
    transition: background-color 0.5s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1;
    will-change: transform, box-shadow;
    overflow: hidden;
    border-top: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent);
    text-decoration: none; /* Ensure no underline on the card link */
    color: inherit; /* Inherit text color */
}
.dark-mode a.blog-post.glow-card {
     border-top: 1px solid rgba(255, 255, 255, 0.08);
}
a.blog-post.glow-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow), 0 0 25px color-mix(in srgb, var(--border-highlight-color) 80%, transparent);
    /* Apply border glow on hover */
    border-color: color-mix(in srgb, var(--border-highlight-color) 50%, var(--border-color));
}


/* Style for the image within the blog post card */
.blog-post-image {
    margin-bottom: 0; /* Remove margin if image is directly in link */
    overflow: hidden; /* Ensure image respects border radius */
    /* border-radius: 16px 16px 0 0; */ /* Apply radius via parent link */
     max-height: 200px; /* Control image height */
     display: flex; /* Center image if needed */
     align-items: center;
     justify-content: center;
     background-color: var(--secondary-color); /* Placeholder bg */
}

.blog-post-image img {
    display: block;
    width: 100%;
    height: 100%; /* Let object-fit handle sizing */
    object-fit: cover; /* Crop image nicely */
    transition: transform 0.3s ease;
}

a.blog-post:hover .blog-post-image img { /* Target hover on the link */
    transform: scale(1.05); /* Subtle zoom on hover */
}

/* Adjustments if card has image */
a.blog-post.has-image .blog-post-image {
     /* No specific style needed now, handled by structure */
}
a.blog-post.has-image .blog-post-content {
     /* Padding is already set */
}


/* Content container within the card (when image present) */
.blog-post-content {
    padding: 30px; /* Add padding here */
    flex-grow: 1; /* Allow content to take space */
    display: flex;
    flex-direction: column; /* Stack title, p, visual cue */
    text-align: left; /* Align content left */
}

.blog-post-content h2 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.blog-post-content p { /* Description */
    color: var(--text-color);
    font-weight: 400;
    margin-bottom: 15px;
    font-size: 0.95em; /* Slightly smaller description text */
    display: -webkit-box; /* Truncate description */
    -webkit-line-clamp: 3; /* Show 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.7 * 0.95em * 3); /* Approx height for 3 lines */
    flex-grow: 1; /* Allow description to push visual cue down */
}

/* Style the new visual cue span */
.read-more-visual {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-block; /* Needed for margin */
    margin-top: auto; /* Push to bottom */
    padding-top: 10px; /* Add some space above */
    align-self: flex-start; /* Align to left */
}

.read-more-visual i {
    margin-left: 5px;
    transition: transform 0.2s ease;
}

a.blog-post:hover .read-more-visual { /* Style on card hover */
    text-decoration: underline;
}
a.blog-post:hover .read-more-visual i {
    transform: translateX(4px);
}
.rtl-active .read-more-visual i {
    transform: translateX(0px) scaleX(1); /* Move left, point left */
    margin-left: 0;
    margin-right: 5px;
}

.rtl-active a.blog-post:hover .read-more-visual i {
    transform: translateX(4px) scaleX(1); /* Move left, point left */
}

/* Responsive adjustments for blog posts */
@media (max-width: 900px) {
    #blog-posts {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
     /* Adjust blog title size */
     .blog-page h1 {
         font-size: 2.5em;
     }
}

@media (max-width: 768px) {
    /* Adjust blog page padding for smaller header */
    .blog-page {
        padding-top: 80px;
    }
    /* Adjust blog post padding (handled by .blog-post-content now) */
    .blog-post-content {
        padding: 25px;
    }
     /* Adjust blog title size */
     .blog-page h1 {
         font-size: 2em;
     }
     /* Ensure container takes appropriate width */
     .blog-page .container {
         width: 95%; /* Slightly wider on small screens */
     }
}

@media (max-width: 480px) {
     .blog-post-content {
         padding: 20px; /* Further reduce padding */
     }
}