/* ================================================================
   Legal Document Page Template
   Template: page-legal-document.php
   ================================================================ */

/* ── Hero ──────────────────────────────────────────────────────── */

.legalDoc__hero {
    padding: 100px 0 0;
    text-align: center;
    background: var(--base-bg);
}

/* ── Breadcrumbs ───────────────────────────────────────────────── */

.legalDoc__breadcrumbs {
    margin-bottom: 50px;
}

.legalDoc__breadcrumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.legalDoc .legalDoc__crumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 129%;
    letter-spacing: 0.01em;
    color: var(--gray-500);
}

.legalDoc__crumb a {
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 129%;
    letter-spacing: 0.01em;
    color: var(--base-black);
    transition: color 0.15s ease;
    text-decoration: none;
}

.legalDoc__crumb a:hover {
    color: var(--base-black);
}

.legalDoc__crumb--current span {
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 129%;
    letter-spacing: 0.01em;
    color: var(--gray-500);
}

.legalDoc__crumb-sep {
    color: var(--gray-400, #ced4da);
    font-size: 14px;
}

.legalDoc__title {
    font-family: var(--second-family);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--base-black);
    margin: 0 0 16px;
}

.legalDoc__desc {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-subtlest);
    margin: 0 auto;
}

.legalDoc .gfBtn--solid {
    padding: 16px 32px;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 16px;
    line-height: 125%;
    letter-spacing: 0.01em;
    text-align: center;
    color: var(--base-white);
}

.legalDoc .gfBtn--outline {
    padding: 16px 32px;
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.01), 0 6px 17px 0 rgba(0, 0, 0, 0.01), 0 15px 40px 0 rgba(0, 0, 0, 0.02);
background: var(--base-white);
border: 1px solid var(--base-border-black);
border-radius: 6px;
}
.legalDoc .gfBtn--outline:hover{
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.01), 0 6px 17px 0 rgba(0, 0, 0, 0.01), 0 15px 40px 0 rgba(0, 0, 0, 0.02);
background: var(--base-bg);
border: 1px solid var(--base-border-black);
border-radius: 6px;
}


/* ── Tab Navigation ───────────────────────────────────────────── */

.legalDoc__tabs-wrap {
    background: var(--base-bg);
    position: sticky;
    top: 72px;
    z-index: 10;
    padding: 12px 0;
}

.legalDoc__tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.01), 0 6px 17px 0 rgba(0, 0, 0, 0.01), 0 15px 40px 0 rgba(0, 0, 0, 0.02);
    background: var(--base-white);
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
    border: 1px solid var(--base-border-black);
    border-radius: 8px;
    padding: 4px;

}

.legalDoc__tabs::-webkit-scrollbar {
    display: none;
}

.legalDoc__tab {
    flex-shrink: 0;
    padding: 8px 20px;
    font-family: var(--second-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-subtlest);
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 129%;
    letter-spacing: 0.01em;
    color: var(--text-base);
    padding: 20px;
}

.legalDoc__tabs-wrap-cont {
    display: flex;
    align-items: center;
    justify-content: center;
}

.legalDoc__tab:hover {
    color: var(--base-black);
    background: var(--brand-blue-50);
}

.legalDoc__tab.is-active {
    background: var(--brand-blue-50);
    color: var(--brand-blue-500);
    font-weight: 600;
}

/* ── Panels wrapper ───────────────────────────────────────────── */

.legalDoc__panels-wrap {
    padding: 108px 0 100px;
    background: var(--base-bg);
}

.legalDoc__panel {
    display: none;
}

.legalDoc__panel.is-active {
    display: block;
    animation: ldPanelIn 0.22s ease;
}

@keyframes ldPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ── Body: two-column grid ────────────────────────────────────── */

.legalDoc__body {
    display: grid;
    grid-template-columns: 384px 1fr;
    gap: 46px;
    align-items: start;
}

/* ── TOC Sidebar ──────────────────────────────────────────────── */

.legalDoc__toc {
    position: sticky;
    top: 0;
    /* header (~72px) + tabs (~56px) + gap */
    box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.01), 0 6px 17px 0 rgba(0, 0, 0, 0.01), 0 15px 40px 0 rgba(0, 0, 0, 0.02);
    background: var(--base-white);
    border: 1px solid var(--base-border-black);
    border-radius: 8px;
    padding: 32px;
}

.legalDoc__toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.legalDoc__toc-title {
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 133%;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, rgba(0, 5, 25, 0.9) 0%, #000519 50%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legalDoc__toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.legalDoc__toc-toggle:hover {
    background: var(--gray-100, #f8f9fa);
}

.legalDoc__toc-toggle svg {
    transition: transform 0.2s ease;
}

.legalDoc__toc-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
}

.legalDoc__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc-counter;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.legalDoc__toc-list.is-collapsed {
    max-height: 0;
    opacity: 0;
}

.legalDoc__toc-item {
    counter-increment: toc-counter;
}

.legalDoc__toc-link {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-subtlest);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    position: relative;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.01em;
    color: var(--text-subtle);
    padding: 8px 0 8px 0;
}

.legalDoc__toc-link::before {
    content: counter(toc-counter) ".";
    flex-shrink: 0;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.01em;
    color: var(--text-subtle);
    min-width: 12px;
}

.legalDoc__toc-link:hover {
    color: var(--base-black);

}

/* ── TOC Progress bar ─────────────────────────────────────────── */

.legalDoc__toc-progress {
    margin-top: 12px;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-50, #f7f8f9);
    overflow: hidden;
}

.legalDoc__toc-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: var(--brand-blue-500, #1b5df8);
    transition: width 0.3s ease;
}

/* ── Main content area ────────────────────────────────────────── */

.legalDoc__main {
    min-width: 0;
}

/* ── Document sections ────────────────────────────────────────── */

.legalDoc__section {
    scroll-margin-top: 180px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--base-border-black);
    margin-bottom: 40px;
}

.legalDoc__section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legalDoc__section-heading {
    font-family: var(--second-family);
    font-weight: 550;
    font-size: 22px;
    line-height: 136%;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, rgba(0, 5, 25, 0.7) 0%, #000519 50%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 16px;
}

.legalDoc__section-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-base, #61647a);
}

/* Wysiwyg resets */
.legalDoc__section-content p {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 157%;
    letter-spacing: 0.02em;
    color: var(--text-subtle);
    margin: 0 0 14px;
}

.legalDoc__section-content p:last-child {
    margin-bottom: 0;
}

.legalDoc__section-content ul,
.legalDoc__section-content ol {
    list-style: disc;
    padding-left: 22px;
    margin: 0 0 14px;
}

.legalDoc__section-content ol {
    list-style: decimal;
}

.legalDoc__section-content li {
    margin-bottom: 6px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 14px;
    line-height: 157%;
    letter-spacing: 0.02em;
    color: var(--text-subtle);
}

.legalDoc__section-content li::marker {
    color: var(--brand-blue-500);
}

.legalDoc__section-content h3 {
    font-family: var(--second-family);
    font-size: 18px;
    font-weight: 600;
    color: var(--base-black);
    margin: 28px 0 10px;
}

.legalDoc__section-content a {
    color: var(--brand-blue-500, #1b5df8);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legalDoc__section-content a:hover {
    color: var(--brand-blue-600, #1b4ec4);
}

/* ── Certification cards ──────────────────────────────────────── */

.legalDoc__cert {
    scroll-margin-top: 180px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--gray-300, #eff0f2);
    margin-bottom: 56px;
}

.legalDoc__cert:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legalDoc__cert-heading {
    font-family: var(--second-family);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--base-black);
    margin: 0 0 12px;
}

.legalDoc__cert-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-base, #61647a);
    margin: 0 0 28px;
    max-width: 640px;
}

.legalDoc__cert-logo {
    margin-bottom: 32px;
}

.legalDoc__cert-logo img {
    max-height: 72px;
    width: auto;
    display: block;
}

.legalDoc__cert-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.legalDoc__cert-download {
    padding-top: 10px;
    padding-bottom: 10px;
}

.legalDoc__tab:hover {
    color: var(--brand-blue-500);
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .legalDoc__body {
        grid-template-columns: 200px 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .legalDoc__hero {
        padding: 40px 0 32px;
    }

    .legalDoc__tabs-wrap {
        position: static;
    }

    .legalDoc__body {
        grid-template-columns: 1fr;
    }

    .legalDoc__toc {
        position: static;
    }

    .legalDoc__panels-wrap {
        padding: 32px 0 64px;
    }

    .legalDoc__section,
    .legalDoc__cert {
        padding-bottom: 32px;
        margin-bottom: 32px;
    }

    .legalDoc__hero {
        padding: 90px 0 0;
    }

    .legalDoc__title {
        font-size: 40px;
        line-height: 110%;
        letter-spacing: -0.03em;
        margin-bottom: 16px;
    }

    .legalDoc__desc {
        font-size: 16px;
        line-height: 150%;
        letter-spacing: 0.01em;
    }

    .legalDoc__breadcrumbs {
        margin-bottom: 24px;
    }

    .legalDoc__tabs {
        flex-direction: column;
        width: 100%;
    }

    .legalDoc__tabs-wrap-cont {
        display: block;
    }

    .legalDoc__tab {
        width: 100%;
        font-weight: 600;
        font-size: 14px;
        line-height: 129%;
        letter-spacing: 0.01em;
    }

    .legalDoc__toc {
        display: none;
    }

    .legalDoc__panels-wrap {
        padding-top: 24px;
    }
}