/* === CLS responsive shell (loads after app.css) === */
/* Breakpoints: 480 / 640 / 768 / 1024 / 1200 — align with --bp-* below */
:root {
  --bp-sm: 480px;
  --bp-md: 640px;
  --bp-lg: 768px;
  --bp-xl: 1024px;
  --bp-2xl: 1200px;
  --bp-wide: 1440px;
  --layout-pad-x: clamp(1rem, 4vw, 3.75rem);
  --layout-hero-pad: clamp(1.25rem, 5vw, 5rem);
  --font-hero: clamp(1.75rem, 5vw, 3.5rem);
  --z-header: 1000;
  --z-mobile-menu: 2000;
  --header-height: 73px;
  /* Header bar: edge + elevation (navy-tinted, matches search / UI chrome) */
  --header-border-color: rgba(20, 73, 121, 0.12);
  --header-shadow:
    0 2px 10px rgba(20, 73, 121, 0.08),
    0 1px 3px rgba(15, 23, 42, 0.06);
  /* Primary nav: horizontal space between links (desktop) */
  --header-nav-link-gap: clamp(1.125rem, 2.4vw, 2.125rem);
  /* Home hero “card” corners (Figma ~20–28px) */
  --hero-border-radius: clamp(1.25rem, 2.2vw, 1.75rem);
  /* Home hero band width (desktop + mobile/tablet); centered with auto margins */
  --hero-container-width: 99%;
  /* Mobile/tablet hero: gap under fixed header + bottom margin (match desktop rhythm) */
  --mobile-hero-below-header: clamp(0.5rem, 2vw, 1rem);
  --mobile-hero-margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

/* --- Global responsive baseline (mobile-first additions) --- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  overflow-x: clip;
}

[dir='rtl'] body {
  font-family: 'Cairo', 'Poppins', sans-serif;
}

/* Ensure Arabic typography wins over per-component font-family rules */
[dir='rtl'] :where(h1, h2, h3, h4, h5, h6, p, a, span, li, label, button, input, select, textarea) {
  font-family: inherit;
}

/* Kicker labels like "— Popular Choice" or "🔥 Hot Programs" */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

[dir='rtl'] .section-kicker {
  flex-direction: row-reverse;
}

/*
 * RTL header: normal row + inherited direction: rtl.
 * row-reverse wrongly placed the first child (logo) on the left; with dir=rtl,
 * flex row places inline-start (logo) on the right and actions on the left.
 */
[dir='rtl'] .header {
  flex-direction: row;
}

[dir='rtl'] .header .header-actions {
  flex-direction: row;
}

/* Keep primary nav reading order in RTL */
[dir='rtl'] .header .nav {
  direction: rtl;
}

/* Hero: solid fallback behind CSS background-image so refresh doesn’t flash empty/neutral */
.hero,
.mobile-hero {
  background-color: #0f1419;
}

/* Nextstep / inner heroes: tone matches gradient until background photo paints */
.heroone {
  background-color: #0c253b;
}

/* UI/UX course hero image frame */
.hero-imgfou {
  background-color: #1a2332;
}

/* In-page anchors: offset for fixed header */
#course-categories {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

a.scroll-btn {
  text-decoration: none;
  cursor: pointer;
}

a.scroll-btn:focus-visible {
  outline: 2px solid var(--color-navy-header, #144979);
  outline-offset: 3px;
}

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

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Scroll wide content blocks without breaking table semantics */
.cls-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

table {
  max-width: 100%;
}

/* --- Fluid typography (overrides fixed px in app.css) --- */
.section-header h2,
.section-headerr h2,
.section-headerrs h2,
.section-headerrx h2,
.section-headerx h2,
.section-headerele h2 {
  font-size: clamp(1.125rem, 3.2vw, 1.6rem);
}

.section-header span,
.small-title span {
  font-size: clamp(1rem, 2.8vw, 1.75rem);
}

.hero-content h1,
.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.leftfou h1 {
  font-size: clamp(1.5rem, 4.5vw, 3rem);
}

.page-headertreefo h2 {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
}

/* --- Subscribe (home): remove fixed 1090px / offset --- */
.subscribe-wrapper {
  width: 100%;
  max-width: min(1090px, 100%);
  margin-left: auto;
  margin-right: auto;
  /* Reduce the large gap above/below subscribe block (app.css sets margin: 80px auto). */
  margin-block: clamp(1.5rem, 3.5vw, 2.75rem);
  padding-inline: var(--layout-pad-x);
  box-sizing: border-box;
}

.subscribe-card {
  width: 100% !important;
  max-width: min(1090px, 100%);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .subscribe-card {
    padding: 2rem 1.25rem;
    border-radius: 16px;
  }

  .subscribe-card::before,
  .subscribe-card::after {
    transform: scale(0.65);
    transform-origin: center;
  }
}

/* --- Home: category section intro (eyebrow + title; calmer scale vs generic .section-header span) --- */
.category-section .section-header {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.category-section .section-header .small-title {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: clamp(0.75rem, 1.15vw, 0.8125rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-navy-text-soft, #1f3b63);
}

.category-section .section-header .small-title span {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.category-section .section-header h2 {
  margin-top: 0.25rem;
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  line-height: 1.22;
  color: var(--color-navy-text, #1f3b63);
  font-weight: 700;
}

/* --- Home category grid: stack on small / tablet (avoid fixed inner widths) --- */
@media (max-width: 1024px) {
  .category-section {
    padding: 40px var(--layout-pad-x);
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .left-column,
  .right-column {
    height: auto !important;
    min-height: 0;
  }

  .bottom-grid .row {
    flex-direction: column;
    gap: 1rem;
  }

  .row .horizontal {
    width: 100% !important;
    max-width: 100%;
    flex: 1 1 auto !important;
  }

  .bottom-grid .horizontal:hover,
  .bottom-grid .horizontal {
    transform: none;
  }
}

/* Tablet: two-column category grid (641–1024px); overrides 1fr from block below */
@media (min-width: 641px) and (max-width: 1024px) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .left-column {
    height: auto !important;
  }
}

/* --- Neutralise large negative margins / fixed cards (overflow on narrow) --- */
@media (max-width: 1024px) {
  .explore {
    margin-inline: 0;
  }

  .hero-content {
    margin-top: 0;
  }

  .simv {
    margin-top: 0;
  }

  .leftv h1 {
    margin-bottom: 1rem;
    white-space: normal;
  }

  .abovev {
    margin-top: 0;
  }

  .video-card p {
    margin-top: 0.5rem;
  }

  .sma img {
    margin-left: 0;
    margin-top: 0;
  }

  .sma h4 {
    margin-top: 0;
    margin-left: 0;
  }

  .cardi.smalli img {
    margin-left: 0;
    margin-top: 0.25rem;
  }

  .cardi.smalli h4 {
    margin-top: 0.5rem;
    margin-left: 0;
  }

  .cardi.smalli p {
    margin-left: 0;
  }

  .right-cards {
    margin-left: 0;
  }

  .left-cards {
    margin-right: 0;
  }

  .cardi,
  .cardi.largei,
  .cardi.smalli {
    width: 100% !important;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .accordion-contentsev ul {
    margin-left: 0 !important;
  }

  .contenti {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .video-card {
    width: 100%;
    max-width: 380px;
  }

  .best-sellersr {
    padding: 40px var(--layout-pad-x);
  }

  .containerr {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: 0;
  }

  .best-sellersrx,
  .best-sellersrs {
    padding: 40px var(--layout-pad-x);
  }

  .containerrx,
  .containerrs {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: 0;
  }

  .card-topr h3,
  .card-toprs h3,
  .card-toprx h3 {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .subscribe-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    border-radius: 18px;
  }

  .email-field {
    min-width: 0;
    width: 100%;
  }
}

/* --- Skill pages: course cards + trending grids --- */
.cardfo,
.cardfi {
  height: auto;
  min-height: 0;
}

.cardfo img,
.cardfi img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .cardstreefo {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .cardsfi {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .cardstreefo {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .cardsfi {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* --- Listing: sidebar + main --- */
/* Desktop: avoid fixed-width overflow (not RTL-specific) */
.containertreefo {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  height: auto !important;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .containertreefo {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    padding: var(--layout-pad-x);
    box-sizing: border-box;
  }

  .sidebar {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
  }

  .search-boxth {
    max-width: 100%;
  }

  .search-boxth input {
    width: 100% !important;
  }

  .sidebar-header,
  .section-title,
  .menu,
  .dropdown,
  .tags {
    max-width: 100%;
  }

  .maintreefo {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .containertreefo {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    padding: 16px;
  }

  .sidebar,
  .maintreefo {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  .menu li {
    white-space: normal;
    gap: 10px;
  }

  .dropdown {
    white-space: normal;
    gap: 10px;
  }
}

/* --- UI/UX course page: 1500px section + hero image --- */
@media (max-width: 1024px) {
  .course-sectionfou {
    width: 100% !important;
    max-width: 100%;
    flex-direction: column;
    padding-inline: var(--layout-pad-x);
    gap: 1.5rem;
    box-sizing: border-box;
  }

  .leftfou,
  .rightfou {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-imgfou img {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
  }
}

/* --- Nextstep booking --- */
.booking-wrappertin {
  flex-wrap: wrap;
  max-width: 100%;
  padding-inline: var(--layout-pad-x);
  box-sizing: border-box;
  overflow-x: visible;
  gap: clamp(1.5rem, 4vw, 5rem);
}

.form-sidetin,
.summary-sidetin {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}

.section-titletin {
  width: 100% !important;
  max-width: 100%;
}

@media (max-width: 768px) {
  .booking-wrappertin {
    flex-direction: column;
    align-items: stretch;
  }

  .form-cardtin {
    padding: 1.5rem 1rem;
  }

  .summary-cardtin {
    height: auto !important;
    min-height: 0;
  }
}

/* --- Footer --- */
@media (max-width: 768px) {
  footer.footer {
    height: auto !important;
    min-height: 0;
    padding: 2rem var(--layout-pad-x) 2.5rem !important;
  }

  .footer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
  }

  .footer-col-1,
  .footer-col-2,
  .footer-col-3 {
    flex: 1 1 auto !important;
    width: 100%;
    max-width: 100% !important;
  }

  .footer-links {
    columns: 1;
  }

  .footer-links li {
    white-space: normal;
  }

  .newsletter-form {
    max-width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  footer.footer {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* --- Pagination --- */
.paginationfo {
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ========== Header / mobile nav (existing) ========== */
#site-mobile-menu.site-mobile-menu {
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .header .burger {
    display: none !important;
  }

  #site-mobile-menu.site-mobile-menu {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  /* Figma-style drawer: white panel, navy + orange “CLS Menu”, grey list rows */
  #site-mobile-menu.site-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    background: var(--color-white, #ffffff);
    color: var(--color-navy-text, #1f3b63);
    transition: right 0.35s ease;
    z-index: var(--z-mobile-menu);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 40px rgba(15, 39, 66, 0.08);
  }

  #site-mobile-menu.site-mobile-menu.active {
    right: 0;
  }

  /* RTL: slide from the left instead of the right */
  [dir='rtl'] #site-mobile-menu.site-mobile-menu {
    left: -100%;
    right: auto;
    transition: left 0.35s ease;
    box-shadow: 8px 0 40px rgba(15, 39, 66, 0.08);
  }

  [dir='rtl'] #site-mobile-menu.site-mobile-menu.active {
    left: 0;
  }

  .site-mobile-menu__inner {
    padding: clamp(1rem, 4vw, 1.5rem) clamp(1rem, 4vw, 1.25rem) 2rem;
    width: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .site-mobile-menu__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .site-mobile-menu__logo {
    display: block;
    line-height: 0;
    flex-shrink: 0;
  }

  .site-mobile-menu__logo img {
    display: block;
    height: clamp(32px, 8vw, 40px);
    width: auto;
    max-width: min(200px, 55vw);
    object-fit: contain;
  }

  .site-mobile-menu-close {
    background: transparent;
    border: none;
    padding: 10px;
    margin: -6px -6px -6px 0;
    color: var(--color-navy-text-sofi, #1f3c88);
    cursor: pointer;
    line-height: 1;
    font-size: 1.35rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .site-mobile-menu-close:hover {
    background: rgba(31, 59, 99, 0.06);
    color: var(--color-navy-header, #144979);
  }

  [dir='rtl'] .site-mobile-menu-close {
    margin: -6px 0 -6px -6px;
  }

  .site-mobile-menu__heading {
    margin: 0 0 1.25rem;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.65rem, 6.5vw, 2.125rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: start;
    letter-spacing: -0.02em;
  }

  [dir='rtl'] .site-mobile-menu__heading {
    font-family: 'Cairo', 'Poppins', sans-serif;
  }

  .site-mobile-menu__heading-brand {
    font-weight: 800;
  }

  .site-mobile-menu__heading-c,
  .site-mobile-menu__heading-s {
    color: var(--color-navy-text-sofi, #1f3c88);
  }

  .site-mobile-menu__heading-l {
    color: var(--color-orange-main, #f47429);
  }

  .site-mobile-menu__heading-rest {
    color: var(--color-navy-text, #1f3b63);
    font-weight: 700;
  }

  #site-mobile-menu .menu-links {
    display: block;
    width: 100%;
  }

  #site-mobile-menu .site-mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #site-mobile-menu .site-mobile-menu__list > li {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--color-gray-line, #e0e0e0);
  }

  #site-mobile-menu .site-mobile-menu__list > li:first-child {
    border-top: 1px solid var(--color-gray-line, #e0e0e0);
  }

  #site-mobile-menu .menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    padding: 0.85rem 0;
    text-decoration: none;
    color: var(--color-text-muted, #6c757d);
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
  }

  #site-mobile-menu .menu-item:active {
    background: rgba(31, 59, 99, 0.04);
  }

  #site-mobile-menu .menu-item__icon {
    flex-shrink: 0;
    width: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy-text, #1f3b63);
    font-size: 1.2rem;
    opacity: 0.92;
  }

  #site-mobile-menu .menu-item__icon i {
    display: block;
    line-height: 1;
  }

  #site-mobile-menu .menu-item__label {
    flex: 1 1 auto;
    text-align: start;
    min-width: 0;
    color: var(--color-text-muteds, #555555);
  }

  #site-mobile-menu .menu-item__chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--color-text-halfypy, #6b7280);
    margin-inline-start: 0.25rem;
  }

  /* RTL: mirror chevron direction (FontAwesome doesn't auto-flip icons) */
  [dir='rtl'] #site-mobile-menu .menu-item__chevron {
    transform: scaleX(-1);
    margin-inline-start: 0;
    margin-inline-end: 0.25rem;
  }
}

body {
  overflow-x: clip;
  max-width: 100%;
}

body.site-mobile-menu-open {
  overflow: hidden;
}

/* --- Site header: bottom border + soft shadow (fixed bar above content) --- */
.header {
  border-bottom: 1px solid var(--header-border-color);
  box-shadow: var(--header-shadow);
}

/* --- Language switcher (LaravelLocalization) --- */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.language-switcher__link {
  color: var(--color-navy-header, #144979);
  text-decoration: none;
  font-weight: 600;
  padding-inline: 0.25rem;
  line-height: 1;
}

.language-switcher__link.is-active {
  color: var(--color-orange-main, #f47429);
}

/* --- Header (desktop): globe opens AR / EN dropdown --- */
.language-switcher--header {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.language-switcher__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-navy-header, #144979);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  font-size: 1.2rem;
  line-height: 1;
  box-sizing: border-box;
}

/* Single child: center Font Awesome glyph (avoids baseline drift) */
.language-switcher__trigger > .fa-solid {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin: 0;
  line-height: 1;
  font-size: 1.15rem;
}

.language-switcher__trigger:hover {
  background: rgba(20, 73, 121, 0.08);
}

.language-switcher__trigger:focus-visible {
  outline: 2px solid var(--color-orange-main, #f47429);
  outline-offset: 2px;
}

.language-switcher--header.is-open .language-switcher__trigger {
  background: rgba(20, 73, 121, 0.1);
}

.language-switcher__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 7.75rem;
  padding: 0.35rem;
  margin: 0;
  background: var(--color-white, #fff);
  border: 1px solid rgba(20, 73, 121, 0.12);
  border-radius: 12px;
  box-shadow:
    0 4px 14px rgba(15, 39, 66, 0.12),
    0 0 1px rgba(15, 39, 66, 0.08);
  z-index: 1100;
}

.language-switcher__dropdown[hidden] {
  display: none !important;
}

.language-switcher__dropdown-link {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-navy-text-sofi, #1f3c88);
  text-decoration: none;
  text-align: center;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.language-switcher__dropdown-link:hover {
  background: rgba(20, 73, 121, 0.06);
}

.language-switcher__dropdown-link:focus-visible {
  outline: 2px solid var(--color-orange-main, #f47429);
  outline-offset: 0;
}

.language-switcher__dropdown-link.is-active {
  color: var(--color-orange-main, #f47429);
  background: rgba(244, 116, 41, 0.1);
}

/*
 * Mobile drawer: segmented “EN / AR” control (replaces plain links under CLS Menu title).
 * Header bar still uses .language-switcher--header (hidden ≤1024px in app.css).
 */
#site-mobile-menu .language-switcher--drawer {
  display: flex;
  width: 100%;
  max-width: min(14.5rem, 100%);
  margin: 0 auto 0.95rem;
  padding: 0.18rem;
  gap: 0.18rem;
  box-sizing: border-box;
  align-items: stretch;
  background: rgba(20, 73, 121, 0.07);
  border: 1px solid rgba(20, 73, 121, 0.12);
  border-radius: 999px;
}

#site-mobile-menu .language-switcher--drawer .language-switcher__link {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.32rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-navy-text-sofi, #1f3c88);
  text-decoration: none;
  line-height: 1.2;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

#site-mobile-menu .language-switcher--drawer .language-switcher__link:not(.is-active):hover,
#site-mobile-menu .language-switcher--drawer .language-switcher__link:not(.is-active):focus-visible {
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-navy-header, #144979);
}

#site-mobile-menu .language-switcher--drawer .language-switcher__link:focus-visible {
  outline: 2px solid var(--color-orange-main, #f47429);
  outline-offset: 2px;
}

#site-mobile-menu .language-switcher--drawer .language-switcher__link.is-active {
  background: var(--color-white, #ffffff);
  color: var(--color-orange-main, #f47429);
  box-shadow:
    0 1px 3px rgba(15, 39, 66, 0.08),
    0 4px 12px rgba(31, 59, 99, 0.1);
}

[dir='rtl'] #site-mobile-menu .language-switcher--drawer {
  direction: rtl;
}

@media (max-width: 1024px) {
  .header .logo {
    margin-inline-end: auto;
  }
}

/* --- Site header: desktop fluid row (≥1025px) --- */
@media (min-width: 1025px) {
  .header {
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-bottom: 1rem;
    padding-left: max(env(safe-area-inset-left, 0px), var(--layout-pad-x));
    padding-right: max(env(safe-area-inset-right, 0px), var(--layout-pad-x));
    box-sizing: border-box;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    align-items: center;
  }

  .header .logo {
    max-width: min(180px, 40vw);
    width: auto;
    height: auto;
    min-width: 0;
    flex-shrink: 0;
    top: auto;
    left: auto;
  }

  .header .logo img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 40px;
    object-fit: contain;
  }

  .header .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    /* row-gap when wrapped; column-gap = space between items (replaces tiny 0.35rem) */
    gap: 0.5rem var(--header-nav-link-gap);
    flex: 1 1 auto;
    min-width: 0;
  }

  .header .nav a {
    margin: 0;
    padding-inline: 0.125rem;
    white-space: nowrap;
    font-size: clamp(0.8125rem, 1.05vw, 1rem);
  }

  .header .header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: clamp(0.5rem, 1.5vw, 1.25rem);
  }

  /* Globe: same vertical band as 40px search + register row; icon +4% vs 1.15rem */
  .header .language-switcher--header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    align-self: center;
  }

  .header .language-switcher__trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
    position: relative;
    top: -4px;
  }

  .header .language-switcher__trigger > .fa-solid {
    font-size: 1.77rem;
    width: 1.2em;
    height: 1.2em;
    transform: translateY(-1px);
  }

  .header .search-box {
    width: 100%;
    max-width: min(312px, 28vw);
    min-width: 0;
  }

  /* Header search: use logical positioning so the icon works in RTL/LTR */
  .header .search-box {
    position: relative;
    height: 40px;
  }

  .header .search-box input {
    height: 40px;
    padding-inline-start: 14px;
    padding-inline-end: 58px; /* room for the pill icon */
  }

  .header .search-box .search-img {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 34px;
    cursor: pointer;
  }

  .header .search-box .search-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
  }

  .header .search-box .search-img i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--color-white, #fff);
    font-size: 13px;
    pointer-events: none;
    transform: none;
  }

  /* RTL: keep icon on the physical right, but let text start on the left */
  html[dir='rtl'] .header .search-box .search-img {
    right: 6px;
    left: auto;
    inset-inline-end: auto;
  }

  html[dir='rtl'] .header .search-box input {
    direction: ltr;
    text-align: left;
  }
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .header .nav a {
    font-size: 0.8125rem;
  }

  .header .search-box {
    max-width: min(260px, 24vw);
  }

  .header .register-btn {
    padding: 10px 16px;
    font-size: 0.875rem;
  }
}

/* Arabic: compact “سجّل” in header on desktop only (burger layouts hide this control). */
.register-btn__txt--short {
  display: none !important;
}

@media (min-width: 1025px) {
  html[dir='rtl'] .header .register-btn .register-btn__txt--full {
    display: none !important;
  }

  html[dir='rtl'] .header .register-btn .register-btn__txt--short {
    display: inline !important;
  }
}

@media (min-width: 1201px) and (max-width: 1320px) {
  .header .search-box {
    max-width: min(300px, 26vw);
  }
}

/* --- Site header: mobile tap targets + safe area (≤1024px) --- */
@media (max-width: 1024px) {
  .header {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    padding-top: max(0.9375rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(0.9375rem, env(safe-area-inset-bottom, 0px));
  }

  /* Mobile: ensure desktop nav collapses regardless of other CSS order */
  .header .nav {
    display: none !important;
  }

  .header .burger {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Home hero desktop (≥1025px): fluid offsets under fixed header --- */
@media (min-width: 1025px) {
  .hero {
    --hero-gap-under-header: clamp(0.5rem, 1.5vw, 1rem);
    --hero-margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
    height: auto; /* override app.css 100vh so min-height + margins control layout */
    width: var(--hero-container-width);
    margin-top: calc(var(--header-height) + var(--hero-gap-under-header));
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--hero-margin-bottom);
    border-radius: var(--hero-border-radius);
    overflow: hidden;
    min-height: calc(
      100vh - var(--header-height) - var(--hero-gap-under-header) - var(--hero-margin-bottom)
    );
    min-height: calc(
      100dvh - var(--header-height) - var(--hero-gap-under-header) - var(--hero-margin-bottom)
    );
    /* Header cleared by margin-top; inner offset only */
    padding-top: clamp(1rem, 3vh, 2.25rem);
    box-sizing: border-box;
  }

  .hero .hero-content {
    /* Shift headline block slightly up vs prior centering (Figma alignment) */
    margin-top: clamp(-13rem, -18vh, -4.5rem);
    /* % is of .hero; scales with 99% hero band on desktop + medium widths */
    max-width: min(700px, min(90%, 40rem));
    padding-inline: var(--layout-pad-x);
    box-sizing: border-box;
  }

  .hero .stats {
    left: var(--layout-pad-x);
    top: clamp(10rem, 24vh, 15.625rem);
  }

  .hero .partners {
    left: var(--layout-pad-x);
    width: auto;
    max-width: min(400px, calc(100% - 2 * var(--layout-pad-x)));
  }

  .hero .moving-strip {
    left: var(--layout-pad-x);
  }

  /* Same horizontal anchor as student pill so right edges line up (Figma) */
  .hero .buttom-right {
    right: clamp(1.75rem, 7vw, 7.75rem);
    max-width: 24.9375rem; /* 420px * 0.95 */
    width: min(24.9375rem, calc(100% - 3rem));
    text-align: right;
    font-size: clamp(0.83125rem, 1.2825vw, 1.009375rem); /* ~5% smaller */
    line-height: 1.55;
    box-sizing: border-box;
    margin: 0 0 clamp(0.75rem, 1.5vh, 1.125rem) 0; /* override .hero p spacing */
  }

  .hero .right-bottom-section {
    right: clamp(1.75rem, 7vw, 7.75rem);
  }
}

/* Medium desktop: scale right cluster for fit (width: 99% from base ≥1025px rule) */
@media (min-width: 1025px) and (max-width: 1200px) {
  .hero .right-sec {
    transform: scale(0.9);
    transform-origin: bottom right;
  }

  .hero .buttom-right {
    max-width: min(22rem, min(34vw, 100% - 2rem));
    font-size: 0.9rem;
  }
}

@media (min-width: 1201px) and (max-width: 1400px) {
  .hero .right-sec {
    transform: scale(0.95);
    transform-origin: bottom right;
  }
}

/* --- Home mobile + tablet hero (≤1024px): 99% width, viewport height, full radius like desktop ---
   Margin clears the fixed header so the rounded card sits fully below it (padding-top alone hid top corners). */
@media (max-width: 1024px) {
  .mobile-hero {
    width: var(--hero-container-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: calc(var(--header-height) + var(--mobile-hero-below-header));
    margin-bottom: var(--mobile-hero-margin-bottom);
    border-radius: var(--hero-border-radius);
    overflow: hidden;
    padding-left: clamp(0.875rem, 3.5vw, 1.25rem);
    padding-right: clamp(0.875rem, 3.5vw, 1.25rem);
    padding-top: clamp(1.5rem, 4vw, 2.75rem);
    padding-bottom: clamp(1.5rem, 5vw, 2.75rem);
    min-height: calc(
      100vh - var(--header-height) - var(--mobile-hero-below-header) - var(--mobile-hero-margin-bottom)
    );
    min-height: calc(
      100dvh - var(--header-height) - var(--mobile-hero-below-header) - var(--mobile-hero-margin-bottom)
    );
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 3vw, 1.5rem);
  }

  .mobile-hero .mobile-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem 1rem;
  }

  .mobile-hero .mobile-stats > div {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 5.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .mobile-hero .mobile-search {
    max-width: 100%;
    box-sizing: border-box;
    margin-top: auto;
  }
}

/* Small phones: keep hero band 99%; same corner radius as desktop for consistency */
@media (max-width: 480px) {
  .mobile-hero {
    width: var(--hero-container-width);
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--hero-border-radius);
  }

  .mobile-hero h2 {
    font-size: clamp(0.9375rem, 4vw, 1.125rem);
  }

  .mobile-hero h1 {
    font-size: clamp(1.125rem, 6vw, 1.5rem);
  }

  .mobile-hero p {
    font-size: 0.875rem;
  }

  .mobile-hero .mobile-stats h3 {
    font-size: 1rem;
  }

  .mobile-hero .mobile-stats span {
    font-size: 0.6875rem;
  }

  .mobile-hero .mobile-stats > div {
    flex: 1 1 100%;
    text-align: center;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (max-width: 1024px) {
  .mobile-hero {
    width: var(--hero-container-width);
    margin-left: auto;
    margin-right: auto;
    min-height: 0;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.5rem;
  }

  .mobile-hero .mobile-search {
    margin-top: 0;
  }

  .mobile-hero .mobile-stats {
    margin-bottom: 0.75rem;
  }

  .mobile-hero h1 {
    margin-bottom: 0.5rem;
  }

  .mobile-hero p {
    margin-bottom: 0.75rem;
  }
}

/* --- Skill One hero --- */
@media (max-width: 1024px) {
  .herotwo {
    flex-direction: column;
    text-align: center;
    padding: calc(73px + var(--layout-hero-pad)) var(--layout-pad-x) var(--layout-hero-pad);
    min-height: auto;
  }

  .hero-contenttwo {
    width: 100%;
    max-width: 42rem;
    margin-inline: auto;
  }

  .hero-contenttwo p {
    max-width: 60ch;
    margin-inline: auto;
  }

  .hero-contenttwo h1 {
    font-size: var(--font-hero);
  }

  .hero-righttwo {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    height: auto;
    margin-top: 2rem;
    padding: 1rem 0;
    overflow: visible;
  }

  .hero-righttwo .persontwo {
    width: min(300px, 55vw) !important;
    height: auto !important;
    max-width: 100%;
  }

  .hero-righttwo .shape-bluetwo {
    width: min(85vw, 360px);
    height: min(85vw, 360px);
    max-width: 100%;
  }

  .hero-righttwo .shape-orangetwo {
    width: min(55vw, 220px);
    height: min(55vw, 220px);
    max-width: 100%;
    border-width: 20px;
  }

  .hero-righttwo .cardtwo {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0.35rem auto !important;
    max-width: min(320px, 92vw);
    display: block;
  }

  .search-boxtwo {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .search-boxtwo {
    max-width: 100%;
  }

  .categoriestwo {
    gap: 10px;
    justify-content: center;
  }

  .categoriestwo button {
    min-height: 44px;
    padding: 10px 14px;
    flex: 1 1 auto;
    min-width: 9.5rem;
  }

  .hero-contenttwo h1 {
    font-size: clamp(1.5rem, 7vw, 2.25rem);
  }
}

@media (max-width: 1024px) {
  .accordion-contentsev ul {
    margin-left: 0;
  }
}

/* --- Direction gallery --- */
@media (max-width: 1024px) {
  .gallery-section .gallery-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: 12px;
  }

  .gallery-section .big {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery-section .filter-menu {
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: center;
    padding: 0 8px;
  }

  .gallery-section .main-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    padding: 0 var(--layout-pad-x);
  }

  .gallery-section .slider-track {
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .gallery-section .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-section .big {
    grid-column: 1;
    grid-row: auto;
  }
}

/* --- Direction courses grid --- */
@media (max-width: 768px) {
  .coursesdi {
    grid-template-columns: 1fr;
    width: min(92%, 1200px);
  }

  .course-carddi {
    height: auto;
    min-height: 220px;
  }

  .course-contentdi p {
    max-width: 60ch;
  }
}

/* --- Home mobile hero: horizontal padding; vertical offset is margin-top on .mobile-hero (see block above) --- */
@media (max-width: 1024px) {
  .mobile-hero {
    padding-left: var(--layout-pad-x);
    padding-right: var(--layout-pad-x);
    width: var(--hero-container-width);
    margin-left: auto;
    margin-right: auto;
    max-width: none;
    box-sizing: border-box;
  }

  .mobile-search {
    width: 100%;
    max-width: min(36rem, 100%);
    margin-inline: auto;
    min-width: 0;
    box-sizing: border-box;
  }

  .mobile-search input {
    min-width: 0;
  }

  .mobile-stats {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .mobile-stats > div {
    flex: 1 1 auto;
    min-width: 5rem;
  }
}

/* --- Nextstep hero --- */
@media (max-width: 1024px) {
  .heroone {
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding: calc(73px + 2rem) var(--layout-pad-x) 3rem;
  }

  .hero-contentone {
    width: 100%;
  }

  .hero-statsone {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .hero-imageone {
    width: 100%;
    max-width: 100%;
  }

  .hero-imageone img {
    width: 100%;
    height: auto;
  }
}

/* --- Home TESTIMONIALS: mobile card stack (replaces broken horizontal strip) --- */
@media (max-width: 768px) {
  .testimonials {
    padding: 2.75rem var(--layout-pad-x) 3rem;
    text-align: center;
    overflow-x: clip;
  }

  .testimonials .container {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  /* Match home “Category” section header: orange rule + uppercase label + large title */
  .testimonials .section-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-size: clamp(0.72rem, 2.6vw, 0.8125rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-navy-text-soft, #1f4e79);
    margin: 0;
  }

  .testimonials .section-small .dash {
    width: 22px;
    height: 3px;
    flex-shrink: 0;
    background: var(--color-orange-alt, #ff8c42);
    border-radius: 2px;
  }

  /* Mobile testimonials title: prior clamp, then −12%; orange matches desktop */
  .testimonials .section-title {
    font-size: clamp(1.198rem, 4.448vw, 1.604rem);
    font-weight: 700;
    line-height: 1.22;
    margin-top: 0.65rem;
    margin-bottom: 1.75rem;
    padding-inline: 0.5rem;
    color: var(--color-orange-main, #f47429);
  }

  .testimonials .testimonial-cards {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .testimonials .testimonial-card,
  .testimonials .testimonial-card.active {
    width: 100% !important;
    max-width: 100%;
    min-height: 0;
    height: auto;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--color-white, #fff);
    color: var(--color-black, #111);
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 39, 66, 0.1);
    border: 1px solid rgba(31, 78, 121, 0.1);
    padding: 1.5rem 1.25rem 1.35rem;
    overflow: visible;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .testimonials .testimonial-card.active {
    border-color: rgba(244, 116, 41, 0.45);
    box-shadow: 0 10px 32px rgba(15, 39, 66, 0.14);
  }

  .testimonials .testimonial-content {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    min-height: 0;
    padding: 0 !important;
    text-align: center;
    box-sizing: border-box;
    position: relative;
  }

  /* Each card shows full story (no “closed” sliver columns) */
  .testimonials .testimonial-card:not(.active) h3,
  .testimonials .testimonial-card:not(.active) .role,
  .testimonials .testimonial-card:not(.active) .description {
    display: block !important;
  }

  .testimonials .testimonial-card .avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.85rem;
  }

  .testimonials .testimonial-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-navy-text, #1f3b63);
    margin-bottom: 0.35rem;
  }

  .testimonials .testimonial-card .role {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--color-text-muted, #6c757d);
    margin-bottom: 1rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .testimonials .testimonial-card .description {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--color-navy-text-soft, #1f4e79);
    text-align: left;
    margin-bottom: 0;
  }

  .testimonials .testimonial-card .description br {
    display: none;
  }

  .testimonials .testimonial-card .mini-img {
    display: none !important;
  }

  .testimonials .testimonial-card .bottom {
    position: relative;
    inset: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 0 !important;
  }

  .testimonials .testimonial-card .quote {
    position: relative;
    inset: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }

  .testimonials .testimonial-card .quote img,
  .testimonials .testimonial-card.active .quote img,
  .testimonials .testimonial-card:not(.active) .quote img {
    width: 44px !important;
    height: 44px !important;
    max-width: 100%;
    margin: 0 !important;
    opacity: 0.25 !important;
    object-fit: contain;
  }

  .testimonials .testimonial-card:last-child {
    display: flex !important;
  }
}

/* --- Wide desktop cap (1440px content rhythm) --- */
@media (min-width: 1440px) {
  .gallery-section .container,
  .footer-inner {
    max-width: min(1600px, 100%);
  }
}
