/* Legal documents (Privacy Policy, Terms, Cookie Policy, Acceptable Use Policy). docs/legal-pages.md
   Loaded only by marketing/legal.blade.php, after marketing.css. Reading comes first: a calm measure, quiet colour, numbered sections. */

.legal-head .legal-eyebrow {
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.legal-head .lede { max-width: 40em; }
.legal-meta { margin-top: 10px; color: var(--ink-2); font-size: .875rem; }

.legal {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-block: clamp(24px, 3.5vw, 48px) clamp(40px, 5vw, 72px);
}

/* ── On this page ────────────────────────────────────────────── */

.legal-toc { min-width: 0; }
.legal-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f8f2;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s;
}
.legal-toc[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.legal-toc[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.legal-toc-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 6px 8px 8px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #f7f8f2;
    list-style: none;
    counter-reset: toc;
}
.legal-toc-list li { counter-increment: toc; }
.legal-toc-list a {
    display: flex;
    gap: 10px;
    align-items: baseline;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: .9375rem;
    line-height: 1.35;
    text-decoration: none;
}
.legal-toc-list a::before { content: counter(toc) "."; flex: none; min-width: 1.6em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legal-toc-list a:hover { background: var(--paper-2); color: var(--ink); }
.legal-toc-list a[aria-current="location"] { background: var(--paper-2); color: var(--ink); font-weight: 650; }
.legal-toc-list a[aria-current="location"]::before { color: var(--accent-strong); }

/* ── The text ────────────────────────────────────────────────── */

.legal-body { min-width: 0; max-width: 46rem; counter-reset: legal-section; color: var(--ink); line-height: 1.65; overflow-wrap: break-word; }
.legal-body > :first-child { margin-top: 0; }
.legal-body p, .legal-body ul, .legal-body ol, .legal-body dl, .legal-body .legal-table { margin: 0 0 1em; }
.legal-body ul, .legal-body ol { padding-left: 1.35rem; }
.legal-body ul { list-style: disc; }
.legal-body li { margin-bottom: .4em; padding-left: .2rem; }
.legal-body li::marker { color: var(--accent-strong); }
.legal-body li > ul, .legal-body li > ol { margin: .4em 0 0; }
.legal-body a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.legal-body a:hover { color: var(--accent-strong); }
.legal-body strong { font-weight: 700; }
.legal-body code { padding: 1px 6px; border-radius: 4px; background: var(--paper-2); -webkit-box-decoration-break: clone; box-decoration-break: clone; font: 500 .875em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

.legal-section { margin-top: clamp(32px, 4vw, 48px); }
.legal-section > h2 {
    display: flex;
    gap: .55em;
    margin: 0 0 .7rem;
    font-size: clamp(1.25rem, 1.1rem + .55vw, 1.5rem);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -.02em;
    text-wrap: balance;
}
.legal-section > h2::before { content: counter(legal-section) "."; counter-increment: legal-section; flex: none; min-width: 1.4em; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.legal-section h3 { margin: 1.6em 0 .45em; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }

/* The short version, at the top of a document. */
.legal-summary {
    margin: 0 0 8px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent-strong);
    border-radius: 8px;
    background: #f7f8f2;
}
.legal-summary h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 750; letter-spacing: -.01em; }
.legal-summary ul { margin: 0; }
.legal-summary li:last-child { margin-bottom: 0; }

.legal-note { color: var(--ink-2); font-size: .9375rem; }

/* Tables (cookies, retention, bases). On a phone every row becomes a small card whose cells carry their column's name. */
.legal-table { overflow-x: auto; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.legal-table th { padding: 10px 14px 10px 0; border-bottom: 1.5px solid var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.legal-table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table td:first-child { font-weight: 600; }
/* Cookie names break only where they are told to (after an underscore) or not at all. */
.legal-table td:first-child code { overflow-wrap: normal; }
.legal-nowrap { white-space: nowrap; }

/* ── Below the text ──────────────────────────────────────────── */

.legal-more { padding-block: clamp(28px, 4vw, 48px) clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.legal-more h2 { margin-bottom: 18px; font-size: 1.125rem; font-weight: 750; letter-spacing: -.015em; }
.legal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.legal-card {
    display: grid;
    align-content: start;
    gap: 6px;
    height: 100%;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7f8f2;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}
.legal-card:hover { border-color: var(--ink); background: #fff; }
.legal-card strong { font-size: 1rem; font-weight: 700; }
.legal-card span { color: var(--ink-2); font-size: .875rem; line-height: 1.5; }
.legal-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .9375rem; }

@media (min-width: 1000px) {
    .legal { grid-template-columns: 16rem minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
    /* The box starts 10px left of the column, so the numbers line up with the page heading and the hover tint still stays inside the box:
       nothing sticks out of it, and so nothing can scroll sideways. */
    .legal-toc { position: sticky; top: calc(var(--header-h) + 24px); margin-left: -10px; }
    /* On a wide screen the list is always open and is a heading, not a button. */
    .legal-toc summary { min-height: 0; margin-bottom: 6px; padding: 0 10px; border: 0; background: none; color: var(--ink-2); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; cursor: default; pointer-events: none; }
    .legal-toc summary::after { display: none; }
    /* Compact rows: the longest document (18 sections) fits a laptop window without scrolling. */
    .legal-toc-list a { min-height: 0; padding: 6px 10px; font-size: .875rem; line-height: 1.35; }
    .legal-toc-list a:focus-visible { outline-offset: -2px; }
    .legal-toc-list a[aria-current="location"] { box-shadow: inset 2px 0 0 var(--accent-strong); border-top-left-radius: 0; border-bottom-left-radius: 0; }
    /* If a window is still too low, only the list scrolls. It has no bar: a soft fade marks the edge that has more, and legal.js keeps
       the section being read in view. */
    .legal-toc-list { position: relative; max-height: calc(100dvh - var(--header-h) - 48px - 2rem); overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; background: none; scrollbar-width: none; }
    .legal-toc-list::-webkit-scrollbar { display: none; }
    .legal-toc-list[data-fade="end"] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
    .legal-toc-list[data-fade="start"] { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 44px), transparent); }
    .legal-toc-list[data-fade="both"] { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
}

@media (max-width: 640px) {
    .legal-summary { padding: 16px 18px; }
    .legal-table table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; }
    .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .legal-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
    /* The label hangs in the margin of the cell, so the cell's own text and links stay in one normal flow. */
    .legal-table td { position: relative; padding: 3px 0 3px 6.75rem; border: 0; }
    .legal-table td::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 6rem; color: var(--ink-2); font-size: .6875rem; font-weight: 700; letter-spacing: .05em; line-height: 1.5; text-transform: uppercase; }
    /* The first cell names the row: it needs no label. */
    .legal-table td:first-child { margin-bottom: 4px; padding-left: 0; font-size: 1.0625rem; }
    .legal-table td:first-child::before { display: none; }
}

@media print {
    .site-header, .legal-toc, .legal-more, .skip-link { display: none !important; }
    .legal { display: block; padding: 0; }
    .legal-body { max-width: none; font-size: 11pt; }
    .legal-summary { break-inside: avoid; }
    .legal-section h2 { break-after: avoid; }
    .legal-body a { text-decoration: none; }
    .legal-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
