/* static/css/blog.css */
/* Color scheme and variables */
:root {
    --primary-color: #1a3a6c;
    --primary-light: #2c4e86;
    --primary-dark: #102548;
    --secondary-color: #0e9aa7;
    --secondary-light: #11b5c4;
    --secondary-dark: #0b7983;
    --accent-color: #f46036;
    --accent-light: #f67e5c;
    --accent-dark: #d64927;
    --highlight-color: #ffde22;
    --highlight-light: #ffe54c;
    --highlight-dark: #e6c71f;
    --dark-color: #2f2d2e;
    --light-color: #f8f9fa;
    --border-color: #e2e8f0;
    --light-gray: #f1f5f9;
    --gray: #718096;
    --gradient-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s ease;
    
    /* Typography */
    --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-size-base: 16px;
    --line-height: 1.6;
}

/* Base blog styles */
body {
    background-color: var(--light-color);
    background-image: 
        radial-gradient(circle at 25% 15%, rgba(14, 154, 167, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 75% 85%, rgba(244, 96, 54, 0.03) 0%, transparent 25%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em 0;
    line-height: 1.3;
    font-weight: 600;
    font-family: var(--font-heading);
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
}

h4 {
    font-size: 1.2rem;
}

p, ul, ol {
    margin-bottom: 1.2rem;
}

blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--light-gray);
    border-radius: 0 8px 8px 0;
    position: relative;
    color: var(--dark-color);
    font-style: italic;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 3rem;
    color: rgba(14, 154, 167, 0.1);
    font-family: Georgia, serif;
}

code {
    font-family: var(--font-mono);
    background: var(--light-gray);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-dark);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

pre {
    font-family: var(--font-mono);
    background: var(--dark-color);
    color: #f8f8f2;
    padding: 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--card-shadow);
}

pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border: none;
}

/* Header styles */
.header-wrapper {
    background: var(--gradient-bg);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    display: none; /* Hide the header as requested */
}

.header-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(26, 58, 108, 0.9) 0%, rgba(14, 154, 167, 0.9) 100%);
    z-index: -1;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    color: white;
    text-align: center;
}

.blog-title {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Main layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
}

.main-content {
    flex: 1;
    max-width: 720px;
    padding-top: 2rem;
}

.sidebar {
    width: 280px;
    margin-left: 40px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    display: none; /* Hidden on mobile by default */
    padding-top: 2rem;
}

/* Filter notice */
.filter-notice {
    margin-bottom: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: var(--light-gray);
    border-radius: 8px;
    font-size: 0.95rem;
}

.clear-filter {
    color: var(--secondary-color);
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Blog posts */
.blog-posts {
    margin-top: 1rem;
}

.post {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    background: white; /* Changed from blue background to white */
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.post:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

/* Color coding for post types */
.post-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
}

.post-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.post-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--highlight-color);
}

/* Post header styles */
.post-header {
    margin-bottom: 0.8rem; /* Reduced spacing */
    position: relative;
    background: transparent;
}

.post-date {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.5rem; /* Reduced spacing */
    font-weight: 500;
    margin-left: 5px;
}

.post-date svg {
    vertical-align: -2px;
    margin-right: 4px;
}

.post-title {
    margin-bottom: 0.6rem; /* Reduced spacing */
    line-height: 1.2;
    margin-left: 5px;
}

.post-title-link {
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
    background-image: linear-gradient(transparent calc(100% - 3px), var(--secondary-light) 3px);
    background-size: 0 100%;
    background-repeat: no-repeat;
    display: inline;
    padding-bottom: 3px;
}

.post-title-link:hover {
    color: var(--primary-dark);
    background-size: 100% 100%;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem; /* Reduced spacing */
    margin-bottom: 0.8rem; /* Reduced spacing */
    font-size: 0.85rem;
    margin-left: 5px;
}

.post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gray);
    background: var(--light-gray);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

/* Link post specific styles */
.post-link .post-title {
    font-size: 1.5rem;
    padding-right: 1.5rem;
    position: relative;
    display: inline-block;
    margin-bottom: 0.4rem; /* Reduce bottom margin */
}

.post-link .post-title-link::after {
    content: '→';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.post-link .post-title-link:hover::after {
    transform: translate(3px, -50%);
    color: var(--accent-color);
}

.post-content {
    position: relative;
    margin-left: 5px; /* Add left margin for alignment */
}

.permalink {
    display: inline-block;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--gray);
    transition: var(--transition);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 1px;
}

.permalink:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Note post styles */
.post-note {
    background: white;
}

.post-note .post-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem; /* Reduced spacing */
}

/* Full post specific styles */
.post-article .post-title {
    font-size: 1.8rem;
    margin-bottom: 0.4rem; /* Reduced spacing */
}

.post-detail .post-title {
    font-size: 2rem;
    margin-bottom: 0.6rem; /* Reduced spacing */
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.post-tag {
    background: var(--light-gray);
    color: var(--gray);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.post-tag:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Numbered list alignment fix */
ol {
    list-style-position: inside; /* Align numbers with the text */
    padding-left: 0; /* Remove default padding */
}

ol li {
    padding-left: 0; /* Reset padding */
    margin-bottom: 0.8rem;
    text-indent: -1.2em; /* Pull the number to the left */
    padding-left: 1.2em; /* Offset the negative text-indent */
}

/* Read more section */
.post-read-more {
    margin-top: 1.5rem;
}

.read-more-link {
    color: var(--secondary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.read-more-link:hover {
    color: var(--accent-color);
}

.read-more-link svg {
    transition: var(--transition);
}

.read-more-link:hover svg {
    transform: translateX(2px);
}

/* Image with caption */
.post-image {
    margin: 1.8rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.post-image:hover img {
    transform: scale(1.02);
}

.image-caption {
    background: var(--dark-color);
    padding: 1rem;
    font-size: 0.9rem;
    color: white;
    font-style: italic;
}

/* Post gallery */
.post-gallery {
    margin-top: 2rem;
}

/* External links in link posts */
.external-link-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    transition: var(--transition);
}

.external-link:hover {
    color: var(--accent-color);
}

.external-link:hover svg {
    transform: translate(1px, -1px);
}

.external-link svg {
    transition: var(--transition);
}

/* Related posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

.related-posts h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.related-post {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.related-post:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.related-post-link {
    display: block;
    padding: 1.2rem;
    height: 100%;
    color: var(--dark-color);
    text-decoration: none;
}

.related-post-link h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.related-post-link time {
    font-size: 0.8rem;
    color: var(--gray);
}

.related-post-link:hover h4 {
    color: var(--secondary-color);
}

/* Sidebar styles */
.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.sidebar-title {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background: var(--secondary-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag-cloud a {
    background: var(--light-gray);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gray);
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(14, 154, 167, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

/* No posts message */
.no-posts {
    padding: 2rem;
    text-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* Fix for image margins to ensure equal spacing on both sides */
.post-content img {
    max-width: calc(100% - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
    display: block;
}

/* Mobile responsive styles */
@media (min-width: 768px) {
    .sidebar {
        display: block;
    }
}

@media (max-width: 767px) {
    .post-title {
        font-size: 1.4rem;
    }

    .post-article .post-title {
        font-size: 1.6rem;
    }

    .post-detail .post-title {
        font-size: 1.8rem;
    }

    .post {
        padding: 1.5rem;
    }
    
    .header-wrapper {
        padding: 2rem 0;
    }
    
    .blog-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 576px) {
    .blog-title {
        font-size: 1.8rem;
    }
    
    .blog-description {
        font-size: 1rem;
    }
    
    .post-article .post-title {
        font-size: 1.4rem;
    }
    
    .post-detail .post-title {
        font-size: 1.6rem;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}