/*
 * English With Meryem design system: tokens, base typography, layout helpers, buttons, icons.
 * Every page template builds on this file. Brand colours are defined once here.
 */

:root {
	/* Brand palette */
	--ewm-navy: #172b55;
	--ewm-navy-dark: #102344;
	--ewm-blue: #2f6fd6; /* Bright blue for buttons next to a red one (owner's pick, 24 Nov) */
	--ewm-white: #ffffff;
	--ewm-sky: #a9d8f5;
	--ewm-sky-light: #eaf6fd;
	--ewm-sky-soft: #d5ecfa;
	--ewm-sky-muted: #6baed6;
	--ewm-red: #e53946;
	--ewm-red-soft: #ffe8ea;
	--ewm-ink: #171717;

	/* Derived (same hues, used for subtle text and lines) */
	--ewm-ink-soft: rgb(23 23 23 / 0.74);
	--ewm-line: rgb(23 43 85 / 0.1);

	/* Typography */
	--ewm-font: "Alexandria", "Segoe UI", Tahoma, Arial, sans-serif;
	--ewm-fs-xs: 0.8125rem;
	--ewm-fs-sm: 0.9375rem;
	--ewm-fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
	--ewm-fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
	--ewm-fs-h3: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
	--ewm-fs-h2: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem);
	--ewm-fs-display: clamp(2.125rem, 1.25rem + 3.6vw, 3.625rem);
	--ewm-lh-tight: 1.3;
	--ewm-lh-body: 1.8;

	/* Space, radius, depth */
	--ewm-gutter: clamp(1rem, 4vw, 2rem);
	--ewm-container: 74rem;
	--ewm-radius-sm: 0.75rem;
	--ewm-radius: 1.25rem;
	--ewm-radius-lg: clamp(1.5rem, 3vw, 2.25rem);
	--ewm-radius-pill: 999px;
	--ewm-shadow-sm: 0 1px 2px rgb(23 43 85 / 0.06), 0 6px 18px -6px rgb(23 43 85 / 0.12);
	--ewm-shadow: 0 2px 8px rgb(23 43 85 / 0.06), 0 24px 60px -24px rgb(23 43 85 / 0.32);
	--ewm-shadow-red: 0 12px 28px -10px rgb(229 57 70 / 0.55);
	--ewm-gloss: linear-gradient(180deg, rgb(255 255 255 / 0.28) 0%, rgb(255 255 255 / 0.08) 48%, rgb(255 255 255 / 0) 52%);
	--ewm-ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

/* Base (scoped resets have zero specificity so components always win) */

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

body.ewm-site {
	margin: 0;
	background: var(--ewm-white);
	color: var(--ewm-ink);
	font-family: var(--ewm-font);
	font-size: var(--ewm-fs-body);
	font-weight: 400;
	line-height: var(--ewm-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

:where(.ewm-site) :where(h1, h2, h3, h4, p, ul, ol, figure, figcaption, blockquote, details, summary) {
	margin: 0;
	padding: 0;
}

:where(.ewm-site) :where(h1, h2, h3, h4) {
	color: var(--ewm-navy);
	font-family: var(--ewm-font);
	line-height: var(--ewm-lh-tight);
	text-wrap: balance;
}

:where(.ewm-site) :where(ul, ol) {
	list-style: none;
}

:where(.ewm-site) a {
	color: var(--ewm-navy);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

:where(.ewm-site) :where(button, input, select, textarea) {
	font: inherit;
	color: inherit;
}

:where(.ewm-site) :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--ewm-navy);
	outline-offset: 3px;
}

/* English learning content inside the Arabic interface */
.ewm-site [lang="en"],
.ewm-en {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: left;
}

/* Layout */

.ewm-container {
	width: min(100% - 2 * var(--ewm-gutter), var(--ewm-container));
	margin-inline: auto;
}

.ewm-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ewm-skip-link {
	position: absolute;
	inset-inline-start: 1rem;
	top: -10rem;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	border-radius: var(--ewm-radius-pill);
	background: var(--ewm-navy);
	color: var(--ewm-white);
	font-weight: 600;
	text-decoration: none;
}

.ewm-skip-link:focus {
	top: 1rem;
}

/* Rich text (Pencilino) */

.pencil-richtext > * + * {
	margin-top: 0.75em;
}

.pencil-richtext a {
	color: inherit;
	font-weight: 600;
}

/* Icons: one two-tone line style, coloured from the palette */

.ewm-icon {
	--ewm-icon-accent: var(--ewm-sky);
	--ewm-icon-detail: var(--ewm-red);
	width: 1.5em;
	height: 1.5em;
	flex: none;
	color: var(--ewm-navy);
	overflow: visible;
}

.ewm-icon .i-s {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ewm-icon .i-a {
	fill: var(--ewm-icon-accent);
}

.ewm-icon .i-d {
	fill: var(--ewm-icon-detail);
}

.ewm-icon .i-w {
	fill: var(--ewm-white);
}

.ewm-icon .i-f {
	fill: currentColor;
}

/* Social links: round icon buttons. The network name stays in the link for screen readers. */

.ewm-social__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ewm-social__item {
	position: relative;
	width: 2.9rem;
	height: 2.9rem;
}

.ewm-social__link {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	border-radius: 50%;
	background: var(--ewm-social-bg, var(--ewm-white));
	box-shadow: var(--ewm-shadow-sm), 0 0 0 1px var(--ewm-line);
	color: transparent;
	font-size: 0.75rem;
	white-space: nowrap;
	text-indent: 4rem;
	text-decoration: none;
	transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ewm-ease);
}

.ewm-social__glyph {
	position: absolute;
	inset: 0;
	width: 1.35rem;
	height: 1.35rem;
	margin: auto;
	color: var(--ewm-navy);
	pointer-events: none;
	transition: color 0.2s, transform 0.2s var(--ewm-ease);
}

.ewm-social__item:hover .ewm-social__link,
.ewm-social__link:focus-visible {
	background: var(--ewm-navy);
	box-shadow: 0 10px 22px -10px rgb(23 43 85 / 0.6);
	transform: translateY(-2px);
}

.ewm-social__item:hover .ewm-social__glyph,
.ewm-social__link:focus-visible + .ewm-social__glyph {
	color: var(--ewm-white);
	transform: translateY(-2px);
}

/* Buttons */

.ewm-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 3.25rem;
	padding: 0.8em 1.6em;
	border: 0;
	border-radius: var(--ewm-radius-pill);
	font-family: var(--ewm-font);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s var(--ewm-ease), box-shadow 0.2s var(--ewm-ease), background-color 0.2s var(--ewm-ease);
}

.ewm-btn--block {
	display: flex;
	width: 100%;
}

.ewm-btn--primary {
	background: var(--ewm-gloss), var(--ewm-red);
	color: var(--ewm-white);
	box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.ewm-btn--primary .ewm-icon {
	color: var(--ewm-white);
}

.ewm-btn--secondary {
	background: var(--ewm-gloss), var(--ewm-blue);
	color: var(--ewm-white);
	box-shadow: 0 12px 28px -12px rgb(47 111 214 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.3);
}

.ewm-btn--outline {
	background: var(--ewm-white);
	color: var(--ewm-navy);
	box-shadow: inset 0 0 0 2px var(--ewm-navy);
}

.ewm-btn--soft {
	background: var(--ewm-sky);
	color: var(--ewm-navy);
}

@media (hover: hover) {
	.ewm-btn:hover {
		transform: translateY(-2px);
	}

	.ewm-btn--primary:hover {
		box-shadow: 0 16px 32px -10px rgb(229 57 70 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.35);
	}
}

.ewm-btn:active {
	transform: translateY(0);
}

.ewm-btn[disabled],
.ewm-btn[aria-disabled="true"] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/*
 * Join-button glow (buttons with .ewm-cta-glow). The effect is chosen in Appearance → Customize →
 * "تأثير أزرار الانضمام" and added to <body> as .ewm-glow-saber / -orbit / -pulse / -off.
 * Only motion is added; size, colour and text of the buttons stay the same.
 */
@property --ewm-orbit {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

@media (prefers-reduced-motion: no-preference) {
	/* Saber: a white-hot edge and a red aura that hums. */
	.ewm-glow-saber .ewm-cta-glow {
		animation: ewm-saber 2.8s ease-in-out infinite;
	}

	.ewm-glow-saber .ewm-cta-glow:hover,
	.ewm-glow-saber .ewm-cta-glow:focus-visible {
		animation-duration: 1.2s;
	}

	/* Orbit: a spark of light travels around the edge. */
	.ewm-glow-orbit .ewm-cta-glow {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), 0 0 18px -2px rgb(229 57 70 / 0.55);
	}

	.ewm-glow-orbit .ewm-cta-glow::before {
		content: "";
		position: absolute;
		inset: -3px;
		z-index: 0;
		padding: 3px;
		border-radius: inherit;
		background: conic-gradient(from var(--ewm-orbit), transparent 0 58%, rgb(255 140 148 / 0.6) 72%, #fff 82%, rgb(255 92 104) 88%, transparent 96%);
		-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
		-webkit-mask-composite: xor;
		mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
		pointer-events: none;
		animation: ewm-orbit 3.4s linear infinite;
	}

	/* Pulse: a soft ring of light every few seconds. */
	.ewm-glow-pulse .ewm-cta-glow {
		animation: ewm-halo 3.2s ease-out infinite;
	}
}

@keyframes ewm-saber {
	0%,
	100% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 0 0 1.5px rgb(255 228 230 / 0.5), 0 0 6px 1px rgb(255 96 108 / 0.55), 0 0 18px 3px rgb(229 57 70 / 0.35);
	}

	46% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 0 0 1.5px rgb(255 244 245 / 0.9), 0 0 10px 2px rgb(255 108 118 / 0.85), 0 0 32px 8px rgb(229 57 70 / 0.5);
	}

	50% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 0 0 1.5px rgb(255 238 240 / 0.7), 0 0 8px 2px rgb(255 108 118 / 0.7), 0 0 26px 6px rgb(229 57 70 / 0.42);
	}

	54% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 0 0 1.5px rgb(255 244 245 / 0.9), 0 0 11px 2px rgb(255 108 118 / 0.85), 0 0 34px 8px rgb(229 57 70 / 0.5);
	}
}

@keyframes ewm-orbit {
	to {
		--ewm-orbit: 360deg;
	}
}

@keyframes ewm-halo {
	0% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), 0 0 0 0 rgb(229 57 70 / 0.5);
	}

	70%,
	100% {
		box-shadow: var(--ewm-shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.35), 0 0 0 14px rgb(229 57 70 / 0);
	}
}

/* Arrow icons point "forward" in right-to-left reading */
[dir="ltr"] .ewm-icon--arrow {
	transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
	.ewm-site *,
	.ewm-site *::before,
	.ewm-site *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/*
 * Teacher card (template-parts/components/teacher-card.php): teaching record and qualification,
 * shown with Meryem's photo on the waiting-list page and the Pricing page. Each page places it.
 */

.ewm-wl-badge {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	max-width: 100%;
	padding: 0.55rem 0.85rem;
	border-radius: 1rem;
	background: rgb(255 255 255 / 0.92);
	-webkit-backdrop-filter: blur(10px) saturate(1.2);
	backdrop-filter: blur(10px) saturate(1.2);
	box-shadow: var(--ewm-shadow-sm), 0 0 0 1px var(--ewm-line);
	line-height: 1.35;
	pointer-events: auto;
}

.ewm-wl-badge__text strong {
	display: block;
	color: var(--ewm-navy);
	font-size: 1rem;
	font-weight: 700;
}

.ewm-wl-badge__text small {
	display: block;
	color: var(--ewm-ink-soft);
	font-size: var(--ewm-fs-xs);
	font-weight: 500;
}

/* Teaching record in the teacher card: three numbers side by side, a word under each (first line of the card). */
.ewm-wl-badge__stats {
	display: flex;
	gap: 0.7rem;
}

.ewm-wl-badge__stat {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.ewm-wl-badge__stat + .ewm-wl-badge__stat {
	padding-inline-start: 0.7rem;
	border-inline-start: 1px solid var(--ewm-line);
}

/* "+1,800" and "+3" are read left to right, aligned with the Arabic word under them. */
.ewm-wl-badge__num {
	color: var(--ewm-navy);
	font-size: 1.05rem;
	font-weight: 800;
	direction: ltr;
	unicode-bidi: isolate;
	text-align: right;
}

.ewm-wl-badge__label {
	color: var(--ewm-ink-soft);
	font-size: var(--ewm-fs-xs);
	font-weight: 500;
	white-space: nowrap;
}

/* Qualification line inside the teacher card (kept off the photo). */
.ewm-wl-badge__credential {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.4rem;
	padding-top: 0.4rem;
	border-top: 1px dashed var(--ewm-sky-soft);
	color: var(--ewm-navy);
	font-size: var(--ewm-fs-xs);
	font-weight: 600;
}

.ewm-wl-badge__credential .ewm-icon {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
}
