/*
 * Blog post layout
 * Layout: navy title band across the page, then a pinned "In this article" index beside a 760px reading column.
 * Hierarchy comes from contrast: white headings at large sizes over muted blue-grey body copy, with hairline rules between sections.
 */

.single-post {
    --post-ink: #FFFFFF;           /* headings, lead, strong text */
    --post-text: #B4C3D1;          /* body copy */
    --post-muted: #8497A9;         /* meta labels, breadcrumb */
    --post-rule: rgba(238, 247, 255, 0.10);
    --post-band: #041728;          /* title band and summary box */
    --post-link: #93D476;          /* links on dark ground */
    --post-link-hover: #ABE591;
    --post-accent: #62BC3A;        /* bullets, active index item */
}

/* ---------- Title band ---------- */
.block-post-header {
    padding: 150px 0 56px;
    background: var(--post-band);
    border-bottom: 1px solid var(--post-rule);
}
.block-post-header__inner {
    max-width: 1256px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.block-post-header__breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 15px;
    color: var(--post-muted);
}
.block-post-header__breadcrumb li + li::before {
    content: "\203A";
    margin-right: 10px;
    color: var(--post-muted);
}
.block-post-header__breadcrumb li:last-child {
    color: var(--post-link);
    font-weight: 500;
}
.block-post-header__breadcrumb a {
    color: var(--post-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.block-post-header__breadcrumb a:hover {
    color: var(--post-ink);
}
.block-post-header h1.block-post-header__title {
    margin: 0;
    max-width: 960px;
    font-size: clamp(36px, 4.4vw, 64px);
    line-height: 1.06;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--post-ink);
    text-wrap: balance;
}
@media (min-width: 992px) {
    .block-post-header h1.block-post-header__title {
        max-width: none;
        text-wrap: pretty;
    }
}
.block-post-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 40px;
    font-size: 16px;
}
.block-post-header__meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.block-post-header__meta-label {
    font-size: 14px;
    color: var(--post-muted);
}
.block-post-header__meta-value {
    color: var(--post-ink);
}
.block-post-header__author {
    display: flex;
    align-items: center;
    gap: 12px;
}
.block-post-header__avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bgprimary800);
    color: var(--bglightgreen1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}
.block-post-header__author-name {
    color: var(--post-ink);
    font-weight: 600;
}
.block-post-header__image {
    margin: 12px 0 0;
}
.block-post-header__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2.4 / 1;
    object-fit: cover;
    border-radius: 16px;
}

/* ---------- Page body ---------- */
.block-blog-single.block-blog-single--article {
    padding-top: 72px;
}
.block-blog-single__layout {
    width: 100%;
}
.block-blog-single__layout.has-toc {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 72px;
    align-items: start;
}
.block-blog-single__article {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.block-blog-single__layout.has-toc .block-blog-single__copy {
    max-width: 760px;
    margin: 0;
}
.block-blog-single__layout:not(.has-toc) .block-blog-single__copy {
    width: 100%;
}

/* ---------- Reading column ---------- */
.block-blog-single--article .block-blog-single__copy p,
.block-blog-single--article .block-blog-single__copy ul li,
.block-blog-single--article .block-blog-single__copy ol li {
    font-size: 17px;
    line-height: 1.7;
    color: var(--post-text);
}
.block-blog-single--article .block-blog-single__copy p {
    margin: 0 0 1.1em;
}
.block-blog-single--article .block-blog-single__copy strong,
.block-blog-single--article .block-blog-single__copy b {
    color: var(--post-ink);
    font-weight: 600;
}
.block-blog-single--article .block-blog-single__copy p.block-blog-single__lead {
    margin: 0 0 32px;
    font-size: 19px;
    line-height: 1.6;
    color: var(--post-ink);
}

/* Section titles: large, white, with a hairline rule above to mark each new section */
.block-blog-single--article .block-blog-single__copy h2 {
    margin: 56px 0 20px;
    padding-top: 44px;
    border-top: 1px solid var(--post-rule);
    font-size: 28px;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--post-ink);
    text-wrap: balance;
    scroll-margin-top: 110px;
}
.block-blog-single--article .block-blog-single__copy h3 {
    margin: 36px 0 12px;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--post-ink);
    scroll-margin-top: 110px;
}

/* Links flow with the sentence, so punctuation after a link stays on the same line */
.block-blog-single--article .block-blog-single__copy a:not(.btn) {
    display: inline;
    color: var(--post-link);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(147, 212, 118, 0.45);
    transition: color 0.2s, text-decoration-color 0.2s;
}
.block-blog-single--article .block-blog-single__copy a:not(.btn):hover {
    color: var(--post-link-hover);
    text-decoration-color: currentColor;
}

/* Bullets in the brand green */
.block-blog-single--article .block-blog-single__copy ul {
    margin: 0 0 1.1em;
    gap: 8px;
}
.block-blog-single--article .block-blog-single__copy ul li {
    padding-left: 28px;
}
.block-blog-single--article .block-blog-single__copy ul li::before {
    inset: calc(0.85em - 3px) auto auto 8px;
    width: 6px;
    height: 6px;
    background-color: var(--post-accent);
}
.block-blog-single--article .block-blog-single__copy ol {
    margin: 0 0 1.1em;
    gap: 8px;
}
.block-blog-single--article .block-blog-single__copy ol li::marker {
    color: var(--post-link);
    font-weight: 600;
}

/* Images and buttons inside the copy */
.block-blog-single--article .block-blog-single__copy img {
    margin: 4px 0 24px;
    border-radius: 16px;
}
.block-blog-single--article .block-blog-single__copy .btn {
    font-size: 17px;
}

/* Summary box */
.block-blog-single--article .block-blog-single__copy .key-takeaways {
    margin: 0 0 40px;
    padding: 32px 36px;
    background: var(--post-band);
    border: 1px solid var(--post-rule);
    border-radius: 16px;
}
.block-blog-single--article .block-blog-single__copy .key-takeaways h2 {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    font-size: 22px;
}
.block-blog-single--article .block-blog-single__copy .key-takeaways ul {
    margin: 0;
}
.block-blog-single--article .block-blog-single__copy .key-takeaways li {
    color: #D3DEE8;
}

/* ---------- "In this article" index: stays on screen while scrolling ---------- */
.block-blog-single__toc {
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}
.block-blog-single__toc-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--post-muted);
    list-style: none;
}
.block-blog-single__toc-title::-webkit-details-marker {
    display: none;
}
.block-blog-single__toc-details[open] > .block-blog-single__toc-title {
    margin-bottom: 16px;
}
@media (min-width: 992px) {
    .block-blog-single__toc-title {
        pointer-events: none;
    }
}
.block-blog-single__toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--post-rule);
}
.block-blog-single__toc a {
    display: block;
    margin-left: -1px;
    padding: 7px 0 7px 16px;
    border-left: 2px solid transparent;
    color: var(--post-muted);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
.block-blog-single__toc a:hover,
.block-blog-single__toc a:focus-visible {
    color: var(--post-ink);
}
.block-blog-single__toc a.is-active {
    color: var(--post-ink);
    font-weight: 500;
    border-left-color: var(--post-accent);
}

/* ---------- Desktop sizes ---------- */
@media (min-width: 768px) {
    .block-blog-single--article .block-blog-single__copy h2 {
        font-size: 34px;
    }
    .block-blog-single--article .block-blog-single__copy h3 {
        font-size: 23px;
    }
}
@media (min-width: 1200px) {
    .block-blog-single--article .block-blog-single__copy p,
    .block-blog-single--article .block-blog-single__copy ul li,
    .block-blog-single--article .block-blog-single__copy ol li {
        font-size: 18px;
        line-height: 1.75;
    }
    .block-blog-single--article .block-blog-single__copy p.block-blog-single__lead {
        font-size: 21px;
    }
    .block-blog-single--article .block-blog-single__copy h2 {
        margin-top: 72px;
        padding-top: 56px;
        font-size: 40px;
    }
    .block-blog-single--article .block-blog-single__copy .key-takeaways h2 {
        font-size: 24px;
    }
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 991px) {
    .block-post-header {
        padding: 130px 0 44px;
    }
    .block-blog-single__layout.has-toc {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
    .block-blog-single__toc {
        position: static;
        max-height: none;
        overflow: visible;
        padding: 0;
        background: var(--post-band);
        border: 1px solid var(--post-rule);
        border-radius: 16px;
    }
    /* The index folds into a tappable "In this article" bar */
    .block-blog-single__toc-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 52px;
        padding: 14px 20px;
        cursor: pointer;
        color: var(--post-ink);
    }
    .block-blog-single__toc-title::after {
        content: "";
        width: 8px;
        height: 8px;
        flex-shrink: 0;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.2s;
    }
    .block-blog-single__toc-details[open] > .block-blog-single__toc-title {
        margin-bottom: 0;
    }
    .block-blog-single__toc-details[open] > .block-blog-single__toc-title::after {
        transform: translateY(2px) rotate(-135deg);
    }
    .block-blog-single__toc-title:focus-visible {
        outline: 2px solid var(--post-accent);
        outline-offset: -2px;
        border-radius: 16px;
    }
    .block-blog-single__toc ol {
        margin: 0 20px 18px;
    }
}
@media (max-width: 767px) {
    .block-post-header {
        padding: 120px 0 36px;
    }
    .block-post-header__inner {
        gap: 22px;
    }
    .block-post-header__meta {
        gap: 14px 28px;
    }
    .block-post-header__author {
        gap: 10px;
    }
    .block-post-header__avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .block-blog-single.block-blog-single--article {
        padding-top: 40px;
    }
    .block-blog-single--article .block-blog-single__copy p.block-blog-single__lead {
        font-size: 18px;
    }
    .block-blog-single--article .block-blog-single__copy h2 {
        margin-top: 44px;
        padding-top: 36px;
    }
    .block-blog-single--article .block-blog-single__copy .key-takeaways {
        padding: 24px 20px;
    }
    .block-blog-single--article .block-blog-single__copy .key-takeaways h2 {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .block-blog-single__toc a,
    .block-blog-single__toc-title::after,
    .block-post-header__breadcrumb a,
    .block-blog-single--article .block-blog-single__copy a:not(.btn) {
        transition: none;
    }
}
