/*
 * Manarah typography system
 *
 * The platform intentionally has two text families only:
 * - Alexandria for display and heading content.
 * - IBM Plex Sans Arabic for reading and interface content.
 * Icon fonts and code samples keep their functional font faces.
 */

@font-face {
  font-family: "Alexandria";
  src: url("../fonts/manarah/Alexandria-Arabic-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Alexandria";
  src: url("../fonts/manarah/Alexandria-Latin-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Arabic-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Latin-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Arabic-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Latin-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Arabic-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Latin-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Arabic-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../fonts/manarah/IBMPlexSansArabic-Latin-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root,
html.fonts-ready {
  --font-heading: "Alexandria", sans-serif;
  --font-ui: "IBM Plex Sans Arabic", sans-serif;
  --font-arabic: var(--font-ui) !important;
  --font-latin: var(--font-ui) !important;
  --font-system: var(--font-ui) !important;
  --font-main: var(--font-ui) !important;
  --bs-font-sans-serif: var(--font-ui) !important;
  --bs-body-font-family: var(--font-ui) !important;

  --type-body-size: 1rem;
  --type-body-leading: 1.78;
  --type-heading-leading: 1.38;
  --type-secondary-size: 0.875rem;
}

html {
  font-synthesis: none;
}

body,
button,
input,
select,
textarea:not(.code-editor),
.btn,
.form-control,
.form-select,
.navbar,
.nav,
.dropdown-menu,
.table,
.alert,
.toast,
.modal,
.offcanvas,
.footer,
.manarah-assistant-root {
  font-family: var(--font-ui) !important;
}

/* The learning player ships a legacy page-specific font declaration. Keep
   its text on the platform UI face while the heading rules below take over
   its lesson and card titles. */
.learn-page,
.learn-page :is(p, span, a, li, label, button, input, select, textarea, .btn, .lesson-summary, .lesson-meta-chip) {
  font-family: var(--font-ui) !important;
}

body {
  font-size: var(--type-body-size);
  font-weight: 400;
  line-height: var(--type-body-leading);
  letter-spacing: normal;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6,
.card-title,
.modal-title,
.offcanvas-title,
.section-title,
.course-title,
.product-title,
.article-title,
.manarah-brand-title {
  font-family: var(--font-heading) !important;
  line-height: var(--type-heading-leading);
  letter-spacing: normal !important;
  overflow-wrap: anywhere;
}

h1,
.h1 {
  font-size: clamp(2rem, 1.7rem + 1.2vw, 2.5rem);
  font-weight: 700;
}

h2,
.h2 {
  font-size: clamp(1.625rem, 1.4rem + 0.8vw, 2rem);
  font-weight: 700;
}

h3,
.h3 {
  font-size: clamp(1.3125rem, 1.16rem + 0.45vw, 1.5625rem);
  font-weight: 700;
}

h4,
.h4,
h5,
.h5,
h6,
.h6 {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  font-weight: 600;
}

.hero h1,
.hero-title,
.hero-heading,
.page-hero h1,
.marketing-hero h1 {
  font-size: clamp(2.25rem, 1.65rem + 2.1vw, 3rem);
  font-weight: 800;
  line-height: 1.3;
}

.course-title,
.product-title,
.course-card .card-title,
.product-card .card-title {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  font-weight: 600;
}

p,
li,
td,
th,
label,
.form-text,
.text-muted,
.small,
.navbar-nav .nav-link,
.dropdown-item,
.btn,
.form-control,
.form-select {
  letter-spacing: normal !important;
}

p + p {
  margin-block-start: 1rem;
}

.article-content,
.article-body,
.blog-content,
.post-content,
article .article-content,
article .content-body {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.85;
}

.article-content :is(h2, h3, h4),
.article-body :is(h2, h3, h4),
.blog-content :is(h2, h3, h4),
.post-content :is(h2, h3, h4) {
  margin-block: 1.75em 0.7em;
}

.navbar-nav .nav-link,
.dropdown-item,
.btn,
.form-label,
label,
th {
  font-weight: 600;
}

.form-control,
.form-select,
textarea:not(.code-editor) {
  line-height: 1.7;
}

.small,
small,
.form-text,
.text-muted {
  font-size: var(--type-secondary-size);
  line-height: 1.7;
}

/* Keep mixed Arabic/English terminology and numbers stable in RTL contexts. */
[dir="ltr"],
.dir-ltr,
abbr,
time,
code,
kbd,
samp,
.font-monospace {
  unicode-bidi: plaintext;
}

@media (max-width: 575.98px) {
  body {
    line-height: 1.75;
  }

  .btn,
  .form-control,
  .form-select {
    font-size: 0.9375rem;
  }
}


/* Homepage brand statement: expressive without introducing a third font. */
.manarah-hero .hero-title {
  font-family: var(--font-heading) !important;
  font-weight: 800 !important;
  line-height: 1.24 !important;
  text-wrap: balance;
  text-shadow: 0 8px 28px rgba(2, 20, 40, 0.28);
}

.manarah-hero .hero-title .highlight {
  color: #5dd4ff !important;
  background: linear-gradient(112deg, #7dd3fc 0%, #38bdf8 48%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.manarah-hero .hero-specialty {
  display: inline-block;
  margin-inline-start: 0.15em;
  padding: 0.18em 0.5em 0.22em;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 0.48em;
  background: rgba(14, 116, 144, 0.2);
  color: #e0f2fe;
  font-family: var(--font-heading) !important;
  font-size: 0.53em;
  font-weight: 700;
  line-height: 1.15;
  vertical-align: 0.12em;
  text-shadow: none;
}

@media (max-width: 575.98px) {
  .manarah-hero .hero-specialty {
    font-size: 0.48em;
  }
}
