/* Legal pages (Privacy & Policies, Terms of Use). Reuses the site's card, tab and colour patterns. */
.legal-page {
    background: #eef2f8;
    color: #0f172a;
}

/* reset.min.css sets article/details to display:block, which would override [hidden]. */
.legal-page [hidden] {
    display: none !important;
}

.legal-container {
    width: calc(100% - (2 * var(--bambu-container-gutter, 24px)));
    max-width: var(--bambu-container-max-width, 1290px);
    margin-inline: auto;
}

.legal-section {
    padding: 48px 0 96px;
}

.legal-preview-note {
    margin: 0 0 20px;
    padding: 12px 16px;
    color: #92400e;
    font-size: 13px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
}

/* Policy tabs: same pill group as the opportunity type tabs used before. */
.legal-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: rgba(226, 232, 240, 0.8);
    border-radius: 12px;
}

.legal-tab {
    padding: 9px 18px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: color 160ms ease, background-color 160ms ease;
}

.legal-tab:hover {
    color: #0f766e;
}

.legal-tab.active {
    color: #08162d;
    font-weight: 700;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.legal-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.legal-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legal-toc-card,
.legal-help-card {
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.legal-toc-title {
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    list-style: none;
    cursor: default;
}

.legal-toc-title::-webkit-details-marker {
    display: none;
}

.legal-toc {
    max-height: calc(100vh - 260px);
    margin-top: 12px;
    overflow-y: auto;
}

.legal-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-toc a {
    display: block;
    padding: 6px 10px;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
}

.legal-toc a:hover {
    color: #0f766e;
}

.legal-toc a.active {
    color: #0f766e;
    background: #f0fdfa;
    border-left-color: #0d9488;
}

.legal-toc .legal-toc-sub a {
    padding-left: 22px;
    font-size: 12px;
}

.legal-help-card {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.14), rgba(59, 117, 179, 0.17));
    border-color: #ccfbf1;
}

.legal-help-title {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.legal-help-card p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.legal-help-card a {
    color: #0f766e;
}

.legal-related {
    margin: 12px 0 0;
    padding: 12px 0 0;
    list-style: none;
    border-top: 1px solid rgba(15, 118, 110, 0.15);
}

.legal-related a {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* Policy text */
.legal-article {
    position: relative;
    padding: 40px 48px 48px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.legal-article::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #43b263 0%, #3ba295 25%, #3b7ab5 55%, #7147a7 80%, #814272 100%);
}

/* Tab switch: the new policy and its table of contents fade in. */
.legal-article.is-entering {
    animation: legal-panel-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.legal-toc.is-entering {
    animation: legal-toc-in 280ms ease both;
}

@keyframes legal-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes legal-toc-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.legal-tabs {
    scroll-margin-top: 24px;
}

.legal-article-head {
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.legal-article-title {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.legal-meta-pill {
    padding: 5px 12px;
    color: #475569;
    font-size: 12px;
    background: #f4f7f9;
    border-radius: 9999px;
}

.legal-meta-pill strong {
    color: #0f172a;
    font-weight: 600;
}

.legal-print {
    margin-left: auto;
    padding: 7px 14px;
    color: #334155;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

.legal-print:hover {
    color: #0f766e;
    border-color: #0d9488;
}

.legal-language-note {
    margin: 0 0 24px;
    padding: 12px 16px;
    color: #475569;
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.legal-content {
    max-width: 820px;
    color: #334155;
    font-size: 16px;
    line-height: 1.75;
}

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

.legal-content h2 {
    margin: 40px 0 14px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    scroll-margin-top: 24px;
}

.legal-content h3 {
    margin: 28px 0 10px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    scroll-margin-top: 24px;
}

.legal-content h4 {
    margin: 20px 0 8px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.legal-content p {
    margin: 0 0 14px;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 6px;
}

.legal-content li::marker {
    color: #0d9488;
}

.legal-content a {
    color: #0f766e;
}

.legal-content strong {
    color: #0f172a;
}

.legal-content blockquote {
    margin: 0 0 16px;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), rgba(59, 117, 179, 0.12));
    border-left: 3px solid #35ad68;
    border-radius: 0 12px 12px 0;
}

@media (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
    }

    .legal-toc-title {
        cursor: pointer;
    }

    .legal-toc-title::after {
        content: " ▾";
    }

    .legal-toc {
        max-height: 50vh;
    }
}

@media (max-width: 767px) {
    .legal-section {
        padding: 32px 0 56px;
    }

    .legal-tabs {
        display: flex;
        width: 100%;
    }

    .legal-tab {
        flex: 1 1 auto;
        text-align: center;
    }

    .legal-article {
        padding: 28px 20px 32px;
    }

    .legal-article-title {
        font-size: 22px;
    }

    .legal-print {
        margin-left: 0;
    }

    .legal-content {
        font-size: 15px;
    }
}

@media print {
    .site-header,
    .site-footer,
    .hero,
    .legal-tabs,
    .legal-sidebar,
    .legal-print,
    .legal-language-note,
    .cta-banner,
    .legal-article[hidden] {
        display: none !important;
    }

    .legal-page,
    .legal-section {
        padding: 0;
        background: #ffffff;
    }

    .legal-layout {
        display: block;
    }

    .legal-article {
        padding: 0;
        box-shadow: none;
    }

    .legal-article::before {
        display: none;
    }

    .legal-content {
        max-width: none;
        font-size: 12pt;
    }
}
