/* typography.css — the one type system, for both locales.
 *
 * Loaded site-wide from components/layout/default.blade.php straight after the
 * locale sheet (style.css for Arabic, en.css for English), so the tokens below
 * exist on every page and the role rules sit above the legacy base.
 *
 * HOW IT WORKS
 *   - Every text role has ONE size, weight and leading, declared once with the
 *     tokens in :root. A class whose rules live in the legacy base
 *     (style.css / en.css) gets its role HERE. A class that belongs to a single
 *     component sheet (news-section.css, opportunities-section.css, ...) gets
 *     its role THERE, with the same tokens.
 *   - The legacy base no longer declares font-size / font-weight / line-height
 *     for any of these classes. Do not add them back; change the token.
 *   - SomarSans ships two cuts, Regular (400) and Bold (700). Nothing may ask
 *     for 500, 600 or 800 — `font-synthesis: none` below makes a faux weight
 *     impossible, so a stray value simply snaps to the nearest real cut.
 *   - Arabic is a joined script: letter-spacing pulls the letters apart.
 *     style.css (Arabic) carries none; the shared sheets scope theirs to
 *     [dir="ltr"].
 */

:root {
    --font-ui: "SomarSans", "Almarai", "Segoe UI", Tahoma, Arial, sans-serif;

    /* sizes */
    --t-meta: .8125rem;      /* dates, tags, issuers, faculty position */
    --t-label: .875rem;      /* buttons, nav, filters, section kicker */
    --t-body: 1rem;          /* all running text */
    --t-lead: 1.125rem;      /* hero paragraph */
    --t-card: 1.125rem;      /* card / item titles */
    --t-feature: 1.375rem;   /* featured news, opportunity, why-choose-us point */
    --t-section: clamp(1.75rem, 1.25rem + 1.4vw, 2.375rem); /* every .ul-section-title */
    --t-display: clamp(2.5rem, 1.6rem + 3vw, 4rem);         /* .ul-banner-title */
    --t-stat: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);         /* .ul-stat-number */

    /* leading */
    --lh-body: 1.85;
    --lh-ui: 1.5;
    --lh-heading: 1.45;
    --lh-display: 1.3;
}

/* ------------------------------------------------------------------ base */

html {
    font-synthesis: none;
}

body {
    font-family: var(--font-ui);
    font-size: var(--t-body);
    line-height: var(--lh-body);
    overflow-wrap: break-word;
}

::selection {
    background: #febe35;
    color: #0b254e;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-ui);
    /* Bootstrap's 500 is not a cut this font has. */
    font-weight: 700;
    line-height: var(--lh-heading);
    text-wrap: balance;
    overflow-wrap: break-word;
}

p {
    line-height: var(--lh-body);
    text-wrap: pretty;
}

/* UI text sits tighter than prose. `line-height: 1` on a button clips the
   dots above and below Arabic letters, so nothing goes below the UI leading. */
button, input, select, textarea,
.btn, .ul-btn {
    font-family: inherit;
    line-height: var(--lh-ui);
}

.ul-btn {
    letter-spacing: normal;
}

/* Bootstrap utilities that name weights the font does not have. */
.fw-medium { font-weight: 400; }
.fw-semibold, .fw-bold, .fw-bolder, b, strong { font-weight: 700; }

/* ---------------------------------------------------------------- roles */
/* Classes whose rules live in the legacy base (style.css / en.css). */

/* section */
.ul-section-title {
    font-size: var(--t-section);
    font-weight: 700;
    line-height: var(--lh-heading);
    letter-spacing: normal;
    text-wrap: balance;
}

/* kicker */
.ul-section-sub-title {
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
}

/* body */
.ul-2-about-descr,
.ul-why-choose-us-descr,
.ul-resource-description,
.ul-footer-about-txt,
.ul-mobile-app-content p {
    font-size: var(--t-body);
    line-height: var(--lh-body);
    max-width: 65ch;
    text-wrap: pretty;
}

/* The resource card clamps its description to two lines with a max-height
   written in em; it follows the body leading so the second line still fits. */
.ul-resource-description {
    max-height: calc(2em * var(--lh-body));
}

/* feature */
.ul-why-choose-us-point-title {
    font-size: var(--t-feature);
    font-weight: 700;
    line-height: var(--lh-heading);
    letter-spacing: normal;
}

/* card */
.ul-resource-title,
.ul-faculty-name,
.ul-footer-widget-title,
.ul-mobile-app-content h4 {
    font-size: var(--t-card);
    font-weight: 700;
    line-height: var(--lh-heading);
    letter-spacing: normal;
}

/* stat */
.ul-stat-number {
    font-size: var(--t-stat);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: normal;
    font-variant-numeric: tabular-nums;
}

/* meta */
.ul-faculty-position,
.download-text {
    font-size: var(--t-meta);
    line-height: var(--lh-ui);
    letter-spacing: normal;
}

.ul-faculty-position {
    font-weight: 700;
}

/* The activity cards went down to 10–11px on a phone. */
.ul-activity-category,
.ul-activity-location {
    font-size: var(--t-meta);
    line-height: var(--lh-ui);
}

.ul-activity-description {
    font-size: var(--t-label);
    line-height: var(--lh-ui);
}

/* label */
.download-store {
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
}
