/* ==========================================================
   Ghaith Academy — refinements (Nov 2026)
   Arabic font, centred headings, calm section colours,
   compact solid buttons, step icons.
   ========================================================== */

/* ---------- Arabic font: IBM Plex Sans Arabic (as quraised.com) ---------- */
:root {
	--gh-font: "Manrope", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gh-font-ar: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif;
}
html.gh-ar body { line-height: 1.85; }
html.gh-ar .gh-main :is(h1, h2, h3, h4, h5, h6, p, li, a, span, strong, em, small, b, label, button, td, th, summary, blockquote, figcaption, div):not(i):not([class^="fa"]):not([class*=" fa-"]):not([class*="icon"]),
html.gh-ar .gh-header :is(a, span, strong, small, button),
html.gh-ar .gh-footer :is(h2, h3, h4, p, li, a, span, strong, small) {
	font-family: var(--gh-font-ar) !important;
	letter-spacing: 0 !important;
}
html.gh-ar :is(h1, h2, h3) { line-height: 1.45; font-weight: 700; }

/* ---------- Buttons ---------- */
.gh-btn--orange { background: var(--gh-gold); border-color: var(--gh-gold); color: #fff; box-shadow: none; }
.gh-btn--orange:hover { background: #d98c0b; border-color: #d98c0b; color: #fff; }
.gh-program__actions { justify-content: center; gap: 8px; flex-wrap: nowrap; }
.gh-program__actions .gh-btn { flex: 0 0 auto; min-height: 38px; padding: 0 14px; font-size: .84rem; border-radius: 10px; }

/* ---------- Centred headings, site-wide ---------- */
.gh-section__top { flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gh-section__head { margin-inline: auto; text-align: center; }
.gh-section__head .gh-kicker { justify-content: center; }
.gh-program__body, .gh-curriculum__body, .gh-why__item, .gh-plan > h3, .gh-plan__freq, .gh-post-card h2, .gh-post-card h3 { text-align: center; }
.gh-plan__price { justify-content: center; }
.gh-trial__copy > .gh-kicker, .gh-trial__copy > h2 { display: block; text-align: center; }
.gh-trial__actions { justify-content: center; }
.gh-cta__inner { flex-direction: column; text-align: center; }
.gh-page-hero, .gh-page-hero h1 { text-align: center; }
.gh-prose :is(h1, h2, h3),
.gh-page-content--full :is(h1, h2) { text-align: center !important; }

/* ---------- Calm section colours ---------- */
.gh-programs     { background: #f1f8f9; }
.gh-steps-section{ background: #fff8ec; }
.gh-trial        { background: #f2f8f4; }
.gh-why          { background: #f5f6fb; }
.gh-curricula    { background: #fdf6ee; }
.gh-video        { background: #eef7f9; }
.gh-pricing      { background: #fffaf2; }
.gh-posts-section, .gh-blog-list { background: #f6fafb; }
html.gh-dark :is(.gh-programs, .gh-trial, .gh-curricula, .gh-pricing) { background: var(--gh-bg); }
html.gh-dark :is(.gh-steps-section, .gh-why, .gh-video, .gh-posts-section, .gh-blog-list) { background: var(--gh-soft); }

/* ---------- How it works: centred cards with icons ---------- */
.gh-step { text-align: center; padding: 30px 22px 26px; }
.gh-step__icon {
	width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 20px;
	display: grid; place-items: center;
	background: rgba(0, 111, 127, .09); color: var(--gh-primary);
}
.gh-step__icon svg { width: 30px; height: 30px; }
html.gh-dark .gh-step__icon { background: rgba(16, 169, 191, .14); color: #8ff4ff; }
.gh-step__num {
	position: absolute; top: 14px; inset-inline-start: 14px;
	width: 28px; height: 28px; margin: 0; border-radius: 50%;
	background: #fdecc8; color: #8a5a00; font-size: .8rem; font-weight: 800;
}
html.gh-dark .gh-step__num { background: rgba(242, 165, 31, .18); color: #f2c46d; }

/* ---------- Unified page cover (all pages, articles, blog, 404) ---------- */
.gh-hero--page { margin-bottom: clamp(26px, 4vw, 46px); }
.gh-hero--page .gh-hero__media { height: clamp(190px, 26vw, 340px); }
.gh-hero--page .gh-hero__logo { width: 116px; height: 116px; margin-top: -58px; }
.gh-hero--page .gh-hero__title { font-size: clamp(1.7rem, 3.8vw, 3.1rem); line-height: 1.15; max-width: 920px; margin-inline: auto; }
html.gh-ar .gh-hero--page .gh-hero__title { font-size: clamp(1.55rem, 3.4vw, 2.75rem); line-height: 1.5; }
.gh-hero--page .gh-hero__intro { font-size: clamp(.98rem, 1.4vw, 1.1rem); }
.gh-hero--page a.gh-kicker { text-decoration: none; }
.gh-hero__meta { margin-top: 12px; color: var(--gh-muted); font-weight: 700; font-size: .9rem; }
/* Old custom pages: remove the big top spacing they kept for the old fixed header. */
.gh-page-content--covered > section:first-of-type,
.gh-page-content--covered article > section:first-of-type,
.gh-page-content--covered section[class*="hero"]:first-of-type { padding-top: clamp(24px, 4vw, 48px) !important; margin-top: 0 !important; }
@media (max-width: 640px) {
	.gh-hero--page { width: calc(100% - 24px); margin-top: 14px; }
	.gh-hero--page .gh-hero__media { border-radius: 20px; height: 200px; }
	.gh-hero--page .gh-hero__logo { width: 96px; height: 96px; margin-top: -48px; padding: 8px; }
}

/* ---------- Calm colour for every section of the old inner pages ---------- */
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+1) { background: #f1f8f9 !important; }
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+2) { background: #fff8ec !important; }
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+3) { background: #f2f8f4 !important; }
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+4) { background: #f5f6fb !important; }
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+5) { background: #fdf6ee !important; }
html:not(.gh-dark) body #main-content .gh-page-content--covered section:not([class*="cta"]):not([data-gh-moved]):nth-of-type(6n+6) { background: #eef7f9 !important; }
/* Sections nested inside another section keep the parent's colour. */
html:not(.gh-dark) body #main-content .gh-page-content--covered section section:not([data-a]):not([data-b]):not([data-c]) { background: transparent !important; }

/* Flat content like quraised */
/* Flatten only legacy content wrappers; leave artwork, controls and FAQs intact. */
html body #main-content .gh-page-content--covered :is(div, article):is([class*="card"], [class*="box"], [class*="panel"], [class*="story"], [class*="copy"], [class*="template"], .gqm-submap):not(:is([class*="image"], [class*="media"], [class*="img"], [class*="figure"], [class*="video"], [class*="btn"], [class*="subscribe"], [class*="tag"], [class*="chip"], [class*="badge"], [class*="kicker"], [class*="faq"], [class*="gfq-"], [class*="cta"], [class*="payload-box"], [class*="icon"], [class*="search"], [class*="grid"], [class*="actions"], [class*="head"])):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *)) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0 !important;
  padding-inline: clamp(8px, 1.8vw, 18px) !important;
  text-align: center !important;
}

/* Older template cards draw an extra border with a pseudo-element. */
html body #main-content .gh-page-content--covered :is(div, article)[class*="template-card"]::before,
html body #main-content .gh-page-content--covered :is(div, article)[class*="template-card"]::after {
  border: 0 !important;
  box-shadow: none !important;
}

/* Keep section copy centred without changing button, FAQ or media text. */
html body #main-content .gh-page-content--covered :is(h1, h2, h3, h4, h5, h6, p):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *, [class*="btn"] *)) {
  text-align: center !important;
}

/* Readable headings and body copy after the old dark cards become transparent. */
html.gh-dark body #main-content .gh-page-content--covered :is(div, article):is([class*="card"], [class*="box"], [class*="panel"], [class*="story"], [class*="copy"], [class*="template"], .gqm-submap):not(:is([class*="image"], [class*="media"], [class*="img"], [class*="figure"], [class*="video"], [class*="btn"], [class*="subscribe"], [class*="tag"], [class*="chip"], [class*="badge"], [class*="kicker"], [class*="faq"], [class*="gfq-"], [class*="cta"], [class*="payload-box"], [class*="icon"], [class*="search"], [class*="grid"], [class*="actions"], [class*="head"])):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *)) {
  color: var(--gh-text) !important;
}
html.gh-dark body #main-content .gh-page-content--covered :is(div, article):is([class*="card"], [class*="box"], [class*="panel"], [class*="story"], [class*="copy"], [class*="template"], .gqm-submap):not(:is([class*="image"], [class*="media"], [class*="img"], [class*="figure"], [class*="video"], [class*="btn"], [class*="subscribe"], [class*="tag"], [class*="chip"], [class*="badge"], [class*="kicker"], [class*="faq"], [class*="gfq-"], [class*="cta"], [class*="payload-box"], [class*="icon"], [class*="search"], [class*="grid"], [class*="actions"], [class*="head"])):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *)) :is(h1, h2, h3, h4, h5, h6):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *, [class*="btn"] *)) {
  color: var(--gh-ink) !important;
}
html.gh-dark body #main-content .gh-page-content--covered :is(div, article):is([class*="card"], [class*="box"], [class*="panel"], [class*="story"], [class*="copy"], [class*="template"], .gqm-submap):not(:is([class*="image"], [class*="media"], [class*="img"], [class*="figure"], [class*="video"], [class*="btn"], [class*="subscribe"], [class*="tag"], [class*="chip"], [class*="badge"], [class*="kicker"], [class*="faq"], [class*="gfq-"], [class*="cta"], [class*="payload-box"], [class*="icon"], [class*="search"], [class*="grid"], [class*="actions"], [class*="head"])):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *)) :is(p, li):not(:is([class*="cta"] *, [class*="payload-box"] *, [class*="faq"] *, [class*="gfq-"] *, details *, [class*="image"] *, [class*="media"] *, [class*="img"] *, [class*="video"] *, [class*="subscribe"] *, [class*="btn"] *)) {
  color: var(--gh-text) !important;
}

/* Tighter section spacing */
/* Limit changes to inner pages and their sections. Never change front-page spacing. */
html body #main-content .gh-page-content--covered section:not([class*="cta"]):not([class*="payload"]):not([class*="hero"]):not([class*="map"]) {
  padding-block: clamp(28px, 4vw, 48px) !important;
  margin-block: 0 !important;
}
html body #main-content .gh-page-content--covered > section[class*="hero"],
html body #main-content .gh-page-content--covered > article > section[class*="hero"] {
  padding-block: clamp(28px, 4vw, 48px) !important;
  margin-block: 0 !important;
}
html body #main-content .gh-section:not(.home *),
html body #main-content .gh-section--tight:not(.home *) {
  padding-block: clamp(28px, 4vw, 48px) !important;
  margin-block: 0 !important;
}
html body #main-content .gh-hero--page {
  margin-bottom: clamp(16px, 2.6vw, 26px) !important;
}
html body #main-content .gh-page-content--covered :is(div, header):is([class$="-head"], [class$="-section-head"], [class$="-intro"]):not(:is([class*="cta"], [class*="faq"], [class*="image"], [class*="media"], [class*="img"], [class*="hero"], [class*="video"])) {
  margin-block: 0 16px !important;
  padding-block: 0 !important;
}
html body #main-content .gh-page-content--covered :is(div, header):is([class$="-head"], [class$="-section-head"], [class$="-intro"]) :is(h1, h2, h3, h4, p):not([class*="cta"] *) {
  margin-bottom: 12px !important;
}
html body #main-content .gh-page-content--covered :is(section, article) > :is(h2, h3) {
  margin-bottom: 16px !important;
}
/* Only actual empty spacers; leave image holders and interactive diagrams intact. */
html body #main-content .gh-page-content--covered :is(div, hr):is([class*="divider"], [class*="spacer"], [class*="separator"]):empty,
html body #main-content .gh-page-content--covered div:empty[style*="height:"]:not([style*="background"]):not(:is([class*="image"], [class*="media"], [class*="img"], [class*="hero"], [class*="video"], [class*="map"], [class*="connector"], [class*="icon"], [class*="dot"], [class*="line"], [class*="progress"], [class*="faq"], [class*="cta"])) {
  display: none !important;
}
@media (max-width: 640px) {
  html body #main-content .gh-page-content--covered section:not([class*="cta"]):not([class*="payload"]):not([class*="map"]),
  html body #main-content .gh-page-content--covered > section[class*="hero"],
  html body #main-content .gh-page-content--covered > article > section[class*="hero"],
  html body #main-content .gh-section:not(.home *),
  html body #main-content .gh-section--tight:not(.home *) {
    padding-block: 24px !important;
  }
  html body #main-content .gh-page-content--covered :is(div, header):is([class$="-head"], [class$="-section-head"], [class$="-intro"]):not(:is([class*="cta"], [class*="faq"], [class*="media"], [class*="image"], [class*="img"])) {
    margin-bottom: 12px !important;
  }
  html body #main-content .gh-hero--page { margin-bottom: 14px !important; }
}


/* ---------- Country landing pages: prevent horizontal page drift on phones ---------- */
@media (max-width: 767px) {
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) #main-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-hero--page {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-inline: auto !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-hero--page .gh-hero__content {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-inline: 12px !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-hero--page .gh-hero__title {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-hero--page .gh-hero__actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
    max-width: 100% !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-hero--page .gh-hero__actions .gh-btn {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-inline: 12px !important;
    white-space: normal !important;
    text-align: center !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-prose {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-prose table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body:is(.page-id-1168, .page-id-1169, .page-id-1172, .page-id-1173) .gh-prose :is(p, h2, h3, li) {
    overflow-wrap: break-word;
  }
}
