/*
 * ClearFeed AI — legal pages (privacy.html, terms.html).
 *
 * Loaded after landing.css and leans on it for the tokens, the header, the
 * buttons and the footer, so the two pages read as rooms in the same house as
 * the landing page. Everything here is the document itself: a long, numbered,
 * tabular text that has to stay readable with no JavaScript at all.
 *
 * LANGUAGES. Each page carries three complete documents (tr, en, de), one
 * <article class="legal-doc"> apiece. With scripting the page shows the one
 * matching the visitor's choice; without it all three stay on the page, each
 * under its own heading, with the anchor strip at the top to jump between
 * them. A policy that only exists once a script has run is not a policy a
 * regulator can read.
 */

/* The landing backdrop minus the planet: a wash and a vignette are enough
   behind a wall of text, and a rotating globe under a data-retention table
   is a distraction nobody asked for. */
.legal-page .stars,
.legal-page .orb,
.legal-page .globe-stage { display: none; }

.legal {
    position: relative;
    z-index: 10;
    width: var(--shell);
    margin-inline: auto;
    padding-block: clamp(2rem, 5vw, 4rem);
}

/* Anchor strip: the no-JS way to reach a language. Hidden once the script has
   taken over, because then the select in the header does the same job. */
.legal-lang-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.legal-lang-nav a {
    padding: 0.45rem 0.95rem;
    border-radius: 99px;
    border: 1px solid var(--line-strong);
    background: var(--bg-raised);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}
.legal-lang-nav a:hover { color: var(--brand); border-color: var(--brand); }
.legal-js .legal-lang-nav { display: none; }

/* Draft banner: shown by the script only while a [[PLACEHOLDER]] is still on
   the page, so it disappears on its own the day the last one is filled in. */
.ph-banner {
    max-width: 52rem;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.12);
    color: var(--ink);
    font-size: 0.88rem;
}
.ph-banner strong { color: var(--warn); }

.legal-doc {
    max-width: 52rem;
    margin: 0 auto 3rem;
    padding: clamp(1.5rem, 4vw, 3.25rem);
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    box-shadow: var(--shadow);
}
.legal-js .legal-doc { display: none; }
.legal-js .legal-doc.active { display: block; }

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.78rem;
    color: var(--ink-faint);
    font-family: var(--mono);
    margin-bottom: 1rem;
}

.legal-doc h1 {
    font-size: clamp(1.7rem, 3.6vw, 2.4rem);
    margin-bottom: 1rem;
}
.legal-doc .lede {
    font-size: 1.02rem;
    color: var(--ink-soft);
    margin-bottom: 1.25rem;
}
.legal-doc h2 {
    font-size: 1.28rem;
    margin: 2.25rem 0 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 100px;
}
.legal-doc h3 {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 1.35rem 0 0.45rem;
}
.legal-doc p,
.legal-doc li {
    font-size: 0.95rem;
    color: var(--ink-soft);
}
.legal-doc p + p { margin-top: 0.7rem; }
.legal-doc ul,
.legal-doc ol {
    padding-left: 1.35rem;
    margin: 0.5rem 0 1rem;
}
.legal-doc li + li { margin-top: 0.35rem; }
.legal-doc strong { color: var(--ink); font-weight: 600; }
.legal-doc a { color: var(--brand); text-decoration: none; }
.legal-doc a:hover { text-decoration: underline; }

/* Table of contents: two columns where there is room, one where there is not. */
.toc {
    margin: 1.5rem 0 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-sunk);
    border: 1px solid var(--line);
}
.toc ol {
    margin: 0;
    padding-left: 1.2rem;
    columns: 2;
    column-gap: 2rem;
    font-size: 0.88rem;
}
.toc li { break-inside: avoid; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* Callouts: the amber one is "read this before relying on the product", the
   blue one is plain information. */
.notice {
    margin: 1rem 0 1.25rem;
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--warn);
    background: rgba(251, 191, 36, 0.08);
}
.notice.info {
    border-left-color: var(--accent);
    background: rgba(56, 189, 248, 0.08);
}
.notice p { margin: 0; }

/* Data tables scroll inside their own box on a phone; the page never does. */
.legal-table {
    overflow-x: auto;
    margin: 0.75rem 0 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.legal-table table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.legal-table th,
.legal-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
}
.legal-table th {
    color: var(--ink);
    font-weight: 600;
    background: var(--bg-sunk);
    white-space: nowrap;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td:first-child { color: var(--ink); font-weight: 500; }

/* Definition-style rows for "who / what / where". */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.5rem 0 1rem; }
.kv dt { color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.kv dd { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0.1rem 0; } .kv dd { margin-bottom: 0.5rem; } }

.legal-doc .doc-foot {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: var(--ink-faint);
}

@media print {
    .site-header, .site-footer, .sky, .vignette, .ph-banner, .legal-lang-nav { display: none !important; }
    .legal-doc { display: block !important; box-shadow: none; border: none; background: #fff; color: #000; page-break-after: always; }
    .legal-doc p, .legal-doc li, .legal-doc td, .legal-doc th { color: #000; }
}
