@import url("fonts.css");
@import url("global-shell.css");

/* =========================================================
   Mac Winsoft Legal Pages
   Shared layout for English and Arabic privacy and terms pages.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
    color-scheme: light;
    --page-background: #ffffff;
    --bar-background: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: #d2d2d7;
    --link: #0066cc;
    --content-width: 980px;
    --reading-width: 760px;
}

/* ---------- Document foundation ---------- */
* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page-background);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    background: var(--page-background);
    font-family:
        "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial,
        sans-serif;
    font-size: 17px;
    line-height: 1.58;
    -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
    font-family:
        "SF Arabic", "SF Pro AR", "Geeza Pro", Tahoma, Arial, sans-serif;
    font-optical-sizing: auto;
    line-height: 1.8;
}

a {
    color: var(--link);
    text-underline-offset: 0.16em;
}

a:hover {
    text-decoration-thickness: 2px;
}

a:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(0, 125, 250, 0.42);
    outline-offset: 4px;
}

/* ---------- Accessibility ---------- */
.skip-link {
    position: fixed;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    z-index: 50;
    padding: 10px 14px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--text-primary);
    text-decoration: none;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ---------- Product header and legal navigation ---------- */
.legal-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
}

.legal-header__inner {
    width: min(var(--content-width), calc(100% - 44px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.product-name {
    color: var(--text-primary);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.025em;
    text-decoration: none;
}

html[lang="ar"] .product-name {
    letter-spacing: 0;
}

.legal-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 15px;
    white-space: nowrap;
}

.legal-nav a {
    color: var(--text-primary);
    text-decoration: none;
}

.legal-nav a:hover {
    color: var(--link);
}

.legal-nav a[aria-current="page"] {
    color: var(--text-secondary);
    pointer-events: none;
}

/* ---------- Language selection bar ---------- */
.language-bar {
    background: var(--bar-background);
}

.language-nav {
    width: min(var(--content-width), calc(100% - 44px));
    min-height: 112px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 600;
}

.language-nav__globe {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 2px solid var(--link);
    border-radius: 50%;
}

.language-nav__globe::before,
.language-nav__globe::after {
    content: "";
    position: absolute;
    inset: 5px 12px;
    border-inline: 1.5px solid var(--link);
    border-radius: 50%;
}

.language-nav__globe::after {
    inset: 19px 3px auto;
    height: 1.5px;
    border: 0;
    background: var(--link);
}

.language-nav__text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.25em;
}

.language-nav a {
    text-decoration: none;
}

.language-nav a:hover {
    text-decoration: underline;
}

/* ---------- Legal document ---------- */
.legal-main {
    width: min(var(--reading-width), calc(100% - 44px));
    margin: 0 auto;
    padding: 76px 0 96px;
}

.document-heading {
    margin-bottom: 58px;
}

.document-heading h1 {
    margin: 0 0 14px;
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

html[lang="ar"] .document-heading h1 {
    letter-spacing: 0;
}

.document-product {
    margin: 0 0 2px;
    font-size: 22px;
    font-weight: 600;
}

.last-updated {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.document-intro {
    margin-bottom: 52px;
    font-size: 19px;
}

.legal-copy section {
    margin-top: 52px;
    scroll-margin-top: 28px;
}

.legal-copy h2 {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

html[lang="ar"] .legal-copy h2 {
    letter-spacing: 0;
}

.legal-copy p {
    margin: 0 0 18px;
}

.legal-copy ul {
    margin: 4px 0 22px;
    padding-inline-start: 24px;
}

.legal-copy li {
    margin-bottom: 8px;
    padding-inline-start: 4px;
}

.document-footer {
    margin-top: 72px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---------- Responsive layout ---------- */
@media (max-width: 700px) {
    .legal-header__inner {
        width: min(100% - 32px, var(--content-width));
        min-height: auto;
        padding: 17px 0 15px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .product-name {
        font-size: 23px;
    }

    .legal-nav {
        width: 100%;
        gap: 22px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .language-nav,
    .legal-main {
        width: min(100% - 32px, var(--content-width));
    }

    .language-nav {
        min-height: 96px;
        justify-content: flex-start;
        gap: 13px;
        font-size: 19px;
    }

    .language-nav__globe {
        width: 34px;
        height: 34px;
    }

    .language-nav__globe::before {
        inset: 4px 10px;
    }

    .language-nav__globe::after {
        inset-block-start: 15px;
    }

    .legal-main {
        padding: 52px 0 64px;
    }

    .document-heading {
        margin-bottom: 42px;
    }

    .document-intro {
        margin-bottom: 42px;
        font-size: 18px;
    }

    .legal-copy section {
        margin-top: 42px;
    }

    .legal-copy h2 {
        font-size: 24px;
    }
}

/* ---------- Reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
