/**
 * Frontend design tokens — single source of truth for the public site.
 * Loaded from layout before page CSS; do not redefine these in feature stylesheets.
 */

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GE SS Two';
    src: url('../assets/fonts/GE_SS_Two_Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Typography */
    --font-sans: "Archivo", "GE SS Two", "Work Sans", system-ui,
        sans-serif;

    /* Brand */
    --color-primary: #337ab7;
    --color-primary-hover: #2563a8;

    /* Text */
    --color-text: #161616;
    --color-text-muted: #6b7280;
    /* Headings / high-contrast body (home sections) */
    --color-text-strong: #040516;

    /* Surfaces & chrome */
    --color-border: #e5e7eb;
    --color-surface: #ffffff;
    --color-bg-subtle: #f9fafb;

    /* Focus / accessibility */
    --color-focus-ring: #4a90e2;

    /* Radii (prefer these over magic numbers where possible) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    /* Buttons & CTAs — consistent corners (not pills) */
    --radius-btn: 10px;

    /* Page shell — align with .frame (home) */
    --layout-max-width: 1639px;
    --layout-width: 90%;
    /* Bands like .courses-section sit slightly inside the shell */
    --layout-inner-max-width: 1480px;
}

html[lang="ar"] {
    --font-sans: "IBM Plex Sans Arabic", "GE SS Two", "Archivo", "Work Sans",
        system-ui, sans-serif;
    --font-arabic: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* Navbar — always IBM Plex Sans Arabic in Arabic (skip GE SS Two for menu text) */
html[lang="ar"] .frame-header,
html[lang="ar"] .frame-header .nav-link,
html[lang="ar"] .frame-header .dropdown-link,
html[lang="ar"] .frame-header .language-btn,
html[lang="ar"] .frame-header .language-dropdown-toggle,
html[lang="ar"] .frame-header .nav-auth-cta__btn,
html[lang="ar"] .frame-header .user-menu-btn,
html[lang="ar"] .frame-header .user-dropdown-link,
html[lang="ar"] .frame-header .site-logo-text,
body.lang-ar.dir-rtl .frame-header,
body.lang-ar.dir-rtl .frame-header .nav-link,
body.lang-ar.dir-rtl .frame-header .dropdown-link,
body.lang-ar.dir-rtl .frame-header .language-btn,
body.lang-ar.dir-rtl .frame-header .language-dropdown-toggle,
body.lang-ar.dir-rtl .frame-header .nav-auth-cta__btn,
body.lang-ar.dir-rtl .frame-header .user-menu-btn,
body.lang-ar.dir-rtl .frame-header .user-dropdown-link {
    font-family: var(--font-arabic);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
}

a {
    text-decoration: none;
}

/* Global button component (x-frontend.button) — matches template View / Download */
.fh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-btn);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        filter 0.2s ease;
    box-sizing: border-box;
    width: fit-content;
}

.fh-btn__text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fh-btn__leading {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.fh-btn__icon {
    flex-shrink: 0;
}

html:not([dir="rtl"]) .fh-btn__icon {
    transform: rotate(180deg);
}

.fh-btn--primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #2a6599 100%);
    color: #ffffff;
}

.fh-btn--primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    color: #ffffff;
}

.fh-btn--secondary {
    background: rgba(51, 122, 183, 0.1);
    color: var(--color-primary);
}

.fh-btn--secondary:hover {
    background: rgba(51, 122, 183, 0.18);
    transform: translateY(-1px);
    color: var(--color-primary);
}

.fh-btn--lg {
    padding: 14px 20px;
    font-size: 1.125rem;
    font-weight: 500;
}

.fh-btn:disabled,
.fh-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Buttons & link-style CTAs — 10px radius sitewide */
.btn-primary,
.btn-secondary,
.btn-download,
.sign-in-btn,
.nav-auth-cta__btn,
.nav-auth-cta__btn--login,
.nav-auth-cta__btn--start,
.services-cta,
.tools-cta,
.courses-cta,
.tool-link,
.read-more-btn,
.contact-submit-btn,
.course-button,
.courses-nav-prev,
.courses-nav-next,
.lang-switcher-btn,
.enroll-button,
.course-assignment-submit,
.course-user-review__submit,
.filter-toolbar__clear,
.filter-toolbar__apply,
.page-shell button[type="submit"],
.auth-modal button[type="submit"],
.auth-modal__submit,
.auth-button,
.checkout-page button[type="submit"],
.floating-chat__send,
.fh-btn {
    border-radius: var(--radius-btn);
}

/* Metronic student/admin panel (English): GE SS Two lacks Western digit glyphs */
html[lang="en"] body.admin-panel {
    --font-sans: Inter, Helvetica, "Segoe UI", Roboto, Arial, sans-serif;
    font-family: var(--font-sans);
}

html[lang="en"] body.admin-panel .fs-2hx {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
}
