/* Blog Post Page - Modern Dark Theme */

/* Override root variables to match modern theme */
:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --bg-darker: #020617;
    --card-bg: rgba(30, 41, 59, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #cbd5e1;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.7;
}

/* Post Hero Section */
.post-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 40px 0 80px;
    position: relative;
    margin-top: 0;
}

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

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.post-meta-top {
    display: flex;
    justify-content: flex-start;
}

.post-meta-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-tag {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.category-tag:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.post-date,
.reading-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-date i,
.reading-time i {
    margin-right: 0.25rem;
    opacity: 0.7;
}

.post-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-excerpt {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Author Info */
.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 3rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

.author-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.author-details p {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.social-links a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Post Content Section */
.post-content-section {
    background: var(--bg-darker);
    padding: 2rem 0 4rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-top: 2rem;
    margin-bottom: 4rem;
    color: var(--text-primary);
    /* Ensure content is always visible immediately - no animation delay */
    opacity: 1 !important;
    transform: none !important;
}

.post-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem 0;
    color: var(--text-primary);
}

.post-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 500;
    margin: 2.5rem 0 1rem 0;
    color: var(--text-primary);
}

.post-content h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary);
    transition: all 0.3s ease;
}

.post-content a:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.post-content .lead {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
}

.post-content blockquote {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-left: 5px solid var(--primary);
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: 0 15px 15px 0;
    box-shadow: var(--shadow-soft);
    font-style: italic;
    font-size: 1.15rem;
    position: relative;
    border: 1px solid var(--border);
}

.post-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary);
    position: absolute;
    top: -10px;
    left: 20px;
    font-family: serif;
    line-height: 1;
    opacity: 0.3;
}

.post-content blockquote p {
    margin: 0;
    padding-left: 2rem;
    color: var(--text-primary);
}

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

.post-content li {
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.post-content ul li::marker {
    color: var(--primary);
}

.post-content ol li::marker {
    color: var(--primary);
    font-weight: 600;
}

.post-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.post-content pre {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.info-box {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2rem;
    margin: 2.5rem 0;
    backdrop-filter: blur(10px);
}

.info-box h4 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box p {
    color: var(--text-primary);
}

/* Table of Contents */
.table-of-contents {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05)) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 2.5rem !important;
    margin: 3rem 0 !important;
    box-shadow: var(--shadow-soft) !important;
    position: relative !important;
    overflow: hidden !important;
}

.table-of-contents::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 4px !important;
    height: 100% !important;
    background: linear-gradient(180deg, var(--primary), var(--secondary)) !important;
}

/* TOC Header with toggle button */
.toc-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    cursor: pointer !important;
    margin-bottom: 1.5rem !important;
    user-select: none !important;
}

.table-of-contents h4 {
    margin: 0 !important;
    color: var(--text-primary) !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.table-of-contents h4::before {
    content: '📑' !important;
    font-size: 1.5rem !important;
}

/* TOC Toggle Button */
.toc-toggle {
    background: none !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.toc-toggle:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    color: var(--primary) !important;
}

.toc-toggle i {
    transition: transform 0.3s ease !important;
}

.toc-toggle.collapsed i {
    transform: rotate(-90deg) !important;
}

/* TOC Content */
.toc-content {
    max-height: 2000px !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease !important;
    opacity: 1 !important;
}

.toc-content.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
}

.table-of-contents ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.table-of-contents li {
    margin-bottom: 0 !important;
}

.table-of-contents a {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
}

.table-of-contents a::before {
    content: '→' !important;
    color: var(--primary) !important;
    font-weight: bold !important;
    transition: transform 0.3s ease !important;
}

.table-of-contents a:hover {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    transform: translateX(4px) !important;
}

.table-of-contents a:hover::before {
    transform: translateX(4px) !important;
}

/* Tags Section */
.tags-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.tags-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Share Section */
.share-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.share-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.share-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.share-btn.twitter {
    color: white;
    background: #000000;
    border-color: #000000;
}

.share-btn.twitter:hover {
    background: #333333;
    color: white;
    border-color: #333333;
}

.share-btn.linkedin {
    color: #0077b5;
    border-color: #0077b5;
}

.share-btn.linkedin:hover {
    background: #0077b5;
    color: white;
}

.share-btn.facebook {
    color: #1877f2;
    border-color: #1877f2;
}

.share-btn.facebook:hover {
    background: #1877f2;
    color: white;
}

.share-btn.whatsapp {
    color: #25d366;
    border-color: #25d366;
}

.share-btn.whatsapp:hover {
    background: #25d366;
    color: white;
}

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

.related-posts h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

.related-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: inherit;
    border-color: var(--primary);
}

.related-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.related-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.related-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.related-meta span {
    color: var(--text-secondary);
}

/* Newsletter CTA */
.newsletter-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 25px;
    padding: 4rem 2rem;
    text-align: center;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.newsletter-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.newsletter-cta h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    position: relative;
    z-index: 1;
}

.newsletter-cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    color: white;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    color: #1e293b;
}

.newsletter-form input::placeholder {
    color: #94a3b8;
}

.newsletter-form button {
    padding: 16px 32px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Post Image Styles */
.post-image {
    margin: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.post-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInImage 0.8s ease-in-out forwards;
}

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

.image-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-style: italic;
    text-align: center;
    padding: 0 1rem;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: 20px;
    pointer-events: none;
}

.post-image:hover::before {
    opacity: 1;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-hero {
        padding: 40px 0 60px;
    }

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

    .post-excerpt {
        font-size: 1.1rem;
    }

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

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

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

    .post-content blockquote {
        margin: 2rem -1rem;
        padding: 1.5rem;
        font-size: 1.1rem;
    }

    .post-content blockquote::before {
        font-size: 3rem;
        top: -5px;
        left: 15px;
    }

    .post-content blockquote p {
        padding-left: 1.5rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }

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

    .author-info {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .author-details {
        width: 100%;
    }

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

    .post-image img {
        border-radius: 15px;
    }

    .newsletter-cta {
        padding: 3rem 1.5rem;
    }

    .newsletter-cta h3 {
        font-size: 2rem;
    }
}

@media (min-width: 769px) {
    .post-meta {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .post-meta-top,
    .post-meta-bottom {
        display: contents;
    }

    .author-info {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .post-hero {
        padding: 80px 0 40px;
    }

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

    .post-image {
        margin: 1.5rem 0;
    }

    .post-content {
        margin-top: 1rem;
        padding: 0px;
    }

    .newsletter-cta h3 {
        font-size: 1.75rem;
    }

    .newsletter-cta p {
        font-size: 1rem;
    }
}
