/* =========================================================
   Nekoh.it — Pagine legali (/privacy, /cookie-policy)
   Complemento di style.css: riusa shell, panel e token del design system e
   aggiunge solo quello che un documento lungo richiede e che il sito non
   aveva ancora — indice ancorato, gerarchia dei titoli, tabelle dei cookie.
   ========================================================= */

.legal-shell {
    width: min(920px, 100%);
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.legal-meta strong {
    color: var(--text-secondary);
    font-weight: 700;
}

/* ---------- Indice ---------- */

.legal-toc ol {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.legal-toc a {
    color: var(--accent-text);
    text-decoration: none;
}

.legal-toc a:hover {
    text-decoration: underline;
}

/* ---------- Corpo del documento ---------- */

.legal-body {
    display: grid;
    gap: 30px;
}

.legal-section {
    /* L'ancora finisce sotto la topbar sticky senza questo margine di scroll. */
    scroll-margin-top: 90px;
}

.legal-section h2 {
    margin: 0 0 10px;
    font-size: 1.22rem;
    line-height: 1.3;
}

.legal-section h3 {
    margin: 20px 0 8px;
    font-size: 1.02rem;
    color: var(--text-primary);
}

.legal-section p,
.legal-section li {
    color: var(--text-secondary);
    line-height: 1.68;
}

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

.legal-section ul,
.legal-section ol {
    margin: 0 0 12px;
    padding-left: 22px;
    display: grid;
    gap: 8px;
}

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

.legal-section strong {
    color: var(--text-primary);
}

/* ---------- Tabelle dei cookie ----------
   Su schermo stretto la tabella non si comprime: scorre dentro il proprio
   contenitore, cosi' la pagina non guadagna una barra orizzontale. */
.legal-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin: 0 0 12px;
}

.legal-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    line-height: 1.5;
}

.legal-table thead th {
    background: var(--surface-inset);
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
}

.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td {
    border-bottom: 0;
}

.legal-table code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-primary);
}

/* ---------- Riquadro d'attenzione ---------- */

.legal-callout {
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--warning-border);
    background: var(--warning-soft);
}

.legal-callout p {
    margin: 0;
    color: var(--text-secondary);
}

.legal-callout p + p {
    margin-top: 8px;
}

/* ---------- Footer compatto delle pagine legali ---------- */

.legal-footer {
    width: min(920px, 100%);
    margin: 26px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.legal-footer a,
.legal-footer button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.legal-footer a:hover,
.legal-footer button:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .legal-section h2 {
        font-size: 1.1rem;
    }
}
