/* Shared styling for the standalone legal pages. Kept separate from the app's
   Tailwind build: these are plain HTML files in public/, served directly, so
   they must stand on their own without the bundle.

   Every colour comes from palette.css, which the app shares -- see the notes
   there. Nothing in this file names a colour, and tests/test_palette.py keeps
   it that way. */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); }
a:hover { color: var(--brand-over); }

.masthead {
    background: var(--raised);
    border-bottom: 1px solid var(--rule);
    padding: 14px 24px;
}
.masthead-inner {
    max-width: 44rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
}
.masthead a { font-weight: 700; text-decoration: none; }
.masthead-right { display: inline-flex; align-items: center; gap: 14px; }
.masthead .site {
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.masthead .site img { height: 27px; width: auto; display: block; }

main { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

h1 {
    font-weight: 900;
    font-size: clamp(1.7rem, 5vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0 0 0.4rem;
}

.stamp {
    font-size: 0.82rem;
    color: var(--ink-mute);
    padding-bottom: 1.4rem;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 2rem;
}

h2 {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 2.4rem 0 0.8rem;
}

h3 { font-weight: 700; font-size: 1rem; margin: 1.5rem 0 0.4rem; }

p { margin: 0 0 0.9rem; }
ul { margin: 0 0 0.9rem; padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--ink-mute); }

code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.84em;
    background: var(--sunk);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

.caps { font-variant: normal; }

footer {
    background: var(--footer-bg);
    color: var(--on-brand);
    text-align: center;
    padding: 2.2rem 1.25rem;
    font-size: 0.9rem;
}
footer a { color: var(--on-brand); }
footer p { margin: 0 0 0.4rem; }
footer .fine { color: var(--on-brand-fine); font-size: 0.82rem; margin-top: 0.8rem; }

/* --- article pages ------------------------------------------------------ */
/* legal.css started life styling only the notice and terms; it is the shared
   page stylesheet now, and articles need tables and a lead paragraph. */

.lead {
    font-size: 1.16rem;
    line-height: 1.5;
    color: var(--ink-soft);
    margin: 0 0 1.6rem;
}

.tbl { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--rule); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 30rem; background: var(--raised); }
thead th {
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 700;
    padding: 0.7rem 1rem;
    background: var(--sunk);
    border-bottom: 1px solid var(--rule);
}
tbody td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.win { font-weight: 700; color: var(--brand); }
.bad { color: var(--bad); }

.callout {
    background: var(--sunk);
    border-left: 3px solid var(--brand-fill);
    border-radius: 2px;
    padding: 1rem 1.15rem;
    margin: 1.6rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.cta {
    display: inline-block;
    background: var(--brand-fill);
    color: var(--on-brand);
    text-decoration: none;
    font-weight: 700;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    margin: 0.5rem 0 0;
}
.cta:hover { background: var(--brand-fill-over); color: var(--on-brand); }

.method { font-size: 0.9rem; color: var(--ink-mute); }

pre {
    background: var(--code-bg);
    color: var(--code-ink);
    padding: 1rem 1.1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.65;
    margin: 0 0 1.4rem;
}
pre code { background: none; padding: 0; font-size: 1em; color: inherit; }

/* --- use-case cards ----------------------------------------------------- */

.hero-cta { margin: 0 0 2.2rem; }
.cta-big {
    display: inline-block;
    background: var(--brand-fill);
    color: var(--on-brand);
    text-decoration: none;
    font-weight: 900;
    font-size: 1.12rem;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 6px 18px var(--cta-shadow);
}
.cta-big:hover { background: var(--brand-fill-over); color: var(--on-brand); }

.uses { display: flex; flex-direction: column; gap: 1.1rem; margin: 0 0 2rem; }

.use {
    background: var(--raised);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
}
.use-head { display: flex; align-items: flex-start; gap: 0.9rem; }
.use-head svg { flex-shrink: 0; margin-top: 2px; color: var(--brand-fill); }
.use h2 {
    margin: 0 0 0.45rem;
    font-size: 1.18rem;
    text-transform: none;
    letter-spacing: -0.01em;
}
.use p { margin: 0 0 0.9rem; font-size: 1rem; }
.use p:last-of-type { margin-bottom: 1.1rem; }

.use-cta {
    display: inline-block;
    background: var(--brand-fill);
    color: var(--on-brand);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
}
.use-cta:hover { background: var(--brand-fill-over); color: var(--on-brand); }

.tail {
    text-align: center;
    background: var(--sunk);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin-top: 2.4rem;
}
.tail p { margin: 0 0 1rem; font-size: 1.08rem; }

/* --- ad slots on the standalone pages ----------------------------------- */
/* Markup is generated by ads.js so the unit ids live in one place.
 *
 * The slot is transparent on purpose. AdSense creatives are mostly
 * white-backgrounded and will not follow the theme, so on a dark page they
 * will stand out; whether that wants a deliberate light band behind them is a
 * judgement to make against real creatives, not against a placeholder. */

.adslot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin: 1.5rem auto;
    max-width: 1264px;
}
.adslot-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-mute);
    opacity: 0.75;
}
.adslot .adsbygoogle { display: block; width: 100%; }
.adslot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60px;
    border: 1px dashed var(--rule);
    border-radius: 8px;
    background: var(--sunk);
    color: var(--ink-mute);
    font-size: 0.78rem;
    text-align: center;
    padding: 0 0.75rem;
}
@media (min-width: 700px) { .adslot-placeholder { height: 100px; font-size: 0.82rem; } }

/* --- the day/night button ----------------------------------------------- */
/* theme.js builds this into <span data-theme-toggle> so the app and these
   pages share one implementation of the behaviour. */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 9px;
    background: var(--raised);
    color: var(--ink-mute);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
