/* ==========================================================================
   Legal pages: Privacy Policy, Terms of Service, Accessibility Statement
   One stylesheet for all three (html/privacy-policy.html,
   html/terms-of-service.html, html/accessibility.html).

   Layout
   - Phones: the "On this page" tabs sit in one row you can swipe sideways,
     stuck under the header while you read.
   - 60rem and wider: the tabs become a list in a left column that stays in
     view, with the text beside it.
   ========================================================================== */

.legal {
    padding-block: 2.5rem 4rem;
    background: var(--ivory);
}

.legal__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

/* ---------- "On this page" tabs ---------- */
.legal__nav {
    position: sticky;
    top: var(--header-height); /* sits just under the sticky header */
    z-index: 5;
    margin-inline: calc(var(--gutter) * -1); /* let the row run edge to edge on phones */
    padding: .75rem var(--gutter);
    background: var(--ivory);
    border-bottom: 1px solid var(--rose-gold-light);
}

/* The title is only needed once the tabs become a side list */
.legal__nav-title {
    display: none;
}

.legal__tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;          /* swipe sideways when the tabs do not fit */
    list-style: none;
    scrollbar-width: none;     /* hide the scrollbar; the row still scrolls */
}

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

.legal__tab {
    display: block;
    padding: .5rem 1rem;
    font-size: .8125rem;
    white-space: nowrap;
    color: var(--emerald);
    background: var(--white);
    border: 1px solid var(--rose-gold-light);
    border-radius: 999px;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.legal__tab:hover {
    border-color: var(--emerald);
}

/* The tab for the section being read (class added by javascript/legal.js) */
.legal__tab.is-current {
    color: var(--white);
    background: var(--emerald);
    border-color: var(--emerald);
}

/* ---------- Text ---------- */
.legal__content {
    max-width: 44rem; /* keeps lines a comfortable length to read */
}

.legal__intro {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--ink);
}

.legal__section {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--rose-gold-light);
    /* When a tab jumps here, stop below the header AND the row of tabs */
    scroll-margin-top: 4.5rem;
}

.legal__heading {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--emerald);
}

.legal__section p,
.legal__section ul {
    margin-top: 1rem;
    font-size: .9375rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--ink-soft);
}

.legal__section ul {
    padding-left: 1.25rem;
    list-style: disc; /* global.css removes bullets from every list; these are real lists */
}

.legal__section li::marker {
    color: var(--rose-gold);
}

.legal__section li + li {
    margin-top: .5rem;
}

.legal__section strong {
    font-weight: 500;
    color: var(--ink);
}

.legal__section a {
    color: var(--emerald);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.legal__section a:hover {
    color: var(--rose-gold-text);
}

/* ---------- 60rem and wider: tabs become a side list ---------- */
@media (min-width: 60rem) {
    .legal {
        padding-block: 4rem 6rem;
    }

    .legal__inner {
        grid-template-columns: 16rem minmax(0, 1fr);
        gap: 4rem;
        align-items: start;
    }

    .legal__nav {
        top: calc(var(--header-height) + 2rem);
        margin-inline: 0;
        padding: 0;
        background: none;
        border-bottom: 0;
    }

    .legal__nav-title {
        display: block;
        margin-bottom: 1rem;
        font-size: .75rem;
        font-weight: 500;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--rose-gold-text);
    }

    .legal__tabs {
        flex-direction: column;
        gap: .25rem;
        overflow: visible;
    }

    .legal__tab {
        padding: .5rem .875rem;
        font-size: .875rem;
        white-space: normal;
        background: none;
        border-color: transparent;
        border-radius: .5rem;
    }

    .legal__tab:hover {
        background: var(--cream);
        border-color: transparent;
    }

    .legal__section {
        scroll-margin-top: 2rem; /* the tabs are beside the text now, not above it */
    }

    .legal__section:first-of-type {
        margin-top: 2rem;
    }
}
