/* Post Header Styles */
.post-header {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFD180 100%);
    padding: 4rem 2rem;
    margin-bottom: 2rem;
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

.post-meta-header {
    text-align: center;
}

.post-category {
    display: inline-block;
    background: #FFA500;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.post-title {
    font-size: 2.5rem;
    color: #2C3E50;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
}

/* Featured Image Styles */
.featured-image {
    margin: 2rem 0 3rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post Content Styles */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #34495e;
}

/* Rich Text Block Styles - These are critical for Wagtail content */
.post-content .rich-text,
.post-content .block-paragraph,
.post-content .block-html {
    margin-bottom: 1.5rem;
}

/* Headings - Target both direct children and children within block-html */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6,
.post-content .block-html h1,
.post-content .block-html h2,
.post-content .block-html h3,
.post-content .block-html h4,
.post-content .block-html h5,
.post-content .block-html h6 {
    color: #2C3E50;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h1,
.post-content .block-html h1 {
    font-size: 2.25rem;
    margin-top: 3rem;
}

.post-content h2,
.post-content .block-html h2 {
    font-size: 2rem;
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #FFF3E0;
}

.post-content h3,
.post-content .block-html h3 {
    font-size: 1.625rem;
    margin-top: 2.5rem;
}

.post-content h4,
.post-content .block-html h4 {
    font-size: 1.375rem;
    margin-top: 2rem;
}

.post-content h5,
.post-content .block-html h5 {
    font-size: 1.125rem;
}

.post-content h6,
.post-content .block-html h6 {
    font-size: 1rem;
    color: #666;
}

/* Paragraphs */
.post-content p,
.post-content .block-html p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.post-content p:last-child,
.post-content .block-html p:last-child {
    margin-bottom: 0;
}

/* Lists */
.post-content ul,
.post-content ol,
.post-content .block-html ul,
.post-content .block-html ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content ul,
.post-content .block-html ul {
    list-style-type: disc;
}

.post-content ol,
.post-content .block-html ol {
    list-style-type: decimal;
}

.post-content li,
.post-content .block-html li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.post-content li > ul,
.post-content li > ol,
.post-content .block-html li > ul,
.post-content .block-html li > ol {
    margin: 0.75rem 0 0.5rem 0;
}

.post-content li p,
.post-content .block-html li p {
    margin-bottom: 0.5rem;
}

/* Nested lists */
.post-content ul ul,
.post-content .block-html ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

.post-content ul ul ul,
.post-content .block-html ul ul ul {
    list-style-type: square;
}

/* Links */
.post-content a,
.post-content .block-html a {
    color: #FFA500;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover,
.post-content .block-html a:hover {
    color: #FF8C00;
}

/* Blockquotes */
.post-content blockquote,
.post-content .block-html blockquote {
    border-left: 4px solid #FFA500;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #FFF3E0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #2C3E50;
}

.post-content blockquote p,
.post-content .block-html blockquote p {
    margin-bottom: 0.75rem;
}

.post-content blockquote p:last-child,
.post-content .block-html blockquote p:last-child {
    margin-bottom: 0;
}

/* Code and Pre */
.post-content code,
.post-content .block-html code {
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #e83e8c;
}

.post-content pre,
.post-content .block-html pre {
    background: #2C3E50;
    color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    line-height: 1.5;
}

.post-content pre code,
.post-content .block-html pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

/* Images in Content */
.post-content img,
.post-content .block-html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-content .block-image {
    margin: 2rem 0;
}

.post-content .block-image img {
    display: block;
    margin: 0 auto;
}

/* Tables */
.post-content table,
.post-content .block-html table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.post-content th,
.post-content td,
.post-content .block-html th,
.post-content .block-html td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.post-content th,
.post-content .block-html th {
    background: #FFF3E0;
    color: #2C3E50;
    font-weight: 600;
}

.post-content tr:last-child td,
.post-content .block-html tr:last-child td {
    border-bottom: none;
}

.post-content tr:hover,
.post-content .block-html tr:hover {
    background: #f8f9fa;
}

/* Horizontal Rules */
.post-content hr,
.post-content .block-html hr {
    border: none;
    border-top: 2px solid #eee;
    margin: 3rem 0;
}

/* Strong and Em */
.post-content strong,
.post-content b,
.post-content .block-html strong,
.post-content .block-html b {
    font-weight: 700;
    color: #2C3E50;
}

.post-content em,
.post-content i,
.post-content .block-html em,
.post-content .block-html i {
    font-style: italic;
}

/* Embed Blocks */
.post-content .block-embed {
    margin: 2rem 0;
}

.post-content iframe,
.post-content .block-html iframe {
    max-width: 100%;
    border-radius: 8px;
}

/* Post Footer Styles */
.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.share-button {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-twitter {
    background: #1DA1F2;
}

.share-linkedin {
    background: #0077B5;
}

.share-rss {
    background: #ee802f;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
}

.related-posts h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2C3E50;
    font-size: 2rem;
}

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

.related-post-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.related-post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.75rem;
    color: #2C3E50;
    font-size: 1.25rem;
    line-height: 1.3;
}

.card-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: #FFA500;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #FF8C00;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .post-header {
        padding: 3rem 1rem;
    }

    .post-container {
        padding: 0 1rem 2rem 1rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.75rem;
    }

    .post-content h3 {
        font-size: 1.5rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.5rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-button {
        text-align: center;
        justify-content: center;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}