/* ═══════════════════════════════════════════════════════════════
   MARMO · Privacy, Cookie, Terms. A centred opening, then the contents list beside the text.
   The contents list and the h2 ids come from mv_legal_body_end() (config.php), which also prints the @page margin boxes.
   The print rules at the end are the PDF button's page.
   ═══════════════════════════════════════════════════════════════ */
.legal-head { flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-top: 64px; padding-bottom: 56px; }
.legal-head .display { font-size: 44px; line-height: 1.08; max-width: 18em; overflow-wrap: anywhere; }
.legal-updated { font-size: 14px; color: var(--muted); }

.legal-sec { flex: none; width: 100%; padding-bottom: 112px; }
.legal-body { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--rule); padding-top: 48px; counter-reset: none; }
.legal-body.has-toc { max-width: 1100px; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 760px); justify-content: space-between; align-content: start; column-gap: 64px; }
.legal-body.has-toc > * { grid-column: 2; }
.legal-body.has-toc > .legal-toc { grid-column: 1; grid-row: 1 / span 200; align-self: start; position: sticky; top: 92px; max-height: calc(100vh / var(--mv-zoom, 1) - 112px); overflow-y: auto; }

.legal-toc ol { list-style: none; border-left: 1px solid var(--line); }
.legal-toc a { display: flex; align-items: center; min-height: 40px; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.35; color: var(--muted); }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--ink); border-left-color: var(--red-text); }

.legal-body h2 { font-size: 23px; font-weight: 300; line-height: 1.2; margin: 48px 0 16px; padding-top: 28px; border-top: 1px solid var(--line); scroll-margin-top: 24px; text-wrap: balance; overflow-wrap: break-word; }
/* The rule under the opening already closes the title block: no second one over the first heading. */
.legal-body h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body p, .legal-list li { font-size: 16.5px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.legal-body p + p { margin-top: 14px; }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body p a, .legal-list a, .legal-table a { color: var(--red-text); text-decoration: underline; text-underline-offset: 2px; padding-block: .45em; }
.legal-body p a:hover, .legal-list a:hover, .legal-table a:hover { color: var(--ink); }
.legal-body code { font-size: .9em; }
.legal-list { list-style: disc; margin: 14px 0; padding-left: 22px; }
.legal-list li + li { margin-top: 8px; }
.legal-list li::marker { color: var(--red-text); }
.legal-body .legal-note { font-size: 15px; color: var(--muted); }

/* ── Cookie table ── */
.legal-table-wrap { overflow-x: auto; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 34rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table th { color: var(--ink); font-weight: 600; border-bottom-color: var(--rule); }
.legal-table td { color: var(--text); line-height: 1.55; }
.legal-table code { font-size: 13px; white-space: nowrap; color: var(--ink); }

.legal-actions { display: flex; margin-top: 48px; }

@media (max-width: 1040px) {
    .legal-body.has-toc { display: block; max-width: 760px; }
    .legal-body.has-toc > .legal-toc { position: static; max-height: none; overflow: visible; margin-bottom: 48px; }
}

@media (max-width: 760px) {
    .legal-head { padding-top: 52px; padding-bottom: 36px; gap: 12px; }
    .legal-head .display { font-size: 34px; line-height: 1.12; }
    .legal-sec { padding-bottom: 72px; }
    .legal-body { padding-top: 32px; }
    .legal-toc a { min-height: 44px; font-size: 15px; }
    .legal-body h2 { font-size: 22px; margin-top: 36px; padding-top: 22px; }
    .legal-body p, .legal-list li { font-size: 16px; line-height: 1.7; }
    .legal-actions .btn { width: 100%; }
}

/* Cookie table on a phone: one card per cookie, each value under its label, nothing to scroll sideways. */
@media (max-width: 640px) {
    .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; min-width: 0; }
    .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .legal-table tr { padding: 12px 14px; border-top: 1px solid var(--line); }
    .legal-table tbody tr:first-child { border-top: 0; }
    .legal-table td { padding: 4px 0; border: 0; }
    .legal-table td::before { content: attr(data-label); display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
    .legal-table code { white-space: normal; overflow-wrap: anywhere; }
}

/* ═══ PRINT — the legal documents, clean (the PDF button) ═══ */
@page { margin: 16mm 15mm; }
@media print {
    /* ink on white whatever the theme */
    :root, :root[data-theme="light"] { color-scheme: light; --bg: #fff; --surface: #fff; --paper: #fff; --ink: #111; --text: #333; --muted: #555; --line: #ccc; --rule: #999; --red-text: #111; --bronze: #555; }
    body { display: block; min-height: 0; background: #fff !important; color: #111 !important; }
    .legal-actions, .legal-toc, #scroll-progress, .skip-link { display: none !important; }
    .wrap { padding-left: 0; padding-right: 0; }
    /* a line of air under the page header, above the label */
    .legal-head { padding: 14pt 0 1rem; gap: 6pt; }
    .legal-head .display { font-size: 24pt; }
    /* No wordmark above the title (owner, 2026-11-18: «più elegante»): the page header (mv_legal_body_end) names the document. */
    .legal-sec { padding: 0; }
    .legal-body, .legal-body.has-toc { display: block !important; max-width: 100%; padding-top: 0; }
    .legal-body h2 { font-size: 15pt; margin: 18pt 0 8pt; padding-top: 12pt; break-after: avoid; }
    .legal-body h2:first-of-type { border-top: 0 !important; padding-top: 0 !important; margin-top: 16pt !important; }
    .legal-body p, .legal-list li { font-size: 10.5pt; line-height: 1.55; }
    .legal-table-wrap { overflow: visible; border-radius: 0; }
    .legal-table { font-size: 9.5pt; min-width: 0; }
    .legal-table tr { break-inside: avoid; }
    a { color: #111 !important; text-decoration: underline; }
}
