/* ==========================================================================
   EMS — Egypt Malaya Studios · theme 2.0 "Manuscript"
   Brand colours from the logo (black · red · white), graded for a calm,
   scholarly look: warm ink instead of pure black, deep crimson instead of
   signal red, ivory and sand instead of stark white. The logo itself is
   never recoloured. Classical serif headings (Cormorant Garamond), Mulish
   text, Aref Ruqaa calligraphy, Amiri + Noto Naskh for Arabic.
   Logical properties throughout, so Arabic (RTL) mirrors automatically.
   ========================================================================== */

:root {
	/* Ink (graded black) */
	--ems-ink: #15110F;
	--ems-ink-2: #211B18;
	--ems-ink-3: #0E0B0A;
	/* Crimson (graded logo red) */
	--ems-crimson: #9E1B1E;
	--ems-crimson-dark: #7C1417;
	--ems-crimson-light: #D9574B;   /* accents on dark backgrounds */
	--ems-crimson-tint: #F6EAE7;
	/* Paper (graded white) */
	--ems-white: #FFFFFF;
	--ems-ivory: #FBF8F3;
	--ems-sand: #F3EDE3;
	--ems-sand-2: #E7DECF;
	--ems-sand-3: #CDBFA8;
	--ems-text: #2B2522;
	--ems-muted: #6A6058;
	--ems-stone: #8A7F72;
	--ems-line: #E6DDCE;

	/* Legacy names used by older markup */
	--ems-black: var(--ems-ink);
	--ems-red: var(--ems-crimson);
	--ems-red-ink: var(--ems-crimson);
	--ems-red-dark: var(--ems-crimson-dark);
	--ems-grey: var(--ems-sand);
	--ems-charcoal: var(--ems-ink-2);

	--ems-serif: "Cormorant Garamond", "Amiri", Georgia, "Times New Roman", serif;
	--ems-sans: Mulish, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--ems-callig: "Aref Ruqaa", "Amiri", serif;
	--ems-arabic: "Noto Naskh Arabic", "Amiri", Tahoma, serif;
	--ems-arabic-display: "Amiri", "Noto Naskh Arabic", serif;
	/* legacy */
	--ems-font-display: var(--ems-serif);
	--ems-font-body: var(--ems-sans);
	--ems-font-arabic: var(--ems-arabic);

	--ems-content: 760px;
	--ems-wide: 1200px;
	--ems-gutter: clamp(16px, 4vw, 40px);
	--ems-section-y: clamp(64px, 9vw, 120px);
	--ems-header-h: 84px;
	--ems-radius: 2px;
	--ems-shadow: 0 24px 48px -28px rgba(21, 17, 15, .38);
	--ems-shadow-soft: 0 14px 40px -24px rgba(21, 17, 15, .25);
	--ems-ease: cubic-bezier(.2, .7, .2, 1);

	/* Islamic geometric pattern (eight-point star lattice) */
	--ems-pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'%3E%3Crect x='20.5' y='20.5' width='31' height='31'/%3E%3Crect x='20.5' y='20.5' width='31' height='31' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 0L20.5 20.5M72 0L51.5 20.5M0 72L20.5 51.5M72 72L51.5 51.5M36 0V14M36 58V72M0 36H14M58 36H72'/%3E%3C/g%3E%3C/svg%3E");
	--ems-pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%2315110F' stroke-opacity='0.05' stroke-width='1'%3E%3Crect x='20.5' y='20.5' width='31' height='31'/%3E%3Crect x='20.5' y='20.5' width='31' height='31' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 0L20.5 20.5M72 0L51.5 20.5M0 72L20.5 51.5M72 72L51.5 51.5M36 0V14M36 58V72M0 36H14M58 36H72'/%3E%3C/g%3E%3C/svg%3E");
	--ems-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 7H48M72 7H120' stroke='%23CDBFA8' stroke-width='1'/%3E%3Cpath d='M60 0l2.2 4.8L67 7l-4.8 2.2L60 14l-2.2-4.8L53 7l4.8-2.2z' fill='%239E1B1E'/%3E%3C/svg%3E");
	--ems-ornament-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 7H48M72 7H120' stroke='%23ffffff' stroke-opacity='0.35' stroke-width='1'/%3E%3Cpath d='M60 0l2.2 4.8L67 7l-4.8 2.2L60 14l-2.2-4.8L53 7l4.8-2.2z' fill='%23D9574B'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--ems-header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
	margin: 0; background: var(--ems-ivory); color: var(--ems-text);
	font-family: var(--ems-sans); font-size: 1.0625rem; line-height: 1.75;
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--ems-crimson); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ems-crimson-dark); }
:focus-visible { outline: 2px solid var(--ems-crimson); outline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--ems-serif); color: var(--ems-ink); line-height: 1.15; margin: 0 0 .55em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.55rem; }
p { margin: 0 0 1.15em; }
::selection { background: var(--ems-crimson); color: #fff; }

.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important; }
.ems-skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000; background: var(--ems-ink); color: #fff; padding: 10px 16px; font-weight: 700; text-decoration: none; }
.ems-skip:focus { top: 12px; color: #fff; }
.ems-container { width: 100%; max-width: calc(var(--ems-content) + 2 * var(--ems-gutter)); margin-inline: auto; padding-inline: var(--ems-gutter); }
.ems-container--wide { max-width: calc(var(--ems-wide) + 2 * var(--ems-gutter)); }

/* ---------- Typography helpers ---------- */
.ems-display, .ems-content--blocks h2.ems-display, .ems-content--blocks h1.ems-display {
	font-family: var(--ems-serif); font-weight: 600; letter-spacing: -.005em;
	font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 1.08; margin-bottom: .45em; text-transform: none;
}
.ems-display strong { color: var(--ems-crimson); font-weight: 600; font-style: italic; }
.ems-display--center, .ems-content--blocks .ems-display--center { text-align: center; margin-inline: auto !important; }
.ems-display--center::after, .ems-ornament {
	content: ""; display: block; width: 120px; height: 14px; margin: .55em auto 0;
	background: var(--ems-ornament) center / contain no-repeat;
}
.ems-eyebrow {
	font-family: var(--ems-sans); font-size: .72rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
	color: var(--ems-stone); margin: 0 0 1em; display: flex; align-items: center; gap: .9em;
}
.ems-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--ems-crimson); flex: none; }
.ems-eyebrow--center { justify-content: center; text-align: center; }
.ems-eyebrow--center::after { content: ""; width: 28px; height: 1px; background: var(--ems-crimson); flex: none; }
.ems-eyebrow a { color: inherit; text-decoration: none; }
.ems-lead { font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.7; color: var(--ems-muted); }
.ems-section__intro { font-size: 1.12rem; color: var(--ems-muted); max-width: 680px; }
.ems-calligraphy { font-family: var(--ems-callig); font-weight: 700; font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.4; margin: 0 0 .25em; }

/* ---------- Buttons ---------- */
.ems-btn, .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: .55em;
	font-family: var(--ems-sans); font-weight: 700; font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2;
	padding: 1.15em 2.1em; border-radius: var(--ems-radius); border: 1px solid transparent; text-decoration: none; cursor: pointer;
	position: relative; overflow: hidden; isolation: isolate;
	transition: background-color .25s var(--ems-ease), color .25s var(--ems-ease), border-color .25s var(--ems-ease), box-shadow .25s var(--ems-ease);
}
.ems-btn--primary, .wp-block-button:not([class*="is-style-"]) .wp-block-button__link { background: var(--ems-crimson); color: #fff; border-color: var(--ems-crimson); }
.ems-btn--primary:hover, .wp-block-button:not([class*="is-style-"]) .wp-block-button__link:hover { background: var(--ems-crimson-dark); border-color: var(--ems-crimson-dark); color: #fff; box-shadow: 0 10px 24px -12px rgba(158, 27, 30, .7); }
.ems-btn--outline, .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--ems-ink); border-color: var(--ems-ink); }
.ems-btn--outline:hover, .wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--ems-ink); color: #fff; }
.ems-btn--inverse, .wp-block-button.is-style-inverse .wp-block-button__link { background: #fff; color: var(--ems-ink); border-color: #fff; }
.ems-btn--inverse:hover, .wp-block-button.is-style-inverse .wp-block-button__link:hover { background: var(--ems-sand); border-color: var(--ems-sand); color: var(--ems-ink); }
.ems-btn--outline-light, .wp-block-button.is-style-outline-light .wp-block-button__link { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.ems-btn--outline-light:hover, .wp-block-button.is-style-outline-light .wp-block-button__link:hover { background: #fff; color: var(--ems-ink); border-color: #fff; }
.ems-btn--sand, .wp-block-button.is-style-sand .wp-block-button__link { background: var(--ems-sand-3); color: var(--ems-ink); border-color: var(--ems-sand-3); }
.ems-btn--sand:hover, .wp-block-button.is-style-sand .wp-block-button__link:hover { background: #fff; border-color: #fff; color: var(--ems-ink); }
.ems-btn::after, .wp-block-button__link::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
	transform: translateX(-120%); transition: transform .8s var(--ems-ease);
}
.ems-btn:hover::after, .wp-block-button__link:hover::after { transform: translateX(120%); }
.ems-btn--sm { padding: .85em 1.5em; font-size: .72rem; }
.ems-btn--block { width: 100%; }
.ems-btn-row, .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8em; }
.ems-btn-row--center, .wp-block-buttons.ems-buttons--center { justify-content: center; }
.ems-link-arrow { font-weight: 700; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ems-ink); text-decoration: none; display: inline-flex; align-items: center; gap: .6em; }
.ems-link-arrow::after { content: "→"; color: var(--ems-crimson); transition: transform .25s var(--ems-ease); }
[dir="rtl"] .ems-link-arrow::after { content: "←"; }
.ems-link-arrow:hover { color: var(--ems-crimson); }
.ems-link-arrow:hover::after { transform: translateX(4px); }
[dir="rtl"] .ems-link-arrow:hover::after { transform: translateX(-4px); }

/* ---------- Top bar ---------- */
.ems-topbar { background: var(--ems-ink-3); color: rgba(255, 255, 255, .6); font-size: .78rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ems-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; }
.ems-topbar__note { margin: 0; letter-spacing: .04em; }
.ems-topbar__links { display: flex; align-items: center; gap: 22px; }
.ems-topbar a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.ems-topbar a:hover { color: #fff; }
.ems-lang { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.ems-lang a { display: block; padding: 3px 9px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; border: 1px solid transparent; border-radius: 2px; }
.ems-topbar .ems-lang a { color: rgba(255, 255, 255, .7); }
.ems-lang a.is-current { border-color: rgba(255, 255, 255, .35); color: #fff; }
@media (max-width: 900px) { .ems-topbar__note, .ems-topbar__email { display: none; } .ems-topbar__inner { justify-content: center; } }

/* ---------- Header ---------- */
.ems-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--ems-ink) var(--ems-pattern-light); color: #EFE7DC;
	border-bottom: 1px solid rgba(255, 255, 255, .07);
	transition: box-shadow .3s var(--ems-ease);
}
.admin-bar .ems-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ems-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ems-header { top: 0; } }
.ems-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8); }
.ems-header__inner { display: flex; align-items: center; gap: 28px; min-height: var(--ems-header-h); transition: min-height .3s var(--ems-ease); }
.ems-header.is-scrolled .ems-header__inner { min-height: 68px; }
.ems-header__brand { flex: none; }
.ems-logo, .custom-logo-link { display: block; line-height: 0; }
.ems-logo img, .custom-logo { height: 52px; width: auto; transition: height .3s var(--ems-ease); }
.ems-header.is-scrolled .ems-logo img { height: 44px; }
.ems-header__nav { display: flex; align-items: center; gap: 26px; margin-inline-start: auto; }
.ems-header__lang-mobile { display: none; }
.ems-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.ems-nav__list > li { position: relative; }
.ems-nav__list a {
	display: block; padding: 12px 13px; color: #EFE7DC; text-decoration: none;
	font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; position: relative; white-space: nowrap;
}
@media (min-width: 1100px) and (max-width: 1299px) {
	.ems-header__inner { gap: 18px; }
	.ems-header__nav { gap: 14px; }
	.ems-nav__list a { padding-inline: 8px; letter-spacing: .1em; font-size: .7rem; }
	.ems-nav__list > li > a::after { inset-inline: 8px; }
	.ems-nav__list .menu-item-has-children > a { padding-inline-end: 22px; }
	.ems-nav__list .menu-item-has-children > a::before { inset-inline-end: 8px; }
}
.ems-nav__list > li > a::after {
	content: ""; position: absolute; inset-inline: 13px; bottom: 6px; height: 1px; background: var(--ems-crimson-light);
	transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ems-ease);
}
.ems-nav__list > li > a:hover, .ems-nav__list > .current-menu-item > a, .ems-nav__list > .current_page_item > a, .ems-nav__list > .current-menu-ancestor > a { color: #fff; }
.ems-nav__list > li > a:hover::after, .ems-nav__list > .current-menu-item > a::after, .ems-nav__list > .current_page_item > a::after, .ems-nav__list > .current-menu-ancestor > a::after { transform: scaleX(1); }
.ems-nav__list .menu-item-has-children > a { padding-inline-end: 26px; }
.ems-nav__list .menu-item-has-children > a::before {
	content: ""; position: absolute; inset-inline-end: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
	border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .7;
}
.ems-nav__list .sub-menu {
	list-style: none; margin: 0; padding: 10px 0; position: absolute; top: 100%; inset-inline-start: 0; min-width: 280px; z-index: 20;
	background: var(--ems-ink-2); border-top: 2px solid var(--ems-crimson); box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .7);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s var(--ems-ease), transform .25s var(--ems-ease), visibility .25s;
}
.ems-nav__list li:hover > .sub-menu, .ems-nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.ems-nav__list .sub-menu a { padding: 10px 22px; font-size: .9rem; font-weight: 500; letter-spacing: .02em; text-transform: none; color: rgba(239, 231, 220, .85); }
.ems-nav__list .sub-menu a:hover, .ems-nav__list .sub-menu .current-menu-item > a { color: #fff; background: rgba(255, 255, 255, .05); }
.ems-nav__list .sub-menu li:first-child a { font-family: var(--ems-serif); font-style: italic; font-size: 1.05rem; color: var(--ems-sand-3); }
.ems-header__actions { display: flex; align-items: center; gap: 16px; }

.ems-nav-toggle { display: none; margin-inline-start: auto; width: 48px; height: 48px; padding: 0; background: transparent; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--ems-radius); cursor: pointer; position: relative; }
.ems-nav-toggle__bars, .ems-nav-toggle__bars::before, .ems-nav-toggle__bars::after { position: absolute; left: 13px; right: 13px; height: 1.5px; background: #fff; content: ""; transition: transform .25s var(--ems-ease), opacity .2s; }
.ems-nav-toggle__bars { top: 23px; }
.ems-nav-toggle__bars::before { left: 0; right: 0; top: -7px; }
.ems-nav-toggle__bars::after { left: 0; right: 0; top: 7px; }
.ems-nav-open .ems-nav-toggle__bars { background: transparent; }
.ems-nav-open .ems-nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.ems-nav-open .ems-nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1099px) {
	.ems-nav-toggle { display: block; }
	.ems-logo img, .custom-logo { height: 44px; }
	.ems-header__nav {
		display: none; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
		background: var(--ems-ink-2) var(--ems-pattern-light); border-bottom: 2px solid var(--ems-crimson);
		padding: 8px var(--ems-gutter) 26px; max-height: calc(100vh - var(--ems-header-h)); overflow-y: auto;
	}
	.ems-nav-open .ems-header__nav { display: flex; }
	.ems-nav__list { flex-direction: column; gap: 0; }
	.ems-nav__list a { padding: 15px 0; font-size: .85rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
	.ems-nav__list > li > a::after, .ems-nav__list .menu-item-has-children > a::before { display: none; }
	.ems-nav__list .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px; min-width: 0; }
	.ems-nav__list .sub-menu a { padding: 10px 18px; font-size: .95rem; border-bottom: 0; }
	.ems-header__actions { margin-top: 20px; justify-content: space-between; flex-wrap: wrap; }
	.ems-header__lang-mobile { display: block; }
	.ems-header__lang-mobile .ems-lang a { color: rgba(255, 255, 255, .75); border-color: rgba(255, 255, 255, .2); }
}

/* ---------- Page header band (inner pages) ---------- */
.ems-pagehead {
	background: var(--ems-ink) var(--ems-pattern-light); color: #fff; text-align: center;
	padding-block: clamp(64px, 9vw, 120px); border-bottom: 3px solid var(--ems-crimson);
}
.ems-pagehead .ems-container { max-width: calc(900px + 2 * var(--ems-gutter)); display: flex; flex-direction: column; align-items: center; }
.ems-pagehead .ems-eyebrow { color: var(--ems-sand-3); justify-content: center; }
.ems-pagehead .ems-eyebrow::after { content: ""; width: 28px; height: 1px; background: var(--ems-crimson-light); }
.ems-pagehead .ems-eyebrow::before { background: var(--ems-crimson-light); }
.ems-pagehead__title { font-family: var(--ems-serif); font-weight: 600; color: #fff; font-size: clamp(2.6rem, 5.6vw, 4.4rem); line-height: 1.05; margin: 0; }
.ems-pagehead--post .ems-pagehead__title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.ems-pagehead .ems-ornament { background-image: var(--ems-ornament-light); margin-top: 1.1em; }
.ems-pagehead__intro { margin: 1.2em 0 0; max-width: 640px; font-size: 1.1rem; color: rgba(255, 255, 255, .75); }

/* ---------- Block content layout ---------- */
.ems-content--blocks > * { max-width: var(--ems-content); margin-inline: auto; padding-inline: var(--ems-gutter); }
.ems-content--blocks > .ems-section, .ems-content--blocks > .alignwide, .ems-content--blocks > .ems-posts { max-width: calc(var(--ems-wide) + 2 * var(--ems-gutter)); }
.ems-content--blocks > .ems-upnext { max-width: calc(1120px + 2 * var(--ems-gutter)); }
.ems-content--blocks > .alignfull { max-width: none; padding-inline: max(var(--ems-gutter), calc((100% - var(--ems-wide)) / 2)); }
.ems-content--blocks > p:first-child, .ems-content--blocks > .wp-block-heading:first-child, .ems-content--blocks > .wp-block-list:first-child { margin-top: var(--ems-section-y); }
.ems-content--blocks > :last-child:not(.alignfull):not(.ems-section):not(.ems-posts) { margin-bottom: var(--ems-section-y); }
.ems-content--blocks .ems-section > *:not(.alignfull) { max-width: var(--ems-wide); margin-inline: auto; }
.ems-content--blocks .ems-section > .ems-section__intro { margin-inline: 0; max-width: 680px; }
.ems-content--blocks .ems-section > .ems-eyebrow, .ems-content--blocks .ems-section > .ems-display, .ems-content--blocks .ems-section > .wp-block-buttons { margin-inline: 0; }
.ems-content--blocks .ems-section > .ems-eyebrow--center, .ems-content--blocks .ems-section > .ems-display--center, .ems-content--blocks .ems-section > .ems-buttons--center { margin-inline: auto; }
.ems-content--blocks .ems-section.is-layout-constrained > * { margin-inline: auto !important; }
.ems-content--blocks .ems-section.is-layout-constrained > .ems-section__intro,
.ems-content--blocks .ems-section.is-layout-constrained > .ems-eyebrow:not(.ems-eyebrow--center),
.ems-content--blocks .ems-section.is-layout-constrained > .ems-display:not(.ems-display--center) { margin-inline: 0 !important; }
.ems-content--blocks .ems-section.alignfull.is-layout-constrained > * { max-width: var(--ems-wide); margin-inline: auto !important; }

.ems-section { padding-block: var(--ems-section-y); }
.ems-section--grey, .ems-section--sand { background: var(--ems-sand) var(--ems-pattern-dark); }
.ems-section--dark, .ems-section--ink { background: var(--ems-ink) var(--ems-pattern-light); color: rgba(255, 255, 255, .78); }
.ems-section--dark h2, .ems-section--dark h3, .ems-section--ink h2, .ems-section--ink h3 { color: #fff; }
.ems-section--dark a, .ems-section--ink a { color: #fff; }
.ems-section--dark .ems-display strong, .ems-section--ink .ems-display strong { color: var(--ems-crimson-light); }
.ems-section--dark .ems-eyebrow, .ems-section--ink .ems-eyebrow { color: var(--ems-sand-3); }
.ems-section--dark .ems-eyebrow::before, .ems-section--dark .ems-eyebrow::after, .ems-section--ink .ems-eyebrow::before, .ems-section--ink .ems-eyebrow::after { background: var(--ems-crimson-light); }
.ems-section--dark .ems-display--center::after, .ems-section--ink .ems-display--center::after { background-image: var(--ems-ornament-light); }
.ems-section--dark .ems-section__intro, .ems-section--ink .ems-section__intro { color: rgba(255, 255, 255, .7); }

.wp-block-columns { gap: clamp(24px, 4vw, 56px); margin-bottom: 0; }
.wp-block-image { margin: 0 0 1.5em; }
.wp-block-image img { display: block; width: 100%; }
.entry-content ul:not([class*="ems-"]):not(.wp-block-social-links) { padding-inline-start: 1.2em; }
.entry-content li::marker { color: var(--ems-crimson); }
.ems-split .wp-block-columns { align-items: center; }
.ems-frame, .is-style-ems-frame { position: relative; }
.ems-frame img, .is-style-ems-frame img { position: relative; z-index: 1; aspect-ratio: 4 / 3; object-fit: cover; }
.ems-frame::before, .is-style-ems-frame::before { content: ""; position: absolute; inset: 16px -16px -16px 16px; border: 1px solid var(--ems-sand-3); z-index: 0; }
[dir="rtl"] .ems-frame::before, [dir="rtl"] .is-style-ems-frame::before { inset: 16px 16px -16px -16px; }

/* Shared: background photo inside a block (.ems-bg) */
.ems-hero2, .ems-banner, .ems-tile, .ems-mtile--image { position: relative; overflow: hidden; isolation: isolate; }
.ems-hero2 > .ems-bg, .ems-banner > .ems-bg, .ems-tile > .ems-bg, .ems-mtile--image > .ems-bg { position: absolute; inset: 0; margin: 0; z-index: -2; max-width: none !important; padding: 0 !important; }
.ems-bg img, .ems-bg video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ems-hero2 > .ems-bg video { object-position: center 40%; }

/* Background / inline video clips (muted loops from the EMS footage channel) */
.wp-block-video.ems-mission__img { position: relative; margin: 0; flex: 1 1 auto; min-height: 320px; overflow: hidden; }
.ems-mission__img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
@media (max-width: 781px) { .wp-block-video.ems-mission__img { min-height: 420px; } }

/* ---------- Home hero ---------- */
.ems-hero2 {
	min-height: clamp(560px, 86vh, 860px); display: grid; place-items: center; text-align: center; color: #fff;
	padding-block: clamp(96px, 12vw, 150px) clamp(150px, 16vw, 210px);
}
.ems-hero2::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21, 17, 15, .5) 0%, rgba(21, 17, 15, .68) 55%, rgba(21, 17, 15, .88) 100%), var(--ems-pattern-light); }
.ems-hero2__content { max-width: 920px; margin-inline: auto; }
.ems-hero2 .ems-calligraphy { color: var(--ems-sand-3); }
.ems-hero2 .ems-display { color: #fff; font-size: clamp(3rem, 6.8vw, 5.8rem); line-height: 1.02; margin-bottom: .35em; }
.ems-hero2 .ems-display strong { color: #F1D9C8; }
.ems-hero2 .ems-lead { color: rgba(255, 255, 255, .82); max-width: 680px; margin-inline: auto; }
.ems-hero2 .wp-block-buttons { justify-content: center; }

/* "Up next" strip overlapping the hero */
.ems-upnext { position: relative; z-index: 3; margin-top: clamp(-150px, -11vw, -90px); }
.ems-upnext__grid { gap: 0 !important; align-items: stretch !important; }
.ems-upnext__side, .ems-upnext__feature { text-align: center; padding: 40px 32px !important; display: flex; flex-direction: column; align-items: center; }
.ems-upnext__side { background: #fff; box-shadow: var(--ems-shadow-soft); border-top: 2px solid var(--ems-sand-3); }
.ems-upnext__side p { color: var(--ems-muted); font-size: .98rem; margin-bottom: .6em; }
.ems-upnext__side h3, .ems-upnext__feature h3 { font-size: 1.7rem; margin-bottom: .4em; }
.ems-upnext__feature { background: var(--ems-crimson) var(--ems-pattern-light); color: #fff; box-shadow: var(--ems-shadow); margin-top: -26px; padding-block: 56px !important; }
.ems-upnext__feature h3 { color: #fff; font-size: 2rem; }
.ems-upnext__feature .ems-eyebrow { color: rgba(255, 255, 255, .8); }
.ems-upnext__feature .ems-eyebrow::before, .ems-upnext__feature .ems-eyebrow::after { background: rgba(255, 255, 255, .6); }
.ems-upnext__meta { font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .8); margin-bottom: .6em; }
.ems-upnext__date { font-family: var(--ems-serif); font-style: italic; font-size: 1.3rem; color: #fff; }
.ems-upnext .wp-block-buttons { justify-content: center; margin-top: auto; padding-top: 1em; }
@media (max-width: 781px) { .ems-upnext__feature { margin-top: 0; } }

/* Grid children: cancel WordPress's block-gap top margin so every row lines up */
.ems-tiles > *, .ems-mosaic > *, .ems-prog-list > *, .ems-upnext__grid > *, .ems-mission__aside > * { margin-block: 0 !important; }

/* Explore tiles */
.ems-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 2.6em; }
.ems-tile { aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; padding: 24px; box-shadow: var(--ems-shadow-soft); }
.ems-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21, 17, 15, .25), rgba(21, 17, 15, .7)); transition: background-color .4s var(--ems-ease); }
.ems-tile::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255, 255, 255, .28); z-index: -1; transition: inset .4s var(--ems-ease), border-color .4s; }
.ems-tile .ems-bg img { transition: transform 1s var(--ems-ease); }
.ems-tile:hover .ems-bg img { transform: scale(1.06); }
.ems-tile:hover::before { background-color: rgba(158, 27, 30, .35); }
.ems-tile:hover::after { inset: 20px; border-color: rgba(255, 255, 255, .55); }
.ems-tile__title { margin: 0; font-size: clamp(1.45rem, 2.2vw, 1.9rem); color: #fff; }
.ems-tile__title a { color: #fff; text-decoration: none; }
.ems-tile__title a::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 900px) { .ems-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ems-tiles { grid-template-columns: 1fr; } }

/* Mission & vision */
.ems-mission__grid { align-items: stretch !important; gap: clamp(24px, 3vw, 40px) !important; }
.ems-mission__card { background: #fff; padding: clamp(36px, 5vw, 64px) !important; box-shadow: var(--ems-shadow-soft); text-align: center; }
.ems-mission__card p { color: var(--ems-muted); }
.ems-mission__card .ems-display { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
.ems-mission__aside { display: flex; flex-direction: column; }
.ems-mission__img { margin: 0; flex: 1; min-height: 260px; }
.ems-mission__img img { height: 100%; object-fit: cover; }
.ems-notice-box { background: var(--ems-crimson) var(--ems-pattern-light); color: #fff; text-align: center; padding: 36px 32px; }
.ems-notice-box h3 { color: #fff; font-size: 1.8rem; margin-bottom: .3em; }
.ems-notice-box p { color: rgba(255, 255, 255, .88); }
.ems-notice-box .ems-eyebrow { color: rgba(255, 255, 255, .78); }
.ems-notice-box .ems-eyebrow::before, .ems-notice-box .ems-eyebrow::after { background: rgba(255, 255, 255, .55); }
.ems-notice-box .wp-block-buttons { margin-top: 1em; }

/* Journey banner */
.ems-banner { min-height: clamp(460px, 64vh, 640px); display: grid; place-items: center; text-align: center; color: #fff; padding-block: 100px; }
.ems-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21, 17, 15, .55), rgba(21, 17, 15, .72)); }
.ems-banner__content { max-width: 760px; margin-inline: auto; }
.ems-banner__title { font-family: var(--ems-serif); font-style: italic; font-weight: 500; color: #fff; font-size: clamp(2.8rem, 6.4vw, 5rem); line-height: 1.05; letter-spacing: .01em; }
.ems-banner p { color: rgba(255, 255, 255, .85); font-size: 1.12rem; }

/* What we offer mosaic */
.ems-mosaic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2.6em; box-shadow: var(--ems-shadow-soft); }
.ems-mtile { min-height: 280px; padding: clamp(32px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; text-align: center; background: #fff; transition: transform .35s var(--ems-ease), box-shadow .35s var(--ems-ease); position: relative; }
.ems-mtile:nth-child(even) { background: var(--ems-sand); }
.ems-mtile:hover { transform: translateY(-4px); box-shadow: var(--ems-shadow); z-index: 1; }
.ems-mtile h3 { font-size: 1.7rem; margin-bottom: .45em; }
.ems-mtile p { color: var(--ems-muted); font-size: .98rem; margin: 0; }
.ems-mtile--image, .ems-mtile--ink, .ems-mtile--crimson { color: #fff; }
.ems-mtile--image h3, .ems-mtile--ink h3, .ems-mtile--crimson h3 { color: #fff; }
.ems-mtile--image p, .ems-mtile--ink p, .ems-mtile--crimson p { color: rgba(255, 255, 255, .86); }
.ems-mtile--image::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21, 17, 15, .55), rgba(21, 17, 15, .82)); }
.ems-mtile--ink { background: var(--ems-ink) var(--ems-pattern-light) !important; }
.ems-mtile--crimson { background: var(--ems-crimson) var(--ems-pattern-light) !important; }
@media (max-width: 900px) { .ems-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ems-mosaic { grid-template-columns: 1fr; } .ems-mtile { min-height: 0; } }

/* Upcoming programmes (list) */
.ems-prog-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(24px, 4vw, 56px); margin-top: 2.6em; }
.ems-prog-row { border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 24px; }
.ems-prog-row__title { font-size: 1.6rem; margin-bottom: .4em; }
.ems-prog-row__title a { text-decoration: none; }
.ems-prog-row__title a:hover { color: var(--ems-sand-3) !important; }
.ems-prog-row__text { font-size: .98rem; color: rgba(255, 255, 255, .7); }
.ems-prog-row__meta, .ems-prog-row__date, .ems-prog-row__status { font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 .5em; }
.ems-prog-row__meta { color: var(--ems-sand-3); }
.ems-prog-row__date { color: rgba(255, 255, 255, .85); }
.ems-prog-row__status { display: inline-block; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .3); color: #fff; margin-top: .4em; }
.ems-prog-row__status--open { border-color: var(--ems-crimson-light); color: #F4C1B9; }
.ems-upcoming .wp-block-buttons { margin-top: 3em; }
@media (max-width: 900px) { .ems-prog-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .ems-prog-list { grid-template-columns: 1fr; } }

/* Latest articles section */
.ems-content--blocks > .ems-posts { padding-block: var(--ems-section-y); }
.ems-posts__more { text-align: center; margin-top: 2.4em; }

/* Stats (About) */
.ems-stats { background: var(--ems-sand) var(--ems-pattern-dark); padding-block: clamp(40px, 5vw, 64px); }
.ems-stats__grid { max-width: var(--ems-wide); margin-inline: auto; }
.ems-stats .wp-block-column { border-inline-start: 1px solid var(--ems-crimson); padding-inline-start: 22px; }
.ems-stat__num { font-family: var(--ems-serif); font-weight: 600; font-size: clamp(2.8rem, 5vw, 4rem); line-height: 1; color: var(--ems-ink); margin: 0 0 .15em; }
.ems-stat__label { font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ems-muted); margin: 0; }
@media (max-width: 781px) { .ems-stats__grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 28px 20px !important; } }

/* ---------- Cards & grids ---------- */
.ems-grid { display: grid; gap: clamp(20px, 2.5vw, 32px); }
.ems-grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 2.2em; }
.ems-grid--books { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.ems-card { background: #fff; border: 1px solid var(--ems-line); display: flex; flex-direction: column; position: relative; transition: transform .35s var(--ems-ease), box-shadow .35s var(--ems-ease); }
.ems-card::before { content: ""; position: absolute; inset-inline: -1px; top: -1px; height: 2px; background: var(--ems-crimson); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ems-ease); z-index: 2; }
.ems-card:hover { transform: translateY(-4px); box-shadow: var(--ems-shadow); }
.ems-card:hover::before { transform: scaleX(1); }
.ems-card__media { display: block; position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ems-ink); }
.ems-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transition: transform .8s var(--ems-ease); }
.ems-card:hover .ems-card__media img { transform: scale(1.05); }
.ems-card__media--book { aspect-ratio: 3 / 4; background: var(--ems-sand); }
.ems-card__placeholder { display: block; width: 100%; height: 100%; background: var(--ems-ink) var(--ems-pattern-light); }
.ems-card__body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.ems-card__body .ems-eyebrow { font-size: .66rem; margin-bottom: .7em; }
.ems-card__title { font-size: 1.55rem; margin: 0 0 .4em; }
.ems-card__title a { color: var(--ems-ink); text-decoration: none; }
.ems-card__title a:hover { color: var(--ems-crimson); }
.ems-card__text { color: var(--ems-muted); font-size: .98rem; margin-bottom: 1em; }
.ems-card__meta { font-size: .82rem; font-weight: 600; color: var(--ems-ink-2); margin-bottom: 1.2em; }
.ems-card .ems-link-arrow { margin-top: auto; }
.ems-card__price { font-weight: 700; color: var(--ems-crimson); margin: 0; }
.ems-badge { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 6px 11px; background: var(--ems-ink); color: #fff; }
.ems-badge--open { background: var(--ems-crimson); }
.ems-badge--closed { background: #6b6460; }

/* Features (About, programmes) */
.ems-features { margin-top: 2.4em; flex-wrap: wrap !important; }
.ems-feature { padding-top: 22px; border-top: 1px solid var(--ems-sand-3); transition: border-color .3s var(--ems-ease), transform .3s var(--ems-ease); }
.ems-feature:hover { border-top-color: var(--ems-crimson); transform: translateY(-3px); }
.ems-section--dark .ems-feature, .ems-section--ink .ems-feature { border-top-color: rgba(255, 255, 255, .2); }
.ems-feature h3 { font-size: 1.45rem; margin-bottom: .45em; }
.ems-feature p { color: var(--ems-muted); margin: 0; }
.ems-section--dark .ems-feature p, .ems-section--ink .ems-feature p { color: rgba(255, 255, 255, .72); }

/* Learning pathways (legacy) */
.ems-paths { margin-top: 2.4em; }
.ems-path { border: 1px solid rgba(255, 255, 255, .16); padding: 28px 24px; display: flex; flex-direction: column; transition: border-color .25s; }
.ems-path:hover { border-color: var(--ems-crimson-light); }
.ems-path__step { font-family: var(--ems-serif); font-size: 2.4rem; line-height: 1; color: var(--ems-crimson-light); margin-bottom: .4em; }
.ems-path p { color: rgba(255, 255, 255, .72); font-size: .97rem; }
.ems-path__link { margin-top: auto; margin-bottom: 0; }
.ems-path__link a { color: #fff; font-weight: 700; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--ems-crimson-light); padding-bottom: 3px; }

/* Reach & audience (About) */
.ems-reach { margin-top: 2.2em; }
.ems-reach__item { background: #fff; padding: 30px; border-inline-start: 2px solid var(--ems-crimson); transition: transform .3s var(--ems-ease), box-shadow .3s var(--ems-ease); }
.ems-reach__item:hover { transform: translateY(-4px); box-shadow: var(--ems-shadow); }
.ems-reach__item h3 { font-size: 1.6rem; margin-bottom: .2em; }
.ems-reach__item p { margin: 0; color: var(--ems-muted); }
.ems-audience { list-style: none; padding: 0 !important; margin: 2em 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.ems-audience li { font-family: var(--ems-serif); font-weight: 600; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1; padding: 16px 28px; border: 1px solid var(--ems-sand-3); background: #fff; color: var(--ems-ink); transition: background-color .3s, color .3s, border-color .3s; }
.ems-audience li::marker { content: ""; }
.ems-audience li:hover { background: var(--ems-ink); border-color: var(--ems-ink); color: #fff; }

/* CTA band */
.ems-cta { background: var(--ems-crimson) var(--ems-pattern-light); color: #fff; text-align: center; padding-block: clamp(64px, 8vw, 110px); }
.ems-content--blocks .ems-cta > * { max-width: 820px !important; margin-inline: auto !important; }
.ems-cta .ems-display { color: #fff; }
.ems-cta p { color: rgba(255, 255, 255, .9); font-size: 1.12rem; }
.ems-cta .wp-block-buttons, .ems-cta .ems-btn-row { justify-content: center; }
.ems-cta .ems-container { text-align: center; }

/* Callout (programme pages) */
.ems-callout { background: var(--ems-sand); border-inline-start: 2px solid var(--ems-crimson); padding: 30px 34px; margin-block: 2.5em; }
.ems-callout h3 { margin-top: 0; }
.ems-callout .wp-block-buttons { margin-top: 1em; }

/* Mission quote */
.ems-quote { background: var(--ems-sand) var(--ems-pattern-dark); text-align: center; padding-block: clamp(80px, 10vw, 140px); position: relative; overflow: hidden; }
.ems-quote::before { content: "\201C"; display: block; font-family: var(--ems-serif); font-size: 8rem; line-height: .6; color: var(--ems-crimson); height: .45em; }
.ems-content--blocks .ems-quote > * { position: relative; max-width: 900px !important; margin-inline: auto !important; }
.ems-quote__text { font-family: var(--ems-serif); font-style: italic; font-weight: 500; color: var(--ems-ink); font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.2; margin-top: .4em; }
.ems-quote__text strong { color: var(--ems-crimson); font-weight: 600; }
.ems-quote__by { color: var(--ems-stone); font-size: .72rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; margin: 1.4em 0 0; }

/* Subject ticker (legacy) */
.ems-marquee { background: var(--ems-ink); color: #fff; overflow: hidden; padding-block: 14px; }
.ems-content--blocks > .ems-marquee { padding-inline: 0; }
.ems-marquee__track { margin: 0; white-space: nowrap; display: flex; width: max-content; max-width: none !important; font-family: var(--ems-serif); font-size: 1.4rem; font-style: italic; }
.ems-marquee__track span { padding-inline-end: .6em; }
.ems-marquee__track .ems-dot { color: var(--ems-crimson-light); padding-inline: .2em .6em; }
.ems-marquee.is-ready .ems-marquee__track { animation: ems-marquee 40s linear infinite; }
[dir="rtl"] .ems-marquee.is-ready .ems-marquee__track { animation-name: ems-marquee-rtl; }

/* ---------- Programme single ---------- */
.ems-programme__hero { background: var(--ems-ink) var(--ems-pattern-light); color: rgba(255, 255, 255, .82); border-bottom: 3px solid var(--ems-crimson); }
.ems-programme__hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(48px, 7vw, 96px); }
.ems-programme__hero .ems-eyebrow { color: var(--ems-sand-3); }
.ems-programme__hero .ems-eyebrow::before { background: var(--ems-crimson-light); }
.ems-programme__title { font-family: var(--ems-serif); font-weight: 600; color: #fff; font-size: clamp(2.6rem, 5.6vw, 4.4rem); line-height: 1.04; margin: 0 0 .35em; }
.ems-programme__intro { font-size: 1.15rem; color: rgba(255, 255, 255, .8); max-width: 560px; }
.ems-programme__hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; outline: 1px solid rgba(205, 191, 168, .6); outline-offset: 12px; }
.ems-programme__body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); padding-block: var(--ems-section-y); align-items: start; }
.ems-programme__content > * { max-width: none; margin-inline: 0; padding-inline: 0; }
.ems-programme__content.ems-content--blocks > *:first-child { margin-top: 0; }
.ems-programme__aside { position: sticky; top: calc(var(--ems-header-h) + 24px); }
.ems-facts-card { border: 1px solid var(--ems-line); border-top: 3px solid var(--ems-crimson); padding: 26px; background: #fff; box-shadow: var(--ems-shadow-soft); }
.ems-facts-card__title { font-family: var(--ems-serif); font-size: 1.8rem; margin-bottom: .3em; }
.ems-facts { margin: 0 0 1.4em; }
.ems-facts__row { padding: 12px 0; border-bottom: 1px solid var(--ems-line); }
.ems-facts dt { font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ems-stone); }
.ems-facts dd { margin: 3px 0 0; font-weight: 600; color: var(--ems-ink); }
@media (max-width: 900px) { .ems-programme__hero-grid, .ems-programme__body { grid-template-columns: 1fr; } .ems-programme__aside { position: static; } }

/* Archive filter */
.ems-filter { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ems-filter a { padding: 9px 18px; border: 1px solid var(--ems-sand-3); color: var(--ems-ink); text-decoration: none; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; background: #fff; }
.ems-filter a:hover { border-color: var(--ems-ink); }
.ems-filter a[aria-current="page"] { background: var(--ems-ink); border-color: var(--ems-ink); color: #fff; }

/* Resources single */
.ems-resource__grid { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(24px, 5vw, 64px); }
.ems-resource__price { font-family: var(--ems-serif); font-size: 2.4rem; color: var(--ems-crimson); margin: 0 0 .4em; }
@media (max-width: 760px) { .ems-resource__grid { grid-template-columns: 1fr; } }

/* Empty states */
.ems-empty-state { text-align: center; max-width: 620px; margin-inline: auto; padding-block: 24px; }
.ems-empty-state h2 { font-size: 2.4rem; }
.ems-empty { color: var(--ems-muted); text-align: center; }

/* Blog single */
.ems-post-hero { max-width: calc(var(--ems-wide) * .75); }
.ems-post-hero img { display: block; width: 100%; margin-top: 40px; }
.ems-content--article { font-size: 1.1rem; }
.ems-content--article > h2 { margin-top: 1.8em; }
.ems-post-footer { padding-bottom: var(--ems-section-y); }
.ems-post-nav .nav-links { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--ems-line); padding-top: 24px; }
.ems-tags a { display: inline-block; padding: 4px 10px; background: var(--ems-sand); color: var(--ems-ink); text-decoration: none; font-size: .85rem; margin: 0 4px 4px 0; }
.pagination, .ems-pagination { margin-top: 48px; }
.nav-links .page-numbers { display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--ems-line); color: var(--ems-ink); text-decoration: none; margin-inline-end: 6px; }
.nav-links .page-numbers.current { background: var(--ems-ink); color: #fff; border-color: var(--ems-ink); }
.search-form { display: flex; gap: 8px; max-width: 460px; margin: 1.5em auto; }
.search-form label { flex: 1; }
.search-field { width: 100%; }
.search-submit { background: var(--ems-ink); color: #fff; border: 0; padding: 0 18px; font-weight: 700; cursor: pointer; }

/* ---------- Forms ---------- */
.ems-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.ems-field { margin: 0 0 14px; display: flex; flex-direction: column; }
.ems-field--full { grid-column: 1 / -1; }
.ems-field label { font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--ems-ink-2); }
.ems-field label span, .ems-field--check label span { color: var(--ems-crimson); }
.ems-form input[type="text"], .ems-form input[type="email"], .ems-form input[type="tel"], .ems-form select, .ems-form textarea, .search-field {
	font: inherit; font-size: 1rem; color: var(--ems-text); background: #fff; border: 1px solid var(--ems-sand-3); border-radius: var(--ems-radius); padding: 12px 14px; width: 100%;
	transition: border-color .2s, box-shadow .2s;
}
.ems-form input:focus, .ems-form select:focus, .ems-form textarea:focus, .search-field:focus { outline: none; border-color: var(--ems-ink); box-shadow: 0 0 0 3px rgba(158, 27, 30, .18); }
.ems-form textarea { resize: vertical; min-height: 140px; }
.ems-field--check { flex-direction: row; align-items: flex-start; gap: 10px; }
.ems-field--check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ems-crimson); flex: none; }
.ems-field--check label { margin: 0; font-weight: 500; }
.ems-form__note { font-size: .85rem; color: var(--ems-muted); }
.ems-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ems-notice { padding: 16px 20px; margin-bottom: 24px; border-inline-start: 3px solid; }
.ems-notice--success { background: #F1F7F1; border-color: #2E6B3A; color: #1E4426; }
.ems-notice--error { background: var(--ems-crimson-tint); border-color: var(--ems-crimson); color: var(--ems-crimson-dark); }
@media (max-width: 640px) { .ems-form__grid { grid-template-columns: 1fr; } }
.ems-contact-page .wp-block-columns { align-items: flex-start; }
.ems-contact-page__form { background: #fff; padding: clamp(26px, 4vw, 46px) !important; border-top: 3px solid var(--ems-crimson); box-shadow: var(--ems-shadow-soft); }
.ems-contact { list-style: none; margin: 1.6em 0; padding: 0; }
.ems-contact li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--ems-line); }
.ems-contact__label { font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ems-stone); }
.ems-contact a { color: var(--ems-ink); font-weight: 600; text-decoration: none; }
.ems-contact a:hover { color: var(--ems-crimson); }
.ems-btn--whatsapp::before {
	content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3C8.9 3 3 8.8 3 16c0 2.3.6 4.5 1.8 6.5L3 29l6.7-1.7A13 13 0 0 0 16 29c7.2 0 13-5.8 13-13S23.2 3 16 3Zm5.9 15.7c-.3-.2-1.9-.9-2.2-1-.3-.1-.5-.2-.7.1-.2.3-.8 1-1 1.3-.2.2-.4.2-.7.1-.3-.2-1.4-.5-2.6-1.6-.9-.9-1.6-1.9-1.8-2.2-.2-.3 0-.5.1-.7l.5-.6c.2-.2.2-.3.3-.5.1-.2 0-.4 0-.6l-1-2.4c-.3-.6-.5-.5-.7-.6h-.6c-.2 0-.6.1-.9.4-.3.3-1.1 1.1-1.1 2.7s1.1 3.1 1.3 3.3c.2.2 2.2 3.4 5.4 4.8 2.7 1.1 3.2.9 3.8.8.6-.1 1.9-.8 2.2-1.5.3-.7.3-1.4.2-1.5-.1-.1-.3-.2-.6-.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3C8.9 3 3 8.8 3 16c0 2.3.6 4.5 1.8 6.5L3 29l6.7-1.7A13 13 0 0 0 16 29c7.2 0 13-5.8 13-13S23.2 3 16 3Zm5.9 15.7c-.3-.2-1.9-.9-2.2-1-.3-.1-.5-.2-.7.1-.2.3-.8 1-1 1.3-.2.2-.4.2-.7.1-.3-.2-1.4-.5-2.6-1.6-.9-.9-1.6-1.9-1.8-2.2-.2-.3 0-.5.1-.7l.5-.6c.2-.2.2-.3.3-.5.1-.2 0-.4 0-.6l-1-2.4c-.3-.6-.5-.5-.7-.6h-.6c-.2 0-.6.1-.9.4-.3.3-1.1 1.1-1.1 2.7s1.1 3.1 1.3 3.3c.2.2 2.2 3.4 5.4 4.8 2.7 1.1 3.2.9 3.8.8.6-.1 1.9-.8 2.2-1.5.3-.7.3-1.4.2-1.5-.1-.1-.3-.2-.6-.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ems-wa-float { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; background: var(--ems-ink); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .55); border: 2px solid var(--ems-crimson); transition: transform .25s var(--ems-ease), background-color .25s; }
.ems-wa-float:hover { transform: scale(1.06); background: var(--ems-crimson); color: #fff; }

/* ---------- Footer ---------- */
.ems-footer { background: var(--ems-ink) var(--ems-pattern-light); color: rgba(255, 255, 255, .7); font-size: .95rem; }
.ems-touch { background: var(--ems-ink-2) var(--ems-pattern-light); text-align: center; padding-block: clamp(64px, 8vw, 100px); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ems-touch .ems-eyebrow { color: var(--ems-sand-3); }
.ems-touch .ems-eyebrow::before, .ems-touch .ems-eyebrow::after { background: var(--ems-crimson-light); }
.ems-touch__title { color: #fff; font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin-bottom: .3em; }
.ems-touch__text { color: rgba(255, 255, 255, .72); font-size: 1.1rem; max-width: 620px; margin-inline: auto; }
.ems-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-block: clamp(56px, 7vw, 88px); }
.ems-footer .ems-logo img { height: auto; width: 200px; }
.ems-footer__tagline { margin-top: 20px; max-width: 320px; font-family: var(--ems-serif); font-style: italic; font-size: 1.2rem; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.ems-footer__title { color: #fff; font-family: var(--ems-sans); font-size: .72rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; margin-bottom: 18px; }
.ems-footer__list { list-style: none; margin: 0; padding: 0; }
.ems-footer__list li { margin-bottom: 10px; }
.ems-footer a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.ems-footer a:hover { color: #fff; }
.ems-footer .ems-contact { margin: 0; }
.ems-footer .ems-contact li { border-color: rgba(255, 255, 255, .1); padding: 8px 0 10px; }
.ems-footer .ems-contact__label { color: rgba(255, 255, 255, .45); }
.ems-footer .ems-contact a, .ems-footer .ems-contact span { color: #fff; font-weight: 500; }
.ems-social { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ems-social a { display: inline-block; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .25); font-size: .78rem; }
.ems-footer__bottom { background: var(--ems-ink-3); font-size: .82rem; }
.ems-footer__bottom .ems-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; }
.ems-footer__bottom p { margin: 0; }
@media (max-width: 960px) { .ems-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ems-footer__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   MOTION (all disabled for prefers-reduced-motion — see top of file)
   ========================================================================== */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.ems-header { view-transition-name: ems-header; }
::view-transition-old(root) { animation: ems-vt-out .25s var(--ems-ease) both; }
::view-transition-new(root) { animation: ems-vt-in .45s var(--ems-ease) both; }
@keyframes ems-vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes ems-vt-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes ems-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ems-fade-zoom { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes ems-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ems-wipe-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes ems-marquee { to { transform: translateX(-50%); } }
@keyframes ems-marquee-rtl { to { transform: translateX(50%); } }

.ems-hero2__content > *, .ems-pagehead .ems-container > *, .ems-programme__hero-text > * { animation: ems-rise 1s var(--ems-ease) both; }
.ems-hero2__content > :nth-child(1), .ems-pagehead .ems-container > :nth-child(1), .ems-programme__hero-text > :nth-child(1) { animation-delay: .1s; }
.ems-hero2__content > :nth-child(2), .ems-pagehead .ems-container > :nth-child(2), .ems-programme__hero-text > :nth-child(2) { animation-delay: .25s; }
.ems-hero2__content > :nth-child(3), .ems-pagehead .ems-container > :nth-child(3), .ems-programme__hero-text > :nth-child(3) { animation-delay: .4s; }
.ems-hero2__content > :nth-child(4), .ems-pagehead .ems-container > :nth-child(4), .ems-programme__hero-text > :nth-child(4) { animation-delay: .55s; }
.ems-hero2 > .ems-bg img, .ems-hero2 > .ems-bg video { animation: ems-fade-zoom 1.8s var(--ems-ease) both; }
.ems-programme__hero-media img { animation: ems-wipe 1.15s .3s cubic-bezier(.75, 0, .2, 1) both; }
[dir="rtl"] .ems-programme__hero-media img { animation-name: ems-wipe-rtl; }

.ems-js-reveal .ems-reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ems-ease), transform .9s var(--ems-ease); transition-delay: var(--ems-d, 0s); }
.ems-js-reveal .ems-reveal.is-visible { opacity: 1; transform: none; }
.ems-js-reveal .ems-reveal--img { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1.2s cubic-bezier(.75, 0, .2, 1); transition-delay: var(--ems-d, 0s); }
.ems-js-reveal .ems-reveal--img.is-visible { clip-path: inset(0 0 0 0); }
.ems-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; background: var(--ems-crimson-light); transform: scaleX(var(--ems-p, 0)); transform-origin: left; }
[dir="rtl"] .ems-progress { transform-origin: right; }
.admin-bar .ems-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .ems-progress { top: 46px; } }

/* ==========================================================================
   ARABIC (RTL)
   ========================================================================== */
[dir="rtl"] body { font-family: var(--ems-arabic); line-height: 1.95; font-size: 1.08rem; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] .ems-display, [dir="rtl"] .ems-pagehead__title, [dir="rtl"] .ems-programme__title, [dir="rtl"] .ems-stat__num,
[dir="rtl"] .ems-facts-card__title, [dir="rtl"] .ems-banner__title, [dir="rtl"] .ems-quote__text, [dir="rtl"] .ems-touch__title,
[dir="rtl"] .ems-tile__title, [dir="rtl"] .ems-footer__tagline, [dir="rtl"] .ems-upnext__date, [dir="rtl"] .ems-audience li {
	font-family: var(--ems-arabic-display); font-style: normal; letter-spacing: 0; line-height: 1.5;
}
[dir="rtl"] .ems-display strong, [dir="rtl"] .ems-quote__text strong { font-style: normal; }
[dir="rtl"] .ems-hero2 .ems-display { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.35; }
[dir="rtl"] .ems-eyebrow, [dir="rtl"] .ems-nav__list a, [dir="rtl"] .ems-btn, [dir="rtl"] .wp-block-button__link,
[dir="rtl"] .ems-stat__label, [dir="rtl"] .ems-link-arrow, [dir="rtl"] .ems-facts dt, [dir="rtl"] .ems-footer__title,
[dir="rtl"] .ems-upnext__meta, [dir="rtl"] .ems-prog-row__meta, [dir="rtl"] .ems-prog-row__date, [dir="rtl"] .ems-prog-row__status,
[dir="rtl"] .ems-quote__by, [dir="rtl"] .ems-contact__label, [dir="rtl"] .ems-filter a, [dir="rtl"] .ems-badge {
	letter-spacing: 0; text-transform: none;
}
[dir="rtl"] .ems-eyebrow { font-size: .9rem; }
[dir="rtl"] .ems-footer__title { font-size: 1rem; }
[dir="rtl"] .ems-contact__label, [dir="rtl"] .ems-facts dt, [dir="rtl"] .ems-quote__by, [dir="rtl"] .ems-badge, [dir="rtl"] .ems-filter a { font-size: .85rem; }
[dir="rtl"] .ems-upnext__meta, [dir="rtl"] .ems-prog-row__meta, [dir="rtl"] .ems-prog-row__date, [dir="rtl"] .ems-prog-row__status, [dir="rtl"] .ems-stat__label { font-size: .9rem; }
[dir="rtl"] .ems-topbar { font-size: .85rem; }
[dir="rtl"] .ems-nav__list a { font-size: .95rem; }
[dir="rtl"] .ems-btn, [dir="rtl"] .wp-block-button__link { font-size: .92rem; }
[dir="rtl"] .ems-nav__list > li > a::after, [dir="rtl"] .ems-card::before { transform-origin: right; }

/* ---------- Print ---------- */
@media print {
	.ems-topbar, .ems-header, .ems-footer, .ems-wa-float, .ems-nav-toggle, .ems-progress { display: none !important; }
	.ems-pagehead, .ems-hero2, .ems-section--dark, .ems-section--ink, .ems-cta, .ems-banner { background: none !important; color: #000 !important; }
}
