/* ==========================================================================
   BLOG & ARTICLE TYPOGRAPHY & DESIGN SYSTEM
   Modern, Editorial & High-Legibility Styling
   ========================================================================== */

/* Main Article Content Container */
.blog-content {
    font-size: 1.125rem; /* 18px */
    line-height: 1.85;
    color: #334155; /* Slate 700 */
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.01em;
    word-break: break-word;
}

/* Fluid responsive font sizing for reading comfort */
@media (max-width: 640px) {
    .blog-content {
        font-size: 1.0625rem; /* 17px */
        line-height: 1.8;
    }
}

/* Dynamic Font Sizing classes (controlled via user font size switcher) */
.blog-content.text-size-sm { font-size: 1rem; line-height: 1.75; }
.blog-content.text-size-base { font-size: 1.125rem; line-height: 1.85; }
.blog-content.text-size-lg { font-size: 1.25rem; line-height: 1.9; }

/* Lead Paragraph (First paragraph receives elegant editorial treatment) */
.blog-content > p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.85;
    color: #1e293b;
    font-weight: 400;
    margin-bottom: 1.75rem;
}

@media (max-width: 640px) {
    .blog-content > p:first-of-type {
        font-size: 1.15rem;
    }
}

/* Standard Paragraphs */
.blog-content p {
    margin-top: 0;
    margin-bottom: 1.6rem;
    color: #334155;
}

.blog-content p:last-child {
    margin-bottom: 0;
}

/* Headings Typography */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    color: #0f172a; /* Slate 900 */
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.025em;
    scroll-margin-top: 6.5rem; /* For sticky navbar TOC jumping */
}

.blog-content h1 {
    font-size: 2.25rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.blog-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    position: relative;
    display: flex;
    align-items: center;
    border-left: 4px solid #2563eb;
    padding-left: 0.875rem;
    border-radius: 2px;
}

@media (min-width: 768px) {
    .blog-content h2 {
        font-size: 1.95rem;
    }
}

.blog-content h3 {
    font-size: 1.4rem;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

@media (min-width: 768px) {
    .blog-content h3 {
        font-size: 1.55rem;
    }
}

.blog-content h4 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #334155;
}

/* Anchor link copy icon for headings */
.blog-content .heading-anchor {
    opacity: 0;
    margin-left: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.75em;
    transition: opacity 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.blog-content h2:hover .heading-anchor,
.blog-content h3:hover .heading-anchor,
.blog-content h4:hover .heading-anchor {
    opacity: 1;
}

.blog-content .heading-anchor:hover {
    color: #2563eb;
}

/* Links */
.blog-content a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #93c5fd;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: all 0.2s ease;
}

.blog-content a:hover {
    color: #1d4ed8;
    text-decoration-color: #2563eb;
    background-color: #eff6ff;
    border-radius: 2px;
}

/* Bold & Italic */
.blog-content strong,
.blog-content b {
    font-weight: 700;
    color: #0f172a;
}

.blog-content em,
.blog-content i {
    font-style: italic;
    color: #1e293b;
}

.blog-content mark {
    background: #fef08a; /* Amber/Yellow pastel highlight */
    color: #0f172a;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Unordered Lists */
.blog-content ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
    margin-bottom: 1.75rem;
}

.blog-content ul > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.blog-content ul > li::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.65rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 2px #dbeafe;
}

/* Ordered Lists */
.blog-content ol {
    counter-reset: blog-ol-counter;
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
    margin-bottom: 1.75rem;
}

.blog-content ol > li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.85rem;
    line-height: 1.75;
}

.blog-content ol > li::before {
    counter-increment: blog-ol-counter;
    content: counter(blog-ol-counter);
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Blockquotes (Editorial Pull-quotes) */
.blog-content blockquote {
    position: relative;
    margin: 2.25rem 0;
    padding: 1.5rem 1.75rem 1.5rem 2.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-left: 4px solid #2563eb;
    border-radius: 0 1rem 1rem 0;
    color: #1e293b;
    font-size: 1.15rem;
    line-height: 1.8;
    font-style: italic;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

.blog-content blockquote::before {
    content: "\201C"; /* Left double quotation mark */
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
    font-size: 3rem;
    line-height: 1;
    font-family: Georgia, serif;
    color: #93c5fd;
    opacity: 0.6;
    pointer-events: none;
}

.blog-content blockquote p {
    margin-bottom: 0.75rem;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content blockquote footer,
.blog-content blockquote cite {
    display: block;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 600;
    color: #64748b;
    margin-top: 0.75rem;
}

/* Inline Code */
.blog-content code:not(pre code) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    background-color: #f1f5f9;
    color: #0f172a;
    padding: 0.2rem 0.45rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

/* Code Blocks */
.blog-content pre {
    position: relative;
    background-color: #0f172a; /* Slate 900 */
    color: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    overflow-x: auto;
    font-size: 0.925rem;
    line-height: 1.65;
    margin: 2rem 0;
    border: 1px solid #1e293b;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.blog-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
}

/* Copy button for code blocks */
.code-copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Images, Figures and Captions */
.blog-content figure {
    margin: 2.5rem 0;
    text-align: center;
}

.blog-content img {
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    margin: 2rem auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-content figcaption {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.75rem;
    font-style: italic;
    text-align: center;
}

/* Horizontal Dividers */
.blog-content hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 3rem 0;
}

/* Tables */
.blog-content .table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
    margin: 0;
}

.blog-content th {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    padding: 0.875rem 1.25rem;
    border-bottom: 2px solid #e2e8f0;
}

.blog-content td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.blog-content tr:last-child td {
    border-bottom: none;
}

.blog-content tr:nth-child(even) td {
    background-color: #f8fafc/60;
}

.blog-content tr:hover td {
    background-color: #eff6ff;
}

/* Quill WYSIWYG Specific Classes */
.blog-content .ql-align-center {
    text-align: center;
}

.blog-content .ql-align-right {
    text-align: right;
}

.blog-content .ql-align-justify {
    text-align: justify;
}

.blog-content .ql-syntax {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    overflow-x: auto;
    font-family: monospace;
    margin: 1.75rem 0;
}

.blog-content .ql-indent-1 { padding-left: 2rem; }
.blog-content .ql-indent-2 { padding-left: 4rem; }
.blog-content .ql-indent-3 { padding-left: 6rem; }
.blog-content .ql-indent-4 { padding-left: 8rem; }

/* Callout Boxes (Info, Tip, Warning, Success) */
.callout {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    border-left: 4px solid;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.callout .callout-icon {
    font-size: 1.25rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.callout .callout-body {
    flex: 1;
    font-size: 1rem;
    line-height: 1.65;
}

.callout-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e3a8a;
}
.callout-info .callout-icon { color: #3b82f6; }

.callout-tip {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}
.callout-tip .callout-icon { color: #10b981; }

.callout-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}
.callout-warning .callout-icon { color: #f59e0b; }

/* Table of Contents (TOC) Active Link Indicator */
#toc a.active {
    color: #2563eb;
    font-weight: 700;
    border-color: #2563eb;
    background-color: #eff6ff;
}

/* Toast Notification for Link Copied */
#toastNotification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

#toastNotification.show {
    transform: translateY(0);
    opacity: 1;
}
