/* ==========================================================================
   LEGAL PAGES — styling for markdown-rendered LegalPage content
   Scope: /impressum/, /datenschutz/, /tos/, /widerruf/
   Source of the HTML: manage.py sync_legal_pages (docs/legal/*.md)

   Color note: .tw-card is white in EVERY theme (only the app chrome is
   themed), so all ink here is pinned to the light-surface palette. Theme
   variables like --theme-card-text are light in the dark themes and would
   vanish on the white card — do not use them here.
   ========================================================================== */

.legal-page-card {
    padding: 2rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.legal-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.legal-page-content {
    color: #1f2937;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 75ch;
}

.legal-page-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e5e7eb;
}

.legal-page-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 0.5rem;
}

.legal-page-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 1.25rem 0 0.4rem;
}

.legal-page-content p {
    margin: 0 0 0.85rem;
    text-wrap: pretty;
}

.legal-page-content ul,
.legal-page-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.legal-page-content ul {
    list-style: disc;
}

.legal-page-content ol {
    list-style: decimal;
}

.legal-page-content li {
    margin-bottom: 0.3rem;
}

.legal-page-content a,
.legal-page-content a:visited {
    color: #0062cc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-page-content a:hover,
.legal-page-content a:active {
    color: #004a99;
}

.legal-page-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* Address blocks and the model withdrawal form */
.legal-page-content blockquote {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
}

.legal-page-content blockquote p {
    margin-bottom: 0.35rem;
}

.legal-page-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Tables (cookie inventory, sub-processors, retention periods, …) — wide
   tables scroll inside the card instead of overflowing the page. */
.legal-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
}

.legal-page-content th,
.legal-page-content td {
    border: 1px solid #e5e7eb;
    padding: 0.45rem 0.65rem;
    text-align: left;
    vertical-align: top;
    color: #1f2937;
}

.legal-page-content th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

/* Markdown label/value tables use an empty `| | |` header row — hide it
   instead of rendering an empty header bar. */
.legal-page-content thead tr:not(:has(th:not(:empty))) {
    display: none;
}

.legal-page-content code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.85em;
    color: #1f2937;
}

.legal-page-content strong {
    color: #111827;
    font-weight: 600;
}

.legal-page-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0;
}

.legal-page-divider {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border: 0;
    border-top: 1px solid #e5e7eb;
}
