/* public/legal.css
 *
 * The privacy, terms, disclaimer and cookie pages. Deliberately quiet: these are
 * pages people read once, in a hurry, often worried. Same palette and typeface as
 * the app (tokens come from style.css), one column, generous line height, no
 * decoration competing with the text.
 *
 * Loaded together with style.css, which supplies the tokens, the Onest
 * @font-face blocks and the doodle wallpaper.
 */

body.legal-page {
    /* The app centres a card in the viewport; a document should start at the top
       and scroll. */
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0 72px;
}

/* ------------------------------------------------------------------- chrome -- */

.legal-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
    padding: 22px 20px 10px;
}

.legal-brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.legal-brand:hover {
    color: var(--accent-strong);
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.9rem;
}

.legal-nav a {
    color: var(--ink-soft);
    text-decoration: none;
}

.legal-nav a:hover {
    color: var(--accent-strong);
}

.legal-nav a[aria-current="page"] {
    color: var(--accent-strong);
    font-weight: 700;
}

/* ------------------------------------------------------------------- layout -- */

main.legal {
    /* Overrides the app's centred, doodled card. */
    text-align: left;
    background-image: none;
    width: auto;
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 30px 40px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.legal h1 {
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 4.5vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--ink);
}

.legal h2 {
    margin: 34px 0 10px;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--ink);
}

.legal h3 {
    margin: 22px 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.legal p,
.legal li {
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--ink-soft);
}

.legal p {
    margin: 0 0 12px;
}

.legal ul,
.legal ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.legal li {
    margin: 0 0 7px;
}

.legal li::marker {
    color: var(--accent);
}

.legal strong {
    color: var(--ink);
    font-weight: 700;
}

.legal a {
    color: var(--accent-strong);
}

.legal-meta {
    margin: 0 0 4px;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

/* The date line sits under the title and above everything else, so a reader can
   see at a glance whether what they are reading is current. */
.legal-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--ink-soft);
}

/* ------------------------------------------------------------------ callouts -- */

/* The plain-language summary. Cyan-leaning tint, same as the app's output panel:
   a single soft card that invites reading rather than a wall of clauses. */
.legal-short {
    margin: 0 0 26px;
    padding: 20px 22px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-card);
}

.legal-short h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--accent-strong);
}

.legal-short ul {
    margin: 0;
    padding-left: 20px;
}

.legal-short li {
    color: var(--ink);
}

/* For the child-readable notice. Warmer than the summary card so it reads as a
   different kind of thing: something to read together, not a legal box. */
.legal-kids {
    margin: 0 0 26px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-card);
}

.legal-kids h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.legal-kids p {
    margin: 0 0 8px;
    color: var(--ink);
}

.legal-kids p:last-child {
    margin-bottom: 0;
}

/* A clause that matters more than the rest: the AI-generated warning, the
   "we do not sell your data" line. */
.legal-note {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-control) var(--radius-control) 0;
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------------------------------------------------------------- tables ----- */

.legal-table {
    width: 100%;
    margin: 0 0 18px;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    color: var(--ink-soft);
    line-height: 1.5;
}

.legal-table th {
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    font-size: 0.86rem;
    letter-spacing: 0.01em;
}

.legal-table td:first-child {
    color: var(--ink);
    font-weight: 600;
}

/* On a phone these tables would squeeze into unreadable columns, so each row
   becomes its own little block with the header repeated via data-label. */
@media (max-width: 620px) {
    .legal-table,
    .legal-table tbody,
    .legal-table tr,
    .legal-table td {
        display: block;
        width: 100%;
    }

    .legal-table thead {
        display: none;
    }

    .legal-table tr {
        padding: 10px 0 14px;
        border-bottom: 1px solid var(--border);
    }

    .legal-table td {
        border: 0;
        padding: 2px 0;
    }

    .legal-table td:first-child {
        font-weight: 700;
        color: var(--ink);
    }
}

/* ------------------------------------------------------------------- footer -- */

.legal-foot {
    max-width: 760px;
    margin: 22px auto 0;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.86rem;
    color: var(--ink-soft);
}

.legal-foot a {
    color: var(--ink-soft);
}

.legal-foot a:hover {
    color: var(--accent-strong);
}

/* Placeholders the operator must fill in before these pages go live. Made loud
   on purpose: a live policy that still says [CONTACT EMAIL] is worse than no
   policy, and this makes it impossible to miss. */
.fill {
    padding: 0 4px;
    border-radius: 4px;
    background: #fff4d6;
    border: 1px dashed #e2b34e;
    color: #6b4d12;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 620px) {
    main.legal {
        padding: 26px 20px 32px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
