/*
   Legal & Policies, desktop. SCD-536.
   Figma 6jVr7YbefLWCQjcGuvD59L, page frames under 3205:2548, scroll behaviour 3167:17339.
   Values are taken from the design, not approximated. The 768px gate at the end of this file
   and of legal-policy-mobile.css decides which half of the pair renders, so both can sit on
   the same CMS page.
*/

/* Releases the theme's site-wide `body { min-width: 1300px !important }` (styles.css) on any
   page carrying this widget. With `overflow-x: clip` on html and body the floor has no
   scrollbar, so below 1300px the content pane was cut off and unreachable. */
body:has(.legal-policy-desktop) {
    min-width: 0 !important;
}

/* Stated rather than inherited: the 280 and 904 pane widths include their scrollbar padding. */
.legal-policy-desktop,
.legal-policy-desktop *,
.legal-policy-desktop *::before,
.legal-policy-desktop *::after {
    box-sizing: border-box;
}

.legal-policy-desktop {
    background: #fff;
    padding: 32px clamp(24px, 7.78vw, 112px) 72px;
}

/* No flex gap: the design puts 4px between the title and the tab bar and 24px between the
   tab bar and the panes, so the two spaces are set on the children instead. */
.legal-policy-desktop__inner {
    max-width: 1216px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.legal-policy-desktop__title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 38px;
    color: #000;
}

/* ---------- tabs ---------- */

.legal-policy-desktop__tabs {
    display: flex;
    align-items: stretch;
    gap: 24px;
    height: 80px;
    margin-top: 4px;
    background: #fff;
    border-bottom: 1px solid #d9d9d9;
}

.legal-policy-desktop__tab {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 0;
    border: 0;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #717680;
    white-space: nowrap;
    cursor: pointer;
}

.legal-policy-desktop__tab:hover {
    color: #465da6;
}

.legal-policy-desktop__tab.is-active {
    font-weight: 600;
    color: #465da6;
}

.legal-policy-desktop__tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #465da6;
}

/* ---------- the two scroll panes ---------- */

/* Fixed 516px panes, as drawn, with the page scrolling normally down to the footer.
   The other reading, footer pinned and panes filling the gap, leaves a ~66px pane on a
   768px-tall laptop, which is unusable. */
.legal-policy-desktop__panes {
    display: flex;
    align-items: stretch;
    gap: 32px;
    height: 516px;
    margin-top: 24px;
}

.legal-policy-desktop__rail,
.legal-policy-desktop__content {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Firefox only. Setting scrollbar-width in Chromium disables the ::-webkit- rules below,
   which are the ones that give the design's 8px rounded bar. */
@supports not selector(::-webkit-scrollbar) {
    .legal-policy-desktop__rail,
    .legal-policy-desktop__content {
        scrollbar-width: thin;
        scrollbar-color: #7a7a7a #e8e8e8;
    }
}

.legal-policy-desktop__rail::-webkit-scrollbar,
.legal-policy-desktop__content::-webkit-scrollbar {
    width: 8px;
}

.legal-policy-desktop__rail::-webkit-scrollbar-track,
.legal-policy-desktop__content::-webkit-scrollbar-track {
    background: #e8e8e8;
    border-radius: 100px;
}

.legal-policy-desktop__rail::-webkit-scrollbar-thumb,
.legal-policy-desktop__content::-webkit-scrollbar-thumb {
    background: #7a7a7a;
    border-radius: 100px;
}

/* 280 total: 260 of text, a 12px gap, then the 8px bar. */
.legal-policy-desktop__rail {
    flex: 0 0 280px;
    padding-right: 12px;
}

.legal-policy-desktop__rail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}

.legal-policy-desktop__rail-head img {
    display: block;
    width: 14px;
    height: 14px;
}

.legal-policy-desktop__rail-head span {
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    color: #595959;
    opacity: 0.6;
}

.legal-policy-desktop__rail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-policy-desktop__rail-item {
    display: block;
    padding: 8px 16px;
    border-left: 1px solid #d9d9d9;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #717680;
    text-decoration: none;
    /* Backstop only: the break opportunities come from LegalPolicySections.NavLabel. */
    overflow-wrap: anywhere;
}

.legal-policy-desktop__rail-item:hover {
    color: #465da6;
}

/* Blue text only. The design keeps the rail's left border a uniform grey. */
.legal-policy-desktop__rail-item.is-active {
    font-weight: 600;
    color: #465da6;
}

/* 904 total: 883 of text, a 13px gap, then the 8px bar. */
.legal-policy-desktop__content {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 13px;
}

/* ---------- document copy ---------- */

.legal-policy-desktop .legal-doc__title {
    margin: 0 0 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eeeff1;
    font-size: 30px;
    font-weight: 600;
    line-height: 38px;
    color: #000;
}

.legal-policy-desktop .legal-doc__heading {
    margin: 20px 0 12px;
    font-size: 20px;
    font-weight: 600;
    line-height: 30px;
    color: #465da6;
}

.legal-policy-desktop .legal-doc p {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #000;
}

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

.legal-policy-desktop .legal-doc li {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #000;
}

.legal-policy-desktop .legal-doc a {
    color: #465da6;
    text-decoration: underline;
}

/* ---------- narrower desktops ---------- */

@media (max-width: 1100px) {
    .legal-policy-desktop__panes {
        gap: 24px;
    }

    .legal-policy-desktop__rail {
        flex-basis: 240px;
    }

    .legal-policy-desktop__tabs {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .legal-policy-desktop {
        display: none;
    }
}
