﻿/* ==========================================================================
   Blog article page (/blogs/{slug}) – loaded after blog.css, which already
   has the breadcrumb bar, tag chips, cards (related articles) and the
   newsletter strip.

   Contents
     1. Article header & meta
     2. Featured image
     3. Rich text (.blog-article-content – sanitised CMS HTML)
     4. Share bar
     5. FAQ accordion (Bootstrap collapse)
     6. Related articles
   ========================================================================== */


/* 1. Article header & meta ================================================ */

.blog-article-container {
    max-width: 960px;
}

.blog-tag--category {
    color: var(--text-on-dark);
    background: var(--brand-plum);
}

a.blog-tag--category:hover {
    background: var(--brand-plum-deep);
}

.blog-article-title {
    margin-bottom: 0;
    font-family: var(--font-serif);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-regular);
    line-height: 1.25;
    color: var(--brand-plum);
}

.blog-article-meta {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.blog-meta-author {
    font-weight: var(--fw-medium);
    color: var(--brand-plum);
}

.blog-meta-sep {
    color: var(--line-strong);
}


/* 2. Featured image ======================================================= */

.blog-article-featured-img {
    margin-inline: 0;
    overflow: hidden;
    aspect-ratio: 2 / 1;
    background: var(--surface-sand);
    border-radius: var(--radius);
}

    .blog-article-featured-img picture {
        display: block;
        width: 100%;
        height: 100%;
    }

    .blog-article-featured-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }


/* 3. Rich text ============================================================
   Links: base.css (underlined). Old posts may still carry their own
   .blog-wrapper / .blog-content wrappers – the sanitiser drops their <style>,
   so they simply inherit these rules. */

.blog-article-content {
    font-size: var(--fs-md);
    line-height: 1.8;
    color: var(--text);
    overflow-wrap: anywhere;
}

    .blog-article-content > :first-child {
        margin-top: 0;
    }

    .blog-article-content h1,
    .blog-article-content h2,
    .blog-article-content h3,
    .blog-article-content h4 {
        margin: 2em 0 .6em;
        font-family: var(--font-serif);
        font-weight: var(--fw-regular);
        line-height: 1.3;
        color: var(--brand-plum);
    }

    .blog-article-content h1,
    .blog-article-content h2 {
        padding-bottom: var(--space-1);
        font-size: var(--fs-xl);
        border-bottom: 1px solid var(--line);
    }

    .blog-article-content h3 {
        font-size: var(--fs-lg);
    }

    .blog-article-content h4 {
        font-family: var(--font-sans);
        font-size: var(--fs-md);
        font-weight: var(--fw-semibold);
    }

    .blog-article-content p {
        margin: 0 0 1.1em;
    }

    .blog-article-content strong,
    .blog-article-content b {
        font-weight: var(--fw-semibold);
        color: var(--text-strong);
    }

    .blog-article-content ul,
    .blog-article-content ol {
        margin: 0 0 1.25em;
        padding-left: 1.4em;
    }

    /* style.css resets list-style on every ul – restore it for article text */
    .blog-article-content ul {
        list-style: disc;
    }

        .blog-article-content ul ul {
            list-style: circle;
        }

    .blog-article-content ol {
        list-style: decimal;
    }

    .blog-article-content li {
        margin-bottom: .4em;
        padding-left: .2em;
    }

        .blog-article-content li::marker {
            color: var(--brand-gold-deep);
        }

        .blog-article-content li > ul,
        .blog-article-content li > ol {
            margin: .4em 0 0;
        }

    .blog-article-content blockquote {
        margin: 1.75em 0;
        padding: var(--space-4) var(--space-5);
        font-family: var(--font-serif);
        font-size: var(--fs-lg);
        font-style: italic;
        line-height: 1.6;
        color: var(--brand-plum);
        background: var(--surface-cream);
        border-left: 3px solid var(--brand-gold);
    }

        .blog-article-content blockquote p:last-child {
            margin-bottom: 0;
        }

    .blog-article-content img {
        max-width: 100%;
        height: auto;
        border-radius: var(--radius-sm);
    }

    .blog-article-content figure {
        margin: 1.75em 0;
    }

    .blog-article-content figcaption {
        margin-top: var(--space-2);
        font-size: var(--fs-sm);
        color: var(--text-muted);
    }

    .blog-article-content hr {
        margin: 2em 0;
        border: 0;
        border-top: 1px solid var(--line);
        opacity: 1;
    }

    .blog-article-content table {
        display: block;
        max-width: 100%;
        margin: 1.75em 0;
        overflow-x: auto;
        font-size: var(--fs-base);
        border-collapse: collapse;
    }

    .blog-article-content caption {
        caption-side: top;
        padding: 0 0 var(--space-2);
        font-size: var(--fs-sm);
        color: var(--text-muted);
    }

    .blog-article-content th,
    .blog-article-content td {
        padding: var(--space-2) var(--space-3);
        text-align: left;
        vertical-align: top;
        border: 1px solid var(--line);
    }

    .blog-article-content th {
        font-weight: var(--fw-semibold);
        color: var(--text-strong);
        background: var(--surface-sand);
    }

    .blog-article-content code {
        padding: .1em .35em;
        font-size: .9em;
        color: var(--brand-plum-deep);
        background: var(--surface-sand);
        border-radius: var(--radius-sm);
    }

    .blog-article-content pre {
        margin: 1.5em 0;
        padding: var(--space-4);
        overflow-x: auto;
        font-size: var(--fs-sm);
        background: var(--surface-sand);
        border-radius: var(--radius-sm);
    }

        .blog-article-content pre code {
            padding: 0;
            background: none;
        }

    .blog-article-content .text-center,
    .blog-article-content .align-center {
        text-align: center;
    }

    .blog-article-content .text-right,
    .blog-article-content .align-right {
        text-align: right;
    }

    .blog-article-content .text-justify,
    .blog-article-content .align-justify {
        text-align: justify;
    }


/* 4. Share bar ============================================================ */

.blog-share-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-top: 1px solid var(--line);
}

.blog-share-label {
    margin-right: var(--space-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--brand-plum);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .blog-share-btn:hover {
        color: var(--text-on-dark);
        background: var(--brand-plum);
        border-color: var(--brand-plum);
    }

.blog-share-copied {
    font-size: var(--fs-sm);
    color: var(--success);
}


/* 5. FAQ accordion ======================================================== */

.blog-faq-heading {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-2);
    font-family: var(--font-serif);
    font-size: var(--fs-xl);
    font-weight: var(--fw-regular);
    line-height: 1.3;
    color: var(--brand-plum);
    border-bottom: 1px solid var(--brand-gold);
}

.blog-faq-item {
    border-bottom: 1px solid var(--line);
}

.blog-faq-btn {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    line-height: 1.5;
    text-align: left;
    color: var(--brand-plum);
    background: transparent;
    border: 0;
    cursor: pointer;
}

    .blog-faq-btn:hover {
        color: var(--brand-plum-soft);
    }

.blog-faq-arrow {
    flex-shrink: 0;
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: var(--space-1);
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s var(--ease);
}

.blog-faq-btn[aria-expanded="true"] .blog-faq-arrow {
    transform: rotate(-135deg);
}

.blog-faq-answer-text {
    padding-bottom: var(--space-5);
    font-size: var(--fs-md);
    line-height: 1.8;
    color: var(--text);
}

    .blog-faq-answer-text p:last-child {
        margin-bottom: 0;
    }


/* 6. Related articles ===================================================== */

.blog-related-heading {
    padding-bottom: 6px;
    font-family: var(--font-serif);
    font-size: var(--fs-xl);
    font-weight: var(--fw-regular);
    color: var(--brand-plum);
    border-bottom: 1px solid var(--brand-gold);
}


/* Responsive ============================================================== */

@media (max-width: 767.98px) {
    .blog-article-featured-img {
        aspect-ratio: 4 / 3;
    }

    .blog-article-content {
        font-size: var(--fs-base);
    }

        .blog-article-content h1,
        .blog-article-content h2 {
            font-size: var(--fs-lg);
        }

        .blog-article-content h3 {
            font-size: var(--fs-md);
        }

        .blog-article-content blockquote {
            font-size: var(--fs-md);
        }

    .blog-share-btn {
        width: 44px;
        height: 44px;
    }

    .blog-faq-answer-text {
        font-size: var(--fs-base);
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-faq-arrow {
        transition: none;
    }
}
