/*
Theme Name: FMI — Faculté des Mathématiques et de l'Informatique
Theme URI: https://fmi.univ-bba.dz
Author: FMI BBA
Description: Trilingual (FR/AR/EN, RTL-ready) faculty theme. Editorial, blue-led design system: one hue, hairline rules instead of cards, IBM Plex Sans + IBM Plex Sans Arabic self-hosted. Requires the "FMI Core" plugin.
Version: 4.1.1
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fmi-theme
Tags: education, two-columns, custom-menu, rtl-language-support, accessibility-ready
*/

/* ==================================================================
   1. DESIGN TOKENS
   Primitive scales → semantic roles. Components only use semantic roles,
   so the dark variant is a token swap (html[data-theme="dark"]).
   Text/background pairs are ≥ 4.5:1 (text) and ≥ 3:1 (UI); ratios noted.
================================================================== */
:root {
	--blue-50:  #EEF3FF;
	--blue-100: #DBE6FF;
	--blue-200: #B7CDFF;
	--blue-300: #8FB0FA;
	--blue-400: #5F8CF2;
	--blue-500: #3D74EE;
	--blue-600: #2159D6;   /* links, buttons — 6.1:1 on white */
	--blue-700: #1A46A8;   /* 8.5:1 */
	--blue-800: #163A85;
	--blue-900: #122B5C;   /* headings — 13.8:1 */
	--blue-950: #0B1A3A;   /* footer */

	--n-0:   #FFFFFF;
	--n-50:  #F7F9FC;
	--n-100: #EFF2F7;
	--n-200: #E1E6EE;
	--n-300: #C9D1DC;
	--n-400: #9AA6B6;
	--n-500: #7B8797;  /* 3.7:1 — control borders */
	--n-600: #556374;  /* 6.1:1 — muted text */
	--n-700: #3E4A5B;  /* 9.0:1 — secondary text */
	--n-800: #28313D;
	--n-900: #151B24;  /* 17.3:1 — body text */

	--ok:      #176B43; --ok-bg:   #E4F4EA;   /* 5.7:1 */
	--warn:    #7A4A00; --warn-bg: #FFF3DC;   /* 6.5:1 */
	--err:     #B32F2B; --err-bg:  #FBE7E6;   /* 5.3:1 */
	--info:    var(--blue-700); --info-bg: var(--blue-50);

	/* Roles (light) */
	--bg:            var(--n-0);
	--bg-alt:        var(--n-50);
	--bg-tint:       var(--blue-50);
	--tint-2:        var(--blue-100);
	--surface:       var(--n-0);
	--surface-2:     var(--n-100);
	--text:          var(--n-900);
	--text-2:        var(--n-700);
	--muted:         var(--n-600);
	--faint:         var(--n-500);      /* separators, arrows — 3.7:1 */
	--heading:       var(--blue-900);
	--link:          var(--blue-600);
	--link-hover:    var(--blue-800);
	--border:        var(--n-200);
	--border-strong: var(--n-500);
	--rule:          var(--blue-900);   /* editorial rules */
	--primary:       var(--blue-600);
	--primary-hover: var(--blue-700);
	--on-primary:    var(--n-0);
	--focus:         var(--blue-600);
	--band:          var(--blue-950);
	--on-band:       var(--n-0);
	--on-band-2:     var(--blue-200);   /* 11.6:1 on blue-950 */
	--on-band-3:     var(--blue-300);   /* 8.0:1 */
	--band-border:   rgba(255,255,255,.14);
	--tag-bg:        var(--blue-100);
	--tag-text:      var(--blue-900);   /* 11.0:1 */
	--pin-bg:        var(--blue-900);
	--pin-text:      var(--n-0);
	--shadow-panel:  0 16px 40px -16px rgba(18, 43, 92, .28), 0 2px 6px -2px rgba(18, 43, 92, .12);

	--font-latin:  "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-arabic: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
	--font: var(--font-latin);

	--text-display: clamp(34px, 3.9vw, 54px);
	--text-h1: clamp(30px, 3vw, 42px);
	--text-h2: clamp(24px, 2.2vw, 30px);
	--text-h3: clamp(19px, 1.5vw, 22px);
	--text-h4: 18px;
	--text-body-lg: clamp(17px, 1.2vw, 18px);
	--text-body: 16px;
	--text-sm: 15px;
	--text-xs: 14px;
	--text-label: 13px;
	--track-tight: -0.015em;
	--track-h2: -0.01em;

	--radius-xs: 4px;
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 14px;

	--container: 1240px;
	--container-md: 960px;
	--container-sm: 760px;
	--gutter: clamp(16px, 4vw, 40px);
	--gap: 24px;
	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 48px; --s9: 64px; --s10: 80px;
	--section: clamp(56px, 7vw, 96px);
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--t-fast: 120ms; --t-hover: 160ms; --t-comp: 200ms;
	--header-h: 68px;
}
html[lang="ar"] { --font: var(--font-arabic); --track-tight: 0; --track-h2: 0; }

/* Dark variant: same roles, different primitives (text pairs ≥ 7:1) */
html[data-theme="dark"] {
	--bg: #0B1220; --bg-alt: #0F172A; --bg-tint: #101A30; --tint-2: #1B2D57;
	--surface: #111C33; --surface-2: #1B2D57;
	--text: #E6EDF5; --text-2: #C9D5E8; --muted: #AFBCCF; --faint: #7A8AA3; --heading: #F2F6FA;
	--link: #8FB0FA; --link-hover: #B7CDFF;
	--border: #23324F; --border-strong: #7F92B0; --rule: #C9D5E8;
	--primary: #8FB0FA; --primary-hover: #B7CDFF; --on-primary: #0B1220;
	--focus: #B7CDFF;
	--band: #070E1C; --on-band: #E6EDF5; --on-band-2: #C9D5E8; --on-band-3: #AFBCCF; --band-border: rgba(255,255,255,.12);
	--tag-bg: #1B2D57; --tag-text: #DBE6FF; --pin-bg: #DBE6FF; --pin-text: #0B1220;
	--ok: #5FCF93; --ok-bg: #12301F; --warn: #F2B33D; --warn-bg: #3A2A08; --err: #F28B87; --err-bg: #3B1A19; --info: #8FB4E6; --info-bg: #13213A;
	--shadow-panel: 0 24px 48px -24px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0,0,0,.5);
	color-scheme: dark;
}

/* ==================================================================
   2. BASE
================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--n-300) transparent; }
body { margin: 0; font-family: var(--font); font-size: var(--text-body); line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[lang="ar"] body { line-height: 1.75; }
img, svg, video { max-width: 100%; height: auto; display: block; }
::selection { background: var(--blue-100); color: var(--blue-900); }
html[data-theme="dark"] ::selection { background: var(--blue-700); color: #fff; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color var(--t-hover) var(--ease); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4, h5 { margin: 0 0 0.5em; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: 1.15; font-weight: 700; letter-spacing: var(--track-tight); }
h2 { font-size: var(--text-h2); line-height: 1.2; letter-spacing: var(--track-h2); }
h3 { font-size: var(--text-h3); line-height: 1.3; }
h4 { font-size: var(--text-h4); line-height: 1.35; }
h5 { font-size: 16px; line-height: 1.4; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.45; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-inline-start: 1.4em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: start; vertical-align: top; }
thead th { border-bottom: 2px solid var(--rule); color: var(--heading); font-weight: 600; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
blockquote { margin: var(--s5) 0; padding-inline-start: var(--s5); border-inline-start: 1px solid var(--rule); color: var(--text-2); }
code, pre { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em; }
pre { background: var(--surface-2); padding: var(--s4); border-radius: var(--radius-sm); overflow-x: auto; }
time, .num { font-variant-numeric: tabular-nums; }
[lang="ar"] { font-family: var(--font-arabic); letter-spacing: 0; }
html[lang="ar"] [lang="fr"], html[lang="ar"] [lang="en"] { font-family: var(--font-latin); }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 1000; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: var(--s4); color: var(--on-primary); }
.dot { margin: 0 6px; color: var(--faint); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
html[dir="rtl"] .icon--dir { transform: scaleX(-1); }
.icon--ext { width: 14px; height: 14px; color: var(--faint); }

/* ==================================================================
   3. LAYOUT
================================================================== */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--md { max-width: var(--container-md); }
.container--sm { max-width: var(--container-sm); }
.section { padding-block: var(--section); }
.section--alt { background: var(--bg-alt); }
.section--tint { background: var(--bg-tint); }
.section:not(.section--alt):not(.section--tint):not(.scene--deep) + .section:not(.section--alt):not(.section--tint):not(.scene--deep) { padding-top: 0; }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.grid--sidebar { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
@media (max-width: 1023px) {
	.grid--main, .grid--sidebar { grid-template-columns: minmax(0, 1fr); gap: var(--s8); }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) { .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: var(--s4); }
.prose { max-width: 70ch; font-size: var(--text-body-lg); line-height: 1.7; }
.prose > * + *, .prose__content > * + * { margin-top: 1em; }
.prose__content > :first-child { margin-top: 0; }
/* Content in another language than the page: its own direction, the page's alignment for headings. */
html[dir="rtl"] .bidi-keep[dir="ltr"] { text-align: right; }
html[dir="ltr"] .bidi-keep[dir="rtl"] { text-align: left; }
.prose h2 { margin-top: 1.6em; font-size: var(--text-h3); }
.prose h3 { margin-top: 1.4em; font-size: var(--text-h4); }
.prose img { border-radius: var(--radius-md); }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose figure { margin: var(--s5) 0; }
.prose figcaption { font-size: var(--text-xs); color: var(--muted); margin-top: var(--s2); }
.prose .btn { text-decoration: none; }
.prose details { border-top: 1px solid var(--border); padding: 0; margin: 0; }
.prose details:last-of-type { border-bottom: 1px solid var(--border); }
.prose details + details { margin-top: 0; }
.prose summary { padding: 14px 0; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); color: var(--heading); font-size: var(--text-body); }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-inline-end: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(45deg); transition: transform var(--t-fast) var(--ease); }
.prose details[open] summary::after { transform: rotate(-135deg); }
.prose details p { margin: 0 0 var(--s4); color: var(--text-2); font-size: var(--text-body); }
.wp-block-table, .wp-block-embed { margin: var(--s5) 0; }
.aligncenter { margin-inline: auto; }
/* Pictures placed with the classic editor ("Add media": img.alignleft, figure.wp-caption.alignright, …).
   Left and right follow the direction of the text they sit in, so they mirror in Arabic; on phones they
   stop floating and take the full line. */
.prose .alignleft { float: left; float: inline-start; max-width: min(50%, 360px); margin: 6px 0 var(--s3); margin-inline-end: var(--s5); }
.prose .alignright { float: right; float: inline-end; max-width: min(50%, 360px); margin: 6px 0 var(--s3); margin-inline-start: var(--s5); }
.prose .aligncenter, .prose .alignnone { display: block; }
.prose .wp-caption img { display: block; width: 100%; }
.prose .wp-caption-text { text-align: start; }
.prose::after, .prose__content::after { content: ""; display: block; clear: both; }
@media (max-width: 599px) { .prose .alignleft, .prose .alignright { float: none; display: block; max-width: 100%; margin: var(--s4) auto; } }
.alignwide, .alignfull { max-width: none; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: clamp(20px, 3vw, 28px); }
.section-head h2, .section-head h3 { margin: 0; }
.section-head p { margin: var(--s2) 0 0; color: var(--muted); max-width: 60ch; font-size: var(--text-sm); }
.section-head .link-more { flex-shrink: 0; }
@media (max-width: 599px) { .section-head { flex-direction: column; align-items: flex-start; gap: var(--s2); } .section-head .link-more { margin-bottom: 0; } }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s3); }
.side-head h2, .side-head h3 { margin: 0; font-size: var(--text-h4); }
.side-head--lg h3 { font-size: var(--text-h3); }
.side-intro { font-size: var(--text-sm); color: var(--text-2); margin: 0 0 var(--s4); }

/* ==================================================================
   4. CONTROLS: buttons, links, tags, tabs, filters, pagination, alerts, empty, forms
================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 8px 20px; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; border-radius: var(--radius-sm); border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); text-decoration: none; cursor: pointer; transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease), transform var(--t-fast) var(--ease); }
.btn:hover, .btn:active { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: var(--surface); color: var(--link); border-color: var(--link); }
.btn--secondary:hover, .btn--secondary:active { background: var(--bg-tint); color: var(--link-hover); border-color: var(--link-hover); }
.btn--accent { background: var(--primary); color: var(--on-primary); }
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: progress; pointer-events: none; }
.link-more { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-weight: 600; text-decoration: none; color: var(--link); font-size: var(--text-xs); }
.link-more:hover { color: var(--link-hover); text-decoration: underline; }
.link-more .icon { width: 16px; height: 16px; transition: transform var(--t-hover) var(--ease); }
.link-more:hover .icon { transform: translateX(3px); }
html[dir="rtl"] .link-more:hover .icon--dir { transform: scaleX(-1) translateX(3px); }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--tag-bg); color: var(--tag-text); text-decoration: none; vertical-align: middle; }
.tag--outline { background: transparent; border: 1px solid var(--n-300); color: var(--text-2); }
.tag--lang { background: transparent; border: 1px solid var(--n-300); color: var(--muted); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); }

.tabs { display: flex; gap: var(--s1); margin: 0 0 var(--s5); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: var(--text-xs); font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease); }
.tabs a:hover { color: var(--heading); border-bottom-color: var(--n-300); }
.tabs a[aria-current="page"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--primary); }
.subtabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 var(--s5); font-size: var(--text-xs); }
.subtabs__label { color: var(--muted); font-weight: 500; }
.subtabs a { padding: 4px 0; color: var(--text-2); text-decoration: none; border-bottom: 1px solid transparent; }
.subtabs a:hover { color: var(--heading); }
.subtabs a[aria-current="page"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--heading); }
.tabs + .subtabs { margin-top: calc(-1 * var(--s2)); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3) var(--s4); align-items: end; padding: var(--s4) 0 var(--s5); border-bottom: 1px solid var(--border); margin: 0 0 var(--s5); }
.filters label { display: grid; gap: 4px; font-size: var(--text-label); font-weight: 600; color: var(--muted); }
.filters select { min-height: 42px; font: inherit; font-size: 15px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; }
.filters__actions { display: flex; align-items: center; gap: var(--s3); }
.filters__reset { font-size: var(--text-xs); display: inline-flex; align-items: center; min-height: 36px; }
.filters-toggle { margin: 0 0 var(--s5); }
.filters-toggle > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--link); min-height: 32px; }
.filters-toggle > summary::-webkit-details-marker { display: none; }
.filters-toggle > summary::after { content: ""; width: 6px; height: 6px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.filters-toggle[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.filters-toggle .filters { margin-top: var(--s2); margin-bottom: 0; }

.pagination { display: flex; justify-content: center; gap: 4px; margin-top: clamp(32px, 4vw, 48px); flex-wrap: wrap; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; font-size: var(--text-xs); color: var(--heading); }
.pagination .page-numbers.current { background: var(--heading); color: var(--bg); border-color: var(--heading); }
.pagination a.page-numbers:hover { border-color: var(--border-strong); }
.pagination .dots { border: 0; }

.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--radius-md); border: 1px solid; margin-bottom: var(--s5); font-size: var(--text-sm); }
.alert > div, .alert p { margin: 0; }
.alert p + p { margin-top: 4px; }
.alert--ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.alert--err { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.alert--info { background: var(--info-bg); border-color: var(--tint-2); color: var(--heading); }
.alert ul { margin: 6px 0 0; padding-inline-start: 1.2em; }
.empty { padding: clamp(28px, 4vw, 40px) var(--s5); text-align: center; background: var(--bg-alt); border-radius: var(--radius-md); color: var(--text-2); font-size: var(--text-sm); }
.empty p { margin: 0; }
.empty p + p { margin-top: var(--s2); }
.empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--tint-2); color: var(--blue-700); margin-bottom: var(--s3); }
html[data-theme="dark"] .empty__icon { color: var(--link); }
.empty__icon .icon { width: 24px; height: 24px; }
.empty .link-more { justify-content: center; }

.form { display: grid; gap: var(--s4); max-width: 820px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 639px) { .form__grid { grid-template-columns: minmax(0, 1fr); } }
.form__row { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; font-size: var(--text-sm); color: var(--heading); }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form select, .form textarea, .level-select__input, .search-form input[type="search"], .staff-tools input[type="search"] { min-height: 46px; font: inherit; font-size: 16px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; transition: border-color var(--t-hover) var(--ease); }
.form input:hover, .form select:hover, .form textarea:hover, .level-select__input:hover { border-color: var(--n-600); }
.form input:focus, .form select:focus, .form textarea:focus, .level-select__input:focus, .filters select:focus, .search-form input:focus, .staff-tools input:focus { border-color: var(--primary); outline-offset: 1px; }
::placeholder { color: var(--muted); opacity: 1; }
.form textarea { min-height: 120px; resize: vertical; }
.form input[type="file"] { font-size: 15px; padding: 8px 0; }
.form .req { color: var(--err); }
.form__note { font-size: var(--text-xs); color: var(--muted); margin: 0; }
.form .btn { justify-self: start; }
.form__row--error input, .form__row--error select, .form__row--error textarea { border-color: var(--err) !important; }
.form__error { font-size: var(--text-xs); color: var(--err); font-weight: 600; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
select.level-select__input, .filters select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23556374' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: right 12px center; }
html[dir="rtl"] select.level-select__input, html[dir="rtl"] .filters select { background-position: left 12px center; }
html[data-theme="dark"] select.level-select__input, html[data-theme="dark"] .filters select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AFBCCF' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ==================================================================
   5. HEADER
================================================================== */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header { --bar-gap: var(--s3); --nav-pad: 8px; --nav-pad-mega: 8px; --nav-pull: -7px; }
.main-bar__inner { display: flex; align-items: center; gap: var(--bar-gap); min-height: var(--header-h); }
@media (max-width: 639px) { :root { --header-h: 60px; } }

.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--heading); flex: 0 1 auto; min-width: 0; min-height: 44px; }
.brand:hover { color: var(--heading); }
.brand img, .brand .custom-logo { height: 42px; width: auto; max-width: 220px; }
.brand__mark { height: 36px; width: auto; flex: none; color: var(--blue-700); }
html[data-theme="dark"] .brand__mark { color: var(--n-0); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-size: 11.5px; font-weight: 600; max-width: 158px; color: var(--heading); text-wrap: balance; }
.brand__univ { font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 2px; }
html[lang="ar"] .brand__name { font-size: 12.5px; max-width: 170px; }
html[lang="ar"] .brand__univ { font-size: 10.5px; }
@media (max-width: 479px) { .brand { gap: 6px; } .brand__mark { height: 30px; } .brand__name { font-size: 10.5px; max-width: none; } .brand__univ { display: none; } }

.primary-nav { display: none; flex: 1; min-width: 0; }
.nav-list { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-item { display: flex; align-items: center; position: static; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--nav-pad); font-size: 14px; font-weight: 500; color: var(--heading); text-decoration: none; border-radius: var(--radius-sm); position: relative; white-space: nowrap; }
.nav-item.has-mega > .nav-link { padding-inline-end: var(--nav-pad-mega); }
.nav-link:hover { color: var(--link); }
.nav-link::after { content: ""; position: absolute; inset-inline: var(--nav-pad); bottom: 7px; height: 2px; background: var(--primary); opacity: 0; transition: opacity var(--t-hover) var(--ease); }
.nav-item:hover > .nav-link::after, .nav-item.is-open > .nav-link::after, .nav-item.is-current > .nav-link::after, .nav-link:focus-visible::after { opacity: 1; }
.mega-toggle { width: 24px; height: 44px; margin-inline-start: var(--nav-pull); padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.mega-toggle:hover { color: var(--heading); }
.mega-toggle .icon { width: 14px; height: 14px; transition: transform var(--t-fast) var(--ease); }
.nav-item.is-open > .mega-toggle .icon { transform: rotate(180deg); }
.mega-panel { position: absolute; inset-inline: 0; top: 100%; background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-panel); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--t-comp) var(--ease), transform var(--t-comp) var(--ease), visibility 0s linear var(--t-comp); z-index: 30; }
.nav-item.is-open > .mega-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (hover: hover) and (pointer: fine) {
	.nav-item:hover > .mega-panel, .nav-item:focus-within > .mega-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 120ms, 120ms, 0s; }
}
.mega-inner { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-block: var(--s6) var(--s7); }
.mega-intro { padding-inline-end: var(--s6); border-inline-end: 1px solid var(--border); }
.mega-intro p { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--s3); }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--s5) var(--s6); }
.mega-col__title { font-size: var(--text-label); font-weight: 600; color: var(--muted); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.mega-col__title a { text-decoration: none; color: var(--muted); }
.mega-col__title a:hover { color: var(--heading); }
.mega-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mega-links a { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-inline: -8px; border-radius: var(--radius-xs); font-size: var(--text-xs); font-weight: 500; color: var(--heading); text-decoration: none; }
.mega-links a:hover, .mega-links a:focus-visible { background: var(--bg-tint); color: var(--heading); }
.mega-links a[aria-current="page"] { background: var(--tint-2); }

.header-actions { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; flex-shrink: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--heading); cursor: pointer; transition: background-color var(--t-hover) var(--ease); }
.icon-btn:hover, .icon-btn:active { background: var(--surface-2); color: var(--heading); }
.icon-btn .icon { width: 22px; height: 22px; }
.menu-toggle .icon--close { display: none; }
.menu-toggle[aria-expanded="true"] .icon--close { display: block; }
.menu-toggle[aria-expanded="true"] .icon--menu { display: none; }
/* Desktop sections: each language shows them from the width at which its own labels fit, a classic 17 px
   scrollbar included, with at least 15 px to spare (17 for French at 1220, 21 for English at 1110, 34 for
   Arabic at 1050). Below that width, the drawer.
     Arabic   from 1050 px (tight spacing to 1099, regular from 1100)
     English  from 1110 px (tight spacing to 1159, regular from 1160)
     French   from 1220 px (tight spacing to 1279, regular from 1280), also the default for any other language
   Measured needs (viewport, no scrollbar): Arabic 1000 tight / 1047 regular, English 1072 / 1119,
   French 1187 / 1234. From 1280 px up the three languages show the sections in the regular spacing.
   main.js re-measures, because menus are editable: if the sections stop fitting it first applies .is-tight,
   then .is-overflowing (drawer). It does not measure under 1050 px, the lowest width at which any language
   shows the sections: if that width changes here, change it there too (main.js, "narrow"). */
@media (min-width: 1050px) { .lang-ar .primary-nav { display: block; } .lang-ar .menu-toggle { display: none; } }
@media (min-width: 1110px) { .lang-en .primary-nav { display: block; } .lang-en .menu-toggle { display: none; } }
@media (min-width: 1220px) { .primary-nav { display: block; } .menu-toggle { display: none; } }
@media (min-width: 1050px) and (max-width: 1099px) { .lang-ar .site-header { --bar-gap: var(--s2); --nav-pad: 6px; --nav-pad-mega: 4px; --nav-pull: -6px; } }
@media (min-width: 1110px) and (max-width: 1159px) { .lang-en .site-header { --bar-gap: var(--s2); --nav-pad: 6px; --nav-pad-mega: 4px; --nav-pull: -6px; } }
@media (min-width: 1220px) and (max-width: 1279px) { body:not(.lang-ar):not(.lang-en) .site-header { --bar-gap: var(--s2); --nav-pad: 6px; --nav-pad-mega: 4px; --nav-pull: -6px; } }
.site-header.is-tight { --bar-gap: var(--s2); --nav-pad: 6px; --nav-pad-mega: 4px; --nav-pull: -6px; }
.site-header.is-overflowing .primary-nav { display: none; }
.site-header.is-overflowing .menu-toggle { display: inline-flex; }

/* Language menu */
.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--heading); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease); }
.lang__btn:hover { background: var(--surface-2); border-color: var(--n-300); }
.lang__btn .icon--globe { width: 18px; height: 18px; color: var(--muted); }
.lang__btn .icon--chevron { width: 14px; height: 14px; color: var(--muted); transition: transform var(--t-fast) var(--ease); }
.lang.is-open .lang__btn .icon--chevron { transform: rotate(180deg); }
.lang__code { display: none; font-weight: 600; letter-spacing: .02em; }
@media (min-width: 1050px) and (max-width: 1599px) { .lang__name { display: none; } .lang__code { display: inline; } .lang__btn .icon--globe { display: none; } }
.site-header.is-tight .lang__name, .site-header.is-tight .lang__btn .icon--globe { display: none; }
.site-header.is-tight .lang__code { display: inline; }
@media (max-width: 479px) { .lang__name { display: none; } .lang__code { display: inline; } .lang__btn .icon--globe { display: none; } .lang__btn { padding: 0 8px; } .main-bar__inner { gap: 8px; } }
.lang__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 188px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-panel); z-index: 40; }
.lang__menu[hidden] { display: none; }
.lang__item { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; padding: 8px 10px; border-radius: var(--radius-xs); text-decoration: none; color: var(--heading); font-size: 14px; font-weight: 500; }
.lang__item:hover { background: var(--surface-2); color: var(--heading); }
.lang__item[aria-current="true"] { font-weight: 600; background: var(--bg-tint); }
.lang__item .icon--check { width: 16px; height: 16px; color: var(--link); }

.search-panel { border-top: 1px solid var(--border); background: var(--bg-alt); }
.search-panel[hidden] { display: none; }
.search-form { display: flex; gap: var(--s2); max-width: 720px; margin-block: var(--s5); }
.search-form input[type="search"] { flex: 1; min-width: 0; }

/* Mobile drawer */
.mobile-nav { position: fixed; inset: 0; top: var(--header-h); z-index: 90; background: var(--surface); overflow-y: auto; padding: var(--s2) var(--gutter) var(--s10); }
.mobile-nav[hidden] { display: none; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav .mobile-list > li { border-bottom: 1px solid var(--border); }
.mobile-nav li { display: flex; flex-wrap: wrap; align-items: center; }
.mobile-nav .mobile-list a { flex: 1; display: block; padding: 14px 0; font-size: 17px; font-weight: 600; text-decoration: none; color: var(--heading); }
.mobile-nav .mobile-list a:hover { color: var(--link); }
.mobile-nav .sub-menu { flex-basis: 100%; display: none; padding-inline-start: var(--s3); padding-bottom: var(--s2); }
.mobile-nav .sub-menu a { font-size: 15px; font-weight: 500; padding: 10px 0; }
.mobile-nav .sub-menu .sub-menu a { font-size: 15px; font-weight: 400; padding: 8px 0; }
.mobile-nav .sub-menu > li.menu-item-has-children > a { font-weight: 600; color: var(--muted); font-size: var(--text-label); }
.mobile-nav li.is-open > .sub-menu { display: block; }
.mobile-nav .sub-toggle { width: 44px; height: 44px; border: 0; background: transparent; color: var(--heading); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.mobile-nav .sub-toggle .icon { transition: transform var(--t-fast) var(--ease); }
.mobile-nav li.is-open > .sub-toggle .icon { transform: rotate(180deg); }
.mobile-nav__extra { margin-top: var(--s5); display: grid; gap: var(--s3); justify-items: start; }
/* "Sign in to my space" / "My space": the primary button, icon beside the label, white on blue-600 (6.1:1),
   blue-700 on hover and press (8.5:1); dark theme #0B1220 on #8FB0FA (8.7:1) and on #B7CDFF (11.6:1). */
.mobile-nav__signin { min-height: 48px; padding: 10px 22px; font-size: 16px; gap: 10px; }
.mobile-nav__signin .icon { width: 20px; height: 20px; }
@media (max-width: 479px) { .mobile-nav__signin { justify-self: stretch; } }
.mobile-nav__out { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--link); text-decoration: underline; }
.mobile-nav__out:hover { color: var(--link-hover); }
.mobile-nav__links { display: grid; gap: 0; margin-top: var(--s2); }
.mobile-nav__links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--link); text-decoration: none; }
.mobile-nav__links a:hover { color: var(--link-hover); text-decoration: underline; }
body.nav-open { overflow: hidden; }
.offline-notice { display: flex; align-items: center; justify-content: center; gap: var(--s2); padding: 10px var(--gutter); background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn); font-size: var(--text-xs); font-weight: 500; }
.offline-notice[hidden] { display: none; }
.offline-notice .icon { width: 18px; height: 18px; }

/* ==================================================================
   6. HERO + LEVEL PANEL
================================================================== */
.hero { background: var(--bg-tint); border-bottom: 1px solid var(--tint-2); padding-block: clamp(40px, 6vw, 80px) clamp(40px, 6vw, 72px); }
html[data-theme="dark"] .hero { border-bottom-color: var(--border); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 1023px) { .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); } }
.hero__statement { font-size: var(--text-display); line-height: 1.08; letter-spacing: var(--track-tight); font-weight: 700; margin: 0 0 var(--s5); max-width: 20ch; color: var(--heading); }
html[lang="ar"] .hero__statement { line-height: 1.35; max-width: 22ch; }
.hero__text { font-size: var(--text-body-lg); color: var(--text-2); max-width: 52ch; margin: 0 0 var(--s6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

.level-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); }
.level-panel__title { font-size: var(--text-h4); margin: 0 0 6px; }
.level-panel__text, .level-panel__current { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--s4); }
.level-panel__current { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px 12px; background: var(--bg-tint); border-radius: var(--radius-sm); color: var(--text-2); }
.level-panel__current strong { color: var(--heading); font-weight: 600; }
.level-panel__current a { font-weight: 500; white-space: nowrap; }
.level-select { display: grid; gap: 10px; }
.level-select__label { font-weight: 600; font-size: var(--text-xs); color: var(--heading); }
.level-select__btn { width: 100%; }
/* Hidden from the first paint when scripts run (the form submits on change): hiding it later moved the page. */
.js .level-select__btn { display: none; }
.level-select.is-loading { opacity: .7; cursor: progress; }
.level-select__status { font-size: var(--text-label); color: var(--muted); margin: 0; }
.level-select__status[hidden] { display: none; }

/* ==================================================================
   7. LISTS — announcements, events, documents, quick links, programs,
      departments, labs, news, pathways, search results, facts, people
================================================================== */
.ann-list, .event-list, .doc-list, .quick-links, .dept-list, .lab-list, .link-list, .cycle__list, .pathways { list-style: none; margin: 0; padding: 0; }

.ann-list { border-top: 1px solid var(--border); }
.ann-row { border-bottom: 1px solid var(--border); }
.ann-row__link { display: grid; grid-template-columns: 92px minmax(0, 1fr) 20px; gap: var(--s4); align-items: start; padding: 14px 0; color: var(--text); text-decoration: none; }
.ann-row__date { font-size: var(--text-xs); font-weight: 500; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.ann-row__body { min-width: 0; }
/* A title that is one unbroken word longer than the line (a file name, a reference) breaks inside the word instead
   of pushing the page sideways on phones; titles made of ordinary words wrap as before. */
.ann-row__title { overflow-wrap: anywhere; }
.ann-row__title { display: block; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--heading); transition: color var(--t-hover) var(--ease); }
.ann-row__link:hover .ann-row__title { color: var(--link); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.ann-row__meta { display: block; margin-top: 3px; font-size: var(--text-label); color: var(--muted); }
.ann-row__aud { color: var(--text-2); font-weight: 500; }
.ann-row__pin { display: inline-block; margin-inline-end: 8px; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--pin-bg); color: var(--pin-text); font-size: 11px; font-weight: 600; line-height: 1.6; vertical-align: 2px; letter-spacing: .02em; }
/* vertical-align: an inline-flex box would otherwise sit on its icon's bottom edge, 3px above the text beside it. */
.ann-row__file { display: inline-flex; align-items: center; gap: 4px; vertical-align: top; }
.ann-row__file .icon { width: 14px; height: 14px; }
.ann-row__arrow { color: var(--faint); margin-top: 4px; transition: transform var(--t-hover) var(--ease), color var(--t-hover) var(--ease); }
.ann-row__link:hover .ann-row__arrow { color: var(--link); transform: translateX(3px); }
html[dir="rtl"] .ann-row__link:hover .ann-row__arrow { transform: scaleX(-1) translateX(3px); }
.ann-list--compact .ann-row__link { padding: 10px 0; grid-template-columns: 80px minmax(0, 1fr) 20px; }
.ann-list--compact .ann-row__title { font-size: 15px; }
@media (max-width: 599px) { .ann-row__link, .ann-list--compact .ann-row__link { grid-template-columns: minmax(0, 1fr); gap: 2px; } .ann-row__arrow { display: none; } .ann-row__date { padding-top: 0; } }

.event-list { border-top: 1px solid var(--border); }
.event-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--s4); padding: 14px 0; border-bottom: 1px solid var(--border); position: relative; }
.event-row__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; background: var(--bg-tint); color: var(--heading); border-radius: var(--radius-sm); line-height: 1; }
.event-row__date b { font-size: 20px; font-weight: 700; }
.event-row__date span { font-size: 11px; font-weight: 600; margin-top: 3px; }
.event-row__body { min-width: 0; }
.event-row__body h3 { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 2px 0 4px; }
.event-row__body h3 a { text-decoration: none; color: var(--heading); }
.event-row__body h3 a::after { content: ""; position: absolute; inset: 0; }
.event-row:hover h3 a { color: var(--link); text-decoration: underline; }
.event-row__body p { margin: 0; font-size: var(--text-label); color: var(--muted); }
.event-list--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s7); border-top: 0; }
.event-list--grid .event-row { border-top: 1px solid var(--border); border-bottom: 0; padding: 18px 0; }
.event-list--grid .event-row__body h3 { font-size: 16px; }
@media (max-width: 767px) { .event-list--grid { grid-template-columns: minmax(0, 1fr); } }

.doc-list { border-top: 1px solid var(--border); }
.doc-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.doc-row__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-tint); color: var(--blue-700); display: flex; align-items: center; justify-content: center; }
html[data-theme="dark"] .doc-row__icon { color: var(--link); }
.doc-row__icon .icon { width: 20px; height: 20px; }
.doc-row__body { min-width: 0; }
.doc-row__title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 3px; }
.doc-row__title a { text-decoration: none; color: var(--heading); }
.doc-row__title a:hover { text-decoration: underline; color: var(--link); }
.doc-row__meta { margin: 0; font-size: var(--text-label); color: var(--muted); }
.doc-row__type { color: var(--text-2); font-weight: 500; }
.doc-row__action { justify-self: end; }
@media (max-width: 599px) { .doc-row { grid-template-columns: 40px minmax(0, 1fr); row-gap: var(--s2); } .doc-row__action { grid-column: 2; justify-self: start; } }

.quick-links { border-top: 1px solid var(--border); }
.quick-links li { border-bottom: 1px solid var(--border); }
.quick-links a { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 6px 0; font-size: var(--text-sm); font-weight: 500; color: var(--heading); text-decoration: none; }
.quick-links a:hover { color: var(--link); }
.quick-links .icon { width: 20px; height: 20px; color: var(--link); }
.quick-links .icon--ext { margin-inline-start: auto; color: var(--faint); width: 14px; height: 14px; }

.quick-links--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s7); border-top: 0; }
.quick-links--grid li { border-top: 1px solid var(--border); border-bottom: 0; }
@media (max-width: 899px) { .quick-links--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .quick-links--grid { grid-template-columns: minmax(0, 1fr); } }
.quick-access { background: var(--bg-alt); border-top: 1px solid var(--border); padding-block: clamp(32px, 4vw, 48px) clamp(36px, 5vw, 56px); }
.quick-access__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-bottom: var(--s3); }
.quick-access__head h2 { margin: 0; font-size: var(--text-h4); }
.quick-access__head p { margin: 0; font-size: var(--text-xs); color: var(--muted); }
.page-body + .quick-access, .section + .quick-access { margin-top: clamp(24px, 4vw, 40px); }

.cycles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6); }
@media (max-width: 1023px) { .cycles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cycles { grid-template-columns: minmax(0, 1fr); gap: var(--s5); } }
.cycle { border-top: 1px solid var(--rule); padding-top: var(--s3); }
.cycle__title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: var(--text-h4); margin: 0 0 var(--s2); }
.cycle__title a { color: var(--heading); text-decoration: none; }
.cycle__title a:hover { color: var(--link); text-decoration: underline; }
.cycle__count { font-size: var(--text-label); font-weight: 500; color: var(--muted); white-space: nowrap; }
.cycle__list li { border-top: 1px solid var(--border); }
.cycle__list a { display: block; padding: 9px 0; font-size: var(--text-sm); font-weight: 500; line-height: 1.4; color: var(--text); text-decoration: none; }
.cycle__list a:hover { color: var(--link); text-decoration: underline; }
.cycle__empty { font-size: var(--text-xs); color: var(--muted); margin: 0; }
.home-programs .cycles { margin-bottom: clamp(40px, 5vw, 56px); }
.home-side { display: grid; gap: clamp(32px, 4vw, 40px); align-content: start; }

.dept-list { border-top: 1px solid var(--border); }
.dept-row { border-bottom: 1px solid var(--border); }
.dept-row__link { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto 20px; gap: var(--s5); align-items: center; padding: 18px 0; text-decoration: none; color: var(--text); }
.dept-row__main { min-width: 0; }
.dept-row__name { display: block; font-size: var(--text-h4); font-weight: 600; line-height: 1.3; color: var(--heading); transition: color var(--t-hover) var(--ease); }
.dept-row__link:hover .dept-row__name { color: var(--link); text-decoration: underline; }
.dept-row__text { display: block; margin-top: 4px; font-size: var(--text-xs); color: var(--text-2); }
.dept-row__head { font-size: var(--text-xs); color: var(--muted); }
.dept-row__head strong { font-weight: 500; color: var(--text-2); }
.dept-row__count { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.dept-row__arrow { color: var(--faint); transition: transform var(--t-hover) var(--ease), color var(--t-hover) var(--ease); }
.dept-row__link:hover .dept-row__arrow { color: var(--link); transform: translateX(3px); }
html[dir="rtl"] .dept-row__link:hover .dept-row__arrow { transform: scaleX(-1) translateX(3px); }
@media (max-width: 767px) { .dept-row__link { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 0; } .dept-row__arrow { display: none; } }

.lab-list { border-top: 1px solid var(--border); }
.lab-row { border-bottom: 1px solid var(--border); }
.lab-row__link { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: 12px 0; text-decoration: none; color: var(--text); }
.lab-row__acr { font-size: var(--text-label); font-weight: 700; color: var(--blue-700); letter-spacing: .02em; padding-top: 3px; }
html[data-theme="dark"] .lab-row__acr { color: var(--link); }
.lab-row__body { min-width: 0; }
.lab-row__name { display: block; font-size: var(--text-sm); font-weight: 600; line-height: 1.4; color: var(--heading); }
.lab-row__link:hover .lab-row__name { color: var(--link); text-decoration: underline; }
.lab-row__text, .lab-row__meta { display: block; margin-top: 3px; font-size: var(--text-label); color: var(--muted); }
.lab-row__text { color: var(--text-2); font-size: var(--text-xs); }
.lab-list--lg .lab-row__link { grid-template-columns: 76px minmax(0, 1fr); padding: 18px 0; }
.lab-list--lg .lab-row__name { font-size: var(--text-h4); }

.link-list li { border-top: 1px solid var(--border); }
.link-list li:last-child { border-bottom: 1px solid var(--border); }
.link-list a { display: flex; align-items: center; gap: 6px; padding: 9px 0; font-size: var(--text-sm); font-weight: 500; color: var(--heading); text-decoration: none; }
.link-list a:hover { color: var(--link); text-decoration: underline; }
.link-list--after { margin-top: var(--s3); }
.link-list--static span { display: block; padding: 8px 0; font-size: var(--text-sm); color: var(--text-2); }

.news-list { display: grid; }
.news-item { padding: 16px 0; border-top: 1px solid var(--border); }
.news-item--featured { border-top: 0; padding-top: 0; padding-bottom: 20px; }
.news-item__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-md); margin-bottom: var(--s4); background: var(--surface-2); }
.news-item__img img { width: 100%; height: 100%; object-fit: cover; }
.news-item__meta { margin: 0 0 6px; font-size: var(--text-label); font-weight: 500; color: var(--muted); }
.news-item__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.news-item--featured .news-item__title { font-size: var(--text-h3); }
.news-item__title a { color: var(--heading); text-decoration: none; }
.news-item__title a:hover { color: var(--link); text-decoration: underline; }
.news-item__text { margin: var(--s2) 0 0; font-size: var(--text-sm); color: var(--text-2); max-width: 60ch; }
.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s7); }
.news-grid .news-item, .news-grid .news-item--featured { border-top: 1px solid var(--border); padding: 20px 0; }
.news-grid .news-item--featured .news-item__title { font-size: 17px; }
@media (max-width: 767px) { .news-grid { grid-template-columns: minmax(0, 1fr); } }

.program-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s7); border-top: 1px solid var(--border); }
@media (max-width: 767px) { .program-list { grid-template-columns: minmax(0, 1fr); } }
.program-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.program-item__title { font-size: 17px; font-weight: 600; line-height: 1.35; margin: 0 0 4px; }
.program-item__title a { color: var(--heading); text-decoration: none; }
.program-item__title a:hover { color: var(--link); text-decoration: underline; }
.program-item__meta { margin: 0 0 6px; font-size: var(--text-label); color: var(--muted); }
.program-item__text { margin: 0; font-size: var(--text-xs); color: var(--text-2); }
.program-group { margin-bottom: clamp(32px, 4vw, 48px); }
.program-group > h2 { margin-bottom: var(--s3); font-size: var(--text-h3); }

.pathways { border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s7); }
@media (max-width: 767px) { .pathways { grid-template-columns: minmax(0, 1fr); } }
.pathway { border-bottom: 1px solid var(--border); }
.pathway a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s4); padding: 18px 0; text-decoration: none; color: var(--text); }
.pathway .icon { width: 40px; height: 40px; padding: 9px; border-radius: var(--radius-sm); background: var(--bg-tint); color: var(--blue-700); }
html[data-theme="dark"] .pathway .icon { color: var(--link); }
.pathway__title { display: block; font-size: 17px; font-weight: 600; color: var(--heading); margin-bottom: 3px; }
.pathway a:hover .pathway__title { color: var(--link); text-decoration: underline; }
.pathway__text { display: block; font-size: var(--text-xs); color: var(--text-2); }

.search-result { padding: var(--s5) 0; border-top: 1px solid var(--border); }
.search-result:last-of-type { border-bottom: 1px solid var(--border); }
.search-result__type { font-size: var(--text-label); font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.search-result h2 { font-size: var(--text-h4); margin: 0 0 6px; }
.search-result h2 a { text-decoration: none; color: var(--heading); }
.search-result h2 a:hover { text-decoration: underline; color: var(--link); }
.search-result p { margin: 0; color: var(--text-2); font-size: var(--text-sm); }
.search-tabs { margin-top: var(--s5); }
.results-count { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--s4); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4) var(--s5); padding: var(--s5); border-radius: var(--radius-md); background: var(--bg-alt); margin: 0 0 var(--s6); }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: var(--text-label); font-weight: 600; color: var(--muted); }
/* A long address stays inside its column: it breaks at the @ (a <wbr> from the template), anywhere as a last resort. */
.facts dd { margin: 0; font-weight: 600; font-size: var(--text-sm); color: var(--heading); overflow-wrap: anywhere; }
.facts dd a { text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }
.facts__sub { display: block; font-weight: 500; color: var(--text-2); font-size: var(--text-xs); margin-top: 2px; }
.facts--person { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.year-head { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s5) 0 var(--s2); font-size: var(--text-h4); color: var(--heading); }
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.sub-section .year-head:first-of-type { margin-top: 0; }

/* Council minutes rows */
.pv-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.pv-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pv-row__date { font-size: var(--text-xs); font-weight: 500; color: var(--muted); white-space: nowrap; }
.pv-row__body { min-width: 0; }
.pv-row__title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 3px; color: var(--heading); }
.pv-row__meta { margin: 0; font-size: var(--text-label); color: var(--muted); }
.pv-row__session { color: var(--text-2); font-weight: 500; }
.pv-row__action { justify-self: end; }
.pv-row__none { font-size: var(--text-label); color: var(--muted); }
@media (max-width: 599px) { .pv-row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; } .pv-row__action { justify-self: start; margin-top: var(--s2); } }

/* Final year projects rows */
.proj-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.proj-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--s4); align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.proj-row__year { font-size: var(--text-xs); font-weight: 600; color: var(--blue-700); padding-top: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .proj-row__year { color: var(--link); }
.proj-row__body { min-width: 0; }
.proj-row__title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; }
.proj-row__title a { color: var(--heading); text-decoration: none; }
.proj-row__title a:hover { color: var(--link); text-decoration: underline; }
.proj-row__people { margin: 0 0 2px; font-size: var(--text-xs); color: var(--text-2); }
.proj-row__sup { color: var(--muted); }
.proj-row__meta { margin: 0; font-size: var(--text-label); color: var(--muted); }
.proj-row__action { justify-self: end; margin-top: 2px; }
@media (max-width: 599px) { .proj-row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; padding: 14px 0; } .proj-row__action { justify-self: start; margin-top: var(--s2); } }
.filters--projects { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.filters__search { grid-column: 1 / -1; }
@media (min-width: 1024px) { .filters--projects { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) auto; } .filters__search { grid-column: auto; } }
.filters input[type="search"] { min-height: 42px; font: inherit; font-size: 15px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; }
.filters input[type="search"]:focus { border-color: var(--primary); outline-offset: 1px; }
.tags li { list-style: none; }
.tags .tag { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; }
.prose ul.tags { padding: 0; }
a.tag:hover { background: var(--tint-2); color: var(--tag-text); }

.attachment-box { display: flex; align-items: center; gap: var(--s4); padding: var(--s5); border-radius: var(--radius-md); background: var(--bg-tint); margin: var(--s6) 0; flex-wrap: wrap; }
.attachment-box > .icon { width: 28px; height: 28px; color: var(--blue-700); }
html[data-theme="dark"] .attachment-box > .icon { color: var(--link); }
.attachment-box__body { flex: 1; min-width: 200px; }
.attachment-box__body strong { display: block; color: var(--heading); }
.attachment-box__body span { font-size: var(--text-xs); color: var(--muted); }

/* Attachments of an announcement, document or event (markup: FMI Core, fmi_attachments()).
   Images show as images, every other file as a row: type tile, name, format · size, download.
   The tile tint follows the family of formats and reuses the status pairs (all >= 5.3:1). */
.fmi-attachments { margin-top: var(--s7); font-size: var(--text-body); line-height: 1.5; }
.fmi-attachments .fmi-attachments__title { display: flex; align-items: baseline; gap: var(--s2); margin: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); font-size: var(--text-h4); line-height: 1.35; letter-spacing: 0; }
.fmi-attachments__count { font-size: var(--text-xs); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.fmi-attachments .fmi-attachments__gallery, .fmi-attachments .fmi-attachments__list { list-style: none; margin: 0; padding: 0; }
.fmi-attachments .fmi-attachments__gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s5); align-items: start; padding-block: var(--s5); border-bottom: 1px solid var(--border); }
.fmi-attachments .fmi-attachments__gallery:last-child { border-bottom: 0; padding-bottom: 0; }
.fmi-attachments .fmi-attachments__figure, .fmi-attachments .fmi-attachments__figure figure { margin: 0; min-width: 0; }
.fmi-attachments__image { display: block; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
/* Never enlarged past its own size, never taller than 620 px: small pictures sit centred on the tint. */
.fmi-attachments .fmi-attachments__image img { display: block; width: auto; max-width: 100%; height: auto; max-height: 620px; margin-inline: auto; border-radius: 0; transition: opacity var(--t-hover) var(--ease); }
.fmi-attachments__image:hover img { opacity: .9; }
.fmi-attachments .fmi-attachments__caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s4); row-gap: 2px; align-items: center; margin-top: var(--s2); font-size: inherit; color: inherit; }
.fmi-attachments__caption .fmi-attachment__name, .fmi-attachments__caption .fmi-attachment__meta { grid-column: 1; }
.fmi-attachments__caption .fmi-attachment__download { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s2); margin-inline-end: calc(-1 * var(--s2)); font-size: var(--text-xs); font-weight: 600; text-decoration: none; }
.fmi-attachments__caption .fmi-attachment__download:hover { text-decoration: underline; }
.fmi-attachments .fmi-attachment { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--border); }
.fmi-attachment__icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.fmi-attachment__svg { width: 24px; height: 24px; }
.fmi-attachment__ext { display: none; }
.fmi-attachment--pdf .fmi-attachment__icon { background: var(--err-bg); color: var(--err); }
.fmi-attachment--word .fmi-attachment__icon { background: var(--info-bg); color: var(--info); }
.fmi-attachment--excel .fmi-attachment__icon, .fmi-attachment--csv .fmi-attachment__icon { background: var(--ok-bg); color: var(--ok); }
.fmi-attachment--powerpoint .fmi-attachment__icon { background: var(--warn-bg); color: var(--warn); }
.fmi-attachment__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fmi-attachment__name { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--heading); overflow-wrap: anywhere; }
.fmi-attachment__meta { font-size: var(--text-label); color: var(--muted); }
.fmi-attachment__format { color: var(--text-2); font-weight: 500; }
/* Latin format names and numbers inside Arabic lines (and the reverse) keep their place: format, then size. */
.fmi-attachment__name, .fmi-attachment__format, .fmi-attachment__size { unicode-bidi: isolate; }
.fmi-attachment .fmi-attachment__download { justify-self: end; white-space: nowrap; }
@media (max-width: 599px) {
	.fmi-attachments .fmi-attachment { grid-template-columns: 40px minmax(0, 1fr); row-gap: var(--s2); align-items: start; }
	.fmi-attachment .fmi-attachment__download { grid-column: 2; justify-self: start; }
}

.directory { display: grid; border-top: 1px solid var(--border); }
.directory__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3) var(--s5); padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.directory__item strong { display: block; color: var(--heading); font-weight: 600; }
.directory__item span { font-size: var(--text-xs); color: var(--muted); }
.directory__item a { text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.directory__item a:hover { text-decoration: underline; }
@media (max-width: 599px) { .directory__item { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; border-top: 1px solid var(--border); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-2); }
.steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--heading); color: var(--bg); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

.staff-tools { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s6); }
.staff-tools .tabs { margin: 0; flex: 1 1 100%; }
.staff-tools input[type="search"] { flex: 1; min-width: 220px; max-width: 420px; }
.staff-tools__count { font-size: var(--text-xs); color: var(--muted); }
.staff-group { margin-bottom: clamp(32px, 4vw, 48px); }
.staff-group h2 { font-size: var(--text-h3); padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.staff-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s3); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.staff-card--hidden { display: none; }
.staff-card__avatar { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--tint-2); color: var(--heading); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; overflow: hidden; }
.staff-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.staff-card__body { min-width: 0; }
.staff-card__name { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0; color: var(--heading); }
.staff-card__name small { display: block; font-weight: 500; color: var(--muted); font-size: var(--text-label); margin-top: 2px; }
.staff-card__pos { color: var(--text-2); font-size: var(--text-label); margin: 4px 0 0; }
.staff-card details { margin-top: var(--s2); }
.staff-card summary { cursor: pointer; font-size: var(--text-label); font-weight: 600; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; }
.staff-card summary::-webkit-details-marker { display: none; }
.staff-card summary::after { content: ""; width: 6px; height: 6px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform var(--t-fast) var(--ease); }
.staff-card details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.staff-card__contact { font-size: var(--text-label); color: var(--text); display: grid; gap: 4px; margin-top: var(--s2); }
.staff-card__contact a { word-break: break-all; }
.org { display: grid; gap: var(--s4); }
.org__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }
.org__box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--s4) var(--s5); background: var(--surface); }
.org__box--dean { background: var(--bg-tint); border-color: var(--tint-2); }
.org__box strong { display: block; font-size: 16px; color: var(--heading); }
.org__box span { display: block; font-size: var(--text-label); color: var(--muted); margin-bottom: 2px; }
.org__box a { font-size: var(--text-label); }
.notice-box, .staff-notice { padding: var(--s6); border-radius: var(--radius-md); background: var(--bg-alt); }
.notice-box h2, .staff-notice h2 { display: flex; align-items: center; gap: var(--s2); font-size: var(--text-h4); margin-bottom: var(--s2); }
.notice-box p, .staff-notice p { color: var(--text-2); }
.notice-box p:last-child { margin-bottom: 0; }

/* ==================================================================
   7b. PERSONAL SPACES (students, teachers, staff)
   Same system: hairline lists, one tinted panel (sign-in), status pairs from the tokens.
================================================================== */
.space-entry { margin-bottom: clamp(32px, 4vw, 48px); }
.signin { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); }
.signin__title { display: flex; align-items: center; gap: var(--s2); font-size: var(--text-h4); margin: 0 0 6px; }
.signin__title .icon { color: var(--link); }
.signin__lead { font-size: var(--text-sm); color: var(--text-2); margin: 0 0 var(--s4); max-width: 60ch; }
.signin__form { max-width: 460px; gap: var(--s3); }
.signin__form .btn { justify-self: stretch; }
.signin__help, .signin__alt { font-size: var(--text-xs); color: var(--muted); margin: var(--s4) 0 0; }
.signin__alt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); }
.signin__alt a { font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--text-sm); color: var(--text); cursor: pointer; }
.form .check { font-weight: 500; color: var(--text); }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--primary); }
.form__hint { font-size: var(--text-xs); color: var(--muted); }
.form--narrow { max-width: 460px; }
.alert > .icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.space-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3) var(--s4); padding: 0 0 var(--s4); }
.space-bar__avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--tint-2); color: var(--heading); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.space-bar__who { flex: 1; min-width: 180px; }
.space-bar__name { margin: 0; font-weight: 600; font-size: var(--text-h4); line-height: 1.3; color: var(--heading); }
.space-bar__meta { margin: 2px 0 0; font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }
.space-bar__out { flex: none; }
.space-tabs { margin-bottom: var(--s5); }
.space-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; font-size: var(--text-sm); }
.space-section + .space-section { margin-top: clamp(36px, 5vw, 52px); }
.space-section > h2, .space-section .section-head h2 { font-size: var(--text-h3); }
.space-section > h2 { margin-bottom: var(--s3); }
.space-section__lead { font-size: var(--text-sm); color: var(--text-2); margin: 0 0 var(--s4); max-width: 65ch; }
.space-section .section-head { margin-bottom: var(--s4); }
.space-first { max-width: 560px; }
.space-first__lead { color: var(--text-2); margin-bottom: var(--s5); }
.space-back { margin: 0 0 var(--s4); }
.link-more--back .icon--dir, .link-more--back:hover .icon--dir { transform: scaleX(-1); }
html[dir="rtl"] .link-more--back .icon--dir, html[dir="rtl"] .link-more--back:hover .icon--dir { transform: none; }
.space-elsewhere__actions, .space-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.space-actions { gap: var(--s2); }
.ann-list--after { margin-top: var(--s4); }

/* Status: a text label on its tint, plus a dot; colour never carries the meaning alone */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border: 1px solid; border-radius: var(--radius-xs); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--submitted { color: var(--info); background: var(--info-bg); border-color: var(--tint-2); }
.status--in-progress { color: var(--warn); background: var(--warn-bg); border-color: currentColor; }
.status--ready { color: var(--ok); background: var(--ok-bg); border-color: currentColor; }
.status--rejected { color: var(--err); background: var(--err-bg); border-color: currentColor; }

.req-list, .post-list, .book-list, .group-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.req-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s4); align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.req-row__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-tint); color: var(--blue-700); display: flex; align-items: center; justify-content: center; }
html[data-theme="dark"] .req-row__icon { color: var(--link); }
.req-row__body, .post-row__body, .book-row__body { min-width: 0; }
.req-row__title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; color: var(--heading); }
.req-row__meta, .post-row__meta { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; margin: 0; font-size: var(--text-label); color: var(--muted); }
.req-row__note { margin: var(--s2) 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-alt); font-size: var(--text-sm); color: var(--text); }
.req-row--rejected .req-row__note { background: var(--err-bg); color: var(--err); }
.req-row__note strong { color: inherit; margin-inline-end: 4px; }
.req-row__action { align-self: center; }
@media (max-width: 599px) { .req-row { grid-template-columns: 40px minmax(0, 1fr); } .req-row__action { grid-column: 2; justify-self: start; } }

.post-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--s4); align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.post-row__date { padding-top: 3px; font-size: var(--text-xs); font-weight: 500; color: var(--muted); white-space: nowrap; }
.post-row__title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; color: var(--heading); }
.post-row__title a { color: var(--heading); text-decoration: none; }
.post-row__title a:hover { color: var(--link); text-decoration: underline; }
.post-row__note { margin: var(--s2) 0 0; font-size: var(--text-xs); color: var(--text-2); }
.post-row__action { margin: 0; }
@media (max-width: 599px) { .post-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .post-row__action { justify-self: start; margin-top: var(--s2); } }

.choice, .checks { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice legend, .checks legend { padding: 0; margin-bottom: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--heading); }
.choice { display: grid; gap: var(--s2); }
.form .choice__item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; cursor: pointer; }
.choice__item input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.choice__item strong { display: block; font-weight: 600; color: var(--heading); }
.choice__item small { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--muted); }
.form .choice__item:has(input:checked) { border-color: var(--primary); background: var(--bg-tint); }
.checks__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--s4); }
.checks.form__row--error .checks__grid { outline: 1px solid var(--err); outline-offset: 4px; border-radius: var(--radius-xs); }
.checks[hidden] { display: none; }

.notice-detail h2 { font-size: var(--text-h3); margin-bottom: var(--s2); }
.notice-detail .page-meta { margin: 0 0 var(--s5); }

.filters--library { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
@media (max-width: 767px) { .filters--library { grid-template-columns: minmax(0, 1fr); } }
.book-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--s4); align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.book-row__call { padding-top: 3px; font-size: var(--text-label); font-weight: 700; letter-spacing: .02em; color: var(--blue-700); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
html[data-theme="dark"] .book-row__call { color: var(--link); }
.book-row__title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; color: var(--heading); }
.book-row__meta { margin: 0; font-size: var(--text-label); color: var(--muted); }
.book-row__more { margin-top: 4px; font-size: var(--text-xs); color: var(--text-2); }
.book-row__more summary { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; color: var(--link); cursor: pointer; }
.book-row__more p { margin: 4px 0 0; }
.book-row__action { align-self: center; }
.book-row__action form { margin: 0; }
@media (max-width: 599px) { .book-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .book-row__action { justify-self: start; margin-top: var(--s2); } }

.group-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 14px 0; border-bottom: 1px solid var(--border); }
.group-row__name { margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.group-row__meta { margin: 0; font-size: var(--text-label); color: var(--muted); }
.group-row__count { font-size: var(--text-xs); color: var(--text-2); white-space: nowrap; }
.group-list + .space-section__lead { margin-top: var(--s4); }

.my-space { position: relative; text-decoration: none; }
.my-space.is-signed-in::after { content: ""; position: absolute; top: 9px; inset-inline-end: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
.request-steps { margin-bottom: var(--s6); }
.request-spaces__title { margin-bottom: var(--s3); font-size: var(--text-h3); }
.request-cta { padding: var(--s5); border-radius: var(--radius-md); background: var(--bg-tint); }
.request-cta__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: 0; }

/* ==================================================================
   8. PAGE CHROME
================================================================== */
.page-header { background: var(--bg-tint); border-bottom: 1px solid var(--tint-2); padding-block: clamp(28px, 4vw, 44px) clamp(24px, 3vw, 36px); }
html[data-theme="dark"] .page-header { border-bottom-color: var(--border); }
.page-header h1 { margin: 0; max-width: 26ch; }
.page-header__caption { margin: 0 0 var(--s2); font-size: var(--text-xs); font-weight: 500; color: var(--text-2); }
.page-header .lead { margin: var(--s3) 0 0; font-size: var(--text-body-lg); color: var(--text-2); max-width: 62ch; }
.page-header .page-meta { margin-top: var(--s4); }
.breadcrumbs { font-size: var(--text-label); color: var(--muted); margin-bottom: var(--s4); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--faint); margin-inline-end: 6px; }
.breadcrumbs a { display: inline-block; padding: 4px 0; text-decoration: none; color: var(--muted); }
.breadcrumbs a:hover { text-decoration: underline; color: var(--link); }
.breadcrumbs [aria-current] { display: inline-block; padding: 4px 0; color: var(--text-2); }
.page-body { padding-block: clamp(32px, 5vw, 64px); }
.page-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; font-size: var(--text-xs); color: var(--muted); margin-top: var(--s4); }
.page-meta strong { color: var(--heading); font-weight: 600; }
.page-meta .icon { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 4px; }
.sub-section { margin-top: clamp(40px, 5vw, 56px); }
.sub-section > h2 { margin-bottom: var(--s4); font-size: var(--text-h3); }
.sub-section .section-head { margin-bottom: var(--s4); }
.sub-section .section-head h2 { font-size: var(--text-h3); }
.post-thumb { border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--s6); background: var(--surface-2); }
.post-thumb:not(.post-thumb--cover) img { width: 100%; height: auto; }
/* Announcement cover (poster, scanned notice): the whole picture, never cropped, never taller than the screen.
   No width is set on it, not even "auto": its width and height attributes then give the browser the picture's
   box before the file arrives, and the text below does not move when it does ("width: auto" left the box
   empty until then). A poster taller than the limit keeps that box and is drawn whole inside it. */
.post-thumb--cover { display: block; border: 1px solid var(--border); }
.prose .post-thumb--cover img { max-width: 100%; height: auto; max-height: min(82vh, 860px); margin-inline: auto; border-radius: 0; object-fit: contain; }
.event-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }

.sidebar { display: grid; gap: clamp(32px, 4vw, 40px); align-content: start; }
.side-block__title { font-size: var(--text-sm); font-weight: 600; color: var(--heading); margin: 0 0 var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); }
.side-block p { font-size: var(--text-xs); color: var(--text-2); margin: 0 0 var(--s2); }
.side-block p:last-child { margin-bottom: 0; }
.side-block .link-list li:first-child { border-top: 0; }
.side-block--tint { background: var(--bg-alt); border-radius: var(--radius-md); padding: var(--s5); }
.side-block--tint .side-block__title { border-bottom: 0; padding-bottom: 0; }
.side-block--tint .link-list li:last-child { border-bottom: 0; }
.side-block--tint p .icon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-inline-end: 6px; color: var(--muted); }
.side-block .btn { margin-top: var(--s3); }
.map-embed { border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.map-embed iframe { display: block; width: 100%; height: 300px; border: 0; }

.error-404 { text-align: center; padding-block: clamp(56px, 9vw, 120px); }
.error-404__code { display: block; font-size: clamp(64px, 12vw, 120px); font-weight: 700; line-height: 1; color: var(--tint-2); letter-spacing: var(--track-tight); margin-bottom: var(--s3); }
html[data-theme="dark"] .error-404__code { color: var(--surface-2); }
.error-404 h1 { font-size: var(--text-h2); }
.error-404 p { color: var(--text-2); }
.error-404 .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.error-404 .search-form { margin: var(--s6) auto 0; max-width: 560px; }

/* Section rhythm: consecutive white sections share one gap; tinted bands keep their own */
.section + .section { padding-top: 0; }
.section--alt + .section, .section--tint + .section, .section + .section--alt, .section + .section--tint { padding-top: var(--section); }

/* ==================================================================
   9. FOOTER
================================================================== */
.site-footer { background: var(--band); color: var(--on-band-2); }
.site-footer a { color: var(--on-band); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--on-band); }
.footer-main { padding-block: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
@media (max-width: 1023px) { .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .footer-main { grid-template-columns: minmax(0, 1fr); gap: var(--s6); } }
.brand--footer { color: var(--on-band); }
.brand--footer:hover { color: var(--on-band); }
.brand--footer .brand__mark { color: var(--on-band); height: 42px; }
.brand--footer .brand__name { color: var(--on-band); font-size: 13px; max-width: 220px; }
.brand--footer .brand__univ { color: var(--on-band-2); display: block; }
.footer-brand img { height: 48px; width: auto; }
.footer-brand p { color: var(--on-band-2); font-size: var(--text-xs); max-width: 40ch; margin: var(--s4) 0; }
.footer-contact { color: var(--on-band-2); font-size: var(--text-xs); font-style: normal; display: grid; gap: 0; justify-items: start; }
.footer-contact a, .footer-contact span { display: inline-block; padding: 3px 0; }
.footer-col h2 { font-size: var(--text-label); font-weight: 600; letter-spacing: .04em; color: var(--on-band-3); margin: 0 0 var(--s3); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-col a { display: inline-block; padding: 4px 0; font-size: var(--text-xs); font-weight: 500; }
.footer-bottom { border-top: 1px solid var(--band-border); padding-block: var(--s5); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3) var(--s5); font-size: var(--text-label); color: var(--on-band-2); }
.footer-bottom__copy { margin: 0; flex: 1 1 100%; }
.footer-bottom__links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.footer-links a { display: inline-block; padding: 4px 0; color: var(--on-band-2); }
.footer-bottom__tools { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; }
.social { display: flex; gap: var(--s2); }
.social a, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--band-border); border-radius: var(--radius-sm); background: transparent; color: var(--on-band-2); cursor: pointer; }
.social a:hover, .theme-toggle:hover { border-color: var(--on-band-3); color: var(--on-band); }
.social .icon, .theme-toggle .icon { width: 16px; height: 16px; }
.theme-toggle--drawer { color: var(--heading); border-color: var(--border); width: auto; padding: 0 12px; gap: 6px; }
.theme-toggle .icon--sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon--moon { display: none; }

/* ==================================================================
   10. MISC, MOTION, PRINT
================================================================== */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor, .gallery-caption { display: initial; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; }
}
@media print {
	.site-header, .site-footer, .search-panel, .mobile-nav, .level-panel, .sidebar, .filters, .filters-toggle, .tabs, .subtabs, .pagination, .btn, .skip-link, .offline-notice, .link-more, .quick-access, .signin, .post-form, .space-bar__out { display: none !important; }
	body { color: #000; font-size: 12pt; background: #fff; }
	a { color: #000; text-decoration: none; }
	.container { width: 100%; }
	.grid--main, .grid--sidebar, .hero__grid { grid-template-columns: 1fr; }
	.hero, .page-header, .section--alt { background: #fff; }
}

/* ==================================================================
   11. RELEASE 4 — DEPTH AND MOTION
   Same hue and type. What changes: a deep-blue hero with a drawn figure (curves and a small graph),
   key figures, a second level of elevation, and motion: load-in of the hero, reveal on scroll,
   hover responses, page transitions, a reading-progress line.
   Rules of the motion layer:
   - only transform and opacity move (no layout shift); the largest text of a page never fades (it is
     painted from the first frame), it only settles into place;
   - nothing is hidden by the stylesheet alone: .rv is set by main.js, on elements still below the
     screen, so the page is complete without JavaScript and while it loads;
   - directions follow the reading direction through --dir (1 left-to-right, -1 right-to-left);
   - loops run on wide screens only; everything is off under prefers-reduced-motion.
================================================================== */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --dir: 1; --shadow-1: 0 1px 2px rgba(18, 43, 92, .05), 0 10px 28px -14px rgba(18, 43, 92, .22); --shadow-2: 0 2px 6px rgba(18, 43, 92, .06), 0 28px 56px -24px rgba(18, 43, 92, .34); --section: clamp(64px, 8vw, 112px); }
html[dir="rtl"] { --dir: -1; }
html[data-theme="dark"] { --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7); --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -24px rgba(0, 0, 0, .8); }
@keyframes settle { from { transform: translateY(20px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } }
@keyframes float { to { transform: translateY(-10px); } }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }
@keyframes progress { to { transform: scaleX(1); } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* Reveal on scroll (classes set by main.js) */
.rv { opacity: 0; transform: translateY(20px); }
.rv--x { transform: translateX(calc(-28px * var(--dir))); }
.rv.rv-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--rv-i, 0) * 70ms); }

/* Header: lifts off the page once scrolled; reading progress under it */
.site-header { transition: box-shadow 240ms var(--ease), background-color 240ms var(--ease); }
.site-header.is-scrolled { box-shadow: 0 14px 32px -22px rgba(18, 43, 92, .45); }
html[data-theme="dark"] .site-header.is-scrolled { box-shadow: 0 14px 32px -18px rgba(0, 0, 0, .9); }
@media (min-width: 1024px) {
	@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		/* The blur sits on a pseudo-element: on the header itself it would capture the fixed drawer. */
		.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--surface); opacity: 0; transition: opacity 240ms var(--ease); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); }
		.site-header.is-scrolled { background: transparent; }
		.site-header.is-scrolled::before { opacity: .84; }
		body.nav-open .site-header, .site-header:has(.search-panel:not([hidden])) { background: var(--surface); }
	}
}
.nav-link::after { opacity: 1; transform: scaleX(0); transform-origin: calc(50% - 50% * var(--dir)) 50%; transition: transform 260ms var(--ease-out); }
.nav-item:hover > .nav-link::after, .nav-item.is-open > .nav-link::after, .nav-item.is-current > .nav-link::after, .nav-link:focus-visible::after { transform: scaleX(1); }
.mobile-nav:not([hidden]) { animation: fade 200ms ease-out; }
.mobile-nav:not([hidden]) .mobile-list > li, .mobile-nav:not([hidden]) .mobile-nav__extra { animation: fade-up 420ms var(--ease-out) backwards; }
.mobile-list > li:nth-child(2) { animation-delay: 30ms; } .mobile-list > li:nth-child(3) { animation-delay: 60ms; } .mobile-list > li:nth-child(4) { animation-delay: 90ms; } .mobile-list > li:nth-child(5) { animation-delay: 120ms; } .mobile-list > li:nth-child(6) { animation-delay: 150ms; } .mobile-list > li:nth-child(7) { animation-delay: 180ms; } .mobile-list > li:nth-child(n+8) { animation-delay: 210ms; }
.mobile-nav:not([hidden]) .mobile-nav__extra { animation-delay: 240ms; }
.nav-item.is-open .mega-intro, .nav-item.is-open .mega-col { animation: fade-up 380ms var(--ease-out) backwards; }
@media (hover: hover) and (pointer: fine) { .nav-item:hover .mega-intro, .nav-item:hover .mega-col, .nav-item:focus-within .mega-intro, .nav-item:focus-within .mega-col { animation: fade-up 380ms var(--ease-out) 120ms backwards; } }
.mega-col:nth-child(2) { animation-delay: 160ms !important; } .mega-col:nth-child(3) { animation-delay: 200ms !important; } .mega-col:nth-child(n+4) { animation-delay: 240ms !important; }

/* Home hero: deep blue, the figure at the end side */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 0; color: #C9D8FA; padding-block: clamp(44px, 6vw, 88px) clamp(92px, 10vw, 136px); background: radial-gradient(110% 90% at calc(50% + 40% * var(--dir)) 0%, rgba(61, 116, 238, .46), transparent 62%), linear-gradient(160deg, #0B1A3A 0%, #122B5C 58%, #163A85 100%); }
.hero__statement { color: #fff; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.06; max-width: 21ch; }
html[lang="ar"] .hero__statement { line-height: 1.32; max-width: 22ch; }
.hero__text { color: #C9D8FA; }
.hero :focus-visible { outline-color: #fff; }
.hero .btn--primary { background: #fff; border-color: #fff; color: #122B5C; }
.hero .btn--primary:hover, .hero .btn--primary:active { background: #DBE6FF; border-color: #DBE6FF; color: #122B5C; }
.hero .btn--secondary { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .45); color: #fff; }
.hero .btn--secondary:hover, .hero .btn--secondary:active { background: rgba(255, 255, 255, .16); border-color: #fff; color: #fff; }
.hero .level-panel { border-color: transparent; box-shadow: var(--shadow-2); }
@media (prefers-reduced-motion: no-preference) {
	.hero__statement, .hero__text, .page-header h1, .page-header .lead { animation: settle 900ms var(--ease-out) backwards; }
	.hero__text, .page-header .lead { animation-delay: 80ms; }
	.hero__actions { animation: fade-up 800ms var(--ease-out) 180ms backwards; }
	.hero .level-panel { animation: fade-up 900ms var(--ease-out) 280ms backwards; }
	.page-header .breadcrumbs, .page-header .page-meta, .page-header__caption { animation: fade 800ms ease-out 120ms backwards; }
	@media (min-width: 1024px) {
		.error-404__code { animation: float 5s ease-in-out infinite alternate; }
	}
	/* Page to page: a short cross-fade, the header stays put */
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: vt-out 140ms ease-in both; }
	::view-transition-new(root) { animation: vt-in 280ms var(--ease-out) both; }
	.site-header { view-transition-name: site-header; }
	@supports (animation-timeline: scroll()) {
		.site-header::after { content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 2px; background: linear-gradient(calc(90deg * var(--dir)), var(--blue-600), var(--blue-300)); transform: scaleX(0); transform-origin: calc(50% - 50% * var(--dir)) 50%; animation: progress linear both; animation-timeline: scroll(root block); pointer-events: none; }
	}
}

/* Key figures: counted from the published content, overlapping the hero */
.stats { position: relative; z-index: 2; margin-top: calc(-1 * clamp(46px, 5vw, 62px)); }
.stats__list { list-style: none; margin: 0; padding: 0; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.stat { flex: 1 1 0; min-width: 0; }
.stat + .stat { border-inline-start: 1px solid var(--border); }
.stat__link { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: clamp(16px, 2.4vw, 28px) clamp(14px, 3vw, 36px); text-decoration: none; color: var(--muted); transition: background-color var(--t-comp) var(--ease); }
.stat__link:hover { background: var(--bg-tint); color: var(--text-2); }
.stat__num { font-size: clamp(30px, 4vw, 50px); font-weight: 700; line-height: 1.05; letter-spacing: var(--track-tight); color: var(--heading); font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--text-xs); font-weight: 500; line-height: 1.35; }
.stat__label .icon { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-inline-start: 4px; color: var(--link); transition: transform 240ms var(--ease-out); }
.stat__link:hover .icon { transform: translateX(calc(3px * var(--dir))); }
html[dir="rtl"] .stat__link:hover .icon--dir { transform: scaleX(-1) translateX(3px); }
.stats + .section { padding-top: clamp(48px, 6vw, 80px); }

/* Section heads: larger, with a short rule that draws in */
.section-head h2 { font-size: clamp(26px, 2.6vw, 36px); }
.section-head h2::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 12px; border-radius: 2px; background: linear-gradient(calc(90deg * var(--dir)), var(--primary), var(--blue-300)); transform-origin: calc(50% - 50% * var(--dir)) 50%; }
.section-head.rv h2::after { transform: scaleX(0); }
.section-head.rv-in h2::after { transform: scaleX(1); transition: transform 700ms var(--ease-out) 250ms; }

/* Rows answer the pointer: a tint behind the row, the arrow moves on */
.ann-row__link, .dept-row__link, .lab-row__link, .quick-links a, .link-list a, .cycle__list a { margin-inline: -12px; padding-inline: 12px; border-radius: var(--radius-sm); transition: background-color var(--t-comp) var(--ease), color var(--t-hover) var(--ease); }
.ann-row__link:hover, .dept-row__link:hover, .lab-row__link:hover, .quick-links a:hover, .link-list a:hover, .cycle__list a:hover { background: var(--bg-tint); text-decoration: none; }
.link-more:hover .icon { transform: translateX(calc(4px * var(--dir))); }
html[dir="rtl"] .link-more:hover .icon--dir { transform: scaleX(-1) translateX(4px); }
.quick-links .icon:first-child { transition: transform 240ms var(--ease-out); }
.quick-links a:hover .icon:first-child { transform: scale(1.12); }

/* Buttons: a small lift, a press */
.btn { transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease-out); }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(33, 89, 214, .6); } }
.btn:active { transform: scale(.98); box-shadow: none; }

/* Programs by cycle: four panels with a blue edge */
.cycle { position: relative; overflow: hidden; padding: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }
.cycle::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(calc(90deg * var(--dir)), var(--blue-600), var(--blue-300)); }
@media (hover: hover) { .cycle:hover, .staff-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-1); border-color: var(--n-300); } }
.staff-card { transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }

/* Departments: numbered rows, the arrow in a ring that fills */
.dept-list { counter-reset: dept; }
.dept-row { counter-increment: dept; }
.dept-row__link { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto 36px; padding-block: 22px; }
.dept-row__name { font-size: clamp(18px, 1.7vw, 23px); }
.dept-row__name::before { content: counter(dept, decimal-leading-zero); margin-inline-end: 14px; font-size: 13px; font-weight: 600; color: var(--link); font-variant-numeric: tabular-nums; vertical-align: .2em; }
.dept-row__arrow { width: 36px; height: 36px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--heading); transition: transform var(--t-comp) var(--ease-out), color var(--t-comp) var(--ease), background-color var(--t-comp) var(--ease), border-color var(--t-comp) var(--ease); }
.dept-row__link:hover .dept-row__arrow { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.dept-row__link:hover .dept-row__name { text-decoration: none; }
@media (max-width: 767px) { .dept-row__link { grid-template-columns: minmax(0, 1fr); padding-block: 16px; } }

/* News: the picture breathes */
.news-item__img img { transition: transform 700ms var(--ease-out); }
.news-item:hover .news-item__img img { transform: scale(1.04); }

/* Inner page header: the same deep blue as the home hero, a field of points at the end side.
   The semantic colours are re-declared for the band, so breadcrumbs, tags and meta lines follow
   (white 13.8:1, lead and meta #C9D8FA 9.6:1, muted #AFC3F0 7.7:1 on blue-900). */
.page-header { --heading: #fff; --text: #E6EDFB; --text-2: #C9D8FA; --muted: #AFC3F0; --faint: #8FA6DA; --link: #DBE6FF; --link-hover: #fff; --focus: #fff; --border: rgba(255, 255, 255, .2); --tag-bg: rgba(255, 255, 255, .14); --tag-text: #fff; position: relative; overflow: hidden; isolation: isolate; border-bottom: 0; color: var(--text-2); padding-block: clamp(32px, 4.5vw, 60px) clamp(28px, 4vw, 52px); background: radial-gradient(90% 150% at calc(50% + 45% * var(--dir)) 0%, rgba(61, 116, 238, .42), transparent 62%), linear-gradient(160deg, #0B1A3A 0%, #122B5C 60%, #163A85 100%); }
.page-header::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: min(46%, 600px); z-index: -1; pointer-events: none; background-image: radial-gradient(circle, rgba(183, 205, 255, .55) 1px, transparent 1.4px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(calc(-90deg * var(--dir)), #000, transparent); mask-image: linear-gradient(calc(-90deg * var(--dir)), #000, transparent); opacity: .7; }
.page-header .tag--lang { border-color: rgba(255, 255, 255, .45); }
.page-header a { text-underline-offset: .2em; }

/* Sign-in card, 404, footer */
.signin { position: relative; overflow: hidden; box-shadow: var(--shadow-1); }
.signin::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(calc(90deg * var(--dir)), var(--blue-600), var(--blue-300)); }
.error-404__code { font-size: clamp(88px, 16vw, 180px); background: linear-gradient(120deg, var(--blue-600), var(--blue-300)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-footer { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(70% 110% at calc(50% - 46% * var(--dir)) 0%, rgba(33, 89, 214, .3), transparent 62%), var(--band); }
.site-footer::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(143, 176, 250, .7), transparent); }
.site-footer::after { content: ""; position: absolute; inset-inline-end: -48px; bottom: -56px; width: min(46vw, 440px); aspect-ratio: 800 / 693; z-index: -1; pointer-events: none; opacity: .045; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 693' fill='%23fff'%3E%3Cpath d='M343 301v392H197V101l10-16 432 200 161 74-146 30v304H508V257z'/%3E%3Cpath d='m207 85-10 16L23 156V0zM79 236l-3 82-76-56zM386 352h2l34 25v302l-35-1-1-2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.footer-col a { background: linear-gradient(currentColor, currentColor) calc(50% - 50% * var(--dir)) 100% / 0 1px no-repeat; transition: background-size 300ms var(--ease-out); }
.footer-col a:hover { background-size: 100% 1px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
	.rv, .rv--x { opacity: 1; transform: none; }
	*, *::before, *::after { animation-iteration-count: 1 !important; animation-delay: 0s !important; }
}

/* ==================================================================
   12. RELEASE 4, SECOND PASS — THE FIGURE, SCENES, CARDS, PHONE
   The home page is a sequence of scenes (deep blue, white, tinted, deep blue, white, tinted) with slanted
   seams. Every main object carries a figure drawn by the theme (fmi_motif(): Lissajous curves for
   departments, rose curves for cycles, small graphs for laboratories, waves where a picture is missing).
   Phones get their own decisions: a tab bar within reach of the thumb, swipe rows instead of long stacks,
   a hero composed for a portrait screen. Same motion rules as section 11.
================================================================== */
@keyframes spin { to { transform: scaleX(var(--dir)) rotate(360deg); } }
@keyframes bob { to { transform: scaleX(var(--dir)) translateY(-12px); } }
@keyframes drift { to { transform: translateY(-9px); } }
@keyframes scene-away { to { transform: translateY(10vh) scale(1.05); opacity: .3; } }

/* Arabic is set a step larger: the same pixel size reads smaller in Arabic script */
html[lang="ar"] { --text-body: 17px; --text-sm: 16px; --text-xs: 15px; --text-label: 14px; }
html[lang="ar"] .section-head h2 { font-size: clamp(28px, 2.8vw, 40px); font-weight: 700; }

/* Figures */
.motif { display: block; width: 100%; height: 100%; overflow: visible; }
.motif__node { fill: currentColor; stroke: none; }
.rv .motif > path:first-child { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rv.rv-in .motif > path:first-child { stroke-dashoffset: 0; transition: stroke-dashoffset 1800ms var(--ease-out) 200ms; }

/* Scene 1: the hero. Headline at full scale; the figure fills the end side in three depths. */
.hero { display: grid; align-items: center; min-height: min(78svh, 800px); padding-block: clamp(44px, 5vw, 76px) clamp(116px, 12vw, 172px); }
.hero__inner { position: relative; }
.hero__copy { max-width: min(760px, 60%); }
.hero__statement { font-size: clamp(38px, 5vw, 74px); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; }
html[lang="ar"] .hero__statement { font-size: clamp(40px, 5.2vw, 78px); line-height: 1.3; letter-spacing: 0; max-width: 16ch; }
.hero__text { font-size: clamp(17px, 1.5vw, 21px); max-width: 44ch; margin-bottom: var(--s6); }
html[lang="ar"] .hero__text { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.9; }
.hero__actions .btn { min-height: 52px; padding-inline: 26px; font-size: 16px; }
.hero__scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero__layer { position: absolute; transition: translate 700ms var(--ease-out); }
.hero__layer > svg { display: block; width: 100%; height: auto; max-width: none; transform: scaleX(var(--dir)); }
.hero__layer--back { inset-inline-end: -8%; top: 50%; width: min(66vw, 920px); margin-top: calc(min(66vw, 920px) / -2); color: #5F8CF2; opacity: .6; translate: calc(var(--px, 0) * -16px) calc(var(--py, 0) * -10px); }
.hero__curve > path { stroke-width: .16; }
.hero__layer--mid { inset-inline-end: 3%; bottom: 17%; width: min(44vw, 620px); translate: calc(var(--px, 0) * -34px) calc(var(--py, 0) * -22px); }
.hero__layer--front { inset-inline-end: 9%; top: 11%; width: min(23vw, 320px); translate: calc(var(--px, 0) * -62px) calc(var(--py, 0) * -40px); }
.hero__chip { position: absolute; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 8px; background: rgba(11, 26, 58, .6); color: #DBE6FF; font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; white-space: nowrap; box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .7); translate: calc(var(--px, 0) * -84px) calc(var(--py, 0) * -56px); transition: translate 700ms var(--ease-out); }
.hero__chip--1 { inset-inline-end: 31%; top: 21%; }
.hero__chip--2 { inset-inline-end: 4%; top: 49%; }
.hero__chip--3 { inset-inline-end: 31%; bottom: 24%; }
.hero__chip--4 { inset-inline-end: 27%; top: 8%; }
.hero__ring { opacity: 0; transform-box: fill-box; transform-origin: center; }
@media (max-width: 1023px) {
	/* Portrait: the curve behind the headline, the tree at the top end, the wave along the bottom. */
	.hero { min-height: 0; padding-block: clamp(40px, 9vw, 72px) clamp(120px, 26vw, 170px); }
	.hero__copy { max-width: none; }
	.hero__layer--back { inset-inline-end: -42%; top: 0; width: 130vw; margin-top: -22vw; opacity: .42; }
	.hero__layer--mid { inset-inline: -4%; bottom: 3%; width: 108%; opacity: .5; }
	.hero__layer--front { inset-inline-end: -3%; top: 3%; width: 34vw; opacity: .4; }
	.hero__chip { display: none; }
	.hero__actions .btn { flex: 1 1 0; padding-inline: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
	.hero__scene { animation: fade 1100ms ease-out backwards; }
	@supports (animation-timeline: scroll()) {
		.hero__scene { animation: fade 1100ms ease-out backwards, scene-away linear both; animation-timeline: auto, scroll(root block); animation-range: normal, 0 90vh; }
	}
}
/* The lines draw themselves and the tree's points pop from 768 px up only. A stroke that draws itself is repainted by
   the browser on every frame, for four seconds: on a phone that was about a second of painting during the page load
   (measured at 4x CPU slowdown), enough to stall it. Phones get the finished drawing, fading in with the scene. */
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
	.hero__scene path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2600ms var(--ease-out) 150ms forwards; }
	.hero__curve > path { animation-duration: 4200ms; }
	.hero__sine { animation-delay: 500ms; }
	.hero__tree g:first-child path:nth-child(1) { animation-delay: 1300ms; animation-duration: 700ms; } .hero__tree g:first-child path:nth-child(2) { animation-delay: 1650ms; animation-duration: 700ms; } .hero__tree g:first-child path:nth-child(3) { animation-delay: 2000ms; animation-duration: 700ms; }
	.hero__tree circle { transform-box: fill-box; transform-origin: center; animation: pop 520ms var(--ease-out) 1250ms backwards; }
	.hero__tree circle:nth-child(n+2) { animation-delay: 1600ms; } .hero__tree circle:nth-child(n+4) { animation-delay: 1950ms; } .hero__tree circle:nth-child(n+8) { animation-delay: 2300ms; }
	.hero__chip { animation: fade-up 700ms var(--ease-out) 1900ms backwards; }
	.hero__chip--2 { animation-delay: 2100ms; } .hero__chip--3 { animation-delay: 2300ms; } .hero__chip--4 { animation-delay: 2500ms; }
	.page-header__motif .motif > path:first-child { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3200ms var(--ease-out) 200ms forwards; }
	@media (min-width: 1024px) {
		.hero__layer--back > svg { animation: spin 160s linear infinite; }
		.hero__layer--front > svg { animation: bob 7s ease-in-out infinite alternate; }
		.hero__chip { animation: fade-up 700ms var(--ease-out) 1900ms backwards, drift 6s ease-in-out 2800ms infinite alternate; }
		.hero__chip--2 { animation-delay: 2100ms, 3400ms; } .hero__chip--3 { animation-delay: 2300ms, 4000ms; } .hero__chip--4 { animation-delay: 2500ms, 4600ms; }
		.hero__tree .hero__ring { animation: ring 2800ms ease-out 3000ms infinite; }
		.page-header__motif .motif { animation: spin 140s linear infinite; }
	}
}

/* Dock: my announcements and the key figures, overlapping the hero */
.dock { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s4); align-items: stretch; margin-top: calc(-1 * clamp(84px, 9vw, 124px)); }
.dock .level-panel { border-color: transparent; box-shadow: var(--shadow-2); }
.dock .stats { display: flex; margin-top: 0; }
.dock .stats__list { flex: 1; }
.dock .stat__link { justify-content: center; }
.dock + .section { padding-top: clamp(56px, 7vw, 96px); }
@media (max-width: 899px) { .dock { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: no-preference) { .dock { animation: fade-up 900ms var(--ease-out) 300ms backwards; } }

/* Scene 2: announcements adapt to what exists */
.home-now__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.home-now__main { display: grid; gap: var(--s5); min-width: 0; }
.home-now--noevents .home-now__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.home-now--noevents:not(.home-now--single) .home-now__main { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.home-now--noevents:not(.home-now--single) .ann-feature { grid-template-columns: minmax(0, 1fr); }
.home-now--noevents:not(.home-now--single) .ann-feature__media { aspect-ratio: 16 / 9; min-height: 0; }
.ann-feature { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }
.ann-feature__media { position: relative; display: block; min-height: 240px; overflow: hidden; background: linear-gradient(150deg, #122B5C, #1A46A8); color: #8FB0FA; }
.ann-feature__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform 700ms var(--ease-out); }
.ann-feature__media .motif { position: absolute; inset: -12% -6%; width: 112%; height: 124%; }
.ann-feature__date { position: absolute; inset-inline-start: 22px; bottom: 18px; display: flex; align-items: baseline; gap: 8px; color: #fff; font-size: 15px; font-weight: 600; }
.ann-feature__date b { font-size: 60px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ann-feature__body { display: flex; flex-direction: column; gap: 10px; padding: clamp(20px, 3vw, 32px); min-width: 0; }
.ann-feature__meta { margin: 0; font-size: var(--text-label); font-weight: 500; color: var(--muted); }
.ann-feature__title { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.25; }
.ann-feature__title a { color: var(--heading); text-decoration: none; }
.ann-feature__title a::after { content: ""; position: absolute; inset: 0; }
.ann-feature__title a:focus-visible { outline: none; }
.ann-feature:has(.ann-feature__title a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.ann-feature__text { margin: 0; font-size: var(--text-sm); color: var(--text-2); }
.ann-feature .link-more { margin-top: auto; }
@media (hover: hover) {
	.ann-feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--blue-300); }
	.ann-feature:hover .ann-feature__media img { transform: scale(1.04); }
	.ann-feature:hover .ann-feature__title a { color: var(--link); }
	.ann-feature:hover .link-more .icon { transform: translateX(calc(4px * var(--dir))); }
	html[dir="rtl"] .ann-feature:hover .link-more .icon--dir { transform: scaleX(-1) translateX(4px); }
}
/* From 600px only: on phones every row stacks (date over title), with or without a thumbnail. */
@media (min-width: 600px) { .ann-row__link { grid-template-columns: 92px minmax(0, 1fr) auto; } }
.ann-row__thumb { display: block; width: 56px; height: 56px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.ann-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.agenda-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: 0; padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--text-2); }
.agenda-strip > .icon { color: var(--link); }
.agenda-strip strong { color: var(--heading); }
.agenda-strip .link-more { margin-inline-start: auto; }
@media (max-width: 1023px) { .home-now__grid, .home-now--noevents:not(.home-now--single) .home-now__main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 699px) { .ann-feature { grid-template-columns: minmax(0, 1fr); } .ann-feature__media { aspect-ratio: 16 / 9; min-height: 0; } }
@media (max-width: 599px) { .ann-row__link:has(.ann-row__thumb) { grid-template-columns: minmax(0, 1fr) 56px; column-gap: var(--s3); } .ann-row__thumb { grid-column: 2; grid-row: 1 / span 2; } }

/* Scene 3: quick access as tiles, three to a row */
.quick-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); border-top: 0; }
.quick-tiles li { border-bottom: 0; }
.quick-tiles a { gap: var(--s4); min-height: 76px; margin: 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--text-body); transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease), border-color 260ms var(--ease); }
.quick-tiles a .icon:first-child { width: 44px; height: 44px; padding: 11px; border-radius: 10px; background: var(--bg-tint); color: var(--link); transition: background-color 260ms var(--ease), color 260ms var(--ease); }
.quick-tiles a:hover { background: var(--surface); transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--blue-300); }
.quick-tiles a:hover .icon:first-child { background: var(--primary); color: var(--on-primary); transform: none; }
@media (max-width: 1023px) { .quick-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Deep-blue scene: the semantic colours are re-declared, as on the page header */
.scene--deep { --heading: #fff; --text: #E6EDFB; --text-2: #C9D8FA; --muted: #AFC3F0; --faint: #8FA6DA; --link: #DBE6FF; --link-hover: #fff; --focus: #fff; --border: rgba(255, 255, 255, .16); --border-strong: rgba(255, 255, 255, .42); --surface: rgba(255, 255, 255, .06); --bg-tint: rgba(255, 255, 255, .1); position: relative; z-index: 1; isolation: isolate; color: var(--text-2); background: radial-gradient(70% 90% at calc(50% - 42% * var(--dir)) 100%, rgba(61, 116, 238, .38), transparent 62%), linear-gradient(200deg, #0B1A3A 0%, #122B5C 55%, #163A85 100%); --seam: clamp(18px, 2.6vw, 40px); margin-block: calc(-1 * var(--seam)); padding-block: calc(var(--section) + var(--seam)); clip-path: polygon(0 0, 100% var(--seam), 100% 100%, 0 calc(100% - var(--seam))); }
html[dir="rtl"] .scene--deep { clip-path: polygon(0 var(--seam), 100% 0, 100% calc(100% - var(--seam)), 0 100%); }
.scene--deep::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: min(50%, 640px); z-index: -1; pointer-events: none; background-image: radial-gradient(circle, rgba(183, 205, 255, .5) 1px, transparent 1.4px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(calc(90deg * var(--dir)), #000, transparent); mask-image: linear-gradient(calc(90deg * var(--dir)), #000, transparent); opacity: .5; }
.scene--deep .section-head p { color: var(--text-2); }
.scene--deep + .section { padding-top: calc(var(--section) + clamp(18px, 2.6vw, 40px)); }

/* Scene 4: programs by cycle. A cycle with four programs or more takes two columns, so the panels end level. */
.cycles { display: flex; flex-wrap: wrap; gap: var(--s4); margin-bottom: 0; }
.home-programs .cycles { margin-bottom: 0; }
.cycle { padding: 28px var(--s5) var(--s5); border-color: var(--border); }
.cycle { flex: 2 1 210px; min-width: 0; }
.cycle--wide { flex: 3 1 320px; }
.cycle--wide .cycle__list { columns: 2; column-gap: var(--s6); }
.cycle__list li { break-inside: avoid; }
.cycle__motif { position: absolute; inset-inline-end: -22px; top: -22px; width: 100px; height: 100px; color: var(--blue-300); opacity: .6; pointer-events: none; transition: transform 1400ms var(--ease-out), opacity 400ms var(--ease); }
.cycle__title { position: relative; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding-inline-end: 64px; font-size: clamp(20px, 1.8vw, 25px); overflow-wrap: normal; }
@media (hover: hover) { .cycle:hover .cycle__motif { transform: rotate(60deg) scale(1.1); opacity: 1; } .scene--deep .cycle:hover { border-color: rgba(255, 255, 255, .4); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .6); } }

/* Scene 5 and the departments page: a card per department, with its own curve */
.dept-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: var(--s4); border-top: 0; }
.dept-row { border-bottom: 0; }
.dept-row__link { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; min-height: 250px; margin: 0; padding: 24px 24px 72px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }
.dept-row__motif { position: absolute; inset-inline-end: -30px; top: -30px; width: 176px; height: 176px; color: var(--blue-300); opacity: .75; pointer-events: none; transition: transform 1400ms var(--ease-out), color 400ms var(--ease); }
.dept-row__main { margin-top: auto; padding-top: 88px; }
.dept-row__name::before { display: block; margin: 0 0 8px; vertical-align: 0; }
.dept-row__count { position: absolute; inset-inline-start: 24px; bottom: 24px; padding: 2px 9px; border-radius: var(--radius-xs); background: var(--tag-bg); color: var(--tag-text); font-size: 12px; font-weight: 600; }
.dept-row__count:empty { display: none; }
.dept-row__arrow { position: absolute; inset-inline-end: 20px; bottom: 18px; display: block; }
.dept-row__link:hover { background: var(--surface); }
@media (hover: hover) { .dept-row__link:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: var(--blue-300); } .dept-row__link:hover .dept-row__motif { transform: rotate(45deg) scale(1.12); color: var(--primary); } }

/* Laboratories: a card with its graph */
.lab-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s3); border-top: 0; }
.lab-row { border-bottom: 0; }
.lab-list .lab-row__link { position: relative; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s4); align-items: center; height: 100%; margin: 0; padding: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }
.lab-row__motif { width: 64px; height: 64px; color: var(--link); transition: transform 1200ms var(--ease-out); }
.lab-row__acr { position: absolute; top: 12px; inset-inline-end: 14px; padding: 0; }
.lab-row__body { padding-inline-end: 44px; }
.lab-list .lab-row__link:hover { background: var(--surface); }
@media (hover: hover) { .lab-list .lab-row__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--blue-300); } .lab-row__link:hover .lab-row__motif { transform: rotate(-40deg) scale(1.1); } }
.news-item__img--drawn { position: relative; background: linear-gradient(150deg, #122B5C, #1A46A8); color: #8FB0FA; }
.news-item__img--drawn { aspect-ratio: 21 / 8; }
.news-item__img--drawn .motif { position: absolute; inset: 0; }
.motif--wave > path { vector-effect: non-scaling-stroke; stroke-width: 1.6px; }

/* Inner pages: the page's figure in the band; covers and fact blocks overlap it */
.page-header__motif { position: absolute; inset-inline-end: clamp(-70px, 3vw, 72px); top: 50%; z-index: -1; width: clamp(240px, 30vw, 430px); margin-top: calc(clamp(240px, 30vw, 430px) / -2); color: #5F8CF2; opacity: .55; pointer-events: none; transform: scaleX(var(--dir)); }
.page-header__motif .motif > path { stroke-width: .6; }
.page-header--cover { padding-bottom: calc(clamp(28px, 4vw, 52px) + clamp(44px, 6vw, 88px)); }
.page-body--cover { padding-top: 0; }
.page-body--cover .post-thumb { position: relative; z-index: 1; margin-top: calc(-1 * clamp(44px, 6vw, 88px)); border: 0; background: var(--surface); box-shadow: var(--shadow-2); }
.page-body--cover .sidebar { padding-top: clamp(32px, 5vw, 64px); }
.prose__content > p:first-child { font-size: 1.1em; color: var(--text); }
/* The facts card rises into the page header, and stops 16px under its last line: the header's bottom padding is
   clamp(28px, 4vw, 52px), so the rise is that less 16px (12px on a phone, 30px at most). */
.page-body .prose > .facts:first-child { position: relative; z-index: 1; margin-top: calc(-1 * (clamp(32px, 5vw, 64px) + clamp(12px, 4vw - 16px, 30px))); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); }
.sub-section > h2, .sub-section .section-head h2 { font-size: clamp(22px, 2vw, 28px); }
/* Programs: a card each, with the rose curve of its cycle; documents: one panel */
.program-list { gap: var(--s3); border-top: 0; }
.program-item { position: relative; overflow: hidden; padding: 20px; padding-inline-end: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease), border-color 300ms var(--ease); }
.program-item__motif { position: absolute; inset-inline-end: -18px; top: -18px; width: 92px; height: 92px; color: var(--blue-300); opacity: .7; pointer-events: none; transition: transform 1400ms var(--ease-out), color 400ms var(--ease); }
.program-item__title a::after { content: ""; position: absolute; inset: 0; }
.program-item__title a:focus-visible { outline: none; }
.program-item:has(.program-item__title a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) { .program-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); border-color: var(--blue-300); } .program-item:hover .program-item__motif { transform: rotate(60deg) scale(1.1); color: var(--primary); } .program-item:hover .program-item__title a { color: var(--link); text-decoration: none; } }
.doc-list { padding: 4px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.doc-list > .doc-row:last-child { border-bottom: 0; }
/* Staff cards: a larger portrait, level cards in a row */
.staff-grid { gap: var(--s4); }
.staff-card { grid-template-columns: 64px minmax(0, 1fr); gap: var(--s4); padding: 20px; border-radius: var(--radius-lg); }
.staff-card__avatar { width: 64px; height: 64px; border-radius: 12px; font-size: 18px; }
/* French and English pages: the initials take the weight of the name beside them. At 700 the two Arabic letters of
   a person without a photograph made these pages download a second Arabic font file (Bold, 44 KB) for the tile alone. */
html:not([lang="ar"]) .staff-card__avatar { font-weight: 600; }
.staff-card__name { font-size: 16px; }

/* The page may use the whole screen (viewport-fit=cover): in landscape, text stays clear of the notch. */
body { padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px); }
/* Phone: swipe rows, and the tab bar under the thumb */
.tabbar { display: none; }
@media (max-width: 767px) {
	.quick-tiles, .cycles, .dept-list--cards { display: flex; flex-wrap: nowrap; gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.quick-tiles::-webkit-scrollbar, .cycles::-webkit-scrollbar, .dept-list--cards::-webkit-scrollbar { display: none; }
	.quick-tiles > li { flex: 0 0 62%; scroll-snap-align: start; }
	.cycles > .cycle { flex: 0 0 84%; scroll-snap-align: start; }
	.cycle--wide .cycle__list { columns: 1; }
	.dept-list--cards > .dept-row { flex: 0 0 80%; scroll-snap-align: start; }
	.dept-row__link { min-height: 220px; }
	.page-header__motif { inset-inline-end: -90px; opacity: .32; }
	.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 80; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -10px 30px -18px rgba(18, 43, 92, .35); }
	.tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; padding: 2px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--muted); text-decoration: none; text-align: center; }
	html[lang="ar"] .tabbar__item { font-size: 12.5px; }
	.tabbar__item .icon { width: 22px; height: 22px; }
	.tabbar__item[aria-current="page"], .tabbar__item:active { background: var(--bg-tint); color: var(--link); }
	/* The page ends above the bar: the last footer line is never under it. */
	body { padding-bottom: calc(63px + env(safe-area-inset-bottom, 0px)); }
	/* Nor is a link reached with the keyboard: the browser keeps what it scrolls into view clear of the bar (its 63px and a little air). */
	html { scroll-padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)); }
	body.nav-open .tabbar { display: none; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 767px) { .tabbar { view-transition-name: tabbar; } }
/* On paper nothing waits for a scroll: whatever the reveal still holds back below the screen is printed. */
@media print { .rv, .rv--x { opacity: 1 !important; transform: none !important; } .section-head.rv h2::after { transform: none; } .rv .motif > path:first-child { stroke-dashoffset: 0; }
	.tabbar, .hero__scene, .page-header__motif, .dock .stats { display: none !important; } .scene--deep { clip-path: none; background: #fff; color: #000; --heading: #000; --text-2: #000; --muted: #000; --link: #000; } }

/* Right-to-left details (formerly rtl.css, one request less on Arabic pages) */
html[dir="rtl"] body { font-family: var(--font-arabic); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .hero__statement, html[dir="rtl"] .brand__name, html[dir="rtl"] .lab-row__acr { letter-spacing: 0; }
html[dir="rtl"] .nav-link { font-size: 15px; }
html[dir="rtl"] .ann-row__date, html[dir="rtl"] .event-row__date b { letter-spacing: 0; }
html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="url"], html[dir="rtl"] input[type="search"]:placeholder-shown { direction: rtl; }
html[dir="rtl"] input[type="tel"]:not(:placeholder-shown), html[dir="rtl"] input[type="email"]:not(:placeholder-shown), html[dir="rtl"] input[type="url"]:not(:placeholder-shown) { direction: ltr; text-align: start; }
html[dir="rtl"] .brand__mark { transform: scaleX(1); }
