/* Copyright (c) 2026 Tech Talker 360. All rights reserved. For use on tools.techtalker360.com only. Terms: https://tools.techtalker360.com/terms */
/*
 * The Terms of Use and Privacy Policy pages (terms.php, privacy.php).
 *
 * Both pages link the shared assets/base.css after this file, so the Console
 * tokens, the motion tokens, the text size tokens, the focus ring, the
 * scrollbar tokens, the site footer and the one reduced-motion block all come
 * from there. This file keeps only the layout of a long text page: one card
 * of readable width at the top of the page, the page itself scrolling, and
 * the site footer under it.
 *
 * Lengths: 1rem is 10px (the 62.5% root in base.css). Media queries are in
 * em, px / 16, on the repository's one breakpoint scale.
 */

/* Root size: the same one rule as base.css, so the page keeps its size even
   if base.css fails to load. */
html {
    font-size: calc(62.5% * var(--tt360-ui-scale, 1));
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Page gutters by width, plus the safe areas (uiux layout-spacing.md "Page
   gutters by width, kept by sideways scrollers"). */
:root {
    --legalGutter: 1.6rem;
}

@media (min-width: 48em) {
    :root {
        --legalGutter: 2.4rem;
    }
}

@media (min-width: 62em) {
    :root {
        --legalGutter: 3.2rem;
    }
}

/* A long text page scrolls as a page. The body is a grid: base.css gives it
   a row for the text, which takes the free height, and a row for the site
   footer, which then sits at the bottom of a short window. */
body {
    margin: 0;
    min-block-size: 100dvh;
    display: grid;
    justify-items: center;
    padding-block: 2.4rem;
    padding-inline: calc(var(--legalGutter) + env(safe-area-inset-left, 0px))
        calc(var(--legalGutter) + env(safe-area-inset-right, 0px));
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    scrollbar-gutter: stable;
    scrollbar-color: var(--tt360ScrollbarThumb) var(--tt360ScrollbarTrack);
}

/* The text card: 64rem wide at most, so a line of body text stays under 80
   characters (uiux typography.md "Body text lines stay under 80
   characters"), on the raised surface with a hairline and the resting
   shadow (uiux variants.md "Card"). */
.legalPage {
    align-self: start;
    display: grid;
    gap: 3.2rem;
    inline-size: 100%;
    max-inline-size: 64rem;
    padding: 2.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--hairline), var(--shadow-1);
    overflow-wrap: break-word;
}

@media (min-width: 48em) {
    .legalPage {
        padding: 3.2rem;
    }
}

/* The title, its date, and one line, closer to each other than to the
   sections below (uiux layout-spacing.md "Spacing expresses grouping"). */
.legalHeader,
.legalSection {
    display: grid;
    gap: 0.8rem;
}

.legalPage h1,
.legalPage h2,
.legalPage p,
.legalPage ul {
    margin: 0;
}

.legalPage h1 {
    font-size: var(--tt360H1);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.legalPage h2 {
    font-size: var(--tt360H2);
    font-weight: 700;
    line-height: 1.3;
    text-wrap: balance;
}

.legalUpdated {
    color: var(--text-muted);
}

.legalLead {
    color: var(--text-secondary);
}

.legalSection ul {
    display: grid;
    gap: 0.8rem;
    padding-inline-start: 2.4rem;
}

.legalPage code {
    font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
    font-size: 0.95em;
    overflow-wrap: anywhere;
}

/* Links in the text stay underlined (uiux accessibility.md "Links in
   running text keep their underline"); hover thickens the line and moves
   the color toward the primary text, pressing deepens it, and focus takes
   the shared ring from base.css. */
.legalPage a {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration-line: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: max(1px, 0.07em);
    transition:
        color var(--tt360DurationFast) var(--tt360EaseOut),
        text-decoration-thickness var(--tt360DurationFast) var(--tt360EaseOut);
}

@media (hover: hover) and (pointer: fine) {
    .legalPage a:hover {
        color: color-mix(in oklab, var(--accent-text), var(--text-primary) 30%);
        text-decoration-thickness: max(2px, 0.12em);
    }
}

.legalPage a:active {
    color: var(--text-primary);
    text-decoration-thickness: max(2px, 0.12em);
}

/* The way back to every tool: a link with the home icon before its label,
   on the card's start edge, at least 2.4rem tall, 4.4rem under a coarse
   pointer. */
.legalPage .legalBackLink {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-block-size: 2.4rem;
    font-size: var(--tt360Small);
}

.legalBackLink .tt360Icon {
    inline-size: 1.6rem;
    block-size: 1.6rem;
}

@media (pointer: coarse) {
    .legalPage .legalBackLink {
        min-block-size: 4.4rem;
    }
}
