/* Explain: Styles for typography, text wrapping, and visual balance. */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--background-color);
}

body {
    min-width: 320px;
    overflow-x: clip;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, var(--body-glow), transparent 62%),
        radial-gradient(circle at 12% 6%, rgba(43, 48, 55, 0.05), transparent 32rem),
        radial-gradient(circle at 88% 74%, rgba(43, 48, 55, 0.045), transparent 36rem),
        linear-gradient(180deg, #fbfbfc, var(--background-color) 32%),
        var(--background-color);
}

html,
body,
button,
input,
textarea,
select,
optgroup,
option,
label,
small,
strong,
em,
p,
a,
li,
span,
blockquote,
figcaption,
summary {
    font-family: var(--font-body);
}

/* فرض خط الموقع المعتمد على عناصر الواجهة الجاهزة والحقول في جميع الصفحات */
.btn,
.btn-square,
.input,
.select,
.textarea,
.file-input,
.checkbox,
.radio,
.toggle,
.tab,
.menu,
.card,
.modal-box,
.dropdown-content {
    font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-font {
    font-family: var(--font-heading);
    text-wrap: balance;
}

.brand-font {
    font-family: var(--font-brand);
    letter-spacing: 0.14em;
}

/* ===== توازن النص: توزيع الكلمات على الأسطر بالتساوي ومنع الأسطر المفردة اليتيمة ===== */

.section-head-title,
.hero-title,
.hero-lead,
.stat-value,
.section-kicker,
.gallery-caption,
.gallery-modal-caption,
.ticker-item,
.faq-summary,
.btn,
.chat-panel-title,
.chat-bubble {
    text-wrap: balance;
}

/* العناوين والوصف القصير أعلى الأقسام يظهر متوازناً على الأسطر */
.section-head p {
    text-wrap: balance;
}

/* الفقرات والنصوص الطويلة توزّع كلماتها بسلاسة وتتجنب سطراً أخيراً بكلمة واحدة */
p,
li,
blockquote,
figcaption,
summary,
label,
dd,
dt {
    text-wrap: pretty;
}

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

a,
button,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 0.35rem;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== وضوح النصوص الثانوية: حجم أكبر قليلاً للوصف والتلميحات لتبقى مقروءة بسهولة ===== */

.text-xs {
    font-size: 0.8125rem;
}

.text-sm {
    font-size: 0.9375rem;
}