/* =========================================================
   LEGAL CONTENT BLOCK — BEM
   Repeatable legal sections + optional table-of-contents sidebar,
   sticky on desktop, stacked above the content on mobile.
   ========================================================= */

.smartfix-legal-content {
    background: var(--sf-bg-white);
    padding: 56px 80px var(--sf-padding-section);
}

.smartfix-legal-content__inner {
    display: block;
}

.smartfix-legal-content__inner.has-toc {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 60px;
    align-items: start;
}

/* ── Table of contents ── */

.smartfix-legal-content__toc {
    position: sticky;
    /* Sits below the 88px sticky header (see header.css) plus breathing room. */
    top: 116px;
    border: 1px solid var(--sf-border-color);
    border-radius: var(--sf-card-radius);
    padding: 20px;
}

.smartfix-legal-content__toc-heading {
    font-family: var(--sf-font-heading);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sf-text-muted);
    margin: 0 0 12px;
}

.smartfix-legal-content__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smartfix-legal-content__toc-list a {
    font-family: var(--sf-font-body);
    font-size: 15px;
    line-height: 1.4;
    color: var(--sf-text-dark);
    text-decoration: none;
    display: block;
}

.smartfix-legal-content__toc-list a:hover,
.smartfix-legal-content__toc-list a:focus-visible {
    color: var(--sf-color-primary);
    text-decoration: underline;
}

/* ── Sections ── */

.smartfix-legal-content__sections {
    max-width: 760px;
}

.smartfix-legal-content__section {
    /* Offsets the sticky header so an anchor jump doesn't land the
       heading directly under it. */
    scroll-margin-top: 108px;
}

.smartfix-legal-content__section + .smartfix-legal-content__section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--sf-border-color);
}

.smartfix-legal-content__heading {
    font-family: var(--sf-font-heading);
    font-weight: 700;
    font-size: var(--sf-fs-h3);
    line-height: 1.25;
    color: var(--sf-text-dark);
    margin: 0 0 16px;
}

.smartfix-legal-content__body {
    font-family: var(--sf-font-body);
    font-size: var(--sf-fs-body-lg);
    line-height: var(--sf-lh-body-lg);
    color: var(--sf-text-dark);
}

.smartfix-legal-content__body > *:first-child {
    margin-top: 0;
}

.smartfix-legal-content__body > *:last-child {
    margin-bottom: 0;
}

.smartfix-legal-content__body p {
    margin: 0 0 18px;
}

.smartfix-legal-content__body h3 {
    font-family: var(--sf-font-heading);
    font-weight: 700;
    font-size: var(--sf-fs-h4);
    line-height: 1.3;
    color: var(--sf-text-dark);
    margin: 28px 0 12px;
}

.smartfix-legal-content__body h4 {
    font-family: var(--sf-font-heading);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
    color: var(--sf-text-dark);
    margin: 22px 0 10px;
}

.smartfix-legal-content__body ul,
.smartfix-legal-content__body ol {
    margin: 0 0 18px;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smartfix-legal-content__body li {
    line-height: var(--sf-lh-body-lg);
}

.smartfix-legal-content__body a {
    color: var(--sf-color-primary);
    text-decoration: underline;
}

.smartfix-legal-content__body a:hover,
.smartfix-legal-content__body a:focus-visible {
    text-decoration: none;
}

.smartfix-legal-content__body strong {
    font-weight: 700;
}

.smartfix-legal-content__body blockquote {
    margin: 0 0 18px;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--sf-color-primary);
    color: var(--sf-text-muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {
    .smartfix-legal-content {
        padding: 48px 48px var(--sf-padding-section);
    }

    .smartfix-legal-content__inner.has-toc {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 40px;
    }
}

@media (max-width: 834px) {
    .smartfix-legal-content {
        padding: 40px 20px 56px;
    }

    .smartfix-legal-content__inner.has-toc {
        display: block;
    }

    .smartfix-legal-content__toc {
        position: static;
        margin-bottom: 32px;
    }

    .smartfix-legal-content__toc-list {
        gap: 8px;
    }

    .smartfix-legal-content__sections {
        max-width: none;
    }

    .smartfix-legal-content__section {
        /* Mobile header shrinks to 68px (see header.css) — keep the
           anchor offset in sync so jumps still clear it. */
        scroll-margin-top: 88px;
    }
}

@media (max-width: 375px) {
    .smartfix-legal-content {
        padding: 32px 16px 44px;
    }

    .smartfix-legal-content__heading {
        font-size: 26px;
    }

    .smartfix-legal-content__body {
        font-size: var(--sf-fs-body);
        line-height: var(--sf-lh-body);
    }
}
