/* ============================================================
   English World — mega menu (shared by every page)
   Progressive enhancement: mega.js adds a panel after each
   masthead link. Without the script the plain menu still works.
   Wide screens: panels open under the masthead on hover/focus.
   Small screens: the same panels are expandable sections.
   ============================================================ */
.ewm-x { display: none; }
.ewm-dim { position: fixed; inset: 0; z-index: 45; background: rgba(21,23,28,0.36); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.ewm-dim.show { opacity: 1; pointer-events: auto; }

/* the masthead's own link rules reach every <a> inside the menu, so panels reset them first */
.nav .nav__links .ewm-panel { --ewm-a: #0B3D91; --ewm-muted: #5A5C63; --ewm-rule: rgba(21,23,28,0.14); color: #15171C; font-family: var(--sans); font-size: 1rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none; text-align: start; white-space: normal; }
.nav .nav__links .ewm-panel .ewm-a { position: static; display: block; width: auto; padding: 0; border: 0; font: inherit; color: inherit; white-space: normal; opacity: 1; transform: none; text-decoration: none; }
.nav .nav__links .ewm-panel .ewm-a::before, .nav .nav__links .ewm-panel .ewm-a::after { content: none; }
.ewm-panel * { box-sizing: border-box; }
.ewm-panel :focus-visible { outline: 2px solid var(--ewm-a); outline-offset: 3px; }

.ewm-k { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ewm-a); }
.ewm-title { margin-top: 0.6rem; font-family: var(--serif); font-weight: 600; font-size: clamp(1.45rem, 2.1vw, 2.05rem); line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; }
.ewm-lede { margin-top: 0.7rem; max-width: 40ch; color: var(--ewm-muted); font-size: 0.96rem; line-height: 1.55; text-wrap: pretty; }
.nav .nav__links .ewm-panel .ewm-cta { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; padding: 0.72rem 1.15rem; background: var(--ewm-a); color: #fff; font-size: 0.9rem; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: filter .25s ease, transform .25s ease; }
.nav .nav__links .ewm-panel .ewm-cta:hover, .nav .nav__links .ewm-panel .ewm-cta:focus-visible { filter: brightness(1.12); transform: translateY(-2px); }
.ewm-arrow { display: inline-block; transition: transform .28s ease; }
.ewm-a:hover .ewm-arrow { transform: translateX(3px); }
[dir="rtl"] .ewm-arrow { transform: scaleX(-1); }
[dir="rtl"] .ewm-a:hover .ewm-arrow { transform: scaleX(-1) translateX(3px); }

.ewm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem clamp(1.2rem, 2.6vw, 2.6rem); align-content: start; }
.ewm-cols--1 { grid-template-columns: minmax(0, 1fr); }
.ewm-h { font-family: var(--mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ewm-muted); padding-bottom: 0.55rem; margin-bottom: 0.45rem; border-bottom: 1px solid var(--ewm-rule); }
.ewm-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ewm-list--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 1.8rem); grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
.ewm-list li { padding: 0.36rem 0; font-size: 0.97rem; font-weight: 500; line-height: 1.3; }
.nav .nav__links .ewm-panel .ewm-list .ewm-a, .ewm-list .ewm-txt { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.65rem; align-items: baseline; }
.ewm-list .ewm-a > span, .ewm-list .ewm-txt > span { grid-column: 2; }
.ewm-list small { grid-column: 2; display: block; margin-top: 0.1rem; color: var(--ewm-muted); font-size: 0.84rem; font-weight: 400; line-height: 1.4; }
.ewm-list .ewm-a:hover > span, .ewm-list .ewm-a:focus-visible > span { color: var(--ewm-a); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ewm-n { grid-column: 1; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ewm-a); white-space: nowrap; }
.ewm-chip { grid-column: 1; display: inline-grid; place-items: center; min-width: 2.1em; padding: 0.2em 0.3em; background: var(--c, var(--ewm-a)); color: #fff; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.66rem; font-weight: 500; transform: translateY(-0.08em); }
.ewm-dot { grid-column: 1; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ewm-a); transform: translateY(-0.12em); }
.ewm-badge { grid-column: 1; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--c); color: #fff; border: 2px solid #fff; box-shadow: 0 5px 10px -5px rgba(21,23,28,0.55); align-self: center; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.ewm-badge svg { width: 58%; height: 58%; }
.ewm-list .ewm-a:hover .ewm-badge { transform: scale(1.14) rotate(-8deg); }
.nav .nav__links .ewm-panel .ewm-list--badges .ewm-a { align-items: center; }

/* the feature card on the end of each panel */
.ewm-feature { position: relative; padding: 1.1rem 1.2rem 1.2rem; background: #F4F2ED; border: 1px solid var(--ewm-rule); box-shadow: 8px 8px 0 #E7E2D6; }
[dir="rtl"] .ewm-feature { box-shadow: -8px 8px 0 #E7E2D6; }
.ewm-fk { font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ewm-a); }
.ewm-ft { margin-top: 0.5rem; font-family: var(--serif); font-weight: 600; font-size: 1.22rem; line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
.ewm-fp { margin-top: 0.45rem; color: var(--ewm-muted); font-size: 0.9rem; line-height: 1.5; }
.nav .nav__links .ewm-panel .ewm-flink { display: inline-flex; gap: 0.4rem; margin-top: 0.85rem; padding-bottom: 0.1rem; font-size: 0.9rem; font-weight: 600; border-bottom: 1.5px solid currentColor; }
.nav .nav__links .ewm-panel .ewm-flink:hover { color: var(--ewm-a); }
.ewm-facts { margin: 0.6rem 0 0; font-size: 0.9rem; }
.ewm-facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: 0.34rem 0; border-bottom: 1px dashed rgba(21,23,28,0.22); }
.ewm-facts dt { color: var(--ewm-muted); white-space: nowrap; }
.ewm-facts dd { margin: 0; margin-inline-start: auto; font-weight: 600; text-align: end; white-space: nowrap; }
.ewm-facts .is-closed dd { color: #C8102E; }
.ewm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.7rem; }
.ewm-tiles span { padding: 0.7rem 0.6rem; background: #fff; border: 1.5px solid var(--ewm-a); color: var(--ewm-a); font-family: var(--serif); font-weight: 600; font-size: 0.98rem; text-align: center; }
.ewm-bubbles { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; direction: ltr; }
.ewm-bubbles i { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 1.5px solid #15171C; border-radius: 50%; font-style: normal; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.64rem; font-weight: 500; animation: ewmFill 10s ease infinite; }
.ewm-bubbles i:nth-child(2) { animation-delay: 2s; } .ewm-bubbles i:nth-child(3) { animation-delay: 4s; }
.ewm-bubbles i:nth-child(4) { animation-delay: 6s; } .ewm-bubbles i:nth-child(5) { animation-delay: 8s; }
@keyframes ewmFill { 0%, 3% { background: transparent; color: #15171C; } 7%, 17% { background: #15171C; color: #fff; } 21%, 100% { background: transparent; color: #15171C; } }
.ewm-steps { list-style: none; margin: 0; padding: 0; counter-reset: ewm; display: grid; gap: 0.75rem; }
.ewm-steps li { counter-increment: ewm; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1rem 0.8rem; align-items: baseline; }
.ewm-steps li::before { content: counter(ewm); grid-row: 1 / span 2; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 1.5px solid #15171C; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.76rem; align-self: start; }
.ewm-steps b { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.ewm-steps span { grid-column: 2; color: var(--ewm-muted); font-size: 0.86rem; line-height: 1.4; }
.ewm-lessons { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; }
.ewm-lessons li { padding: 0.55rem 0; border-bottom: 1px dashed rgba(21,23,28,0.22); }
.ewm-lessons li:last-child { border-bottom: 0; }
.ewm-lessons .ewm-a > b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.ewm-lessons .ewm-a > span { display: block; margin-top: 0.2rem; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c, var(--ewm-a)); }
.ewm-lessons .ewm-a:hover > b { color: var(--ewm-a); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ewm-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; }
.ewm-tags span { padding: 0.3rem 0.7rem; border: 1.5px solid rgba(255,255,255,0.85); border-radius: 999px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ewm-coord { margin-top: 0.7rem; direction: ltr; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--ewm-a); }
[dir="rtl"] .ewm-coord { text-align: right; }

/* ---------- each destination keeps its own colours ---------- */
.nav .nav__links .ewm--events { --ewm-a: #BE185D; }
.nav .nav__links .ewm--ielts { --ewm-a: #C8102E; }
.nav .nav__links .ewm--toefl { --ewm-a: #6D28D9; }
.nav .nav__links .ewm--business { --ewm-a: #B5121B; }
.nav .nav__links .ewm--courses, .nav .nav__links .ewm--quiz { --ewm-a: #0B3D91; }
.nav .nav__links .ewm--hub { --ewm-a: #C8102E; }
.nav .nav__links .ewm--contact { --ewm-a: #0E6E64; }
.ewm--business .ewm-n { color: #8A5A0A; }
.ewm-feature--events { color: #fff; border: 0; background: linear-gradient(120deg, #C2410C, #BE185D 30%, #7C3AED 62%, #1D4ED8); box-shadow: 8px 8px 0 #E7E2D6; }
.ewm-feature--events .ewm-fk, .ewm-feature--events .ewm-fp { color: rgba(255,255,255,0.92); }
.nav .nav__links .ewm-panel .ewm-feature--events .ewm-flink:hover { color: #FFD84D; }
.ewm-sun { position: absolute; inset-inline-end: 0.9rem; top: 0.8rem; width: 2.6rem; height: 2.6rem; color: #FFD84D; animation: ewmSpin 34s linear infinite; }
@keyframes ewmSpin { to { transform: rotate(360deg); } }
.ewm-feature--business { color: #F4F2ED; border: 0; padding-top: 1.4rem; background: #15171C; }
.ewm-feature--business::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #D10A0A 0 34%, #000 34% 67%, #D4A017 67% 100%); }
.ewm-feature--business .ewm-fk { color: #F3D36B; }
.ewm-feature--business .ewm-fp { color: rgba(244,242,237,0.76); }
.ewm-places { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.92rem; font-weight: 500; }
.ewm-places li { position: relative; padding-inline-start: 1.3rem; }
.ewm-places li::before { content: ""; position: absolute; inset-inline-start: 0.1rem; top: 0.42em; width: 0.6rem; height: 0.32rem; border-inline-start: 2px solid #D4A017; border-bottom: 2px solid #D4A017; transform: rotate(-45deg); }
[dir="rtl"] .ewm-places li::before { transform: rotate(45deg); }
.nav .nav__links .ewm-panel .ewm-feature--business .ewm-flink:hover { color: #F3D36B; }
.ewm-feature--quiz, .ewm-feature--courses { background: #FFFEFA; border: 1.5px solid #15171C; transform: rotate(-1.2deg); }
[dir="rtl"] .ewm-feature--quiz, [dir="rtl"] .ewm-feature--courses { transform: rotate(1.2deg); }
.ewm-pin { width: 2.4rem; height: 2.4rem; color: var(--ewm-a); }

/* ============================================================
   WIDE SCREENS — a panel under the masthead
   ============================================================ */
@media (min-width: 1161px) {
  .nav .nav__links .ewm-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 6; max-height: calc(100vh - 5rem); overflow-y: auto; background: #FBFAF7; border-top: 3px solid var(--ewm-a); box-shadow: 0 46px 70px -40px rgba(21,23,28,0.55); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity .26s ease, transform .42s cubic-bezier(.16, 1, .3, 1), visibility 0s .26s; }
  .nav .nav__links .ewm-panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav .nav__links .ewm--events { border-image: linear-gradient(90deg, #C2410C, #BE185D, #7C3AED, #1D4ED8, #0F766E) 1; }
  .ewm-in { max-width: var(--maxw, 1320px); margin-inline: auto; padding: clamp(1.6rem, 2.6vw, 2.3rem) var(--pad, 2rem) clamp(1.9rem, 3vw, 2.6rem); display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.6fr) minmax(0, 0.98fr); gap: clamp(1.6rem, 3.6vw, 3.6rem); align-items: start; }
  .ewm-panel.is-open .ewm-in > * { animation: ewmIn .55s cubic-bezier(.16, 1, .3, 1) backwards; }
  .ewm-panel.is-open .ewm-in > :nth-child(2) { animation-delay: .06s; }
  .ewm-panel.is-open .ewm-in > :nth-child(3) { animation-delay: .12s; }
  .nav .nav__links > a.ewm-t.is-open::after { width: 100%; }
  /* keyboard users get a small "open menu" tab under the link they are on */
  .nav .nav__links > .ewm-x { display: grid; place-items: center; position: absolute; bottom: 1px; width: 26px; height: 15px; transform: translateX(-50%); padding: 0; border: 0; border-radius: 0; background: #15171C; color: #F4F2ED; cursor: pointer; opacity: 0; pointer-events: none; }
  .nav .nav__links > .ewm-x:focus-visible { opacity: 1; pointer-events: auto; outline: 2px solid #0B3D91; outline-offset: 2px; }
  .ewm-x svg { width: 12px; height: 12px; }
  .ewm-x .ewm-x__plus { display: none; }
}
@keyframes ewmIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   SMALL SCREENS — the panels are expandable sections of the menu
   ============================================================ */
@media (max-width: 1160px) {
  .ewm-dim { display: none; }
  .ewm-on .nav__links { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ewm-on .nav__links > * { grid-column: 1 / -1; }
  .ewm-on .nav__links > a.ewm-t { grid-column: 1; }
  .ewm-on .nav__links > a.ewm-t::after { content: none; }
  .ewm-on .nav__links.open > a.ewm-t { transition-delay: calc(var(--i, 0) * 0.045s + 0.05s) !important; }
  .ewm-on .nav__links > .ewm-x { grid-column: 2; display: grid; place-items: center; width: 54px; padding: 0; border: 0; border-top: 1px solid rgba(21,23,28,0.14); border-radius: 0; background: transparent; color: #15171C; cursor: pointer; opacity: 0; transition: opacity .45s ease, background .2s ease; }
  .ewm-on .nav__links.open > .ewm-x { opacity: 1; }
  .ewm-on .nav__links > a.ewm-t:first-child + .ewm-x { border-top: 0; }
  .ewm-on .nav__links > .ewm-x[aria-expanded="true"] { background: #15171C; color: #F4F2ED; }
  .ewm-x svg { width: 18px; height: 18px; transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
  .ewm-x[aria-expanded="true"] svg { transform: rotate(45deg); }
  .ewm-x .ewm-x__chev { display: none; }
  .nav .nav__links .ewm-panel { display: none; margin-inline: calc(var(--pad, 1.25rem) * -1); padding: 1.2rem var(--pad, 1.25rem) 1.5rem; background: #EDE9E0; border-top: 3px solid var(--ewm-a); }
  .nav .nav__links .ewm-panel.is-open { display: block; animation: ewmIn .4s cubic-bezier(.16, 1, .3, 1); }
  .ewm-in { display: grid; gap: 1.3rem; }
  .ewm-title { font-size: 1.4rem; }
  .ewm-cols { grid-template-columns: minmax(0, 1fr); }
  .ewm-feature { box-shadow: none; }
}
@media (min-width: 640px) and (max-width: 1160px) {
  .ewm-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem 2rem; align-items: start; }
  .ewm-cols { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ewm-cols--1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 479px) { .ewm-list--2 { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; } }

/* ---------- Arabic ---------- */
[lang="ar"] .ewm-panel * { letter-spacing: 0 !important; }
[lang="ar"] .ewm-k, [lang="ar"] .ewm-h, [lang="ar"] .ewm-fk { font-size: 0.8rem; }
[lang="ar"] .ewm-title { line-height: 1.4; }
[lang="ar"] .ewm-ft { line-height: 1.45; }
[lang="ar"] .ewm-lessons .ewm-a > span, [lang="ar"] .ewm-tags span { font-size: 0.74rem; }
.ewm-en { direction: ltr; unicode-bidi: isolate; font-family: "Mukta", system-ui, sans-serif; }

@media (prefers-reduced-motion: reduce) {
  .ewm-panel, .ewm-panel.is-open .ewm-in > *, .ewm-dim { transition: none !important; animation: none !important; }
  .ewm-bubbles i, .ewm-sun { animation: none; }
}
@media print { .ewm-panel, .ewm-x, .ewm-dim { display: none !important; } }
