/* خط ثمانية من ملفات مشروع icontech////يي
   Sans: 400 عادي · 500 متوسط · 700 عريض
   Serif Display: 700 عريض · 900 أسود
   Serif Text: 400 عادي */

@font-face {
    font-family: "Thmanyah Sans";
    src: url("/fonts/thmanyah/thmanyah-sans-Regular.woff2") format("woff2");
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Thmanyah Sans";
    src: url("/fonts/thmanyah/thmanyah-sans-Medium.woff2") format("woff2");
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Thmanyah Sans";
    src: url("/fonts/thmanyah/thmanyah-sans-Bold.woff2") format("woff2");
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Thmanyah Serif Display";
    src: url("/fonts/thmanyah/thmanyah-serif-display-Bold.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Thmanyah Serif Display";
    src: url("/fonts/thmanyah/thmanyah-serif-display-Black.woff2") format("woff2");
    font-weight: 800 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Thmanyah Serif Text";
    src: url("/fonts/thmanyah/thmanyah-serif-text-Regular.woff2") format("woff2");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-sans: "Thmanyah Sans", "Cairo", system-ui, sans-serif;
    --font-display: "Thmanyah Serif Display", "Thmanyah Sans", "Cairo", serif;
    --font-text: "Thmanyah Serif Text", "Thmanyah Sans", "Cairo", serif;
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-sans) !important;
    font-weight: 400;
    font-synthesis: none;
}

h1,
h2,
.text-3xl,
.text-4xl,
.text-5xl {
    font-family: var(--font-display) !important;
}

p,
li {
    font-family: var(--font-text);
}

.font-light { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-medium,
.font-semibold { font-weight: 500 !important; }
.font-bold,
strong,
b { font-weight: 700 !important; }
.font-extrabold,
.font-black { font-weight: 900 !important; }

h1 { font-weight: 900; }
h2 { font-weight: 700; }
h3,
h4 { font-weight: 700; }

.font-mono,
.mono,
code,
kbd,
pre {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-weight: 500;
}

/* استجابة الموبايل: منع كسر العناوين القصيرة والأزرار الأساسية */
@media (max-width: 639px) {
    .site-header-cta {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mobile-text-balance {
        text-wrap: balance;
    }
}

@media (max-width: 380px) {
    .site-header-cta {
        padding-inline: 0.625rem;
        font-size: 0.6875rem;
    }
}

.scrollbar-none { scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ============================================================
   توافق الموبيل — قواعد عامة لا تُخفي أي محتوى
   ============================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img, video, canvas { max-width: 100%; }
a, button, [role="button"], label, select, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* حاوية الجداول التي يضيفها mobile.js: تمرير أفقي بدل قص البيانات */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.overflow-x-auto { -webkit-overflow-scrolling: touch; }

@media (max-width: 767px) {
    /* iOS يكبّر الصفحة تلقائيًا عند التركيز على حقل أقل من 16px */
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    /* أهداف لمس مريحة لأزرار النماذج ولقوائم التنقل */
    form button:not(.no-touch-size),
    form [type="submit"],
    nav a {
        min-height: 40px;
    }

    /* الجداول داخل حاويات التمرير: لا تنكمش أعمدتها حتى لا يتكسر النص رأسيًا */
    .overflow-x-auto > table:not(.table-stack):has(thead th:nth-child(5)),
    .table-scroll > table:not(.table-stack):has(thead th:nth-child(5)) {
        min-width: 640px;
    }

    /* جدول بصيغة بطاقات: كل صف بطاقة، وكل خلية تظهر بعنوان عمودها (العناوين تُنسخ من الرأس بواسطة mobile.js) */
    table.table-stack,
    table.table-stack tbody,
    table.table-stack tr,
    table.table-stack td {
        display: block;
        width: 100%;
    }
    table.table-stack thead {
        position: absolute;
        width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    table.table-stack tbody > tr {
        padding: 0.375rem 0;
    }
    table.table-stack tbody > tr + tr {
        border-top: 8px solid #f1f5f9;
    }
    table.table-stack td {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.375rem 1rem !important;
        border: 0;
        text-align: right;
        white-space: normal !important;
    }
    table.table-stack td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        flex: 0 0 34%;
        max-width: 34%;
        font-family: var(--font-sans) !important;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: normal;
        text-transform: none;
        color: #64748b;
        line-height: 1.6;
    }
    table.table-stack td > .stack-v {
        flex: 1 1 auto;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    table.table-stack td[colspan] { display: block; }

    /* مسافة آمنة أسفل الصفحة على الأجهزة ذات الحواف (iPhone) */
    body { padding-bottom: env(safe-area-inset-bottom); }

    /* الحوارات والنوافذ المنبثقة داخل حدود الشاشة */
    [role="dialog"] { max-height: 100dvh; overflow-y: auto; }
}
