/* =========================================================================
   Blog (blog/index.html + blog/*.html posts)
   Loaded AFTER styles.css. Everything is scoped under .blog-scope (on <main>)
   and .blog- classes so it can't affect the rest of the site. Same look as
   Patient Stories: cream cards, navy ink, gold rules, Barlow type.

   The post cards keep the site's existing markup
   (<article class="services-page-card"> img / h3 / p / a.btn-secondary), so
   a card added the old way still shows up in the new style.

   Fonts: Barlow and Barlow Condensed (latin subset), self-hosted.
   Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)
   Licensed under the SIL Open Font License 1.1 (https://openfontlicense.org)
   ========================================================================= */

@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url('../fonts/Barlow-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url('../fonts/BarlowCondensed-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

.blog-scope {
    --b-navy: var(--blue, #0b2347);
    --b-ink: #0d203e;
    --b-text: #24324b;          /* long-form body copy */
    --b-gold: var(--gold, #f1b82d);
    --b-gold-text: #5a4210;     /* dark gold for small labels on light backgrounds */
    --b-cream: #f2f1ed;
    --b-photo-bg: #e7e4dc;
    --b-line: #e2dfd7;
    --b-muted: #3e4a5e;
    --b-on-navy: #c8d0df;
    --b-condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--b-ink);
}

/* styles.css makes links inside paragraphs white; keep them readable here */
.blog-scope a { color: var(--b-navy); }

.blog-scope p a,
.blog-scope p a:visited,
.blog-scope li a,
.blog-scope li a:visited {
    color: var(--b-navy);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--b-gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.blog-scope p a:hover,
.blog-scope li a:hover { text-decoration-color: var(--b-navy); }

.blog-scope a:focus-visible,
.blog-scope button:focus-visible {
    outline: 3px solid var(--b-navy);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- Containers (sit inside the site's gold .page-shell) ---------- */
.blog-card {
    max-width: 1240px;
    margin: 0 auto;
    background: var(--b-cream);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 56px 48px;
}

.blog-band + .blog-card,
.blog-card + .blog-card { margin-top: 32px; }

/* ---------- Shared type ---------- */
.blog-breadcrumb {
    font-size: 15px;
    color: var(--b-muted);
    margin-bottom: 28px;
}

.blog-breadcrumb a {
    font-weight: 600;
    text-decoration: none;
}

.blog-breadcrumb a:hover { text-decoration: underline; }

.blog-breadcrumb span { margin: 0 6px; }

/* Topic label above a post title; links to the matching service page */
.blog-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--b-condensed);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--b-ink);
}

.blog-eyebrow::before {
    content: "";
    width: 40px;
    height: 3px;
    background: var(--b-gold);
    flex: none;
}

.blog-scope .blog-eyebrow a,
.blog-scope .blog-eyebrow a:visited {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.blog-scope .blog-eyebrow a:hover { text-decoration: underline; }

.blog-title {
    margin: 12px 0 22px;
    font-family: var(--b-condensed);
    font-weight: 800;
    font-size: clamp(2.3rem, 4.4vw, 3.6rem);
    line-height: 0.98;
    text-transform: uppercase;
    text-wrap: balance;
    color: var(--b-ink);
    text-align: left;
}

.blog-title--index {
    margin-top: 0;
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 0.95;
}

.blog-lead {
    max-width: 680px;
    font-size: 19px;
    line-height: 1.55;
    color: var(--b-muted);
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    font-size: 16px;
    color: var(--b-muted);
}

.blog-meta > * + * {
    margin-left: 14px;
    padding-left: 14px;
    border-left: 2px solid var(--b-gold);
}

.blog-btn {
    display: inline-block;
    background: var(--b-gold);
    color: var(--b-ink) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
    text-align: center;
    padding: 14px 22px;
    border: 2px solid var(--b-gold);
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-btn:hover,
.blog-btn:focus-visible {
    background: #fff;
    border-color: #fff;
}

.blog-btn--outline {
    background: transparent;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.55);
}

.blog-btn--outline:hover,
.blog-btn--outline:focus-visible {
    background: transparent;
    border-color: var(--b-gold);
    color: var(--b-gold) !important;
}

/* ---------- Post page: header ---------- */
.blog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    gap: 48px;
    align-items: center;
}

.blog-hero-image {
    border-radius: 8px;
    overflow: hidden;
    border-bottom: 4px solid var(--b-gold);
    background: var(--b-photo-bg);
}

.blog-hero-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 960 / 500;
    object-fit: cover;
}

/* ---------- Post page: body + sidebar ---------- */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 64px;
    margin-top: 44px;
    padding-top: 44px;
    border-top: 1px solid var(--b-line);
}

.blog-body {
    grid-column: 1;
    grid-row: 1;
    max-width: 690px;
    min-width: 0;
}

/* The sidebar comes first in the HTML so the contents list sits above the
   article on phones; on desktop the grid moves it to the right column. */
.blog-aside {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.blog-body section { scroll-margin-top: 24px; }

.blog-body section + section { margin-top: 44px; }

.blog-body h2 {
    font-family: var(--b-condensed);
    font-weight: 700;
    font-size: clamp(1.75rem, 2.6vw, 2.1rem);
    line-height: 1.1;
    color: var(--b-ink);
    margin-bottom: 14px;
}

.blog-body h2::before {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--b-gold);
    margin-bottom: 16px;
}

.blog-body h3 {
    font-family: inherit;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--b-ink);
    margin: 28px 0 8px;
}

.blog-body p,
.blog-body li {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--b-text);
}

.blog-body p + p,
.blog-body ul + p,
.blog-body p + ul { margin-top: 16px; }

.blog-body strong {
    font-weight: 600;
    color: var(--b-ink);
}

.blog-body ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.blog-body li {
    position: relative;
    padding-left: 24px;
    line-height: 1.6;
}

.blog-body li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 8px;
    height: 8px;
    background: var(--b-gold);
}

/* Opening paragraph reads a little larger */
.blog-intro p:first-child {
    font-size: 1.3rem;
    line-height: 1.55;
    color: var(--b-ink);
}

/* FAQ: one white card per question */
.blog-faq-item {
    background: #fff;
    border: 1px solid var(--b-line);
    border-radius: 8px;
    padding: 20px 22px;
}

.blog-faq-item + .blog-faq-item { margin-top: 12px; }

.blog-body .blog-faq-item h3 { margin: 0 0 6px; }

/* Sidebar: contents list */
.blog-aside-title {
    font-family: var(--b-condensed);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--b-gold-text);
    margin-bottom: 12px;
}

.blog-toc ol { list-style: none; }

.blog-scope .blog-toc a,
.blog-scope .blog-toc a:visited {
    display: block;
    padding: 8px 0 8px 14px;
    border-left: 3px solid var(--b-line);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--b-muted);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.blog-scope .blog-toc a:hover { color: var(--b-ink); border-left-color: #cfcac0; }

.blog-scope .blog-toc a[aria-current="true"] {
    color: var(--b-ink);
    font-weight: 600;
    border-left-color: var(--b-gold);
}

/* Sidebar: call box */
.blog-callbox {
    background: var(--b-navy);
    color: #fff;
    border-radius: 8px;
    border-top: 4px solid var(--b-gold);
    padding: 26px 24px;
}


.blog-scope .blog-callbox p {
    margin: 10px 0 18px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--b-on-navy);
}

.blog-scope .blog-callbox .blog-callbox-title {
    margin: 0;
    font-family: var(--b-condensed);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.05;
    color: #fff;
}

.blog-scope .blog-callbox p a,
.blog-scope .blog-callbox p a:visited { color: #fff; }

.blog-callbox .blog-btn { display: block; }

/* ---------- Navy band (consultation call to action) ---------- */
.blog-band {
    max-width: 1240px;
    margin: 32px auto 0;
    background: var(--b-navy);
    color: #fff;
    border-radius: 24px;
    border-top: 6px solid var(--b-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 32px 56px;
    align-items: center;
    justify-content: space-between;
}

.blog-band-text {
    flex: 1 1 480px;
    max-width: 720px;
}

.blog-band h2 {
    font-family: var(--b-condensed);
    font-weight: 800;
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    line-height: 1;
    text-transform: uppercase;
    text-wrap: balance;
    color: #fff;
}

.blog-scope .blog-band p {
    margin-top: 14px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--b-on-navy);
}

.blog-scope .blog-band p strong { color: #fff; font-weight: 600; }

.blog-scope .blog-band p a,
.blog-scope .blog-band p a:visited { color: var(--b-gold); text-decoration-color: rgba(241, 184, 45, 0.5); }

.blog-scope .blog-band p a:hover { text-decoration-color: var(--b-gold); }

.blog-band-actions {
    flex: 0 1 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Blog index: topic filters ---------- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

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

.blog-filter {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--b-ink);
    border: 1px solid #cfcac0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-filter:hover { border-color: var(--b-navy); }

.blog-filter[aria-pressed="true"] {
    background: var(--b-navy);
    color: #fff;
    border-color: var(--b-navy);
}

.blog-empty {
    margin-top: 24px;
    font-size: 17px;
    color: var(--b-muted);
}

/* ---------- Post cards (blog index + "Keep reading" on posts) ---------- */
.blog-scope .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 32px;
}

/* Resets the gold services-page look and its scroll-in animation */
.blog-scope .services-page-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--b-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    color: var(--b-ink);
    opacity: 1;
    transform: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transition-delay: 0s !important;
}

.blog-scope .services-page-card[hidden] { display: none; }

.blog-scope .services-page-card:hover,
.blog-scope .services-page-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(11, 35, 71, 0.18);
}

.blog-scope .services-page-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 960 / 500;
    object-fit: cover;
    display: block;
    background: var(--b-photo-bg);
    border-bottom: 4px solid var(--b-gold);
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 18px 22px 0;
    font-family: var(--b-condensed);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--b-gold-text);
}

.blog-card-meta time {
    font-family: "Barlow", system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--b-muted);
}

.blog-scope .services-page-card h3 {
    margin: 20px 22px 0;
    padding: 0;
    font-family: var(--b-condensed);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.08;
    color: var(--b-ink);
}

.blog-scope .services-page-card .blog-card-meta + h3 { margin-top: 8px; }

.blog-scope .services-page-card p {
    margin: 10px 22px auto;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--b-muted);
}

.blog-scope .services-page-card .btn-secondary {
    display: inline-block;
    align-self: flex-start;
    margin: 16px 22px 22px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    color: var(--b-navy);
    text-decoration: underline;
    text-decoration-color: var(--b-gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.blog-scope .services-page-card .btn-secondary:hover {
    background: none;
    color: var(--b-navy);
}

/* Makes the whole card clickable through its one link */
.blog-scope .services-page-card .btn-secondary::after {
    content: "";
    position: absolute;
    inset: 0;
}

.blog-scope .services-page-card .btn-secondary:focus-visible { outline: none; }

.blog-scope .services-page-card:has(.btn-secondary:focus-visible) {
    outline: 3px solid var(--b-navy);
    outline-offset: 3px;
}

/* Newest post (first card on the index) runs full width, photo on the left.
   Turns off while a topic filter is active. */
@media screen and (min-width: 901px) {
    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        grid-template-rows: 1fr auto auto auto auto 1fr;
    }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type > * {
        grid-column: 2;
        margin-left: 40px;
        margin-right: 40px;
    }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type img {
        grid-column: 1;
        grid-row: 1 / -1;
        margin: 0;
        height: 100%;
        min-height: 340px;
        aspect-ratio: auto;
        border-bottom: 0;
        border-right: 4px solid var(--b-gold);
    }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type .blog-card-meta { grid-row: 2; margin-top: 0; }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type h3 {
        grid-row: 3;
        font-size: clamp(2rem, 3vw, 2.6rem);
        line-height: 1.02;
    }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type p {
        grid-row: 4;
        margin-top: 14px;
        margin-bottom: 0;
        font-size: 18px;
        line-height: 1.55;
    }

    .blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type .btn-secondary {
        grid-row: 5;
        justify-self: start;
        margin-top: 20px;
        margin-bottom: 0;
        font-size: 17px;
    }
}

.blog-scope .blog-grid--index:not(.is-filtered) > .services-page-card:first-of-type::before {
    content: "Latest article";
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 1;
    font-family: var(--b-condensed);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 3px;
    background: var(--b-navy);
    color: #fff;
}

/* "Keep reading" block under a post */
.blog-more-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 24px;
}

.blog-more-head h2 {
    font-family: var(--b-condensed);
    font-weight: 800;
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    line-height: 1;
    text-transform: uppercase;
    color: var(--b-ink);
}

.blog-more-head a {
    font-weight: 600;
    font-size: 17px;
    text-decoration: underline;
    text-decoration-color: var(--b-gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* ---------- Tablet / phone ---------- */
@media screen and (max-width: 1024px) {
    .blog-scope .blog-grid--index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 960px) {
    .blog-hero {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .blog-layout {
        grid-template-columns: 1fr;
        row-gap: 36px;
        margin-top: 32px;
        padding-top: 32px;
    }

    .blog-body,
    .blog-aside {
        grid-column: 1;
        grid-row: auto;
    }

    .blog-body { max-width: none; }

    .blog-aside { position: static; }

    /* The band at the end of the post already has the phone number */
    .blog-callbox { display: none; }

    .blog-toc {
        background: #fff;
        border: 1px solid var(--b-line);
        border-radius: 8px;
        padding: 20px 22px;
    }

    .blog-scope .blog-grid--related { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    .blog-card { padding: 36px 20px 40px; border-radius: 18px; }
    .blog-band { padding: 32px 20px; border-radius: 18px; margin-top: 24px; }
    .blog-band + .blog-card,
    .blog-card + .blog-card { margin-top: 24px; }
    .blog-band-actions { flex-basis: 100%; }
    .blog-lead { font-size: 17px; }
    .blog-eyebrow { font-size: 16px; }
    .blog-breadcrumb { margin-bottom: 20px; }
    .blog-body p,
    .blog-body li { font-size: 1.0625rem; }
    .blog-intro p:first-child { font-size: 1.2rem; }
    .blog-body section + section { margin-top: 36px; }
}

@media screen and (max-width: 700px) {
    .blog-scope .blog-grid--index { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .blog-scope .services-page-card,
    .blog-scope .services-page-card:hover,
    .blog-scope .services-page-card:focus-within {
        transition: none;
        transform: none;
    }

    .blog-scope .blog-toc a,
    .blog-btn,
    .blog-filter { transition: none; }
}
