/*
 * Ryad Al Maârifa — Résultats et promotions.
 *
 * The dress of the three `ram/*` blocks (`/resultats/`, `/promotions/`,
 * `/promotions/{année}/`), ported from the approved mockups (résultats,
 * promotions, promotion 2024). Loaded after `theme.css`.
 *
 * Selectors use the mockups' class names (.rows .r, .wall, .pbig, .meta…),
 * always scoped under the block's own root so nothing leaks to other pages.
 * Colours use the mockups' token names, each falling back to the theme's
 * preset of the same role, so the sheet works before and after the shared
 * mockup stylesheet lands — and follows both colour schemes, since the theme
 * presets are redefined for dark (`theme.css`, top).
 *
 * Faces: DM Serif Display / Noto Kufi Arabic (founders' review, 24 Sept),
 * falling back to the faces the theme already serves.
 */

/* ------------------------------------------------------------------
 * Shared: page head, intro, links, screen-reader text.
 * ------------------------------------------------------------------ */

.ram-phead {
	padding-block: 64px 0;
	background: var(--paper, var(--wp--preset--color--stone));
}

.ram-phead h1 {
	font-family: "DM Serif Display", Georgia, serif;
	font-size: clamp(38px, 5vw, 68px);
	font-weight: 400;
	line-height: 1.12;
	color: var(--ink, var(--wp--preset--color--ink));
	text-wrap: balance;
	max-width: 28ch;
}

.ram-phead--wide .phead-in,
.wrap.promotions-wrap {
	max-width: 1440px;
}

.ram-phead--wide .phead-in {
	padding-inline: 0;
}

.results-wrap,
.promotions-wrap {
	padding-block-end: 72px;
}

.ram-intro {
	padding-block-end: 8px;
}

.ram-intro .ar,
.ram-intro .fr {
	margin: 8px 0 0;
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 26px;
	line-height: 1.6;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.ram-intro .ar {
	text-align: left;
}

[dir="rtl"] .ram-intro .fr {
	text-align: right;
}

.ram-intro .fr {
	font-family: "DM Serif Display", Georgia, serif;
}

.ram-intro .lede {
	max-width: 46ch;
	margin: 20px 0 0;
	font-size: 21px;
	line-height: 1.5;
	color: var(--ink, var(--wp--preset--color--ink));
}

.ram-results .ram-links,
.promotions-wrap .ram-links,
.ram-promotion .ram-links {
	margin: 28px 0 0;
}

.ram-results .ram-links a,
.promotions-wrap .ram-links a,
.ram-promotion__alumni .ram-links a {
	font-weight: 600;
	color: var(--bordeaux, var(--wp--preset--color--bordeaux));
	text-decoration: none;
}

.ram-results .ram-links a:hover,
.promotions-wrap .ram-links a:hover,
.ram-promotion__alumni .ram-links a:hover {
	text-decoration: underline;
}

.ram-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* The « données incomplètes » notice of amendment 5. */
.ram-results .ram-notice {
	margin-block-start: 32px;
	padding: 16px 20px;
	border-inline-start: 3px solid var(--bordeaux, var(--wp--preset--color--bordeaux));
	background: var(--ivory, var(--wp--preset--color--stone-2));
}

.ram-results .ram-notice p {
	margin: 0;
}

.ram-results .ram-notice p + p {
	margin-block-start: 6px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

/* ------------------------------------------------------------------
 * /resultats/ — overview and the 2005 ━ 2026 device.
 * ------------------------------------------------------------------ */

.ram-results .ram-results__title {
	margin: 0;
	font-family: "DM Serif Display", Georgia, serif;
	font-size: clamp(26px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.12;
	color: var(--ink, var(--wp--preset--color--ink));
	text-wrap: balance;
	max-width: 30ch;
}

.ram-results__overview {
	padding-block-start: 56px;
}

.ram-results .ram-results__lede {
	max-width: 62ch;
	margin: 14px 0 0;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.ram-device {
	margin: 24px 0 0;
}

.ram-device__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.ram-device__base {
	stroke: var(--ink2, var(--wp--preset--color--ink-2));
	stroke-width: 2;
}

.ram-device__tick {
	stroke: var(--ink2, var(--wp--preset--color--ink-2));
	stroke-width: 1.5;
}

.ram-device__stem {
	stroke: var(--bordeaux, var(--wp--preset--color--bordeaux));
	stroke-width: 1.5;
}

.ram-device__dot {
	fill: var(--bordeaux, var(--wp--preset--color--bordeaux));
}

/* A label crossed by a neighbour's stem keeps a halo of the page colour. */
.ram-device__label {
	paint-order: stroke;
	stroke: var(--paper, var(--wp--preset--color--stone));
	stroke-width: 6px;
	stroke-linejoin: round;
}

.ram-device__year {
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 22px;
	fill: var(--ink, var(--wp--preset--color--ink));
}

.ram-device__note {
	font-family: "DM Sans", sans-serif;
	font-size: 12px;
	fill: var(--ink2, var(--wp--preset--color--ink-2));
}

.ram-device__end {
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 18px;
	fill: var(--ink2, var(--wp--preset--color--ink-2));
}

/* Narrow screens: the device keeps a legible size and scrolls inside itself. */
@media (max-width: 760px) {
	.ram-device {
		overflow-x: auto;
		padding-block-end: 6px;
	}

	.ram-device__svg {
		min-width: 720px;
	}
}

/* ------------------------------------------------------------------
 * /resultats/ — one row per year.
 * ------------------------------------------------------------------ */

.ram-results__years {
	padding-block-start: 64px;
}

.ram-results .rows {
	margin-block-start: 32px;
	border-block-start: 1px solid var(--line, var(--wp--preset--color--line));
}

.ram-results .rows .r {
	display: grid;
	grid-template-columns: 80px 1.3fr 0.7fr 0.7fr 1.2fr 1.6fr;
	gap: 4px 16px;
	align-items: baseline;
	padding-block: 14px;
	border-block-end: 1px solid var(--line, var(--wp--preset--color--line));
}

.ram-results .rows .r > * {
	margin: 0;
}

.ram-results .rows .r.h {
	font-size: 13px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ink2, var(--wp--preset--color--ink-2));
	border-block-end: 2px solid var(--ink, var(--wp--preset--color--ink));
}

.ram-results .rows .r.h abbr {
	text-decoration: none;
}

.ram-results .rows .y {
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--ink, var(--wp--preset--color--ink));
}

.ram-results .rows .nm {
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: 21px;
	line-height: 1.5;
	text-align: right;
}

.ram-results .rows .r.h .nm {
	font-family: inherit;
	font-size: 13px;
	text-align: start;
}

.ram-results .rows .nm a {
	color: var(--ink, var(--wp--preset--color--ink));
	text-decoration: none;
}

.ram-results .rows .nm a:hover {
	color: var(--bordeaux, var(--wp--preset--color--bordeaux));
	text-decoration: underline;
	text-underline-offset: 4px;
}

.ram-results .rows .n,
.ram-results .rows .m,
.ram-results .rows .d {
	font-size: 15.5px;
	font-variant-numeric: tabular-nums;
}

.ram-results .rows .r.laur {
	background: linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--accent-mark) 8%, transparent), transparent);
}

.ram-results .rows .r.laur .d {
	color: var(--bordeaux, var(--wp--preset--color--bordeaux));
}

/* The row's `laur` class is also the mockups' laureates strip in
 * maquettes.css (`.laur span` at 14.5px, ink-2): the promotion's Arabic name
 * of a distinguished year shrank and faded. It reads like every other row
 * (final polish brief, 13 October 2026). */
.ram-results .rows .r.laur .nm span {
	font-size: inherit;
	color: inherit;
}

/* The methodology note of the row: scope and verification date. */
.ram-results .rows .ram-result__note,
.ram-results .rows .ram-result__more {
	grid-column: 2 / -1;
	font-size: 13.5px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.ram-results .ram-result__more .ram-fields {
	display: grid;
	gap: 4px;
	margin: 6px 0 0;
}

.ram-results .ram-result__more .ram-field {
	display: grid;
	grid-template-columns: minmax(140px, 1fr) 4fr;
	gap: 12px;
}

.ram-results .ram-result__more dt {
	font-weight: 600;
}

.ram-results .ram-result__more dd,
.ram-results .ram-result__more ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 800px) {
	.ram-results .rows .r {
		grid-template-columns: 70px 1fr;
		gap: 6px 14px;
	}

	.ram-results .rows .r.h {
		display: none;
	}

	.ram-results .rows .r > :not(.y) {
		grid-column: 2;
	}

	.ram-results .rows .nm {
		text-align: start;
	}

	/* The column heads are gone: each figure says what it is. */
	.ram-results .rows .n .ram-sr,
	.ram-results .rows .m .ram-sr {
		position: static;
		width: auto;
		height: auto;
		margin: 0;
		clip: auto;
		white-space: normal;
		color: var(--ink2, var(--wp--preset--color--ink-2));
	}

	.ram-results .rows .ram-result__note,
	.ram-results .rows .ram-result__more {
		grid-column: 2;
	}
}

.ram-results .meta {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	margin-block-start: 36px;
	font-size: 15.5px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.ram-results .meta p {
	margin: 0;
}

.ram-results .meta strong {
	font-weight: 600;
	color: var(--ink, var(--wp--preset--color--ink));
}

@media (max-width: 900px) {
	.ram-results .meta {
		grid-template-columns: 1fr;
		gap: 14px;
	}
}

/* ------------------------------------------------------------------
 * /promotions/ — the wall of names.
 * ------------------------------------------------------------------ */

.promotions-wrap .wall {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin: 40px 0 0;
	padding: 0;
	list-style: none;
	border-block-start: 1px solid var(--line, var(--wp--preset--color--line));
	border-inline-start: 1px solid var(--line, var(--wp--preset--color--line));
}

.promotions-wrap .wall li {
	margin: 0;
	border-inline-end: 1px solid var(--line, var(--wp--preset--color--line));
	border-block-end: 1px solid var(--line, var(--wp--preset--color--line));
}

.promotions-wrap .wall a {
	display: block;
	height: 100%;
	min-height: 180px;
	padding: 34px 22px 26px;
	color: var(--ink, var(--wp--preset--color--ink));
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.promotions-wrap .wall a:hover {
	background: var(--ivory, var(--wp--preset--color--stone-2));
}

.promotions-wrap .wall a > span {
	display: block;
}

.promotions-wrap .wall .nm {
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: clamp(26px, 2.6vw, 38px);
	line-height: 1.5;
	direction: rtl;
	text-align: right;
}

.promotions-wrap .wall .ram-promotions__latin,
.promotions-wrap .wall .ram-promotions__meaning {
	margin-block-start: 6px;
	font-size: 15px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.promotions-wrap .wall .ram-promotions__meaning {
	font-style: italic;
}

.promotions-wrap .wall .y {
	margin-block-start: 14px;
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 20px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

.promotions-wrap .wall .ram-promotions__summary {
	margin-block-start: 4px;
	font-size: 14px;
	color: var(--ink2, var(--wp--preset--color--ink-2));
}

@media (max-width: 900px) {
	.promotions-wrap .wall {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 520px) {
	.promotions-wrap .wall {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------------
 * /promotions/{année}/ — the name on the deep band.
 * ------------------------------------------------------------------ */

.ram-promotion {
	margin-block-start: 0;
	padding-block-end: 72px;
}

.ram-promotion .pbig {
	padding: 80px 32px;
	color: var(--onnavy, var(--wp--preset--color--on-navy));
	background: var(--navy2, var(--wp--preset--color--band-2));
}

.ram-promotion .pbig .grid {
	display: grid;
	grid-template-columns: 6fr 6fr;
	gap: 56px;
	align-items: center;
	max-width: 1440px;
	margin-inline: auto;
}

.ram-promotion .pbig .eyebrow {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--onnavy2, var(--wp--preset--color--on-navy-2));
}

.ram-promotion .pbig .name {
	margin: 8px 0 0;
	font-family: "Noto Kufi Arabic", sans-serif;
	font-size: clamp(56px, 8vw, 116px);
	font-weight: 400;
	line-height: 1.35;
	color: var(--wp--preset--color--white, #fff);
	direction: rtl;
	text-align: left;
}

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

.ram-promotion .pbig .ram-promotion__latin,
.ram-promotion .pbig .ram-promotion__meaning {
	margin: 10px 0 0;
	font-size: 18px;
	color: var(--onnavy2, var(--wp--preset--color--on-navy-2));
}

.ram-promotion .pbig h2 {
	margin: 0 0 12px;
	font-family: "DM Serif Display", Georgia, serif;
	font-size: clamp(26px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.12;
	color: var(--wp--preset--color--white, #fff);
}

.ram-promotion .pbig p {
	max-width: 46ch;
	margin: 0;
	color: var(--onnavy2, var(--wp--preset--color--on-navy-2));
}

.ram-promotion .pbig p + p {
	margin-block-start: 14px;
}

.ram-promotion .pbig .ram-promotion__links {
	margin-block-start: 18px;
}

.ram-promotion .pbig a {
	font-weight: 600;
	color: var(--wp--preset--color--white, #fff);
}

@media (max-width: 900px) {
	.ram-promotion .pbig {
		padding: 56px 20px;
	}

	.ram-promotion .pbig .grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}
}

.ram-promotion__more,
.ram-promotion .sec {
	max-width: 1180px;
	margin-inline: auto;
	padding-inline: 32px;
}

.ram-promotion__more {
	padding-block-start: 48px;
}

.ram-promotion .sec {
	padding-block-start: 64px;
}

.ram-promotion .sec .grid {
	display: grid;
	grid-template-columns: 4fr 8fr;
	gap: 48px;
}

.ram-promotion .sec h2 {
	margin: 0;
	font-family: "DM Serif Display", Georgia, serif;
	font-size: clamp(28px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.12;
	color: var(--ink, var(--wp--preset--color--ink));
}

.ram-promotion .sec p {
	max-width: 66ch;
	margin: 0 0 14px;
}

@media (max-width: 900px) {
	.ram-promotion .sec .grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.ram-promotion__more,
	.ram-promotion .sec {
		padding-inline: 20px;
	}
}

/* The band follows the header directly: no flow gap above `main`. */
.single-ram_promotion .wp-site-blocks > main {
	margin-block-start: 0;
}

/* ------------------------------------------------------------------
 * Lisibilité des étiquettes (finition 20 octobre)
 *
 * The device's text is sized in SVG units (viewBox 1000 wide), so it
 * shrinks with the drawing: below a 1000 px figure the 12-unit notes
 * fell to 9 px at 820 and under 9 px at 390. A size in user units
 * cannot be clamped against the screen (a clamp() here would still be
 * scaled by the viewBox), so the minimum is set on the drawing: under
 * a 1000 px figure, the notes grow to 14 units — one per 14-unit line,
 * the spacing the plugin draws them at — and the drawing never goes
 * below 860 px, so 14 × 0.86 ≥ 12 px. Narrower figures scroll inside
 * themselves, as the 760 px rule above already did.
 * ------------------------------------------------------------------ */
.ram-device {
	container: ram-device / inline-size;
}

@container ram-device (max-width: 999px) {
	.ram-device__svg {
		min-width: 860px;
	}

	.ram-device__note {
		font-size: 14px;
	}
}

@media (max-width: 999px) {
	.ram-device {
		overflow-x: auto;
		padding-block-end: 6px;
	}
}
