/**
 * Blog Post Styles
 * Optimized for readability, accessibility, and responsive design
 */

/* ============================================================================
   Layout & Container
   ============================================================================ */

.blog-post-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.blog-post-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .blog-post-layout {
        grid-template-columns: 240px 1fr 280px;
        gap: 1.5rem;
    }
}

@media (max-width: 968px) {
    .blog-post-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-sidebar-left {
        order: 3;
    }
    
    .blog-sidebar-right {
        order: 2;
    }
}

/* ============================================================================
   Hero Section
   ============================================================================ */

.blog-post-hero {
    margin-bottom: 3rem;
}

.blog-post-hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.blog-post-featured-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.blog-post-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

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

.blog-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
}

.blog-post-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--act, #3b82f6);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-post-date,
.blog-reading-time {
    color: var(--fg-sec, #666);
}

.blog-post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 1rem 0;
    color: var(--fg, #1a1a1a);
}

.blog-post-intro {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--fg-sec, #555);
    margin: 1.5rem 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.blog-post-author-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--fg, #1a1a1a);
}

.author-title {
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
}

/* ============================================================================
   Sidebars
   ============================================================================ */

.blog-sidebar {
    font-size: 0.875rem;
}

.sidebar-sticky {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--fg, #1a1a1a);
}

.sidebar-empty {
    color: var(--fg-sec, #666);
    font-style: italic;
}

/* Related Articles */
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-article-card {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--bd, #e5e7eb);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.related-article-card:hover {
    border-color: var(--act, #3b82f6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.related-article-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.related-article-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.related-article-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fg, #1a1a1a);
    margin: 0;
}

.related-article-meta {
    font-size: 0.75rem;
    color: var(--fg-sec, #666);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Author Card */
.author-card {
    padding: 1.5rem;
    background-color: var(--bg-alt, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--bd, #e5e7eb);
}

.author-card-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
}

.author-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 0.5rem;
    color: var(--fg, #1a1a1a);
}

.author-card-title {
    text-align: center;
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
    margin: 0 0 0.25rem;
}

.author-card-org {
    text-align: center;
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
    margin: 0 0 1rem;
}

.author-card-bio {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--fg-sec, #555);
    margin-bottom: 1rem;
}

.author-card-link {
    display: block;
    text-align: center;
    color: var(--act, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
}

.author-card-link:hover {
    text-decoration: underline;
}

.author-card-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bd, #e5e7eb);
}

.social-icon {
    width: 20px;
    height: 20px;
    color: var(--fg-sec, #666);
    transition: color 0.2s ease;
}

.social-icon:hover {
    color: var(--act, #3b82f6);
}

/* ============================================================================
   Table of Contents
   ============================================================================ */

.blog-toc {
    background-color: var(--bg-alt, #f9fafb);
    border: 1px solid var(--bd, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--fg, #1a1a1a);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin: 0.5rem 0;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--fg-sec, #666);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.toc-link:hover {
    background-color: var(--bg-hvr, #f3f4f6);
    color: var(--act, #3b82f6);
}

.toc-link.toc-active {
    background-color: var(--act, #3b82f6);
    color: white;
    font-weight: 500;
}

.toc-level-2 {
    font-weight: 500;
}

.toc-level-3 {
    padding-left: 1.5rem;
    font-size: 0.875rem;
}

.toc-level-4 {
    padding-left: 2.5rem;
    font-size: 0.8125rem;
}

.toc-sublist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

/* ============================================================================
   Main Content
   ============================================================================ */

.blog-post-content {
    min-width: 0; /* Prevent grid overflow */
}

.blog-post-body {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.125rem;
    color: var(--fg, #1a1a1a);
}

.blog-summary {
    background: linear-gradient(135deg, var(--bg-alt, #f9fafb) 0%, #ffffff 100%);
    border: 2px solid var(--act, #3b82f6);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
}

.blog-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--act, #3b82f6) 0%, rgba(59, 130, 246, 0.6) 100%);
}

.blog-summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--act, #3b82f6);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-summary-title::before {
    content: '💡';
    font-size: 1.25rem;
}

.blog-summary-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--fg, #1a1a1a);
}

.blog-summary-content p {
    margin: 0.75rem 0;
}

.blog-summary-content p:first-child {
    margin-top: 0;
}

.blog-summary-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .blog-summary {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .blog-summary-title {
        font-size: 1.25rem;
    }
    
    .blog-summary-content {
        font-size: 1rem;
    }
}

.blog-heading {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2.5rem 0 1.5rem;
    color: var(--fg, #1a1a1a);
    scroll-margin-top: 100px;
}

.blog-subheading {
    font-weight: 600;
    line-height: 1.4;
    margin: 2rem 0 1rem;
    color: var(--fg, #1a1a1a);
    scroll-margin-top: 100px;
}

.blog-h3 {
    font-size: 1.5rem;
}

.blog-h4 {
    font-size: 1.25rem;
}

.blog-h5 {
    font-size: 1.125rem;
}

.blog-paragraph {
    margin: 1.5rem 0;
}

.blog-paragraph p {
    margin: 1rem 0;
}

.blog-quote {
    border-left: 4px solid var(--act, #3b82f6);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--bg-alt, #f9fafb);
    border-radius: 4px;
    font-style: italic;
    color: var(--fg-sec, #555);
}

.blog-image-figure {
    margin: 2.5rem 0;
    text-align: center;
}

.blog-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-image-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
    font-style: italic;
}

.blog-embed {
    margin: 2rem 0;
    text-align: center;
}

.blog-embed iframe {
    max-width: 100%;
    border-radius: 8px;
}

.blog-scientific-source {
    background-color: var(--bg-alt, #f9fafb);
    border: 1px solid var(--bd, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.source-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--fg, #1a1a1a);
}

.source-meta {
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--fg-sec, #555);
    margin: 0 0 0.5rem;
}

.source-link {
    color: var(--act, #3b82f6);
    text-decoration: none;
    font-weight: 500;
}

.source-link:hover {
    text-decoration: underline;
}

.source-citation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bd, #e5e7eb);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--fg-sec, #555);
}

.blog-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    border: 1px solid var(--bd, #e5e7eb);
}

.blog-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.blog-table-wrapper th,
.blog-table-wrapper td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bd, #e5e7eb);
}

.blog-table-wrapper th {
    background-color: var(--bg-alt, #f9fafb);
    font-weight: 600;
    color: var(--fg, #1a1a1a);
}

.blog-code-block {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bd, #e5e7eb);
}

.blog-code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    background-color: var(--bg-alt, #1a1a1a);
    color: #f9fafb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* FAQ Sections */
.blog-faq-section {
    margin: 3rem 0;
}

.faq-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1.5rem;
    color: var(--fg, #1a1a1a);
    scroll-margin-top: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-section-title::before {
    content: '❓';
    font-size: 1.5rem;
}

.blog-faq-item {
    margin: 1rem 0;
    background: linear-gradient(135deg, #ffffff 0%, var(--bg-alt, #f9fafb) 100%);
    border: 2px solid var(--bd, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blog-faq-item:hover {
    border-color: var(--act, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.blog-faq-item[data-faq-open="false"] {
    border-color: var(--bd, #e5e7eb);
}

.blog-faq-item[data-faq-open="true"] {
    border-color: var(--act, #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.faq-question-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.faq-question-btn:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.faq-question-btn:focus {
    outline: 2px solid var(--act, #3b82f6);
    outline-offset: -2px;
    border-radius: 12px;
}

.faq-number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--act, #3b82f6) 0%, rgba(59, 130, 246, 0.8) 100%);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.blog-faq-item[data-faq-open="false"] .faq-number {
    background: linear-gradient(135deg, var(--fg-sec, #666) 0%, rgba(102, 102, 102, 0.8) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-question-text {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fg, #1a1a1a);
    line-height: 1.5;
    transition: color 0.2s ease;
}

.blog-faq-item[data-faq-open="true"] .faq-question-text {
    color: var(--act, #3b82f6);
}

.faq-icon {
    flex-shrink: 0;
    color: var(--act, #3b82f6);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
}

.blog-faq-item[data-faq-open="true"] .faq-icon {
    transform: rotate(180deg);
    color: var(--act, #3b82f6);
}

.blog-faq-item[data-faq-open="false"] .faq-icon {
    color: var(--fg-sec, #666);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 1.5rem;
}

.blog-faq-item[data-faq-open="true"] .faq-answer {
    max-height: 2000px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer-content {
    color: var(--fg-sec, #555);
    line-height: 1.8;
    font-size: 1rem;
    padding-top: 0.5rem;
}

.faq-answer-content p {
    margin: 0.75rem 0;
}

.faq-answer-content p:first-child {
    margin-top: 0;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.faq-answer-content li {
    margin: 0.5rem 0;
}

.faq-answer-content a {
    color: var(--act, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.faq-answer-content a:hover {
    border-bottom-color: var(--act, #3b82f6);
}

/* FAQ Section Animation */
@keyframes fadeInFAQ {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-faq-item {
    animation: fadeInFAQ 0.4s ease-out;
}

.blog-faq-item:nth-child(1) { animation-delay: 0.05s; }
.blog-faq-item:nth-child(2) { animation-delay: 0.1s; }
.blog-faq-item:nth-child(3) { animation-delay: 0.15s; }
.blog-faq-item:nth-child(4) { animation-delay: 0.2s; }
.blog-faq-item:nth-child(5) { animation-delay: 0.25s; }
.blog-faq-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .faq-question-btn {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .faq-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .faq-question-text {
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1.25rem;
    }
    
    .blog-faq-item[data-faq-open="true"] .faq-answer {
        padding: 0 1.25rem 1.25rem;
    }
    
    .faq-answer-content {
        font-size: 0.9375rem;
    }
}

/* Sources Section */
.blog-sources-section {
    margin: 4rem 0;
    padding-top: 2rem;
    border-top: 2px solid var(--bd, #e5e7eb);
}

.sources-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: var(--fg, #1a1a1a);
    scroll-margin-top: 100px;
}

.sources-list {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0;
}

.source-item {
    margin: 1.5rem 0;
    padding-left: 0.5rem;
    line-height: 1.8;
    color: var(--fg-sec, #555);
}

.source-item strong {
    color: var(--fg, #1a1a1a);
    display: block;
    margin-bottom: 0.5rem;
}

.source-author,
.source-name {
    font-weight: 500;
}

.source-separator {
    margin: 0 0.5rem;
    color: var(--fg-sec, #999);
}

/* Tags */
.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--bd, #e5e7eb);
}

.tags-label {
    font-weight: 600;
    color: var(--fg-sec, #666);
}

.blog-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-alt, #f9fafb);
    color: var(--act, #3b82f6);
    border: 1px solid var(--bd, #e5e7eb);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.blog-tag:hover {
    background-color: var(--act, #3b82f6);
    color: white;
    border-color: var(--act, #3b82f6);
}

/* ============================================================================
   Glossary Terms
   ============================================================================ */

.glossary-term {
    color: var(--act, #3b82f6);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px dotted var(--act, #3b82f6);
    font-weight: 500;
}

.glossary-term:hover {
    background-color: rgba(59, 130, 246, 0.1);
    text-decoration-style: solid;
    border-bottom-color: var(--act, #3b82f6);
}

.glossary-term:focus {
    outline: 2px solid var(--act, #3b82f6);
    outline-offset: 2px;
    border-radius: 2px;
}

.glossary-term:visited {
    color: var(--act, #3b82f6);
    opacity: 0.8;
}

/* Glossary Modal */
.glossary-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.glossary-modal.glossary-modal-open {
    opacity: 1;
    visibility: visible;
}

.glossary-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.glossary-modal-content {
    position: relative;
    background-color: var(--bg, #ffffff);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1001;
    margin: 1rem;
}

.glossary-modal-open .glossary-modal-content {
    transform: scale(1);
}

.glossary-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--fg-sec, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.glossary-modal-close:hover {
    background-color: var(--bg-hvr, #f3f4f6);
    color: var(--fg, #1a1a1a);
}

.glossary-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--fg, #1a1a1a);
    padding-right: 2rem;
}

.glossary-modal-body {
    color: var(--fg-sec, #555);
    line-height: 1.7;
}

.glossary-pronunciation {
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
    margin-bottom: 1rem;
}

.glossary-definition {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.glossary-examples {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bd, #e5e7eb);
}

.glossary-examples h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--fg, #1a1a1a);
}

.glossary-examples ul {
    margin: 0;
    padding-left: 1.5rem;
}

.glossary-examples li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.glossary-full-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--act, #3b82f6);
    text-decoration: none;
    font-weight: 500;
}

.glossary-full-link:hover {
    text-decoration: underline;
}

/* ============================================================================
   Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
.glossary-term:focus {
    outline: 2px solid var(--act, #3b82f6);
    outline-offset: 2px;
}

/* ============================================================================
   Share Section
   ============================================================================ */

.blog-share-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-alt, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--bd, #e5e7eb);
}

.share-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--fg, #1a1a1a);
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bd, #e5e7eb);
    border-radius: 6px;
    background-color: var(--bg, #ffffff);
    color: var(--fg, #1a1a1a);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-btn svg {
    flex-shrink: 0;
}

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

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

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

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

.share-email:hover {
    background-color: #ea4335;
    color: white;
    border-color: #ea4335;
}

.share-copy:hover {
    background-color: var(--act, #3b82f6);
    color: white;
    border-color: var(--act, #3b82f6);
}

.share-count {
    text-align: center;
    font-size: 0.875rem;
    color: var(--fg-sec, #666);
    padding-top: 0.75rem;
    border-top: 1px solid var(--bd, #e5e7eb);
}

.share-count span {
    font-weight: 600;
    color: var(--fg, #1a1a1a);
}

/* ============================================================================
   Like/Dislike Section
   ============================================================================ */

.blog-like-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-alt, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--bd, #e5e7eb);
}

.like-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--fg, #1a1a1a);
}

.like-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.like-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--bd, #e5e7eb);
    border-radius: 6px;
    background-color: var(--bg, #ffffff);
    color: var(--fg, #1a1a1a);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.like-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.like-btn svg {
    flex-shrink: 0;
}

.like-btn.active {
    border-color: var(--act, #3b82f6);
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--act, #3b82f6);
}

.like-upvote.active {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.like-upvote:hover:not(.active) {
    border-color: #10b981;
    color: #10b981;
}

.like-downvote.active {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.like-downvote:hover:not(.active) {
    border-color: #ef4444;
    color: #ef4444;
}

.like-count {
    font-weight: 600;
    margin-left: 0.25rem;
    padding: 0.125rem 0.5rem;
    background-color: var(--bg-alt, #f9fafb);
    border-radius: 12px;
    font-size: 0.75rem;
}

.like-btn.active .like-count {
    background-color: rgba(59, 130, 246, 0.2);
}

.like-upvote.active .like-count {
    background-color: rgba(16, 185, 129, 0.2);
}

.like-downvote.active .like-count {
    background-color: rgba(239, 68, 68, 0.2);
}

.like-message {
    font-size: 0.875rem;
    text-align: center;
    min-height: 1.25rem;
    transition: all 0.3s ease;
}

.like-message.success {
    color: #10b981;
    font-weight: 500;
}

.like-message.error {
    color: #ef4444;
    font-weight: 500;
}

.like-message.info {
    color: var(--act, #3b82f6);
    font-weight: 500;
}

/* Responsive adjustments for share and like sections */
@media (max-width: 968px) {
    .share-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .like-buttons {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .share-buttons {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================================
   Related Articles Section (Modern Design)
   ============================================================================ */

.blog-related-articles-section {
    margin: 4rem 0;
    padding: 3rem 0;
    border-top: 2px solid var(--bd, #e5e7eb);
}

.related-articles-header {
    text-align: center;
    margin-bottom: 3rem;
}

.related-articles-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--fg, #1a1a1a);
}

.related-articles-subtitle {
    font-size: 1.125rem;
    color: var(--fg-sec, #666);
    margin: 0;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.related-article-card-modern {
    background-color: var(--bg, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bd, #e5e7eb);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.related-article-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--act, #3b82f6);
}

.related-article-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.related-article-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: var(--bg-alt, #f9fafb);
}

.related-article-image-modern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card-modern:hover .related-article-image-modern {
    transform: scale(1.05);
}

.related-article-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-article-card-modern:hover .related-article-overlay {
    opacity: 1;
}

.related-article-content-modern {
    padding: 1.5rem;
}

.related-article-categories {
    margin-bottom: 0.75rem;
}

.related-article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--act, #3b82f6);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.related-article-title-modern {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.75rem;
    color: var(--fg, #1a1a1a);
    transition: color 0.2s ease;
}

.related-article-card-modern:hover .related-article-title-modern {
    color: var(--act, #3b82f6);
}

.related-article-excerpt {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--fg-sec, #666);
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bd, #e5e7eb);
    font-size: 0.875rem;
}

.related-article-date {
    color: var(--fg-sec, #666);
    font-weight: 500;
}

.related-article-reading-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--fg-sec, #666);
    font-weight: 500;
}

.reading-time-icon {
    width: 16px;
    height: 16px;
    color: var(--fg-sec, #999);
}

/* Responsive adjustments for related articles */
@media (max-width: 968px) {
    .related-articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .blog-related-articles-section {
        margin: 3rem 0;
        padding: 2rem 0;
    }
    
    .related-articles-header {
        margin-bottom: 2rem;
    }
}

@media (max-width: 640px) {
    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .related-article-content-modern {
        padding: 1.25rem;
    }
    
    .related-article-title-modern {
        font-size: 1.125rem;
    }
    
    .related-article-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================================================
   Scroll to Top Button
   ============================================================================ */

.scroll-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background-color: var(--act, #3b82f6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background-color: var(--act, #3b82f6);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

.scroll-to-top-btn:focus {
    outline: 2px solid var(--act, #3b82f6);
    outline-offset: 2px;
}

.scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

@media (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
    
    .scroll-to-top-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Print styles */
@media print {
    .blog-sidebar,
    .blog-toc,
    .glossary-modal,
    .blog-share-section,
    .blog-like-section,
    .scroll-to-top-btn {
        display: none;
    }
    
    .blog-post-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-post-body {
        max-width: 100%;
    }
}

.responsive-object {
    position: relative;
    }
.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blog-embed iframe {
    width: 100vw;
    height: 50vh;
}
