/* The legal pages: terms, acceptable use, privacy, refunds and abuse.
   A photo heading like the other pages, then the text in one column with
   its parts listed beside it. tools/legal_layout.py lays the pages out and
   links this file; the words are the pages' own and are not touched.
   Its own file, so the five pages can change without a new style.css for
   every other page (Cloudflare keeps /assets for a week by address). */

/* The heading: the date as a small badge under the lede. */
.legal-head .updated {
    display: inline-flex; align-items: center; gap: 9px; margin-top: 28px; padding: 8px 14px;
    border: 1px solid var(--line2); border-radius: 999px; background: var(--surface-soft);
    font: 600 13px/1.2 var(--mono); color: var(--text2);
}
.legal-head .updated::before {
    content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft);
}

/* The column and the list of parts beside it. */
.legal { padding-bottom: 88px; }
.legal-grid { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 64px; align-items: start; }
.legal-toc {
    position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto;
    padding: 18px 14px 14px; border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface); box-shadow: var(--card-shadow);
}
.legal-toc-title { margin: 0 6px 10px; font: 700 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); }
.legal-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: legal-toc; }
.legal-toc li { counter-increment: legal-toc; }
.legal-toc a {
    display: flex; gap: 10px; padding: 7px 8px; border-radius: 9px;
    color: var(--text2); font-size: 14px; line-height: 1.4; text-decoration: none;
    transition: background 0.14s, color 0.14s;
}
.legal-toc a::before { content: counter(legal-toc, decimal-leading-zero); flex: none; padding-top: 1px; font: 600 12px/1.45 var(--mono); color: var(--accent-text); }
.legal-toc.numbered a::before { display: none; }
.legal-toc a:hover, .legal-toc a:focus-visible { background: var(--hover); color: var(--text); }

/* The text: each part opens with its number and a line above it. */
.legal-body { max-width: 760px; padding-bottom: 0; counter-reset: legal-part; }
.legal-part { padding: 34px 0 20px; border-top: 1px solid var(--line); scroll-margin-top: 96px; counter-increment: legal-part; }
.legal-part:first-child { padding-top: 0; border-top: 0; }
.legal-body .legal-part > h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.legal-part > h2::before {
    content: counter(legal-part, decimal-leading-zero); flex: none;
    display: grid; place-items: center; min-width: 38px; height: 30px; padding: 0 8px;
    border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-wash);
    font: 700 13px/1 var(--mono); color: var(--accent-text); letter-spacing: 0;
}
.legal-body.numbered .legal-part > h2::before { display: none; }
.legal-part > :last-child { margin-bottom: 0; }

/* "The short version" stands out as a card of its own. */
.legal-part.short {
    margin-bottom: 30px; padding: 26px 28px 24px; border: 1px solid var(--accent-line); border-radius: var(--r);
    background: linear-gradient(135deg, var(--accent-wash), transparent 70%), var(--surface);
}
.legal-part.short + .legal-part { border-top: 0; padding-top: 6px; }
.legal-part.short li { margin-bottom: 10px; }

/* A tablet and a phone: the list of parts becomes a row to swipe. */
@media (max-width: 1060px) {
    .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .legal-toc { position: static; max-height: none; overflow: visible; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
    .legal-toc-title { margin: 0 0 12px; }
    .legal-toc ol { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
    .legal-toc li { flex: none; }
    .legal-toc a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; font-size: 13.5px; }
}
@media (max-width: 600px) {
    .legal-part { padding-top: 28px; }
    .legal-part > h2::before { min-width: 34px; height: 28px; font-size: 12px; }
    .legal-part.short { padding: 20px 18px 18px; }
    .legal-head .updated { margin-top: 22px; }
}
@media print {
    .legal-toc { display: none; }
    .legal-grid { display: block; }
}
