/**
 * @file    legal-v3.css
 * @module  Pages
 * @version 3.0.0 — V3 design system
 * @desc    Styles for /privacy, /terms, /regulamin-tworcow legal documents.
 *          Uses --ds-* tokens for full design-system coherence.
 *          Keeps original .legal / .legal__* class names so content blocks
 *          from v1 templates remain identical — only the CSS layer changes.
 */

.legal {
    max-width: var(--ds-container-narrow);
    margin: 0 auto;
    padding: var(--ds-space-7) var(--ds-space-4) var(--ds-space-9);
    color: var(--ds-text);
}

/* ── Header ──────────────────────────── */
.legal__header {
    text-align: center;
    margin-bottom: var(--ds-space-7);
    padding-bottom: var(--ds-space-5);
    position: relative;
}

/* Sygnet rainbow accent under the header */
.legal__header::after {
    content: "";
    display: block;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 160px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        var(--ds-brand-red) 0%,
        var(--ds-brand-orange) 20%,
        var(--ds-brand-yellow) 40%,
        var(--ds-brand-green) 60%,
        var(--ds-brand-blue) 80%,
        var(--ds-brand-purple) 100%
    );
}

.legal__title {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ds-text);
    margin: 0 0 var(--ds-space-2);
}

.legal__subtitle {
    font-size: 16px;
    color: var(--ds-text-soft);
    margin: 0 0 var(--ds-space-3);
}

.legal__date {
    font-size: 13px;
    color: var(--ds-text-muted);
    font-style: italic;
    margin: 0;
}

/* ── Body ────────────────────────────── */
.legal__body {
    line-height: 1.7;
    color: var(--ds-text);
}

.legal__body h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--ds-accent);
    margin: var(--ds-space-7) 0 var(--ds-space-4);
    padding-top: var(--ds-space-4);
    border-top: 1px solid var(--ds-border);
    letter-spacing: -0.01em;
}

.legal__body h1:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.legal__body h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ds-accent);
    margin: var(--ds-space-6) 0 var(--ds-space-2);
}

.legal__body h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-text);
    margin: var(--ds-space-5) 0 var(--ds-space-2);
}

.legal__body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ds-text-soft);
    margin: 0 0 var(--ds-space-3);
    text-align: justify;
    hyphens: auto;
}

.legal__body ul,
.legal__body ol {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ds-text-soft);
    margin: 0 0 var(--ds-space-3);
    padding-left: var(--ds-space-6);
}

.legal__body li {
    margin-bottom: var(--ds-space-1);
}

/* Nested paragraphs in list items — drop tight spacing */
.legal__body li p {
    margin: 0 0 var(--ds-space-1);
    text-align: left;
    hyphens: none;
}

/* ── Tables ──────────────────────────── */
.legal__body table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--ds-space-4) 0 var(--ds-space-5);
    font-size: 13px;
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}

.legal__body th,
.legal__body td {
    padding: var(--ds-space-3) var(--ds-space-4);
    border-bottom: 1px solid var(--ds-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
    color: var(--ds-text-soft);
}

.legal__body th {
    background: rgba(var(--ds-accent-rgb), 0.06);
    font-weight: 700;
    color: var(--ds-text);
    border-bottom: 2px solid var(--ds-border-strong);
}

.legal__body tr:last-child td {
    border-bottom: none;
}

.legal__body tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.02);
}

/* ── Strong / emphasis ───────────────── */
.legal__body strong {
    color: var(--ds-text);
    font-weight: 600;
}

/* ── Links (e.g. email, URLs) ────────── */
.legal__body a {
    color: var(--ds-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.legal__body a:hover {
    opacity: 0.8;
}

/* ── Footer (creator-terms cross-links) ── */
.legal__footer {
    margin-top: var(--ds-space-7);
    padding-top: var(--ds-space-5);
    border-top: 1px solid var(--ds-border);
    text-align: center;
    font-size: 13px;
    color: var(--ds-text-soft);
}

.legal__footer p {
    margin: 0 0 var(--ds-space-2);
}

.legal__footer a {
    color: var(--ds-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Responsive ──────────────────────── */
@media (max-width: 640px) {
    .legal {
        padding: var(--ds-space-5) var(--ds-space-3) var(--ds-space-7);
    }
    .legal__title { font-size: 24px; }
    .legal__body h1 { font-size: 18px; }
    .legal__body h2 { font-size: 16px; }
    .legal__body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .legal__body p { text-align: left; hyphens: none; }
}
