/* Blog and knowledge-base pages */

:root,
.light-theme {
    --blog-surface: #ffffff;
    --blog-surface-muted: #f4f7f9;
    --blog-border: #dce6eb;
    --blog-copy-muted: #51606a;
    --blog-shadow: 0 18px 44px rgba(18, 46, 60, 0.1);
    --blog-hero-start: #0c2633;
    --blog-hero-end: #123f52;
}

.dark-theme {
    --blog-surface: #11181c;
    --blog-surface-muted: #172126;
    --blog-border: #2a3b43;
    --blog-copy-muted: #b7c5cc;
    --blog-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
    --blog-hero-start: #071116;
    --blog-hero-end: #0d2c3a;
}

.blog-page {
    padding-top: 71px;
}

.blog-page a:focus-visible,
.blog-page summary:focus-visible {
    outline: 3px solid rgba(52, 170, 223, 0.55);
    outline-offset: 4px;
    border-radius: 6px;
}

.blog-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(52, 170, 223, 0.28), transparent 33%),
        linear-gradient(128deg, var(--blog-hero-start), var(--blog-hero-end));
}

.blog-hero::before,
.blog-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.blog-hero::before {
    top: -190px;
    left: -90px;
}

.blog-hero::after {
    right: -180px;
    bottom: -215px;
    width: 430px;
    height: 430px;
}

.blog-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: clamp(38px, 6vw, 88px);
    align-items: center;
    min-height: 510px;
    padding-top: 72px;
    padding-bottom: 72px;
}

.blog-hero--article .blog-hero-inner {
    min-height: 450px;
}

.blog-eyebrow,
.article-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 18px;
    color: #78d5ff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.blog-eyebrow::before,
.article-category::before {
    content: "";
    width: 28px;
    height: 2px;
    background: currentColor;
}

.blog-hero h1 {
    max-width: 840px;
    margin: 0 0 22px;
    color: #fff;
    font-size: clamp(40px, 5vw, 68px);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.blog-hero--article h1 {
    font-size: clamp(36px, 4.4vw, 58px);
}

.blog-hero-lead {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(18px, 1.7vw, 22px);
    line-height: 1.6;
}

.blog-hero-media {
    position: relative;
    overflow: hidden;
    min-height: 350px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.blog-hero--article .blog-hero-media {
    min-height: 320px;
}

.blog-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-hero-media--team img {
    object-position: right center;
}

.blog-hero-media--icon {
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
}

.blog-hero-media--icon img {
    position: static;
    width: 68%;
    height: 68%;
    object-fit: contain;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.18));
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 26px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.blog-meta span + span::before {
    content: "•";
    color: #78d5ff;
}

.breadcrumbs {
    padding-top: 24px;
    padding-bottom: 24px;
    background: var(--blog-surface-muted);
    border-bottom: 1px solid var(--blog-border);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    list-style: none;
    color: var(--blog-copy-muted);
    font-size: 14px;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: #92a0a7;
}

.breadcrumbs a {
    color: var(--blog-copy-muted);
    text-decoration: none;
}

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

.blog-section {
    padding-top: clamp(64px, 8vw, 96px);
    padding-bottom: clamp(72px, 9vw, 112px);
}

.blog-section-heading {
    max-width: 820px;
    margin-bottom: 44px;
}

.blog-section-heading h2 {
    margin: 0 0 16px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.14;
    letter-spacing: -0.025em;
}

.blog-section-heading p {
    margin: 0;
    color: var(--blog-copy-muted);
    font-size: 18px;
    line-height: 1.7;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.blog-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 24px;
    box-shadow: var(--blog-shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 170, 223, 0.62);
    box-shadow: 0 22px 52px rgba(18, 46, 60, 0.16);
}

.blog-card-image {
    width: 42%;
    min-height: 290px;
    flex: 0 0 auto;
    object-fit: cover;
    background: var(--blog-surface-muted);
}

.blog-card-image--contain {
    padding: 30px;
    object-fit: contain;
}

/* The mortgage card now uses a generated photograph, not the former icon. */
.blog-card-image[src="/img/blog-mortgage-investment.webp"] {
    padding: 0;
    object-fit: cover;
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.blog-card-category {
    margin-bottom: 12px;
    color: var(--primary-hover);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dark-theme .blog-card-category {
    color: #69c9f2;
}

.blog-card h2,
.blog-card h3 {
    margin: 0 0 14px;
    font-size: clamp(23px, 2.2vw, 30px);
    line-height: 1.22;
    letter-spacing: -0.018em;
}

.blog-card p {
    margin: 0 0 22px;
    color: var(--blog-copy-muted);
    line-height: 1.62;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    color: var(--primary-hover);
    font-weight: 800;
    text-decoration: none;
}

.dark-theme .blog-card-link {
    color: #69c9f2;
}

.blog-card-link::after {
    content: "→";
    font-size: 20px;
    transition: transform 0.2s ease;
}

.blog-card:hover .blog-card-link::after {
    transform: translateX(4px);
}

.article-section {
    padding-top: 64px;
    padding-bottom: 88px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 780px) minmax(230px, 300px);
    gap: clamp(48px, 7vw, 90px);
    justify-content: center;
    align-items: start;
}

.article-body {
    min-width: 0;
    font-size: 18px;
    line-height: 1.78;
}

.article-body > :first-child {
    margin-top: 0;
}

.article-body h2 {
    margin: 64px 0 20px;
    scroll-margin-top: 105px;
    font-size: clamp(30px, 3.4vw, 42px);
    line-height: 1.17;
    letter-spacing: -0.025em;
}

.article-body h3 {
    margin: 38px 0 14px;
    scroll-margin-top: 105px;
    font-size: clamp(23px, 2.4vw, 29px);
    line-height: 1.28;
}

.article-body p {
    margin: 0 0 24px;
}

.article-body a:not(.article-cta-button) {
    color: var(--primary-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.dark-theme .article-body a:not(.article-cta-button) {
    color: #69c9f2;
}

.article-body ul,
.article-body ol {
    display: grid;
    gap: 11px;
    margin: 0 0 28px;
    padding-left: 26px;
}

.article-body li::marker {
    color: var(--primary);
    font-weight: 800;
}

.article-intro {
    padding: 28px 30px;
    color: var(--text-main);
    background: var(--blog-surface-muted);
    border-left: 5px solid var(--primary);
    border-radius: 0 18px 18px 0;
    font-size: 20px;
    line-height: 1.65;
}

.article-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 30px 0 38px;
}

.article-stat-card {
    min-width: 0;
    padding: 22px 18px;
    background: var(--blog-surface-muted);
    border: 1px solid var(--blog-border);
    border-radius: 16px;
}

.article-stat-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-hover);
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1;
    letter-spacing: -0.025em;
}

.dark-theme .article-stat-card strong {
    color: #69c9f2;
}

.article-stat-card span {
    display: block;
    color: var(--blog-copy-muted);
    font-size: 14px;
    line-height: 1.45;
}

.article-callout {
    margin: 34px 0;
    padding: 26px 28px;
    background: rgba(52, 170, 223, 0.09);
    border: 1px solid rgba(52, 170, 223, 0.32);
    border-radius: 18px;
}

.article-callout--warning {
    background: rgba(230, 154, 44, 0.1);
    border-color: rgba(230, 154, 44, 0.35);
}

.article-callout--success {
    background: rgba(46, 160, 103, 0.1);
    border-color: rgba(46, 160, 103, 0.34);
}

.article-callout strong:first-child {
    display: block;
    margin-bottom: 8px;
    font-size: 19px;
}

.article-callout p:last-child,
.article-callout ul:last-child {
    margin-bottom: 0;
}

.article-steps {
    counter-reset: blog-step;
    padding: 0 !important;
    list-style: none;
}

.article-steps > li {
    position: relative;
    counter-increment: blog-step;
    padding: 4px 0 28px 70px;
}

.article-steps > li::before {
    content: counter(blog-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
    font-size: 19px;
    font-weight: 850;
}

.article-steps h3 {
    margin-top: 0;
}

.article-steps p:last-child,
.article-steps ul:last-child {
    margin-bottom: 0;
}

.article-table-wrap {
    overflow-x: auto;
    margin: 30px 0;
    border: 1px solid var(--blog-border);
    border-radius: 16px;
}

.article-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 16px;
}

.article-table th,
.article-table td {
    padding: 16px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--blog-border);
}

.article-table th {
    background: var(--blog-surface-muted);
    font-size: 14px;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.article-table tr:last-child td {
    border-bottom: 0;
}

.article-formula {
    margin: 30px 0;
    padding: 26px;
    overflow-wrap: anywhere;
    color: #fff;
    background: linear-gradient(135deg, #0e3547, #17617d);
    border-radius: 18px;
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 750;
    line-height: 1.55;
    text-align: center;
}

.article-sidebar {
    position: sticky;
    top: 98px;
}

.article-toc {
    padding: 24px;
    background: var(--blog-surface-muted);
    border: 1px solid var(--blog-border);
    border-radius: 18px;
}

.article-toc h2 {
    margin: 0 0 16px;
    font-size: 17px;
    line-height: 1.3;
}

.article-toc ol {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.article-toc li {
    counter-increment: toc;
}

.article-toc a {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 7px;
    color: var(--blog-copy-muted);
    font-size: 14px;
    line-height: 1.45;
    text-decoration: none;
}

.article-toc a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.8;
}

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

.article-side-note {
    margin-top: 18px;
    padding: 21px 22px;
    color: var(--blog-copy-muted);
    border: 1px solid var(--blog-border);
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
}

.article-faq {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.article-faq details {
    overflow: hidden;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 15px;
}

.article-faq summary {
    position: relative;
    padding: 20px 52px 20px 22px;
    cursor: pointer;
    font-weight: 760;
    line-height: 1.45;
    list-style: none;
}

.article-faq summary::-webkit-details-marker {
    display: none;
}

.article-faq summary::after {
    content: "+";
    position: absolute;
    top: 17px;
    right: 21px;
    color: var(--primary);
    font-size: 25px;
    font-weight: 500;
}

.article-faq details[open] summary::after {
    content: "−";
}

.article-faq-answer {
    padding: 0 22px 21px;
    color: var(--blog-copy-muted);
}

.article-faq-answer p:last-child {
    margin-bottom: 0;
}

.article-source-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    padding-left: 22px;
    font-size: 16px;
}

.article-disclaimer {
    color: var(--blog-copy-muted);
    font-size: 14px;
    line-height: 1.65;
}

.article-author-bio {
    margin-top: 28px;
    padding: 22px 24px;
    background: var(--blog-surface-muted);
    border: 1px solid var(--blog-border);
    border-radius: 16px;
}

.article-author-bio strong {
    display: block;
    margin-bottom: 7px;
    font-size: 18px;
}

.article-author-bio p {
    margin: 0;
    color: var(--blog-copy-muted);
    font-size: 15px;
    line-height: 1.6;
}

.article-cta {
    margin: 58px 0 0;
    padding: clamp(28px, 5vw, 44px);
    color: #fff;
    background:
        radial-gradient(circle at 92% 15%, rgba(255, 255, 255, 0.22), transparent 31%),
        linear-gradient(135deg, #1884b0, #34aadf);
    border-radius: 24px;
}

.article-cta h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(28px, 3.5vw, 39px);
}

.article-cta p {
    max-width: 650px;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.article-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    color: #0c3343;
    background: #fff;
    border-radius: 12px;
    font-weight: 820;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.related-section {
    padding-top: 70px;
    padding-bottom: 90px;
    background: var(--blog-surface-muted);
    border-top: 1px solid var(--blog-border);
}

.related-section h2 {
    margin: 0 0 30px;
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1.2;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 26px;
    color: var(--text-main);
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 18px;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.related-card:hover {
    transform: translateY(-3px);
    border-color: rgba(52, 170, 223, 0.62);
}

.related-card small {
    margin-bottom: 13px;
    color: var(--primary-hover);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dark-theme .related-card small {
    color: #69c9f2;
}

.related-card strong {
    margin-bottom: 12px;
    font-size: 22px;
    line-height: 1.28;
}

.related-card span {
    color: var(--blog-copy-muted);
    font-size: 15px;
    line-height: 1.55;
}

.blog-footer-intro {
    max-width: 360px;
}

.footer-blog-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    font-weight: 750;
    text-decoration: none;
}

.footer-blog-link:hover {
    color: var(--primary-hover);
}

@media (min-width: 1101px) and (max-width: 1366px) {
    .blog-page {
        padding-top: 62px;
    }

    .blog-card-body {
        padding: 24px;
    }
}

@media (max-width: 1050px) {
    .blog-hero-inner {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
        gap: 38px;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-card-image {
        width: 100%;
        min-height: 240px;
        max-height: 280px;
    }

    .article-layout {
        grid-template-columns: minmax(0, 760px);
    }

    .article-sidebar {
        position: static;
        grid-row: 1;
    }

    .article-toc ol {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-side-note {
        display: none;
    }
}

@media (max-width: 750px), (max-device-width: 750px) {
    .blog-page {
        padding-top: 67px;
    }

    .blog-hero-inner,
    .blog-hero--article .blog-hero-inner {
        grid-template-columns: 1fr;
        min-height: 0;
        padding-top: 50px;
        padding-bottom: 52px;
    }

    .blog-hero h1,
    .blog-hero--article h1 {
        font-size: clamp(35px, 10.8vw, 48px);
    }

    .blog-hero-media,
    .blog-hero--article .blog-hero-media {
        min-height: 250px;
        border-radius: 20px;
    }

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

    .blog-card-image {
        min-height: 215px;
    }

    .article-section {
        padding-top: 42px;
        padding-bottom: 64px;
    }

    .article-body {
        font-size: 17px;
        line-height: 1.72;
    }

    .article-body h2 {
        margin-top: 50px;
    }

    .article-intro {
        padding: 22px;
        font-size: 18px;
    }

    .article-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-steps > li {
        padding-left: 58px;
    }

    .article-steps > li::before {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .article-toc ol {
        grid-template-columns: 1fr;
    }

    .article-cta {
        border-radius: 19px;
    }

    .related-card {
        min-height: 0;
    }

    .blog-meta span + span::before {
        display: none;
    }
}

@media (max-width: 390px) {
    .blog-card-body,
    .article-toc,
    .article-callout {
        padding: 20px;
    }

    .article-faq summary {
        padding-left: 18px;
    }

    .article-faq-answer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .article-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card-link::after,
    .article-cta-button,
    .related-card {
        transition: none;
    }
}
