/* ============================================
   PRIVACY POLICY / LEGAL PAGES STYLES
   ============================================ */

.legal-page {
    background: var(--color-bg-light);
    min-height: 100vh;
}

.legal-container {
    max-width: 50rem;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-link);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: opacity 0.2s ease;
}

/* A 44px tap target on phones without moving the text: the box grows by the
   same amount at the top (negative margin) and loses it at the bottom. */
@media (max-width: 768px) {
    .back-link {
        min-height: 2.75rem;
        margin-top: -0.75rem;
        margin-bottom: 1.1875rem;
    }
}

.back-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.back-link svg {
    width: 1rem;
    height: 1rem;
}

/* Page Title */
.legal-title {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-link);
    text-align: center;
    margin-bottom: 1rem;
    /* One long word (German Nutzungsbedingungen, Teilnahmebedingungen,
       Datenschutzerklaerung; Russian konfidencial'nosti) is wider than a phone
       screen at this size and pushed the page sideways. Break it rather than the
       layout; the phone rule below hyphenates it first (the pages carry lang).
       test/css/overflow.test.js guards this. */
    overflow-wrap: anywhere;
}

/* Last Updated */
.last-updated {
    text-align: center;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-text-gray);
    font-style: italic;
    margin-bottom: 3rem;
}

/* Content Sections */
.legal-content {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--color-text-dark);
}

.legal-content h2 {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-link);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg-blue);
}

.legal-content h3 {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content h4 {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    margin-bottom: 1rem;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.legal-content li::marker {
    color: var(--color-link);
}

.legal-content strong {
    color: var(--color-text-dark);
    font-weight: 600;
}

.legal-content a {
    color: var(--color-link);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.legal-content a:hover {
    opacity: 0.8;
}

/* Contact Section */
.legal-contact {
    background: var(--color-bg-blue);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.legal-contact p {
    margin-bottom: 0.5rem;
}

.legal-contact p:last-child {
    margin-bottom: 0;
}

/* Safety warning callout (EULA section 4). Amber rather than the contact
   blue so the disclaimer reads as a warning, not as supporting info. */
.legal-warning {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning-text);
}

.legal-warning a {
    color: inherit;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .legal-container {
        padding: 2rem 1.5rem 3rem;
    }

    .legal-title {
        font-size: 2rem;
        hyphens: auto;
    }

    .legal-content h2 {
        font-size: 1.25rem;
    }

    .legal-content h3 {
        font-size: 1.125rem;
    }
}

/* RTL Support */
/* The chevron comes first in the markup, so under RTL it already sits at the
   right-hand (start) edge; it only has to point right, the way "back" goes. */
[dir="rtl"] .back-link svg {
    transform: scaleX(-1);
}

[dir="rtl"] .legal-content ul {
    padding-left: 0;
    padding-right: 1.5rem;
}
