/* mt.sa. One accent (deep green), greys for everything else, borders instead of shadows, 4px spacing grid. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --band: #eeece5;
  --ink: #1b1f1d;
  --muted: #545a57;
  --line: rgba(27, 31, 29, .14);
  --line-strong: rgba(27, 31, 29, .28);
  --accent: #0b6650;
  --accent-hover: #084f3e;
  --accent-soft: #e2efe9;
  --on-accent: #ffffff;
  --focus: #0b6650;
  --ok: #0b6650;
  --err: #a61b1b;
  --err-soft: #fbeaea;

  --ui: 'Plex Arabic', 'Segoe UI', Tahoma, sans-serif;
  --read: 'Naskh', 'Plex Arabic', 'Traditional Arabic', serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 6px;
  --wrap: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141716;
    --surface: #1b1f1d;
    --band: #191d1b;
    --ink: #e9ece9;
    --muted: #a7aeaa;
    --line: rgba(233, 236, 233, .14);
    --line-strong: rgba(233, 236, 233, .3);
    --accent: #6fcfae;
    --accent-hover: #93dcc3;
    --accent-soft: #1f302a;
    --on-accent: #0c1a15;
    --focus: #6fcfae;
    --ok: #6fcfae;
    --err: #ff9c9c;
    --err-soft: #3a2020;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.7 var(--ui);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--ui); font-weight: 600; line-height: 1.35; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: clamp(28px, 2.2vw + 18px, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 var(--s4); }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92em; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 10; background: var(--surface); color: var(--ink); padding: var(--s2) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.skip:focus { top: var(--s2); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s4); }
@media (min-width: 700px) { .wrap { padding-inline: var(--s6); } }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; }
.brand:hover { color: var(--ink); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); }
.site-nav a { display: block; padding: var(--s2) var(--s3); border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: var(--ink); background: var(--band); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.menu-btn { display: none; }

@media (max-width: 859px) {
  .menu-btn {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
    font: 500 15px var(--ui); color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer;
  }
  .menu-btn[aria-expanded="true"] { background: var(--band); }
  .site-nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: var(--s2) var(--s4) var(--s4); gap: 0; }
  .site-nav a { min-height: 48px; display: flex; align-items: center; padding-inline: var(--s3); font-size: 16px; }
  .site-nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--accent); background: var(--band); }
  .no-js .site-nav { display: block; position: static; border: 0; }
}

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5); border-radius: var(--radius);
  font: 500 15px/1 var(--ui); text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  transition: background-color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--band); color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); }
label { font-weight: 500; font-size: 15px; }
.optional { color: var(--muted); font-weight: 400; }
input, select, textarea {
  font: 400 16px/1.5 var(--ui); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  min-height: 44px; padding: var(--s2) var(--s3); width: 100%;
}
textarea { resize: vertical; min-height: 140px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
select:disabled { color: var(--muted); background: var(--band); cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--err); }
.field-error { color: var(--err); font-size: 14px; margin: 0; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.notice { padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.notice-ok { border-color: var(--ok); background: var(--accent-soft); }
.notice-err { border-color: var(--err); background: var(--err-soft); }

/* Page scaffolding */
.page-head { padding-block: var(--s7) var(--s6); }
.page-head .lead { max-width: 68ch; color: var(--muted); font-size: 17px; margin: 0; }
.crumbs { font-size: 14px; margin-bottom: var(--s2); }
.section { padding-block: var(--s7); }
.section-tight { padding-bottom: var(--s7); }
.section-head { margin-bottom: var(--s5); }
.section-head p { color: var(--muted); max-width: 68ch; margin: 0; }
.band { background: var(--band); border-block: 1px solid var(--line); padding-block: var(--s7); }
.cols-2 { display: grid; gap: var(--s7); }
@media (min-width: 900px) { .cols-2 { grid-template-columns: 1fr 1fr; gap: var(--s8); } }
.prose { font-family: var(--read); font-size: 18px; line-height: 1.9; max-width: 62ch; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* Home */
.intro { display: grid; gap: var(--s6); padding-block: var(--s7); align-items: center; }
.intro h1 { margin-bottom: var(--s1); }
.intro-role { color: var(--muted); font-size: 18px; margin-bottom: var(--s5); }
.portrait { margin: 0; max-width: 240px; }
.portrait img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 1; object-fit: cover; }
@media (min-width: 900px) {
  .intro { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s8); padding-block: var(--s8); }
  .portrait { max-width: none; }
}
@media (max-width: 899px) { .portrait { order: -1; } }

.services { margin: 0; }
.services > div { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.services > div:last-child { border-bottom: 0; }
.services dt { font-weight: 600; }
.services dd { margin: 0; color: var(--muted); }

.link-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.link-rows a { display: grid; gap: var(--s1) var(--s6); padding: var(--s4) var(--s2); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.link-rows a:hover { background: var(--surface); }
.link-rows a:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row-title { font-weight: 600; color: var(--accent); }
.row-text { color: var(--muted); }
@media (min-width: 900px) { .link-rows a { grid-template-columns: 22rem 1fr; align-items: baseline; } }

/* Courses */
.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 var(--s7); }
@media (min-width: 900px) { .course-list { grid-template-columns: 1fr 1fr; } }
.course { padding: var(--s5) 0; border-top: 1px solid var(--line); }
.course h2 { font-size: 19px; margin-bottom: var(--s1); }
.course-meta { font-size: 14px; color: var(--muted); margin-bottom: var(--s2); }
.course p:last-child { margin-bottom: 0; }
.after-list { margin-top: var(--s6); }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.data-table th, .data-table td { text-align: start; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { font-weight: 600; font-size: 14px; color: var(--muted); background: var(--band); }
.data-table tr:last-child td { border-bottom: 0; }
.codes td.code { width: 7.5rem; white-space: nowrap; }

/* Guides */
.filter { margin-top: var(--s5); max-width: 36rem; }
.filter input { font-size: 16px; }
.filter-count { color: var(--muted); font-size: 14px; margin: var(--s2) 0 0; min-height: 1.5em; }
.guide-body { padding-bottom: var(--s8); }
.jump { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.jump a { font-size: 15px; padding: var(--s1) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); min-height: 40px; display: inline-flex; align-items: center; }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.code-group { margin-bottom: var(--s7); scroll-margin-top: 80px; }
.code-group h2 { display: flex; align-items: baseline; gap: var(--s3); }
.count { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { font-size: 13px; color: var(--ink); background: var(--band); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 var(--s2); }

details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s2); }
details > summary { cursor: pointer; padding: var(--s3) var(--s4); min-height: 44px; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-weight: 500; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ''; width: 8px; height: 8px; border-inline-start: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; flex: none; }
details[open] > summary::before { transform: rotate(-135deg) translate(-2px, -2px); }
[dir="rtl"] details > summary::before { transform: rotate(135deg); }
[dir="rtl"] details[open] > summary::before { transform: rotate(45deg); }
details > summary:hover { background: var(--band); }
details > :not(summary) { margin-inline: var(--s4); }
details > .data-table { margin: 0 0 var(--s4); width: calc(100% - 2 * var(--s4)); }

.pillar { margin-bottom: var(--s7); }
.pillar > h2 { font-size: 26px; padding-bottom: var(--s2); border-bottom: 2px solid var(--accent); display: inline-block; }
.goal > summary { font-size: 18px; font-weight: 600; }
.strategic { padding: var(--s2) 0 var(--s3); border-top: 1px solid var(--line); }
.strategic h3 { margin-bottom: var(--s1); }
.strategic ul { margin: 0 0 var(--s2); padding-inline-start: var(--s5); color: var(--muted); }
.strategic li { margin-bottom: var(--s1); }
.empty { color: var(--muted); padding: var(--s5) 0; }

/* Jobs */
.job-form { display: grid; gap: 0 var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
@media (min-width: 900px) { .job-form { grid-template-columns: repeat(3, 1fr); align-items: end; } .job-form .form-actions { grid-column: 1 / -1; } }
.form-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.status { margin: var(--s5) 0 var(--s3); color: var(--muted); min-height: 1.7em; }
.status.error { color: var(--err); }
.job-results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.job-results:empty { border: 0; }
.job-results a { display: grid; gap: var(--s1) var(--s4); padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.job-results a:hover { background: var(--surface); }
.job-results .jr-name { font-weight: 600; color: var(--accent); }
.job-results .jr-meta { color: var(--muted); font-size: 14px; }
@media (min-width: 900px) { .job-results a { grid-template-columns: 6rem minmax(0, 1fr) minmax(0, 1fr) minmax(12rem, .8fr); align-items: baseline; } }
.pager { display: flex; gap: var(--s2); align-items: center; margin: var(--s5) 0 var(--s8); flex-wrap: wrap; }
.pager .btn { min-height: 40px; padding: 0 var(--s4); }
.pager span { color: var(--muted); font-size: 14px; padding-inline: var(--s2); }
.loading-bar { height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: slide 1.1s linear infinite; }
@keyframes slide { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.facts { display: grid; gap: var(--s3) var(--s6); margin: var(--s5) 0 0; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.facts-stack { grid-template-columns: 1fr; }
.reader { max-width: 820px; padding-bottom: var(--s8); }
.reader section { margin-bottom: var(--s6); }
.reader h2 { padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.prose-block p { font-family: var(--read); font-size: 18px; line-height: 1.9; max-width: 68ch; }
.prose-block h2 { margin-top: var(--s6); }
.degree > p { padding-bottom: var(--s3); color: var(--muted); }

/* Contact */
.cols-contact { display: grid; gap: var(--s7); padding-bottom: var(--s8); }
@media (min-width: 900px) { .cols-contact { grid-template-columns: 280px minmax(0, 640px); gap: var(--s8); } }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; font-size: 15px; }
.footer-grid { display: grid; gap: var(--s5); padding-block: var(--s6) var(--s4); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1.2fr 1fr; } }
.footer-grid p { margin: 0; color: var(--muted); }
.footer-grid .footer-name { color: var(--ink); font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.footer-grid li { color: var(--muted); }
.footer-grid li a { display: inline-block; padding-block: var(--s1); }
.footer-base { color: var(--muted); font-size: 13px; padding-block: var(--s3) var(--s5); border-top: 1px solid var(--line); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .filter, .jump, .actions, .skip { display: none; }
  details > :not(summary) { display: block; }
}
