/*
 * terms.php and privacy-policy.php — one stylesheet, because they were always one.
 *
 * WHAT WAS THERE
 *
 * 319 inline lines across the two pages. Nineteen selectors each, of which six were
 * byte-identical and shared outright - .back-to-top and its two states,
 * .effective-date, .highlight-item and its icon - and the other thirteen were THE SAME
 * THIRTEEN RULES under two prefixes. .terms-layout against .privacy-layout,
 * .terms-sidebar h4 against .privacy-sidebar h4, and so on down the file, every pair
 * byte-identical in its declarations.
 *
 * The markup matched too: same wrappers, same nesting, diverging only where one page
 * has a clause the other does not. So the prefix is now `legal-` on both and the file
 * is half the size of what it replaced.
 *
 * WHAT CHANGED ON THE WAY
 *
 *   - 992px becomes 1024px, one of the style guide's four. Two of the four remaining
 *     off-guide widths on the site were these.
 *   - .legal-sidebar h4 goes from 0.05em to 0.12em tracking. The guide allows ALL-CAPS
 *     "with wide tracking, 0.28em, never at default spacing", and 0.05em is default
 *     spacing with extra steps.
 *   - Two hand-rolled shadows become the ramp.
 *   - #f8fafc and #e2e8f0 - a Tailwind slate that appears nowhere else in the brand -
 *     become --surface-subtle and --border-default.
 *
 * WHAT DID NOT CHANGE, AND MUST NOT
 *
 * min-width: 0 on the two grid children. The comment that came with it is kept in full
 * below because it records a measurement and a rejected fix, and both would otherwise
 * be re-derived by the next person to open this file.
 */

.legal-header {
    margin-top: 100px;
    padding: 4rem 2rem;
    background: var(--gradient-primary);
    color: var(--on-brand);
    text-align: center;
}

.legal-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.legal-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.legal-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* A 1fr track is minmax(auto, 1fr), and that auto minimum will not go below the
   min-content width of what is inside it. At 320px this layout has a 240px content box
   but the track measured 289.656px, so both children spilled 10px past the viewport and
   the page scrolled sideways. min-width: 0 lets the track shrink to the container.

   NOT overflow-wrap: anywhere. That was here first, on the assumption the text would
   also need help reflowing. It did not - min-width alone takes both pages to exactly
   320px - and it broke ordinary words mid-word, which made privacy-policy 957px TALLER
   at 320px than before the fix. A readability cost that large in exchange for 10px of
   horizontal scroll is a bad trade, and it was only visible because the page was
   rendered rather than measured. */
.legal-main,
.legal-sidebar {
    min-width: 0;
}

.legal-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
    background-color: var(--surface-subtle);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-default);
}

.legal-sidebar h4 {
    color: var(--brand-text);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    /* 0.12em, not 0.05em. The guide permits ALL-CAPS on a kicker "with wide tracking,
       0.28em, never at default spacing". 0.28em is its figure for a 13px eyebrow and is
       too much at 1.1rem; 0.05em was not tracking at all. */
    letter-spacing: 0.12em;
}

.legal-section {
    background-color: var(--white);
    padding: 3rem 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.legal-main h2 {
    color: var(--brand-text);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 0.5rem;
}

.legal-main h3 {
    color: var(--brand-text-alt);
    margin: 1.5rem 0 1rem;
    font-size: 1.4rem;
}

.legal-main p,
.legal-main ul {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.legal-main ul {
    padding-left: 2rem;
}

.legal-main ul li {
    margin-bottom: 0.5rem;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.highlight-item i {
    color: var(--brand-text-alt);
    margin-top: 0.2rem;
}

.effective-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--light-gray);
    border-radius: 4px;
    margin-bottom: 2rem;
    font-weight: 600;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: var(--on-brand);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

@media (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
        margin-top: 2rem;
    }
}
