/* —— Article page layout (full-width reading + sticky H2 TOC) —— */
.blog-article {
    background: #fff;
}

.blog-article-hero {
    padding: 3rem 1.5rem 0;
}

.blog-article-hero-inner {
    max-width: 44rem;
    margin: 0 auto;
}

.blog-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
    font-size: 0.8125rem;
    color: #4b5563;
}

.blog-breadcrumb a {
    color: #374151;
    text-decoration: none;
}

.blog-breadcrumb a:hover {
    color: var(--primary-color);
}

.blog-article-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.blog-article-title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #111827;
}

.blog-article-lede {
    margin: 0 0 1.5rem;
    font-size: 1.2rem;
    line-height: 1.55;
    color: #4b5563;
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    margin-bottom: 2.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.blog-article-cover {
    max-width: 72rem;
    margin: 0 auto 0;
}

.blog-article-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.75rem;
}

.blog-article-body {
    padding: 3.5rem 1.5rem 5rem;
}

.blog-article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

.blog-toc {
    display: none;
}

.blog-toc-label,
.blog-toc-mobile summary {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4b5563;
}

.blog-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid #e5e7eb;
}

.blog-toc-list a {
    display: block;
    padding: 0.4rem 0 0.4rem 0.95rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.4;
    text-decoration: none;
}

.blog-toc-list a:hover {
    color: var(--primary-color);
}

.blog-toc-list a.is-active {
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.blog-toc-mobile {
    margin-bottom: 2rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eef0f4;
}

.blog-toc-mobile summary {
    cursor: pointer;
    list-style: none;
    margin-bottom: 0.75rem;
}

.blog-toc-mobile summary::-webkit-details-marker {
    display: none;
}

.blog-toc-mobile[hidden] {
    display: none;
}

.blog-article-main {
    min-width: 0;
    max-width: 44rem;
}

.blog-article-footer-block {
    margin-top: 2.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid #eef0f4;
}

.blog-article-footer-title {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4b5563;
}

.blog-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-article-tags a {
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    background: #eef2ff;
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.blog-article-tags a:hover {
    background: #e0e7ff;
}

.blog-article-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.blog-article-share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.blog-share-buttons {
    display: flex;
    gap: 0.6rem;
}

.blog-share-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.blog-share-buttons a:hover {
    background: var(--primary-color);
    color: #fff;
}

.blog-share-buttons a .mdi {
    font-size: 1.15rem;
}

.blog-related {
    padding: 4rem 1.5rem 5rem;
    background: #f8f9fb;
    border-top: 1px solid #eef0f4;
}

.blog-related-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.blog-related h2 {
    margin: 0 0 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.blog-related-card {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-related-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.2);
}

.blog-related-card img {
    display: block;
    width: 100%;
    height: 10.5rem;
    object-fit: cover;
}

.blog-related-card-body {
    padding: 1.25rem 1.35rem 1.4rem;
}

.blog-related-card time {
    font-size: 0.75rem;
    color: #4b5563;
}

.blog-related-card h3 {
    margin: 0.4rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.blog-related-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}

@media (min-width: 768px) {
    .blog-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .blog-article-hero {
        padding-top: 4rem;
    }

    .blog-article-layout {
        grid-template-columns: 15.5rem minmax(0, 44rem);
        justify-content: center;
        gap: 4rem;
        align-items: start;
    }

    .blog-toc {
        display: block;
        position: sticky;
        top: 6.5rem;
        align-self: start;
    }

    .blog-toc[hidden] {
        display: none;
    }

    .blog-toc-mobile {
        display: none;
    }

    .blog-article-main {
        max-width: none;
    }
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Round share links: fixed box + centered icon (avoids flex stretch / line-height squashing MDI) */
.blog-share-buttons a {
    line-height: 1;
}

.blog-share-buttons a .mdi {
    line-height: 1;
    display: block;
}

/*
 * Article body: Quill HTML + Tailwind Preflight.
 * ql-editor picks up list/indent/align from quill.core.css; overrides below restore typography.
 */
.quill-content.ql-editor {
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    max-height: none;
    outline: none;
    overflow: visible;
    padding: 0;
    font-family: inherit;
    font-size: 1.125rem;
    line-height: 1.8;
    white-space: normal;
    text-align: inherit;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    color: #374151;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    counter-reset: list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
}

/*
 * Long-form typography — Inter (OFL), self-hosted variable font.
 */
.quill-content.ql-editor.blog-article-prose {
    max-width: none;
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    color: rgb(56, 63, 78);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0;
}

.quill-content.ql-editor.blog-article-prose h2 {
    scroll-margin-top: 6.5rem;
}

.quill-content.ql-editor.blog-article-prose h1,
.quill-content.ql-editor.blog-article-prose h2,
.quill-content.ql-editor.blog-article-prose h3,
.quill-content.ql-editor.blog-article-prose h4,
.quill-content.ql-editor.blog-article-prose h5,
.quill-content.ql-editor.blog-article-prose h6 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    color: rgb(31, 36, 48);
    letter-spacing: -0.02em;
}

.quill-content.ql-editor.blog-article-prose strong,
.quill-content.ql-editor.blog-article-prose b {
    font-weight: 700;
}

.quill-content.ql-editor.blog-article-prose pre,
.quill-content.ql-editor.blog-article-prose code {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    font-weight: 400;
}

.quill-content.ql-editor.blog-article-prose code {
    font-size: 0.92em;
}

.quill-content.ql-editor.blog-article-prose a {
    color: rgb(52, 78, 140);
}

.quill-content.ql-editor.blog-article-prose a:hover {
    color: rgb(38, 58, 115);
}

.quill-content.ql-editor.blog-article-prose:lang(fr),
.quill-content.ql-editor.blog-article-prose:lang(en) {
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}

.quill-content.ql-editor > * {
    cursor: auto;
}

.quill-content.ql-editor p,
.quill-content.ql-editor h1,
.quill-content.ql-editor h2,
.quill-content.ql-editor h3,
.quill-content.ql-editor h4,
.quill-content.ql-editor h5,
.quill-content.ql-editor h6 {
    margin-top: 0;
    margin-bottom: 1.125rem;
}

.quill-content.ql-editor h1,
.quill-content.ql-editor h2,
.quill-content.ql-editor h3,
.quill-content.ql-editor h4,
.quill-content.ql-editor h5,
.quill-content.ql-editor h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    letter-spacing: -0.02em;
}

.quill-content.ql-editor h1 {
    font-size: 2.25rem;
}
.quill-content.ql-editor h2 {
    font-size: 1.625rem;
    margin-bottom: 0.75rem;
}
.quill-content.ql-editor * + h2 {
    margin-top: 2.25rem;
}
.quill-content.ql-editor h3 {
    font-size: 1.3125rem;
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
}
.quill-content.ql-editor h3:first-child {
    margin-top: 0;
}
.quill-content.ql-editor h4 {
    font-size: 1.1875rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.quill-content.ql-editor h4:first-child {
    margin-top: 0;
}
.quill-content.ql-editor h5 {
    font-size: 1.0625rem;
}
.quill-content.ql-editor h6 {
    font-size: 1rem;
}

.quill-content.ql-editor > *:first-child {
    margin-top: 0;
}

/*
 * Quill v2 uses <ol> for bullet and ordered lists (li[data-list]).
 * Those <ol> were not covered by our ul / plain-ol rules, so they kept margin:0 from quill.core.css
 * while <p> kept a large margin-bottom — causing a big gap before lists and almost none after.
 */
.quill-content.ql-editor ol:has(> li[data-list]) {
    list-style-type: none;
    margin: 0 0 1.25rem;
    padding-left: 1.5em;
}

.quill-content.ql-editor p:has(+ ol),
.quill-content.ql-editor p:has(+ ul) {
    margin-bottom: 0.5rem;
}

.quill-content.ql-editor ol + p,
.quill-content.ql-editor ul + p {
    margin-top: 1.25rem;
}

.quill-content.ql-editor h2:has(+ ol),
.quill-content.ql-editor h2:has(+ ul),
.quill-content.ql-editor h3:has(+ ol),
.quill-content.ql-editor h3:has(+ ul),
.quill-content.ql-editor h4:has(+ ol),
.quill-content.ql-editor h4:has(+ ul) {
    margin-bottom: 0.5rem;
}

.quill-content.ql-editor ol + h2,
.quill-content.ql-editor ol + h3,
.quill-content.ql-editor ul + h2,
.quill-content.ql-editor ul + h3 {
    margin-top: 1.5rem;
}

.quill-content.ql-editor li[data-list] {
    line-height: 1.65;
    margin-bottom: 0.4em;
}

.quill-content.ql-editor li[data-list]:last-child {
    margin-bottom: 0;
}

.quill-content.ql-editor ul > li,
.quill-content.ql-editor ol:not(:has(> li[data-list])) > li {
    line-height: 1.65;
    margin-bottom: 0.35em;
}

.quill-content.ql-editor ul > li:last-child,
.quill-content.ql-editor ol:not(:has(> li[data-list])) > li:last-child {
    margin-bottom: 0;
}

.quill-content.ql-editor li > p {
    margin-bottom: 0.5rem;
}

.quill-content.ql-editor li > p:last-child {
    margin-bottom: 0;
}

.quill-content.ql-editor strong,
.quill-content.ql-editor b {
    font-weight: 700;
}

.quill-content.ql-editor em,
.quill-content.ql-editor i {
    font-style: italic;
}

.quill-content.ql-editor u {
    text-decoration: underline;
}

.quill-content.ql-editor s,
.quill-content.ql-editor strike {
    text-decoration: line-through;
}

.quill-content.ql-editor ul {
    list-style-type: disc;
    list-style-position: outside;
    margin: 0 0 1.25rem;
    padding-left: 1.5em;
}

/* Quill's .ql-editor li { list-style-type: none } hides discs on plain
   <ul><li> (no data-list / .ql-ui). Restore native markers. */
.quill-content.ql-editor ul > li:not([data-list]) {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 0.25em;
}

.quill-content.ql-editor ul ul > li:not([data-list]) {
    list-style-type: circle;
}

.quill-content.ql-editor ul ul ul > li:not([data-list]) {
    list-style-type: square;
}

.quill-content.ql-editor ul ul {
    list-style-type: circle;
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.quill-content.ql-editor ul ul ul {
    list-style-type: square;
}

.quill-content.ql-editor ol:not(:has(li[data-list])) {
    list-style-type: decimal;
    list-style-position: outside;
    margin: 0 0 1.25rem;
    padding-left: 1.5em;
}

.quill-content.ql-editor ol:not(:has(> li[data-list])) > li:not([data-list]) {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 0.25em;
}

.quill-content.ql-editor ol:not(:has(li[data-list])) ol {
    list-style-type: lower-alpha;
}

.quill-content.ql-editor pre,
.quill-content.ql-editor pre.ql-syntax {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.5;
    color: #1f2937;
    background: #f3f4f6;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.quill-content.ql-editor code {
    font-size: 0.9em;
    padding: 0.125rem 0.375rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
}

.quill-content.ql-editor pre code {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.quill-content.ql-editor table {
    width: 100%;
    margin: 1.25rem 0;
    border-collapse: collapse;
    font-size: 0.95em;
}

.quill-content.ql-editor th,
.quill-content.ql-editor td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.quill-content.ql-editor th {
    background: #f9fafb;
    font-weight: 600;
}

.quill-content.ql-editor blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #374151;
    line-height: 1.75;
    font-size: 1.05em;
}

.quill-content.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.quill-content.ql-editor a {
    color: #4559c9;
    text-decoration: underline;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.2em;
}

.quill-content.ql-editor a:hover {
    color: var(--secondary-color);
}

.quill-content.ql-editor li[data-list="bullet"]:not(:has(.ql-ui))::before {
    content: "\2022";
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    margin-right: 0.35em;
}

.quill-content.ql-editor li[data-list="ordered"]:not(:has(.ql-ui)) {
    list-style-type: decimal;
    list-style-position: outside;
}

/* Image Overlay Styles */
.image-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease-out;
}

.overlay-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.overlay-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
}

.overlay-close:hover {
    background: white;
    transform: scale(1.1);
}

.clickable-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .overlay-content {
        max-width: 95%;
        max-height: 95%;
    }

    .overlay-close {
        top: -40px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}
