/* ============================================
   MAILCRAFT — LEGAL PAGES SHARED STYLES
   (legal.css)
   Extends: style.css
   ============================================ */

/* ===== LEGAL HERO ===== */
.legal-hero {
    position: relative;
    z-index: 1;
    padding: 9rem 2rem 5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 800px 400px at 50% 100%,
            rgba(140, 140, 200, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.legal-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}

.legal-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.legal-hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 1.75rem;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.meta-chip {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
}

/* ===== LEGAL LAYOUT ===== */
.legal-main {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem 6rem;
}

.legal-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* ===== TOC SIDEBAR ===== */
.toc-sidebar {
    position: sticky;
    top: 92px;
    padding: 1.5rem;
    border-radius: 20px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-mid) transparent;
}

.toc-sidebar::-webkit-scrollbar {
    width: 4px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 4px;
}

.toc-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.toc-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 1.75rem;
}

.toc-link {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.2s var(--ease);
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.toc-link.active {
    color: var(--accent-1);
    background: rgba(180, 180, 230, 0.08);
    border-left-color: var(--accent-1);
}

/* Developer section in sidebar */
.toc-developer {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.dev-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.dev-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.dev-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dev-link svg {
    flex-shrink: 0;
}

/* ===== LEGAL CONTENT ARTICLE ===== */
.legal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== LEGAL SECTION ===== */
.legal-section {
    padding: 2rem 2.25rem;
    border-radius: 20px;
    position: relative;
    transition: border-color 0.3s;
}

.legal-section:hover {
    border-color: var(--border-mid);
}

.section-num {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.legal-h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.legal-h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.6rem;
}

.legal-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 0.85rem;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section a {
    color: var(--accent-1);
    text-decoration: none;
    border-bottom: 1px solid rgba(180, 180, 230, 0.3);
    transition: border-color 0.2s;
}

.legal-section a:hover {
    border-bottom-color: var(--accent-1);
}

/* ===== LEGAL LIST ===== */
.legal-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.75rem 0 1rem;
    padding: 0;
}

.legal-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    padding-left: 1.4rem;
    position: relative;
}

.legal-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-size: 0.8rem;
}

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

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

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-1);
    background: rgba(180, 180, 230, 0.1);
    padding: 0.1em 0.4em;
    border-radius: 5px;
    border: 1px solid rgba(180, 180, 230, 0.15);
}

/* ===== CALLOUT ===== */
.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.65;
}

.callout-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout p {
    margin: 0;
    color: inherit;
}

.callout strong {
    color: inherit;
}

.callout-info {
    background: rgba(91, 141, 238, 0.08);
    border: 1px solid rgba(91, 141, 238, 0.2);
    color: rgba(180, 200, 255, 0.85);
}

.callout-warning {
    background: rgba(232, 142, 78, 0.08);
    border: 1px solid rgba(232, 142, 78, 0.2);
    color: rgba(255, 200, 150, 0.85);
}

/* ===== INFO BOX ===== */
.info-box {
    margin: 1.25rem 0;
    border-radius: 14px;
    overflow: hidden;
}

.info-row {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-key {
    min-width: 90px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.info-val {
    color: var(--text-secondary);
}

.info-val a {
    color: var(--accent-1);
}

/* ===== LEGAL TABLE ===== */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.legal-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.legal-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-table td {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}

.legal-table tbody tr:last-child td {
    border-bottom: none;
}

.legal-table tbody tr {
    transition: background 0.15s;
}

.legal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

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

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

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

/* ===== PURPOSE GRID ===== */
.purpose-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.purpose-item {
    padding: 1.25rem;
    border-radius: 14px;
    text-align: center;
    transition: transform 0.25s var(--ease);
}

.purpose-item:hover {
    transform: translateY(-3px);
}

.purpose-icon {
    font-size: 1.75rem;
    margin-bottom: 0.6rem;
    display: block;
}

.purpose-item h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.purpose-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ===== RIGHTS GRID ===== */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.right-item {
    padding: 1.25rem;
    border-radius: 14px;
    transition: all 0.25s var(--ease);
}

.right-item:hover {
    border-color: var(--border-mid);
    transform: translateY(-2px);
}

.right-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.6rem;
}

.right-item h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.right-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        position: static;
        max-height: none;
    }

    .toc-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .toc-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.35rem 0.65rem;
    }

    .toc-link.active {
        border-left: none;
        border-bottom-color: var(--accent-1);
    }

    .purpose-grid,
    .rights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .legal-section {
        padding: 1.5rem 1.25rem;
    }

    .purpose-grid,
    .rights-grid {
        grid-template-columns: 1fr;
    }

    .legal-table {
        display: block;
        overflow-x: auto;
    }

    .legal-hero {
        padding: 8rem 1.5rem 3.5rem;
    }

    .toc-developer {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
    }
}