/* =========================================================================
   Best Doors — Blog Body (Article) Styles
   --------------------------------------------------------------------------
   Styles the <article class="bd-article"> wrapper emitted by
   bd-blog-shortcode.php (filter the_content + shortcode [bd_blog_body]).

   Token source: component library (/component-library/index.html)
     - Brand red:    #ED2027 (--bd-red)
     - Body type:    Roboto  (--bd-font-primary)
     - Heading type: Lora    (--bd-font-secondary)
     - Body text:    #545454 (--bd-grey)

   Scope: every selector lives under .bd-article to avoid global leakage.
   v1.1.0 — 2026-05-26 — rebrand inline .button/.button-product-cta CTAs
   ========================================================================= */

.bd-article {
    --bd-red: #ED2027;
    --bd-maroon: #6F1816;
    --bd-black: #000;
    --bd-grey: #545454;
    --bd-light-grey: #D4D2D2;
    --bd-paper: #FFFFFF;
    --bd-soft: #F7F7F7;
    --bd-font-primary: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bd-font-secondary: 'Lora', Georgia, 'Times New Roman', serif;

    max-width: 760px;
    margin: 0 auto;
    padding: 32px 24px 56px;
    font-family: var(--bd-font-primary);
    font-size: 18px;
    line-height: 1.7;
    color: var(--bd-grey);
    word-wrap: break-word;
}

@media (max-width: 640px) {
    .bd-article {
        padding: 24px 16px 40px;
        font-size: 17px;
    }
}

/* --- Byline strip (category · date · read-time) --- */
.bd-article .bd-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bd-light-grey);
    font-family: var(--bd-font-primary);
    font-size: 14px;
    color: var(--bd-grey);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bd-article .bd-byline-sep {
    color: var(--bd-light-grey);
    margin: 0 4px;
}
.bd-article .bd-byline-cats a {
    color: var(--bd-red);
    text-decoration: none;
    font-weight: 600;
}
.bd-article .bd-byline-cats a:hover {
    text-decoration: underline;
}

/* --- Headings --- */
.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4,
.bd-article h5,
.bd-article h6 {
    font-family: var(--bd-font-secondary);
    color: var(--bd-black);
    line-height: 1.25;
    margin: 2em 0 0.6em;
}
.bd-article h1 { font-size: 2.4rem; font-weight: 700; }
.bd-article h2 {
    font-size: 1.85rem;
    font-weight: 700;
    padding-left: 16px;
    border-left: 4px solid var(--bd-red);
    margin-top: 2.2em;
}
.bd-article h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--bd-black);
}
.bd-article h4 { font-size: 1.2rem; font-weight: 600; }
.bd-article h5 { font-size: 1.05rem; font-weight: 600; }
.bd-article h6 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bd-grey);
}

/* --- Paragraphs --- */
.bd-article p {
    margin: 0 0 1.3em;
}
.bd-article p:first-of-type {
    font-size: 1.1em;
    color: var(--bd-black);
    line-height: 1.6;
}

/* --- Links --- */
.bd-article a {
    color: var(--bd-red);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 200ms ease;
}
.bd-article a:hover {
    color: var(--bd-maroon);
    text-decoration-thickness: 2px;
}

/* --- Inline content buttons ---
   Migrated old-prod posts ship <a class="button button-product-cta"> CTAs
   ("View Product", "Contact Us Here", "Browse…"). Without a rule here they fall
   back to a default blue theme style that clashes with the brand. Rebrand them
   as red article CTAs. `a.button` outranks the generic `.bd-article a` colour. */
.bd-article a.button,
.bd-article a.button-product-cta,
.bd-article .button-product-cta {
    display: inline-block;
    background: var(--bd-red);
    color: var(--bd-paper);
    text-decoration: none;
    font-family: var(--bd-font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    padding: 12px 24px;
    border-radius: 8px;
    margin: 6px 0;
    transition: background 200ms ease, transform 120ms ease;
}
.bd-article a.button:hover,
.bd-article a.button-product-cta:hover,
.bd-article .button-product-cta:hover {
    background: var(--bd-maroon);
    color: var(--bd-paper);
    text-decoration: none;
    transform: translateY(-1px);
}

/* --- Strong / em --- */
.bd-article strong { color: var(--bd-black); font-weight: 700; }
.bd-article em     { font-style: italic; }

/* --- Lists --- */
.bd-article ul,
.bd-article ol {
    margin: 0 0 1.6em;
    padding-left: 28px;
}
.bd-article li {
    margin-bottom: 0.6em;
}
.bd-article ul li::marker {
    color: var(--bd-red);
}
.bd-article ol li::marker {
    color: var(--bd-red);
    font-weight: 700;
}
.bd-article li > ul,
.bd-article li > ol {
    margin-top: 0.4em;
    margin-bottom: 0.6em;
}

/* --- Pull quote / blockquote --- */
.bd-article blockquote {
    margin: 2em 0;
    padding: 20px 24px 20px 28px;
    border-left: 4px solid var(--bd-red);
    background: var(--bd-soft);
    font-family: var(--bd-font-secondary);
    font-style: italic;
    font-size: 1.2em;
    color: var(--bd-black);
    line-height: 1.5;
}
.bd-article blockquote p:last-child { margin-bottom: 0; }
.bd-article blockquote cite {
    display: block;
    margin-top: 0.6em;
    font-style: normal;
    font-size: 0.85em;
    color: var(--bd-grey);
    font-family: var(--bd-font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Callout block (use class="callout" on a <div>) --- */
.bd-article .callout {
    margin: 2em 0;
    padding: 20px 24px;
    border-radius: 8px;
    background: #FFF5F5;
    border: 1px solid #F8D7D7;
    color: var(--bd-black);
}
.bd-article .callout strong {
    color: var(--bd-red);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

/* --- Figures + images --- */
.bd-article figure {
    margin: 2em -8px;          /* slight bleed for emphasis */
    padding: 0;
}
.bd-article img,
.bd-article figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    display: block;
    margin: 0 auto;
}
.bd-article figure figcaption,
.bd-article figcaption {
    margin-top: 8px;
    font-family: var(--bd-font-primary);
    font-size: 0.85em;
    color: var(--bd-grey);
    text-align: center;
    font-style: italic;
}
/* Inline images mid-paragraph */
.bd-article p img {
    margin: 1em auto;
}

/* --- Tables --- */
.bd-article table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    font-size: 0.95em;
}
.bd-article table th {
    background: var(--bd-black);
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-family: var(--bd-font-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85em;
}
.bd-article table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--bd-light-grey);
}
.bd-article table tr:nth-child(even) td {
    background: var(--bd-soft);
}

/* --- Inline code (rare in blog content but defensive) --- */
.bd-article code {
    background: var(--bd-soft);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    color: var(--bd-black);
}

/* --- HR --- */
.bd-article hr {
    border: 0;
    height: 1px;
    background: var(--bd-light-grey);
    margin: 3em 0;
}

/* --- Umbraco artefact cleanup ---
   Old-prod posts may leave behind .grid-section / .container / .row.clearfix
   wrappers that our regex didn't catch. Neutralise their layout. */
.bd-article .grid-section,
.bd-article .container,
.bd-article .row,
.bd-article .col-md-12,
.bd-article .column,
.bd-article .clearfix {
    all: unset;
    display: block;
}
.bd-article .clearfix::after { content: none; }

/* --- Related-articles grid (used inside Elementor template; styled here for reuse) --- */
.bd-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 48px auto;
    max-width: 1100px;
    padding: 0 24px;
}
.bd-related-card {
    background: var(--bd-paper);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: transform 250ms ease, box-shadow 250ms ease;
}
.bd-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.bd-related-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.bd-related-card-body {
    padding: 16px 18px 20px;
}
.bd-related-card-cat {
    color: var(--bd-red);
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}
.bd-related-card h3 {
    font-family: 'Lora', Georgia, serif;
    color: var(--bd-black);
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0 0 8px;
}
.bd-related-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}
