/* OJETIMOR legal pages: privacy, terms, delete-account, support (every language).
   Loaded after styles.css; only styles the reading column, the language bar and the legal text. */

.legal-page {
    background: var(--paper);
}

.legal-main {
    padding: 132px 0 100px;
}

.legal-wrap {
    width: min(720px, calc(100% - 32px));
    margin-inline: auto;
}

/* Language bar: plain links, the current language filled */
.legal-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 44px;
}

.legal-langs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    color: #34463e;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.legal-langs a:hover {
    color: var(--green-900);
    border-color: rgba(7, 83, 49, 0.35);
}

.legal-langs a[aria-current="page"] {
    color: var(--white);
    background: var(--green-800);
    border-color: var(--green-800);
}

/* The legal text */
.legal-content {
    color: #2b3b33;
    font-size: 1.02rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.legal-content h1 {
    margin: 0 0 14px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 7vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.legal-content h2 {
    margin: 46px 0 12px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.legal-content h3 {
    margin: 30px 0 12px;
    color: var(--green-800);
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.legal-content h4 {
    margin: 24px 0 8px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
}

.legal-content p {
    margin: 0 0 16px;
}

.legal-content ul {
    margin: 0 0 20px;
    padding-left: 1.3em;
}

.legal-content li {
    margin: 0 0 8px;
    padding-left: 0.2em;
}

.legal-content li::marker {
    color: var(--orange-500);
}

.legal-content strong {
    color: var(--ink);
    font-weight: 700;
}

.legal-content a {
    color: var(--green-800);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.legal-content a:hover {
    color: var(--green-950);
}

/* Tables: the box scrolls sideways inside itself if a row cannot fit; the page never does */
.table-scroll {
    max-width: 100%;
    margin: 0 0 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-content th,
.legal-content td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--line);
}

.legal-content tr:first-child th,
.legal-content tr:first-child td {
    border-top: 0;
}

.legal-content th {
    width: 36%;
    color: var(--ink);
    font-weight: 700;
}

.legal-content td {
    color: #3d4c45;
}

/* The one link that leaves for the app (delete-account: sign in to delete) reads as a button */
.legal-content a[href^="https://ojetimor.asia/"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin: 8px 0;
    padding: 0 26px;
    color: var(--white);
    background: var(--orange-500);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(241, 79, 24, 0.22);
    font-family: var(--font-display);
    font-weight: 800;
    text-decoration: none;
}

.legal-content a[href^="https://ojetimor.asia/"]:hover {
    color: var(--white);
    background: var(--orange-600);
}

/* Chinese pages: keep DM Sans for Latin, then a CJK system font; no tight tracking on CJK headings */
html[lang^="zh"] body {
    font-family: "DM Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html[lang^="zh"] .legal-content h1,
html[lang^="zh"] .legal-content h2,
html[lang^="zh"] .legal-content h3 {
    font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    letter-spacing: 0;
}

@media (max-width: 640px) {
    .legal-main {
        padding: 104px 0 72px;
    }

    .legal-langs {
        margin-bottom: 34px;
    }

    .legal-content {
        font-size: 1rem;
    }

    .legal-content h2 {
        margin-top: 38px;
        font-size: 1.2rem;
    }

    .legal-content th,
    .legal-content td {
        padding: 12px 12px;
    }

    .legal-content table {
        font-size: 0.9rem;
    }
}
