/* Legal document pages (/imprint, /terms, /billing,
   /commercial-terms, /dpa, /privacy, /aup, /cookies).
   Loaded AFTER homepage.css, which supplies the brand tokens, fonts, topbar,
   hamburger, cookie modal and footer. Nothing here restyles those — every
   selector below is scoped to a legal_* class or to a .legal variant of an
   existing block, so this file can only affect these nine pages. */

/* Navigation on these pages is real <a href> rather than the click-wired divs
   the marketing pages use, so two div-shaped assumptions need restoring: the
   logos are sized boxes that an inline anchor would collapse, and the two
   hamburger classes never set a colour (a div inherits it, an anchor would
   fall back to the UA link blue). */
a.logotop,
a.logo_footer {
    display: block;
}

a.hamburger_btn,
a.hamburger_btn_row {
    color: var(--text-color);
}

/* ---------------------------------------------------------------- header */

/* .hero_top's own 30px side padding would set the title 30px inside the rail
   the topbar, the document index and the footer all sit on. On a page with a
   left-hand index that offset reads as a mistake, so drop it and match the
   .block/.footer_top geometry exactly. */
.hero_top.legal {
    height: auto;
    margin-top: 65px;
    padding: 74px 0 38px 0;
    width: calc(100dvw - 60px);
    max-width: 1100px;
    gap: 16px;
    align-items: flex-start;
}

.legal_eyebrow {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-green-slanter);
}

.hero_text.legal {
    font-size: clamp(2.3rem, 8vw, 3.4rem);
    line-height: 1.06;
    max-width: 100%;
    text-align: left;
}

.legal_meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--med-text);
}

.legal_meta_dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--med-text);
    opacity: 0.6;
}

/* ---------------------------------------------------------------- layout */

.block.legal {
    gap: 30px;
    padding: 0 0 90px 0;
    display: block;
    margin: 0 auto;
    justify-self: center;
    width: calc(100dvw - 60px);
    max-width: 1100px;
    border-bottom: 1px solid var(--border-color-sharper);
}

.legal_layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
}

/* -------------------------------------------------------- document index */

.legal_index {
    position: sticky;
    top: 95px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.legal_index_title {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--light-text);
}

.legal_index_list {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color-sharper);
}

.legal_index_link {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--med-text);
    padding: 8px 0 8px 16px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.legal_index_link:hover {
    color: var(--text-color);
    border-left-color: var(--border-color-darker);
}

.legal_index_link.is-current {
    color: var(--text-color);
    font-weight: 500;
    border-left-color: var(--color-green-slanter);
}

.legal_index_link.is-current:hover {
    border-left-color: var(--color-green-slanter);
}

/* ------------------------------------------------------------------ body */

.legal_body {
    max-width: 680px;
    font-family: 'Slanter-Serif', serif;
    font-weight: 100;
    font-size: 1.15rem;
    line-height: 1.75rem;
    color: var(--text-color);
    overflow-wrap: break-word;
}

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

.legal_body p {
    margin: 0 0 22px 0;
    font-weight: 100;
}

.legal_body h2 {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 52px 0 18px 0;
    color: var(--text-color);
    scroll-margin-top: 90px;
}

.legal_body h3 {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 34px 0 12px 0;
    color: var(--text-color);
    scroll-margin-top: 90px;
}

.legal_body ul,
.legal_body ol {
    margin: 0 0 22px 0;
    padding-left: 22px;
}

.legal_body li {
    margin-bottom: 10px;
}

.legal_body a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-color-darker);
    transition: text-decoration-color 0.2s ease;
}

.legal_body a:hover {
    text-decoration-color: var(--text-color);
}

.legal_body hr {
    border: none;
    border-top: 1px solid var(--border-color-sharper);
    margin: 44px 0;
}

.legal_address {
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    font-style: normal;
    margin: 0 0 22px 0;
    color: var(--text-color);
}

/* ------------------------------------------------------ document switch */
/* Switching documents swaps the heading and the article in place (see
   legal-page.js). There is deliberately no exit animation — the outgoing
   document is replaced in the same frame — so this is a short enter only.
   Keep it under ~180ms: anything longer reads as waiting. */

@keyframes legalSwapEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.legal_swap_enter {
    animation: legalSwapEnter 160ms cubic-bezier(0.2, 0.65, 0.2, 1) both;
}

/* The switcher moves focus to the new <h1> so a screen reader announces the
   change of document. That heading is tabindex="-1" — programmatic focus only,
   never reachable by Tab — so the ring is noise rather than an affordance. */
.hero_text[tabindex="-1"]:focus {
    outline: none;
}

.legal_body.legal_swap_enter {
    animation-delay: 25ms;
}

@media (prefers-reduced-motion: reduce) {
    .legal_swap_enter {
        animation: none;
    }
}

/* ---------------------------------------------------- placeholder notice */
/* Delete this block, and the matching markup in each page, once the real
   document text from legal.md replaces the filler copy. */

.legal_draft_notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--orange-border);
    background-color: var(--orange-bg);
    color: var(--orange-text);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 40px 0;
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.5;
}

.legal_draft_notice svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
}

/* -------------------------------------------------------- related footer */

.legal_related {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color-sharper);
    font-family: 'Slanter-Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--med-text);
}

.legal_related a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-color-darker);
}

.legal_related a:hover {
    text-decoration-color: var(--text-color);
}

/* ----------------------------------------------------------- breakpoints */

@media (max-width: 900px) {
    .legal_layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
    }

    /* Stacked, the index would otherwise push nine links between the title and
       the first line of the document. It sits underneath instead — the footer
       and the mobile menu carry the same list for anyone looking for it. */
    .legal_body {
        order: 1;
    }

    .legal_index {
        order: 2;
        position: static;
        top: auto;
        padding-top: 34px;
        border-top: 1px solid var(--border-color-sharper);
    }

    .legal_index_list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-left: none;
        column-gap: 24px;
    }

    .legal_index_link {
        padding-left: 0;
        margin-left: 0;
        border-left: none;
    }

    .legal_index_link:hover,
    .legal_index_link.is-current,
    .legal_index_link.is-current:hover {
        border-left: none;
    }

    .legal_index_link.is-current {
        color: var(--color-green-slanter);
    }
}

@media (max-width: 640px) {
    .hero_top.legal {
        padding-top: 56px;
        padding-bottom: 30px;
    }

    /* Wrapped, the interpunct separator dangles at the end of the first line —
       stack the two facts instead. */
    .legal_meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.9rem;
    }

    .legal_meta_dot {
        display: none;
    }

    .legal_index_list {
        grid-template-columns: minmax(0, 1fr);
    }

    .block.legal {
        padding-bottom: 70px;
    }
}
