/*
 * Ryad Al Maârifa — the home page (blueprint §C, §E, §F).
 *
 * Ported from the approved mockups « accueil / parcours » (artifact
 * bf5ab886) and « accueil-ar » (f8c6fe48): their class names, their token
 * names, their values. Loaded after theme.css, on the home page only
 * (`functions.php`). Everything is scoped under `.ram-home`, the class every
 * home section carries, so nothing here reaches another page.
 *
 * Tokens: the mockups' own (`--paper`, `--ivory`, `--navy`, `--mat`…), light
 * and dark, with the same two dark entries as theme.css (system preference
 * unless the toggle asked for light; the toggle's explicit dark). The shared
 * mockup stylesheet defines the same names with the same values, so the two
 * compose whichever loads last.
 *
 * Typefaces (20 October 2026, docs/POLICES.md): Newsreader for the
 * editorial headings and the quote, Manrope for the text, the labels and
 * every figure (« 03 → 18 », ages, years, results: 700), IBM Plex Sans
 * Arabic for all Arabic.
 */

:root {
	--paper: #f1ebdf;
	--ivory: #e7dfcf;
	--line: #d8cfbd;
	--ink: #172033;
	--ink2: #56617a;
	--navy: #132a4f;
	--navy2: #0e1f3a;
	--bordeaux: #8c2231;
	--onnavy: #e6ecf6;
	--onnavy2: #a9b8d3;
	--white: #fbf8f1;
	--mat: #d99a3e;
	--pri: #5e9e88;
	--col: #4f86b6;
	--lyc: var(--bordeaux);
	--bac: #e9b96e;
	/* Encres des cycles (Variante 1, décision du 20 octobre 2026) : la teinte
	   du cycle quand elle peint du TEXTE sur fond clair (pierre, carte), en
	   clair seulement. Aplats, pastilles, bandes et dégradés gardent --mat… ;
	   le sombre et les bandes nuit gardent l'originale (alias plus bas). */
	--mat-ink: #9a5f0e;
	--pri-ink: #2f6b57;
	--col-ink: #2d5f8a;
	--lyc-ink: var(--lyc);
	--bac-ink: #8a6118;
	--content: 1240px;
	/* One section rhythm for the whole home (final polish brief, 13 October
	   2026): every band starts and ends on the same step. */
	--sec: clamp(56px, 6vw, 80px);
	--ram-serif: var(--wp--preset--font-family--newsreader);
	--ram-sans: var(--wp--preset--font-family--manrope);
	--ram-kufi: var(--wp--preset--font-family--ibm-plex-sans-arabic);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #132a4f;
		--ivory: #0e1f3a;
		--line: #2b4472;
		--ink: #ece8df;
		--ink2: #b7c3d9;
		--navy: #0e1f3a;
		--navy2: #0a1628;
		--bordeaux: #da828e;
		--white: #1a3358;
		--mat-ink: var(--mat);
		--pri-ink: var(--pri);
		--col-ink: var(--col);
		--lyc-ink: var(--lyc);
		--bac-ink: var(--bac);
	}
}

:root[data-theme="dark"] {
	--paper: #132a4f;
	--ivory: #0e1f3a;
	--line: #2b4472;
	--ink: #ece8df;
	--ink2: #b7c3d9;
	--navy: #0e1f3a;
	--navy2: #0a1628;
	--bordeaux: #da828e;
	--white: #1a3358;
	--mat-ink: var(--mat);
	--pri-ink: var(--pri);
	--col-ink: var(--col);
	--lyc-ink: var(--lyc);
	--bac-ink: var(--bac);
}

/* ------------------------------------------------------------------
 * Frame: the sections are the page body, full width; each one centres
 * its own content on the page measure — the content shell (1240) and the
 * gutter of the footer's `.wrap` (`--ram-gutter`, theme.css). The bands
 * (parcours, environnement, promotion) still run full bleed; only their
 * content is held (plan de finition du 20 octobre 2026, P1 #4: `.wide`
 * no longer reaches 1560, which left the home edge to edge at 1440).
 * ------------------------------------------------------------------ */

.wp-block-post-content > .ram-home {
	max-width: none;
	margin-block: 0;
	margin-inline: 0;
}

.ram-home {
	font-family: var(--ram-sans);
	color: var(--ink);
}

.ram-home h1,
.ram-home h2,
.ram-home h3 {
	margin: 0;
	font-family: var(--ram-serif);
	font-weight: 500;
	line-height: 1.08;
	text-wrap: balance;
	color: inherit;
}

.ram-home a {
	color: inherit;
}

.ram-home img {
	display: block;
	max-width: 100%;
}

.ram-home .ar {
	font-family: var(--ram-kufi);
	font-weight: 500;
	line-height: 1.6;
}

/* An Arabic line inside a French page stays on the French page's edge. */
html:not([dir="rtl"]) .ram-home .ar {
	text-align: left;
}

.ram-home.content,
.ram-home .content,
.ram-home.wide,
.ram-home .wide {
	margin-inline: auto;
	padding-inline: var(--ram-gutter, 32px);
}

.ram-home.content,
.ram-home .content {
	max-width: var(--content);
}

.ram-home.wide,
.ram-home .wide {
	max-width: var(--content);
}

.ram-home .cta {
	display: inline-block;
	padding: 11px 20px;
	border: 1px solid var(--bordeaux);
	border-radius: 3px;
	background: var(--bordeaux);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.ram-home .cta.ghost {
	background: none;
	color: var(--bordeaux);
}

:root[data-theme="dark"] .ram-home .cta:not(.ghost) {
	background: #8c2231;
	border-color: #8c2231;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ram-home .cta:not(.ghost) {
		background: #8c2231;
		border-color: #8c2231;
	}
}

/* ------------------------------------------------------------------
 * 01 — Ouverture: 03 → 18.
 * ------------------------------------------------------------------ */

.ram-home.hero {
	display: block;
	padding-block: 40px 0;
}

/* Final polish brief (13 October 2026): at 1440–1600 × 900 the whole
 * proposition — 03 → 18, the headline, the Arabic line, the paragraph and
 * both calls to action — sits in the first viewport. The picture is held to
 * the viewport's height (it used to be a 4:5 box as tall as its 7fr column,
 * ~1060px at 1440, which pushed the copy below the fold) and the numerals'
 * ceiling comes down from 196px. Same asymmetry, picture on the right. */
.ram-home .hero-grid {
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: 48px;
	align-items: end;
}

.ram-home .big {
	font-family: var(--ram-sans);
	font-weight: 700;
	font-size: clamp(76px, 9.4vw, 148px);
	line-height: 0.92;
	letter-spacing: -0.035em;
	font-variant-numeric: tabular-nums;
	color: var(--navy);
}

.ram-home .big span {
	color: var(--bordeaux);
}

.ram-home.hero h1 {
	max-width: 22ch;
	margin-block-start: 22px;
	font-size: clamp(30px, 2.9vw, 42px);
}

/* The brand line is two sentences; each starts its own line, as it did in
   the display serif's measure (Newsreader sets narrower, 20 October 2026). */
.ram-home.hero h1 .ln {
	display: block;
}

.ram-home.hero .ar {
	margin-block-start: 8px;
	font-size: 24px;
	color: var(--ink2);
}

.ram-home.hero p {
	max-width: 44ch;
	margin: 14px 0 22px;
	font-size: 18px;
	line-height: 1.55;
	color: var(--ink2);
}

.ram-home .hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.ram-home .hero-media {
	height: clamp(420px, calc(100vh - 190px), 760px);
	overflow: hidden;
	border-radius: 2px;
	background: var(--ivory);
}

.ram-home .hero-media img,
.ram-home .media43 img,
.ram-home .pr .media img,
.ram-home .envphoto img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Dark: navy text turns light, as on every heading of the dark scheme. */
:root[data-theme="dark"] .ram-home .big {
	color: var(--ink);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ram-home .big {
		color: var(--ink);
	}
}

/* Arabic home: the mockup's phead2 opening. */
.ram-home.phead2 {
	padding-block: 64px 40px;
}

.ram-home.phead2 .grid {
	display: grid;
	grid-template-columns: 7fr 5fr;
	gap: 48px;
	align-items: end;
}

.ram-home.phead2 h1 {
	margin-block-start: 18px;
	font-family: var(--ram-kufi);
	font-size: clamp(30px, 3.9vw, 52px);
	font-weight: 600;
	line-height: 1.45;
}

/* The Arabic page reads « 03 ← 18 » from the right, as its age grid and its
   path rail do (03 on the right, the arrow pointing left): the numerals were
   set left to right, the only line of the page running against it (passe du
   20 octobre 2026, #14). */
.ram-home .hero-big {
	text-align: start;
	font-family: var(--ram-sans);
	font-weight: 700;
	font-size: clamp(70px, 11vw, 150px);
	line-height: 0.92;
	letter-spacing: -0.035em;
	font-variant-numeric: tabular-nums;
	color: var(--navy);
}

.ram-home .hero-big span {
	margin: 0 0.1em;
	font-size: 0.5em;
	vertical-align: middle;
	color: var(--bordeaux);
}

:root[data-theme="dark"] .ram-home .hero-big {
	color: var(--ink);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ram-home .hero-big {
		color: var(--ink);
	}
}

.ram-home .arlede {
	max-width: 46ch;
	margin-block: 18px 0;
	font-size: 20px;
	line-height: 1.8;
}

.ram-home.phead2 .hero-actions {
	margin-block-start: 22px;
}

.ram-home .media43 {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 2px;
	background: var(--ivory);
}

.ram-home.phead2 .media43 {
	aspect-ratio: 4 / 5;
}

.ram-home .lat {
	font-family: var(--ram-sans);
}

/* ------------------------------------------------------------------
 * 02 — « Où commence votre parcours ? » The mockup's segmented control.
 * Without JavaScript the four stages are links to the cycle pages; with
 * it, toggle buttons (`aria-pressed`) and `<html data-depart>` (amendment
 * 3). The sections below only emphasise or reorder, never hide.
 * ------------------------------------------------------------------ */

.ram-home.start {
	padding-block: var(--sec) 0;
}

.ram-home.start h2 {
	margin-block-end: 8px;
	font-size: clamp(28px, 3vw, 38px);
}

.ram-home .depart-intro {
	max-width: 56ch;
	margin: 0 0 24px;
	color: var(--ink2);
}

/* Final polish brief (13 October 2026): typography first, no box. Four
 * columns under one hairline, thin separators between them; the cycle colour
 * appears only on the chosen stage, as the bar of the 03 → 18 line under its
 * age — the same mark the Parcours chapters carry. */
.ram-home .seg {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	overflow: visible;
	border: 0;
	border-block-start: 1px solid var(--line);
	border-radius: 0;
	background: none;
}

.ram-home .seg-opt {
	position: relative;
	display: block;
	text-decoration: none;
	padding: 18px 20px 16px;
	border: 0;
	border-inline-start: 1px solid var(--line);
	color: var(--ink);
	cursor: pointer;
}

.ram-home .seg-opt:first-child {
	border-inline-start: 0;
	padding-inline-start: 0;
}

.ram-home .seg-opt::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: -2px;
	height: 3px;
	background: transparent;
	transition: background-color 0.2s;
}

.ram-home .seg-opt[data-stage="maternelle"] { --c: var(--mat); --ci: var(--mat-ink); }
.ram-home .seg-opt[data-stage="primaire"] { --c: var(--pri); --ci: var(--pri-ink); }
.ram-home .seg-opt[data-stage="college"] { --c: var(--col); --ci: var(--col-ink); }
.ram-home .seg-opt[data-stage="lycee"] { --c: var(--lyc); --ci: var(--lyc-ink); }

.ram-home .seg b {
	display: block;
	font-family: var(--ram-sans);
	font-size: clamp(24px, 2.2vw, 31px);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.1;
}

.ram-home .seg small {
	display: block;
	margin-block-start: 4px;
	font-size: 15px;
	color: var(--ink2);
}

.ram-home .seg-opt:hover b {
	color: var(--bordeaux);
}

.ram-home .seg-opt:focus-visible {
	outline: 2px solid var(--bordeaux);
	outline-offset: 2px;
}

.ram-home .seg-opt[aria-pressed="true"],
[data-depart="maternelle"] .ram-home .seg-opt[data-stage="maternelle"],
[data-depart="primaire"] .ram-home .seg-opt[data-stage="primaire"],
[data-depart="college"] .ram-home .seg-opt[data-stage="college"],
[data-depart="lycee"] .ram-home .seg-opt[data-stage="lycee"] {
	background: none;
	box-shadow: none;
}

.ram-home .seg-opt[aria-pressed="true"]::before,
[data-depart="maternelle"] .ram-home .seg-opt[data-stage="maternelle"]::before,
[data-depart="primaire"] .ram-home .seg-opt[data-stage="primaire"]::before,
[data-depart="college"] .ram-home .seg-opt[data-stage="college"]::before,
[data-depart="lycee"] .ram-home .seg-opt[data-stage="lycee"]::before {
	background: var(--c);
}

.ram-home .seg-opt[aria-pressed="true"] small,
[data-depart="maternelle"] .ram-home .seg-opt[data-stage="maternelle"] small,
[data-depart="primaire"] .ram-home .seg-opt[data-stage="primaire"] small,
[data-depart="college"] .ram-home .seg-opt[data-stage="college"] small,
[data-depart="lycee"] .ram-home .seg-opt[data-stage="lycee"] small {
	color: var(--ink);
	font-weight: 600;
}

.ram-home .seg .hint {
	grid-column: 1 / -1;
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	font-size: 14px;
	color: var(--ink2);
}

.ram-home .seg-clear {
	margin-inline-start: 10px;
	padding: 0;
	border: 0;
	border-block-end: 1px solid currentColor;
	background: none;
	font: inherit;
	font-weight: 600;
	color: var(--bordeaux);
	cursor: pointer;
}

.ram-home .seg-clear[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.ram-home .seg-opt::before {
		transition: none;
	}
}

/* ------------------------------------------------------------------
 * 03 — Le Parcours: six chapters on one coloured line (navy band on the
 * French home, the light `.chaps` of the Arabic mockup).
 * ------------------------------------------------------------------ */

.ram-home .ch[data-cycle="maternelle"] { --c: var(--mat); --ci: var(--mat-ink); }
.ram-home .ch[data-cycle="primaire"] { --c: var(--pri); --ci: var(--pri-ink); }
.ram-home .ch[data-cycle="college"] { --c: var(--col); --ci: var(--col-ink); }
.ram-home .ch[data-cycle="lycee"] { --c: var(--lyc); --ci: var(--lyc-ink); }
.ram-home .ch[data-cycle="bac"] { --c: var(--bac); --ci: var(--bac-ink); }
.ram-home .ch[data-cycle="apres"] { --c: var(--onnavy2); }
.ram-home .chaps .ch[data-cycle="apres"] { --c: var(--line); }

/* The « after » arrow is text: --line is for the dot and the path, too faint
 * for a glyph (1.4:1 light, 1.6:1 dark). */
.ram-home .chaps .ch[data-cycle="apres"] .age { color: var(--ink2); }

.ram-home.parcours {
	margin-block-start: var(--sec);
	padding-block: var(--sec);
	background: var(--navy);
	color: var(--onnavy);
}

.ram-home.parcours .head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 24px;
	margin-block-end: 40px;
}

.ram-home.parcours h2 {
	max-width: 26ch;
	font-size: clamp(30px, 3.4vw, 46px);
	color: #fff;
}

.ram-home.parcours h2 .ar {
	display: block;
	font-size: 0.8em;
	color: var(--onnavy2);
}

.ram-home.parcours .head p {
	max-width: 40ch;
	margin: 0;
	color: var(--onnavy2);
}

.ram-home .chapters,
.ram-home .chaps {
	position: relative;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ram-home .chaps {
	margin-block-start: 16px;
}

.ram-home .chapters::before,
.ram-home .chaps::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: 34px;
	height: 2px;
	background: linear-gradient(90deg, var(--mat) 0 16.6%, var(--pri) 16.6% 33.3%, var(--col) 33.3% 50%, var(--lyc) 50% 66.6%, var(--bac) 66.6% 83.3%, var(--onnavy2) 83.3% 100%);
}

.ram-home .chaps::before {
	background: linear-gradient(90deg, var(--mat) 0 16.6%, var(--pri) 16.6% 33.3%, var(--col) 33.3% 50%, var(--lyc) 50% 66.6%, var(--bac) 66.6% 83.3%, var(--line) 83.3% 100%);
}

[dir="rtl"] .ram-home .chapters::before {
	background: linear-gradient(270deg, var(--mat) 0 16.6%, var(--pri) 16.6% 33.3%, var(--col) 33.3% 50%, var(--lyc) 50% 66.6%, var(--bac) 66.6% 83.3%, var(--onnavy2) 83.3% 100%);
}

[dir="rtl"] .ram-home .chaps::before {
	background: linear-gradient(270deg, var(--mat) 0 16.6%, var(--pri) 16.6% 33.3%, var(--col) 33.3% 50%, var(--lyc) 50% 66.6%, var(--bac) 66.6% 83.3%, var(--line) 83.3% 100%);
}

.ram-home .ch {
	position: relative;
	margin: 0;
	padding-inline-end: 18px;
}

.ram-home .ch::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 28px;
	width: 14px;
	height: 14px;
	border: 3px solid var(--c);
	border-radius: 50%;
	background: var(--navy);
	box-sizing: border-box;
}

.ram-home .chaps .ch::before {
	background: var(--paper);
}

.ram-home .ch .age {
	display: block;
	margin-block-end: 26px;
	font-family: var(--ram-sans);
	font-weight: 700;
	font-size: 24px;
	letter-spacing: -0.01em;
	font-style: normal;
	line-height: 1;
	color: var(--c);
}

/* Sur le fond clair de `.chaps` (accueil arabe), l'encre du cycle. */
.ram-home .chaps .ch .age {
	color: var(--ci, var(--c));
}

.ram-home .ch h3 {
	margin: 6px 0 8px;
	font-size: 22px;
}

.ram-home.parcours .ch h3 {
	color: #fff;
}

/* The lycée's bordeaux reads at ~1.6:1 on the navy band: its age takes the
 * dark scheme's bordeaux there (the line and the dot keep the cycle colour). */
.ram-home.parcours .ch[data-cycle="lycee"] .age {
	color: #da828e;
}

.ram-home .ch p {
	margin: 0 0 10px;
	font-size: 15px;
	color: var(--onnavy2);
}

.ram-home .chaps .ch p {
	color: var(--ink2);
}

.ram-home .ch a {
	font-size: 14px;
	font-weight: 600;
	color: #fff;
}

.ram-home .chaps .ch a {
	color: var(--bordeaux);
}

/* The chosen stage: the mockup's `.ch.on`, the dot kept on the line. */
[data-depart="maternelle"] .ram-home .ch[data-cycle="maternelle"],
[data-depart="primaire"] .ram-home .ch[data-cycle="primaire"],
[data-depart="college"] .ram-home .ch[data-cycle="college"],
[data-depart="lycee"] .ram-home .ch[data-cycle="lycee"] {
	margin-inline-start: -12px;
	padding-inline-start: 12px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.06);
}

[data-depart="maternelle"] .ram-home .chaps .ch[data-cycle="maternelle"],
[data-depart="primaire"] .ram-home .chaps .ch[data-cycle="primaire"],
[data-depart="college"] .ram-home .chaps .ch[data-cycle="college"],
[data-depart="lycee"] .ram-home .chaps .ch[data-cycle="lycee"] {
	background: var(--ivory);
}

[data-depart="maternelle"] .ram-home .ch[data-cycle="maternelle"]::before,
[data-depart="primaire"] .ram-home .ch[data-cycle="primaire"]::before,
[data-depart="college"] .ram-home .ch[data-cycle="college"]::before,
[data-depart="lycee"] .ram-home .ch[data-cycle="lycee"]::before {
	inset-inline-start: 12px;
	background: var(--c);
}

.ram-home.sec {
	padding-block: var(--sec) 0;
}

.ram-home.sec h2 {
	max-width: 30ch;
	font-family: var(--ram-kufi);
	font-size: clamp(28px, 3.2vw, 41px);
	font-weight: 600;
	line-height: 1.45;
}

.ram-home .sec-lede {
	max-width: 60ch;
	color: var(--ink2);
}

/* ------------------------------------------------------------------
 * 04 — Les quatre valeurs: natural height, one after the other.
 * ------------------------------------------------------------------ */

.ram-home.principes,
.ram-home.vals {
	padding-block: var(--sec) 0;
}

.ram-home .intro {
	max-width: 64ch;
	margin-block-end: 40px;
}

.ram-home .intro h2 {
	margin-block-end: 12px;
	font-size: clamp(30px, 3.4vw, 46px);
}

.ram-home .intro p {
	margin: 0;
	color: var(--ink2);
}

.ram-home .pr {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: center;
	padding-block: 44px;
	border-block-start: 1px solid var(--line);
}

.ram-home .pr.flip .media {
	order: -1;
}

.ram-home .pr h3 {
	margin: 0 0 6px;
	font-size: clamp(34px, 4vw, 56px);
}

.ram-home .pr .ar {
	font-size: 28px;
	color: var(--ink2);
}

.ram-home .pr .en {
	font-size: 15px;
	font-style: italic;
	color: var(--ink2);
}

.ram-home .pr p {
	max-width: 52ch;
	margin: 18px 0 0;
}

.ram-home .pr .ev {
	display: grid;
	gap: 8px;
	margin-block-start: 22px;
	padding: 0;
	list-style: none;
	font-size: 15px;
}

.ram-home .pr .ev li {
	padding-inline-start: 16px;
	border-inline-start: 2px solid var(--line);
}

.ram-home .pr .ev b {
	font-weight: 600;
}

.ram-home .pr .media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 2px;
	background: var(--ivory);
}

/* ------------------------------------------------------------------
 * 05 — Tout un environnement. The chosen stage's facilities lead.
 * ------------------------------------------------------------------ */

.ram-home.env {
	margin-block-start: calc(var(--sec) - 44px);
	padding-block: var(--sec);
	background: var(--ivory);
}

.ram-home.env blockquote {
	max-width: 22ch;
	margin: 0;
	padding: 0;
	border: 0;
	font-family: var(--ram-serif);
	font-weight: 500;
	font-size: clamp(28px, 3.6vw, 52px);
	line-height: 1.08;
}

.ram-home.env blockquote em {
	font-style: italic;
	font-weight: 600;
	/* « tout un environnement » is the point of the sentence: one line. */
	white-space: nowrap;
	color: var(--bordeaux);
}

.ram-home.env .sub {
	max-width: 56ch;
	margin: 18px 0 40px;
	color: var(--ink2);
}

.ram-home .envlist {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px 48px;
}

.ram-home .envlist > div {
	padding-block-start: 14px;
	border-block-start: 1px solid var(--line);
}

.ram-home .envlist b {
	display: block;
	margin-block-end: 6px;
	font-family: var(--ram-serif);
	font-size: 23px;
	font-weight: 500;
	line-height: 1.2;
}

.ram-home .envlist span {
	font-size: 15.5px;
	color: var(--ink2);
}

[data-depart="maternelle"] .ram-home .envlist > [data-cycles~="maternelle"],
[data-depart="primaire"] .ram-home .envlist > [data-cycles~="primaire"],
[data-depart="college"] .ram-home .envlist > [data-cycles~="college"],
[data-depart="lycee"] .ram-home .envlist > [data-cycles~="lycee"] {
	order: -1;
}

[data-depart="maternelle"] .ram-home .envlist > [data-cycles="maternelle"],
[data-depart="primaire"] .ram-home .envlist > [data-cycles="primaire"],
[data-depart="college"] .ram-home .envlist > [data-cycles~="college"]:not([data-cycles~="maternelle"]):not([data-cycles~="primaire"]),
[data-depart="lycee"] .ram-home .envlist > [data-cycles~="lycee"]:not([data-cycles~="maternelle"]):not([data-cycles~="primaire"]) {
	order: -2;
	border-block-start: 2px solid var(--bordeaux);
}

.ram-home .envphoto {
	aspect-ratio: 21 / 9;
	overflow: hidden;
	margin-block-start: 44px;
	border-radius: 2px;
}

/* ------------------------------------------------------------------
 * 06 — Les résultats: only the distinguished years on the line.
 * ------------------------------------------------------------------ */

.ram-home.res {
	padding-block: var(--sec) 0;
}

.ram-home .head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 24px;
	margin-block-end: 36px;
}

.ram-home.res h2 {
	max-width: 22ch;
	font-size: clamp(30px, 3.4vw, 46px);
}

.ram-home .head > a {
	font-weight: 600;
	white-space: nowrap;
	color: var(--bordeaux);
}

.ram-home .line {
	position: relative;
	height: 150px;
	margin-block-start: 10px;
	padding: 0 40px;
	direction: ltr;
}

.ram-home .line::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 6px;
	height: 2px;
	background: var(--line);
}

.ram-home .yr {
	position: absolute;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	height: 150px;
	transform: translateX(-50%);
}

.ram-home .yr[data-y="2007"] { left: 12%; }
.ram-home .yr[data-y="2012"] { left: 36%; }
.ram-home .yr[data-y="2019"] { left: 64%; }
.ram-home .yr[data-y="2020"] { left: 73%; }
.ram-home .yr[data-y="2022"] { left: 83%; }

.ram-home .yr b {
	display: block;
	font-family: var(--ram-sans);
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.ram-home .yr small {
	display: block;
	max-width: 12ch;
	min-height: 2.6em;
	margin: 2px 0 10px;
	font-size: 12.5px;
	text-align: center;
	color: var(--ink2);
}

.ram-home .yr i {
	display: block;
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--bordeaux);
}

.ram-home .ends {
	display: flex;
	justify-content: space-between;
	margin-block-start: 8px;
	font-family: var(--ram-sans);
	font-weight: 600;
	font-size: 16px;
	color: var(--ink2);
}

.ram-home .ends .ar {
	font-size: 0.95em;
}

/* The three verified figures, at display size (final polish brief). The
   numbers are Manrope 700, the words that follow them Newsreader. */
.ram-home .figures {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
	margin: -8px 0 28px;
	font-family: var(--ram-serif);
	font-weight: 500;
	font-size: clamp(22px, 2.2vw, 30px);
	line-height: 1.2;
	color: var(--ink2);
}

.ram-home .figures b {
	font-family: var(--ram-sans);
	font-weight: 700;
	font-size: 1.5em;
	letter-spacing: -0.02em;
	color: var(--navy);
}

:root[data-theme="dark"] .ram-home .figures b {
	color: var(--ink);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ram-home .figures b {
		color: var(--ink);
	}
}

[dir="rtl"] .ram-home .figures {
	font-family: var(--ram-kufi);
	font-size: clamp(19px, 1.9vw, 26px);
}

[dir="rtl"] .ram-home .figures b {
	font-family: var(--ram-sans);
}

.ram-home .res-note {
	margin: 18px 0 0;
	font-size: 15px;
	color: var(--ink2);
}

/* Arabic home: the five distinguished years as a row (mockup `.laur`). */
.ram-home.laur-sec {
	padding-block: var(--sec) 0;
}

.ram-home.laur-sec h2 {
	font-family: var(--ram-kufi);
	font-size: clamp(28px, 3.2vw, 41px);
	font-weight: 600;
	line-height: 1.45;
}

.ram-home.laur-sec p {
	max-width: 62ch;
}

.ram-home .laur {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
	margin-block-start: 8px;
}

.ram-home .laur div {
	padding-block-start: 10px;
	border-block-start: 2px solid var(--bordeaux);
}

.ram-home .laur b {
	display: block;
	font-family: var(--ram-sans);
	font-size: 26px;
	font-weight: 700;
}

.ram-home .laur span {
	font-size: 14.5px;
	color: var(--ink2);
}

/* ------------------------------------------------------------------
 * 08 — La promotion, typographic.
 * ------------------------------------------------------------------ */

.ram-home.promo {
	margin-block-start: var(--sec);
	padding-block: var(--sec);
	background: var(--navy2);
	color: var(--onnavy);
}

.ram-home.promo .grid {
	display: grid;
	grid-template-columns: 6fr 6fr;
	gap: 56px;
	align-items: center;
}

.ram-home.promo .name {
	margin: 0;
	direction: rtl;
	text-align: left;
	font-family: var(--ram-kufi);
	font-weight: 600;
	font-size: clamp(60px, 7vw, 112px);
	line-height: 1.25;
	color: #fff;
}

[dir="rtl"] .ram-home.promo .name {
	text-align: right;
}

/* The year, a sentence under the name (no label above it). */
.ram-home.promo .name-note {
	margin: 10px 0 0;
	font-size: 16px;
	color: var(--onnavy2);
}

.ram-home.promo .name a {
	color: inherit;
	text-decoration: none;
}

.ram-home.promo .name a:hover,
.ram-home.promo .name a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.ram-home.promo h2 {
	margin-block-end: 12px;
	font-size: clamp(28px, 3vw, 40px);
	color: #fff;
}

.ram-home.promo p {
	max-width: 46ch;
	color: var(--onnavy2);
}

.ram-home.promo .years {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-start: 22px;
}

.ram-home.promo .years > span {
	padding: 5px 12px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	font-size: 14px;
}

.ram-home.promo .years .ar {
	font-size: 16px;
}

.ram-home.promo a.more {
	display: inline-block;
	margin-block-start: 22px;
	font-weight: 600;
	color: #fff;
}

/* ------------------------------------------------------------------
 * 09 — La vie de l'école: one lead story, three secondary.
 * ------------------------------------------------------------------ */

.ram-home.vie {
	padding-block: var(--sec) 0;
}

.ram-home.vie .head {
	margin-block-end: 28px;
}

.ram-home.vie h2 {
	font-size: clamp(30px, 3.4vw, 46px);
}

.ram-home .mag {
	display: grid;
	grid-template-columns: 7fr 5fr;
	gap: 40px;
}

.ram-home .lead-story img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 2px;
}

.ram-home .lead-story small,
.ram-home .st small {
	display: block;
	margin-block-start: 14px;
	font-size: 14px;
	color: var(--ink2);
}

.ram-home .lead-story h3 {
	margin: 6px 0 8px;
	font-size: clamp(26px, 2.6vw, 34px);
}

.ram-home .lead-story h3 a,
.ram-home .st h3 a {
	text-decoration: none;
}

.ram-home .lead-story p,
.ram-home .st p {
	margin: 0;
	font-size: 16px;
	color: var(--ink2);
}

.ram-home .side {
	display: grid;
	gap: 22px;
	align-content: start;
}

.ram-home .st {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 16px;
	padding-block-start: 18px;
	border-block-start: 1px solid var(--line);
}

.ram-home .st img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 2px;
}

.ram-home .st small {
	margin-block-start: 0;
}

.ram-home .st h3 {
	margin: 4px 0;
	font-size: 19px;
}

.ram-home .vie-empty {
	color: var(--ink2);
}

/* ------------------------------------------------------------------
 * 10 — Rejoindre Ryad Al Maârifa: one path, four steps.
 * ------------------------------------------------------------------ */

.ram-home.adm {
	margin-block-start: var(--sec);
	/* The footer's own top margin closes the page: no second gap. */
	padding-block: var(--sec) 0;
	/* The rule over the section spans the text measure, not the gutters. */
	background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--ram-gutter, 32px)) 1px no-repeat;
}

.ram-home.adm .grid {
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: 56px;
	align-items: start;
}

.ram-home.adm h2 {
	margin-block-end: 12px;
	font-size: clamp(30px, 3.4vw, 46px);
}

.ram-home.adm p {
	max-width: 42ch;
	color: var(--ink2);
}

.ram-home .path {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.ram-home .path::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: 11px;
	height: 2px;
	background: var(--line);
}

.ram-home .path li {
	position: relative;
	padding-block-start: 32px;
	padding-inline-end: 18px;
}

.ram-home .path li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: 5px;
	width: 14px;
	height: 14px;
	border: 3px solid var(--bordeaux);
	border-radius: 50%;
	background: var(--paper);
	box-sizing: border-box;
}

.ram-home .path b {
	display: block;
	margin-block-end: 6px;
	font-family: var(--ram-serif);
	font-size: 22px;
	font-weight: 500;
}

.ram-home .path span {
	font-size: 15px;
	color: var(--ink2);
}

[data-depart="primaire"] .ram-home .path [data-cycles~="primaire"] b,
[data-depart="college"] .ram-home .path [data-cycles~="college"] b,
[data-depart="lycee"] .ram-home .path [data-cycles~="lycee"] b {
	color: var(--bordeaux);
}

/* Address, telephone, e-mail: three aligned lines rather than a row that
   left the e-mail alone on the next one (plan de finition du 20 octobre
   2026, P2 #10). The Arabic home writes them as one sentence (`p.contact`),
   which stays a paragraph. */
.ram-home .contact {
	margin-block-start: 32px;
	font-size: 15.5px;
	color: var(--ink2);
}

.ram-home div.contact {
	display: flex;
	flex-direction: column;
	align-items: start;
	gap: 6px;
}

/* ------------------------------------------------------------------
 * Arabic home: the mockup's type settings, Plex Arabic throughout.
 * ------------------------------------------------------------------ */

[dir="rtl"] .ram-home {
	font-family: var(--ram-kufi);
	line-height: 1.9;
}

[dir="rtl"] .ram-home h2,
[dir="rtl"] .ram-home h3,
[dir="rtl"] .ram-home .pr h3,
[dir="rtl"] .ram-home .envlist b,
[dir="rtl"] .ram-home .path b,
[dir="rtl"] .ram-home .lead-story h3 {
	font-family: var(--ram-kufi);
	font-weight: 600;
	line-height: 1.45;
}

[dir="rtl"] .ram-home.env blockquote {
	max-width: 26ch;
	font-family: var(--ram-kufi);
	font-weight: 600;
	font-size: clamp(26px, 3.3vw, 44px);
	line-height: 1.45;
}

[dir="rtl"] .ram-home .lat,
[dir="rtl"] .ram-home .seg b {
	font-family: var(--ram-sans);
	font-weight: 700;
}

/* ------------------------------------------------------------------
 * The English home keeps the phase-B ladder for now: the same emphasis
 * on its stops.
 * ------------------------------------------------------------------ */

[data-depart="maternelle"] .stop[data-cycle="maternelle"],
[data-depart="primaire"] .stop[data-cycle="primaire"],
[data-depart="college"] .stop[data-cycle="college"],
[data-depart="lycee"] .stop[data-cycle="lycee"] {
	margin: -12px;
	padding: 12px;
	border-radius: 4px;
	background: var(--ivory);
	box-shadow: inset 0 -3px 0 var(--bordeaux);
}

[data-depart="maternelle"] .stop[data-cycle="maternelle"]::before,
[data-depart="primaire"] .stop[data-cycle="primaire"]::before,
[data-depart="college"] .stop[data-cycle="college"]::before,
[data-depart="lycee"] .stop[data-cycle="lycee"]::before {
	inset-block-start: -10px;
	inset-inline-start: 12px;
}

/* ------------------------------------------------------------------
 * Narrow screens: the mockups' breakpoints.
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
	.ram-home .hero-grid,
	.ram-home.phead2 .grid,
	.ram-home .pr,
	.ram-home.promo .grid,
	.ram-home .mag,
	.ram-home.adm .grid {
		grid-template-columns: 1fr;
	}

	.ram-home .hero-media {
		height: auto;
		aspect-ratio: 3 / 2;
	}

	.ram-home .pr {
		gap: 24px;
	}

	.ram-home .pr.flip .media {
		order: 0;
	}

	.ram-home.parcours .head,
	.ram-home .head {
		flex-direction: column;
		align-items: start;
	}

	.ram-home .chapters,
	.ram-home .chaps {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.ram-home .chapters::before,
	.ram-home .chaps::before,
	[dir="rtl"] .ram-home .chapters::before,
	[dir="rtl"] .ram-home .chaps::before {
		inset-inline-start: 6px;
		inset-inline-end: auto;
		inset-block: 0;
		width: 2px;
		height: auto;
		background: linear-gradient(180deg, var(--mat) 0 16.6%, var(--pri) 16.6% 33.3%, var(--col) 33.3% 50%, var(--lyc) 50% 66.6%, var(--bac) 66.6% 83.3%, var(--onnavy2) 83.3% 100%);
	}

	.ram-home .ch {
		padding-inline-start: 30px;
	}

	.ram-home .ch::before {
		inset-block-start: 6px;
	}

	.ram-home .ch .age {
		margin-block-end: 6px;
	}

	[data-depart="maternelle"] .ram-home .ch[data-cycle="maternelle"],
	[data-depart="primaire"] .ram-home .ch[data-cycle="primaire"],
	[data-depart="college"] .ram-home .ch[data-cycle="college"],
	[data-depart="lycee"] .ram-home .ch[data-cycle="lycee"] {
		padding-inline-start: 42px;
	}

	.ram-home .envlist {
		grid-template-columns: 1fr;
	}

	.ram-home .line {
		display: none;
	}


	.ram-home .laur {
		grid-template-columns: 1fr 1fr;
	}

	.ram-home .path {
		grid-template-columns: 1fr 1fr;
		row-gap: 24px;
	}
}

@media (max-width: 700px) {
	.ram-home.hero {
		padding-block-start: 24px;
	}

	/* One stage per row, age then name on one line: a list, not four small cards. */
	.ram-home .seg {
		grid-template-columns: 1fr;
	}

	.ram-home .seg-opt,
	.ram-home .seg-opt:first-child {
		display: flex;
		align-items: baseline;
		gap: 14px;
		padding: 12px 0 12px 14px;
		border-inline-start: 0;
		border-block-end: 1px solid var(--line);
	}

	.ram-home .seg-opt::before {
		inset-block: 0;
		inset-inline: 0 auto;
		width: 3px;
		height: auto;
	}

	.ram-home .seg b {
		min-width: 6.5em;
		font-size: 24px;
	}

	.ram-home .seg small {
		margin: 0;
	}

	.ram-home .seg .hint {
		margin-block-start: 10px;
	}
}

/* ------------------------------------------------------------------
 * 07 — Des voix (approved home mockup): one lead film and the others.
 * A filled card plays its film in place (no link, never autoplayed);
 * its words move to the top to leave the player's controls free.
 *
 * One row, one height (plan de finition du 20 octobre 2026, P1 #8): the
 * others are 9:16 cards, the films' own format, and the lead takes the
 * height they give the row, so no card runs twice as tall as another and
 * none spills out of the section. 900 px and below: the lead above, the
 * others in a row of three; 640 px and below, one card per line.
 * ------------------------------------------------------------------ */

.ram-home.voix {
	padding-block-start: var(--sec);
}

.ram-home.voix .head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 24px;
	margin-block-end: 32px;
}

.ram-home.voix h2 {
	font-size: clamp(30px, 3.4vw, 46px);
	max-width: 22ch;
}

.ram-home.voix .head p {
	color: var(--ink2);
	margin: 0;
	max-width: 40ch;
}

.ram-home .vgrid {
	display: grid;
	grid-template-columns: 2fr;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	gap: 18px;
}

.ram-home .vgrid .v {
	position: relative;
	overflow: hidden;
	background: var(--navy);
	color: #fff;
	text-decoration: none;
	display: flex;
	flex-direction: column;
	justify-content: end;
	aspect-ratio: 9 / 16;
	border-radius: 2px;
}

.ram-home .vgrid .v.lead {
	aspect-ratio: auto;
}

.ram-home .vgrid .v img,
.ram-home .vgrid .v video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ram-home .vgrid .v img {
	opacity: 0.6;
}

.ram-home .vgrid .v .t {
	position: relative;
	padding: 22px;
	background: linear-gradient(transparent, rgba(14, 31, 58, 0.9));
}

.ram-home .vgrid .v.has-video {
	justify-content: start;
}

.ram-home .vgrid .v.has-video .t {
	pointer-events: none;
	background: linear-gradient(rgba(14, 31, 58, 0.9), transparent);
}

.ram-home .vgrid .v .t small {
	display: block;
	font-size: 13px;
	letter-spacing: 0.04em;
	opacity: 0.85;
	margin-block-end: 4px;
}

.ram-home .vgrid .v .t b {
	font-family: var(--ram-serif);
	font-weight: 500;
	font-size: 20px;
	display: block;
	line-height: 1.2;
}

.ram-home .vgrid .v.lead .t b {
	font-size: 30px;
}

.ram-home .vgrid .v .slot {
	display: block;
	margin-block-start: 4px;
	color: #fff;
	opacity: 0.85;
}

.ram-home .vgrid .v .play {
	position: absolute;
	inset-block-start: 18px;
	inset-inline-start: 18px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	display: grid;
	place-items: center;
	transform: none;
}

.ram-home .vgrid .v .play svg {
	width: 14px;
	height: 14px;
	fill: #132a4f;
	margin-inline-start: 2px;
}

@media (max-width: 900px) {
	.ram-home .vgrid {
		grid-template-columns: repeat(3, 1fr);
		grid-auto-flow: row;
	}

	.ram-home .vgrid .v {
		aspect-ratio: 3 / 4;
	}

	.ram-home .vgrid .v.lead {
		grid-column: 1 / -1;
		aspect-ratio: 16 / 10;
	}

	.ram-home.voix .head {
		flex-direction: column;
		align-items: start;
	}
}

@media (max-width: 640px) {
	.ram-home .vgrid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.ram-home .vgrid .v,
	.ram-home .vgrid .v.lead {
		aspect-ratio: 16 / 10;
	}

	.ram-home .vgrid .v.lead .t b {
		font-size: 24px;
	}
}

/* « Rejoindre » : the visit and the online form side by side (marketing
 * piste 4); on the Arabic home, the note that the form is in French. */
.ram-home.adm .adm-actions {
	align-items: center;
	margin-block: 18px 28px;
}

.ram-home.adm .form-lang {
	font-size: 14px;
	color: var(--ink2);
}
