/*
 * Dynamic Blog Content Styles
 * Theme: SocioTricks (Light Theme with Brand Accents)
 * Colors: Gray-900 (#111827), Brand-500 (#4f46e5), Gray-600 (#4b5563)
 */

/* Main Wrapper */
.blog-content {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #4b5563; /* Gray-600 */
    line-height: 1.8;
    font-size: 1.125rem; /* 18px */
}

/* Headings */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111827; /* Gray-900 */
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    text-align: left !important;
}

.blog-content h1 {
    font-size: 2.25rem !important;
    line-height: 1.2 !important;
    color: #4f46e5; /* Brand-500 for H1 */
}

.blog-content h2 {
    font-size: 1.875rem !important;
    line-height: 1.3 !important;
    color: #4f46e5; /* Brand-500 for H2 */
}

.blog-content h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

.blog-content h4 {
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
}

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

.blog-content h6 {
    font-size: 1rem !important;
}

/* Paragraphs */
.blog-content p {
    margin: 0.75em 0;
    text-align: left;
    color: #4b5563;
}

/* Links */
.blog-content a {
    color: #4f46e5; /* Brand-500 */
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

.blog-content a:hover {
    color: #4338ca; /* Brand-600 on hover */
}

/* Images */
.blog-content img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 2rem auto;
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e7eb; /* Gray-200 */
}

.blog-content figure {
    margin: 2rem 0;
}

.blog-content figcaption {
    text-align: center;
    color: #9ca3af; /* Gray-400 */
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin: 1.5em 0 1.5em 2em;
    padding-left: 0;
    text-align: left !important;
    color: #4b5563;
}

.blog-content ul {
    list-style: disc outside;
}

.blog-content ol {
    list-style: decimal outside;
}

.blog-content ul li,
.blog-content ol li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

.blog-content ul li::marker,
.blog-content ol li::marker {
    color: #4f46e5;
}

/* Nested Lists */
.blog-content ul ul,
.blog-content ol ol,
.blog-content ul ol,
.blog-content ol ul {
    margin: 0.5em 0 0.5em 1.5em;
}

/* Blockquotes */
.blog-content blockquote {
    border-left: 4px solid #4f46e5;
    background: #f9fafb; /* Gray-50 */
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #374151; /* Gray-700 */
}

.blog-content blockquote p {
    margin: 0.5em 0;
}

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

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

/* Tables */
.blog-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #ffffff;
}

.blog-content table th,
.blog-content table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.blog-content table th {
    background-color: #f3f4f6; /* Gray-100 */
    font-weight: 600;
    color: #111827;
}

.blog-content table td {
    color: #4b5563;
}

.blog-content table tr:last-child td {
    border-bottom: none;
}

.blog-content table tr:hover {
    background-color: rgba(79, 70, 229, 0.05); /* Brand-500 with low opacity */
}

/* Horizontal Rule */
.blog-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 3rem 0;
}

/* Strong/Bold */
.blog-content strong,
.blog-content b {
    font-weight: 700;
    color: #111827;
}

/* Emphasis/Italic */
.blog-content em,
.blog-content i {
    font-style: italic;
    color: #374151;
}

/* Code Blocks */
.blog-content pre {
    background: #1f2937; /* Gray-800 for contrast */
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #e5e7eb;
}

.blog-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6); /* Brand gradient */
    border-radius: 0.5rem 0.5rem 0 0;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* Inline Code */
.blog-content :not(pre)>code {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
    font-weight: 500;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* Scrollbars for Code */
.blog-content pre::-webkit-scrollbar {
    height: 8px;
}

.blog-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); /* Updated from original to keep dark track inside dark pre */
    border-radius: 4px;
}

.blog-content pre::-webkit-scrollbar-thumb {
    background: #4b5563; /* Gray-600 */
    border-radius: 4px;
}

.blog-content pre::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; /* Gray-400 */
}

/* Mark/Highlight */
.blog-content mark {
    background-color: rgba(79, 70, 229, 0.2);
    color: #111827;
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Abbreviation */
.blog-content abbr {
    text-decoration: underline dotted;
    cursor: help;
    color: #4f46e5;
}

/* Del/Strike */
.blog-content del,
.blog-content s {
    text-decoration: line-through;
    color: #9ca3af;
}

/* Inserted text */
.blog-content ins {
    text-decoration: none;
    background-color: rgba(16, 185, 129, 0.1); /* Emerald-500 light */
    color: #111827;
    border-bottom: 2px solid #10b981;
}

/* Small text */
.blog-content small {
    font-size: 0.875em;
    color: #6b7280; /* Gray-500 */
}

/* Subscript and Superscript */
.blog-content sub,
.blog-content sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.blog-content sup {
    top: -0.5em;
}

.blog-content sub {
    bottom: -0.25em;
}

/* Keyboard key */
.blog-content kbd {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
    color: #374151;
    display: inline-block;
    font-size: 0.875em;
    padding: 0.1em 0.4em;
    vertical-align: baseline;
}

/* Definition List */
.blog-content dl {
    margin: 1.5em 0;
}

.blog-content dt {
    font-weight: 700;
    color: #111827;
    margin-top: 1em;
}

.blog-content dd {
    margin-left: 2em;
    color: #4b5563;
    margin-bottom: 0.5em;
}

/* Address */
.blog-content address {
    font-style: normal;
    margin: 1.5em 0;
    padding: 1rem;
    background: #f9fafb;
    border-left: 4px solid #4f46e5;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Video embeds */
.blog-content iframe,
.blog-content video {
    max-width: 100%;
    margin: 2rem auto;
    display: block;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .blog-content {
        font-size: 1rem;
    }

    .blog-content h1 {
        font-size: 1.875rem !important;
    }

    .blog-content h2 {
        font-size: 1.5rem !important;
    }

    .blog-content h3 {
        font-size: 1.25rem !important;
    }

    .blog-content h4 {
        font-size: 1.125rem !important;
    }

    .blog-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .blog-content table {
        font-size: 0.875rem;
    }

    .blog-content table th,
    .blog-content table td {
        padding: 0.75rem;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-content > * {
    animation: fadeInUp 0.6s ease-out;
}

/* Print Styles */
@media print {
    .blog-content {
        color: #000000;
    }

    .blog-content h1,
    .blog-content h2,
    .blog-content h3,
    .blog-content h4,
    .blog-content h5,
    .blog-content h6 {
        color: #000000;
    }

    .blog-content pre {
        border: 1px solid #000000;
        background: #f5f5f5;
        color: #000000;
    }

    .blog-content a {
        color: #000000;
        text-decoration: underline;
    }
}