/* ============================================
   LEGAL PAGES - Styles for legal document pages
   ============================================ */

body.legal-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #050505;
    justify-content: flex-start;
    align-items: stretch;
}

/* Header / Logo bar */
.legal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-header-content {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.legal-header-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.legal-header-logo:hover {
    opacity: 0.8;
}

.legal-header-logo .bonk {
    color: var(--accent);
    text-shadow: 0 0 30px rgba(204, 255, 0, 0.4);
}

.legal-header-back {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Karla', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-header-back:hover {
    color: var(--accent);
}

.legal-header-back svg {
    width: 16px;
    height: 16px;
}

/* Main content area */
.legal-content {
    flex: 1;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

/* Markdown rendered content */
.legal-content h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.legal-content h1 + p {
    margin-top: 0;
}

.legal-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-content h3 {
    font-family: 'Karla', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.8rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-content em {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}

.legal-content ul,
.legal-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    color: var(--text-secondary);
}

.legal-content li {
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 0.4rem;
}

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

.legal-content a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.legal-content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.legal-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2rem 0;
}

/* Loading state */
.legal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    color: var(--text-secondary);
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
}

.legal-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: legal-spin 0.8s linear infinite;
    margin-right: 0.75rem;
}

@keyframes legal-spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.legal-error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.legal-error h2 {
    border: none;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .legal-header {
        padding: 0.85rem 1.25rem;
    }

    .legal-header-logo {
        font-size: 1.3rem;
    }

    .legal-content {
        padding: 2rem 1.25rem 3rem;
    }

    .legal-content h1 {
        font-size: 1.7rem;
    }

    .legal-content h2 {
        font-size: 1.25rem;
        margin-top: 2rem;
    }

    .legal-content p,
    .legal-content li {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .legal-header {
        padding: 0.75rem 1rem;
    }

    .legal-header-logo {
        font-size: 1.15rem;
    }

    .legal-header-back span {
        display: none;
    }

    .legal-content {
        padding: 1.5rem 1rem 2.5rem;
    }

    .legal-content h1 {
        font-size: 1.5rem;
    }

    .legal-content h2 {
        font-size: 1.15rem;
    }
}
