/* Explain: Base styles, resets, and global typography defaults for consistent reading. */
* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    color: var(--text-color);
    scroll-padding-top: 104px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: var(--leading-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-heading);
    text-wrap: balance;
}

p {
    margin: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button,
a,
select {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
    filter: brightness(1.07) saturate(1.08) contrast(0.97);
}

::selection {
    background: var(--primary-color);
    color: #ffffff;
}

/* ===== نظام الخطوط الموحّد ===== */
/* نصوص صغيرة: مقاس أوضح وارتفاع سطر مريح للقراءة بالعربية */
.text-xs {
    font-size: var(--text-xs-size);
    line-height: 1.7;
}

.text-sm {
    font-size: var(--text-sm-size);
    line-height: 1.8;
}

/* الجوال: تكبير طفيف لمقاسات النصوص الأساسية وتحسين التباعد */
@media (max-width: 640px) {
    body {
        line-height: 1.9;
    }

    .text-xs {
        font-size: 0.85rem;
        line-height: 1.75;
    }

    .text-sm {
        font-size: 0.975rem;
        line-height: 1.85;
    }

    .text-base {
        font-size: var(--text-base-size);
        line-height: 1.9;
    }

    .text-lg {
        line-height: 1.75;
    }
}

/* النص العربي متّصل الحروف: تباعد الحروف يقطعه، لذلك نعطّله في الواجهة العربية */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    letter-spacing: normal;
}

html[dir="rtl"] .tracking-tight,
html[dir="rtl"] .tracking-wide,
html[dir="rtl"] .tracking-wider,
html[dir="rtl"] .tracking-widest,
html[dir="rtl"] .section-kicker {
    letter-spacing: normal;
}