/* Handbook-style reading shell for Interview.ps guide, resource, and search pages.
   Layout: compact fixed header; grouped left guide navigation; readable article
   column; on-page contents rail on wide screens. Mobile collapses the side
   navigation and contents into accessible <details> controls. Logical CSS
   properties keep the geometry mirrored for Arabic RTL. */

:root {
  --site-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --site-ink: #172033;
  --site-muted: #4b556b;
  --site-navy: #012970;
  --site-blue: #1647a5;
  --site-blue-hover: #092e75;
  --site-page: #f5f7fb;
  --site-surface: #ffffff;
  --site-line: #d9e0ed;
  --site-control-line: #7b8798;
  --site-focus: #b45309;
  --hb-header-height: 3.75rem;
  --hb-shell-width: 88rem;
  --hb-article-width: 46rem;
  color-scheme: light;
  font-family: var(--site-font-family);
  color: var(--site-ink);
  background: var(--site-page);
  line-height: 1.6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--hb-header-height) + 1rem);
}

body {
  margin: 0;
  color: var(--site-ink);
  background: var(--site-page);
  font-family: var(--site-font-family);
  font-size: 1rem;
  line-height: 1.6;
}

[dir="rtl"] body,
[dir="rtl"] {
  line-height: 1.75;
}

a {
  color: var(--site-blue);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

a:hover {
  color: var(--site-blue-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

code,
kbd,
samp,
pre,
.hb-logo {
  direction: ltr;
  unicode-bidi: isolate;
}

.skip-link {
  position: fixed;
  inset-inline-start: 1rem;
  top: -6rem;
  z-index: 100000;
  padding: .7rem 1rem;
  border: 2px solid var(--site-blue);
  background: #fff;
}

.skip-link:focus {
  top: 1rem;
}

/* ===== Compact header ===== */

.hb-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 1000;
  min-height: var(--hb-header-height);
  background: rgba(255, 255, 255, .98);
  border-block-end: 1px solid var(--site-line);
  box-shadow: 0 2px 10px rgba(1, 41, 112, .07);
}

.hb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  width: min(calc(100% - 2rem), var(--hb-shell-width));
  min-height: var(--hb-header-height);
  margin-inline: auto;
}

.hb-logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  color: var(--site-navy);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.hb-logo img {
  max-height: 32px;
  margin-inline-end: .55rem;
}

.hb-logo span {
  color: var(--site-navy);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -.025em;
}

.hb-nav {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

.hb-nav #primary-menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: .1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-nav #primary-menu > li {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.hb-nav #primary-menu > li > a,
.hb-nav #primary-menu > li > a:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .45rem .55rem;
  border-radius: .5rem;
  color: var(--site-navy);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.hb-nav #primary-menu > li > a:hover,
.hb-nav #primary-menu > li > a[aria-current="page"],
.hb-nav #primary-menu > li > a[aria-current="location"] {
  color: var(--site-navy);
  background: #eef3fc;
}

.hb-nav #primary-menu > li > a.getstarted,
.hb-nav #primary-menu > li > a.getstarted:focus {
  min-height: 44px;
  margin-inline-start: .2rem;
  padding: .5rem .8rem;
  border: 1px solid var(--site-blue);
  border-radius: .55rem;
  color: #fff;
  background: var(--site-blue);
}

.hb-nav #primary-menu > li > a.getstarted:hover {
  color: #fff;
  background: var(--site-blue-hover);
  border-color: var(--site-blue-hover);
}

.language-control-group {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  margin-inline-start: .2rem;
  padding: .15rem;
  border: 1px solid var(--site-line);
  border-radius: .65rem;
  background: #fff;
}

.language-control-group a,
.language-control-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: .4rem .5rem;
  border: 0;
  border-radius: .45rem;
  color: var(--site-navy);
  background: transparent;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.language-control-group a[aria-current="page"],
.language-control-group button[aria-pressed="true"] {
  color: #fff;
  background: var(--site-navy);
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .4rem .65rem;
  border: 1px solid var(--site-line);
  border-radius: .55rem;
  color: var(--site-navy);
  background: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

/* The homepage header keeps the legacy #header id; outrank the older
   id-scoped rules so it matches the compact handbook header. */
#header.hb-header {
  min-height: var(--hb-header-height);
  padding: 0;
}

#header.hb-header .hb-header-inner {
  min-height: var(--hb-header-height);
}

#header.hb-header .hb-logo img {
  max-height: 32px;
}

#header.hb-header .hb-logo span {
  font-size: 1.25rem;
}

/* ===== Guide shell grid ===== */

.hb-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr) 13.5rem;
  gap: 2.25rem;
  width: min(calc(100% - 2rem), var(--hb-shell-width));
  margin-inline: auto;
  padding-block: calc(var(--hb-header-height) + 1.75rem) 3rem;
}

.hb-shell-plain {
  display: block;
  max-width: 46rem;
}

.hb-shell-no-toc {
  grid-template-columns: 15.5rem minmax(0, 1fr);
  max-width: 82rem;
}

.hb-sidenav-col,
.hb-toc-col {
  min-width: 0;
}

.hb-main {
  min-width: 0;
  scroll-margin-block-start: calc(var(--hb-header-height) + 1rem);
}

/* ===== Left guide navigation ===== */

.hb-sidenav {
  position: sticky;
  inset-block-start: calc(var(--hb-header-height) + 1.75rem);
  max-height: calc(100vh - var(--hb-header-height) - 2.5rem);
  overflow-y: auto;
  padding-inline-end: .5rem;
  font-size: .92rem;
}

.hb-sidenav-home {
  display: block;
  margin-block-end: .9rem;
  padding: .3rem .5rem;
  border-radius: .4rem;
  color: var(--site-navy);
  font-weight: 750;
  text-decoration: none;
}

.hb-navgroup {
  margin-block-end: 1rem;
}

.hb-navgroup > h2 {
  margin: 0 0 .3rem;
  padding-inline: .5rem;
  color: var(--site-muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hb-navgroup > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-sidenav a {
  display: block;
  padding: .32rem .5rem;
  border-inline-start: 2px solid var(--site-line);
  border-radius: 0 .4rem .4rem 0;
  color: var(--site-ink);
  text-decoration: none;
}

[dir="rtl"] .hb-sidenav a {
  border-radius: .4rem 0 0 .4rem;
}

.hb-sidenav a:hover {
  color: var(--site-blue-hover);
  background: #eef3fc;
}

.hb-sidenav a[aria-current="page"] {
  border-inline-start-color: var(--site-blue);
  color: var(--site-blue);
  background: #eef3fc;
  font-weight: 700;
}

.hb-sidenav-home[aria-current="page"] {
  color: var(--site-blue);
  background: #eef3fc;
}

/* ===== Article column ===== */

.hb-article {
  min-width: 0;
  max-width: var(--hb-article-width);
}

.hb-article > .hero {
  margin-block-end: 1.5rem;
}

.hb-article h1 {
  margin-block: 0 .8rem;
  color: var(--site-navy);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.18;
}

.hb-article .hero > p {
  color: var(--site-muted);
  font-size: 1.05rem;
}

.hb-article h2 {
  margin-block: 2.25rem .75rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--site-line);
  color: var(--site-navy);
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  line-height: 1.28;
  scroll-margin-block-start: calc(var(--hb-header-height) + 1rem);
}

.hb-article section:first-of-type h2,
.hb-article .content-card:first-of-type h2,
.hb-article .hb-toc-inline + section h2 {
  border-block-start: 0;
  padding-block-start: 0;
}

.hb-article h3 {
  margin-block: 1.4rem .5rem;
  color: #122b59;
  font-size: 1.12rem;
  line-height: 1.35;
}

.hb-article p,
.hb-article li {
  max-width: 72ch;
}

.hb-article section[id],
.hb-article nav[id] {
  scroll-margin-block-start: calc(var(--hb-header-height) + 1rem);
}

.content-card,
.resource-card,
.hb-article > .hero {
  background: transparent;
}

.content-card {
  margin-block: .25rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1rem;
}

.resource-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--site-line);
  border-radius: .75rem;
  background: var(--site-surface);
  box-shadow: 0 4px 14px rgba(1, 41, 112, .04);
}

.resource-card h3 {
  margin-block: 0 .5rem;
  font-size: 1.05rem;
}

.resource-card a {
  margin-block-start: auto;
  padding-block-start: .6rem;
  font-weight: 700;
}

.callout {
  margin-block: 1rem;
  padding: .85rem 1rem;
  border-inline-start: 4px solid #236342;
  background: #e8f5ec;
}

.template {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--site-line);
  border-radius: .5rem;
  background: #f1f4fa;
  white-space: pre-wrap;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
}

.stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.5rem;
  margin: 1rem 0 0;
  padding-inline-start: 1.4rem;
}

.stage-list li {
  font-weight: 700;
}

.small {
  font-size: .95rem;
  color: var(--site-muted);
}

/* ===== Contents (on this page) ===== */

.hb-toc {
  position: sticky;
  inset-block-start: calc(var(--hb-header-height) + 1.75rem);
  max-height: calc(100vh - var(--hb-header-height) - 2.5rem);
  overflow-y: auto;
  padding-inline-start: 1.25rem;
  border-inline-start: 1px solid var(--site-line);
  font-size: .88rem;
}

.hb-toc > h2 {
  margin: 0 0 .5rem;
  color: var(--site-muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hb-toc > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-toc a {
  display: block;
  padding-block: .22rem;
  color: var(--site-muted);
  text-decoration: none;
}

.hb-toc a:hover {
  color: var(--site-blue-hover);
}

/* ===== Mobile disclosure controls (<details>) ===== */

.hb-mobile-nav,
.hb-toc-inline {
  display: none;
}

/* ===== Prev/next pagination ===== */

.hb-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  max-width: var(--hb-article-width);
  margin-block-start: 2.5rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--site-line);
}

.hb-pagination a {
  display: flex;
  min-width: min(100%, 15rem);
  flex: 1 1 15rem;
  flex-direction: column;
  gap: .15rem;
  padding: .8rem 1rem;
  border: 1px solid var(--site-line);
  border-radius: .6rem;
  background: var(--site-surface);
  text-decoration: none;
}

.hb-pagination a:hover {
  border-color: var(--site-blue);
  box-shadow: 0 4px 14px rgba(1, 41, 112, .08);
}

.hb-pagination .hb-pg-dir {
  color: var(--site-muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hb-pagination .hb-pg-title {
  color: var(--site-blue);
  font-weight: 700;
}

.hb-pagination .hb-next {
  align-items: flex-end;
  margin-inline-start: auto;
  text-align: end;
}

/* ===== Footer ===== */

.hb-footer {
  border-block-start: 1px solid var(--site-line);
  background: #fff;
}

.hb-footer .container,
.hb-footer-inner {
  width: min(calc(100% - 2rem), var(--hb-shell-width));
  margin-inline: auto;
  padding-block: 1.25rem;
  color: var(--site-muted);
}

.hb-footer p {
  margin: 0;
}

/* ===== Homepage handbook blocks ===== */

.hb-hero-inner {
  width: min(calc(100% - 2rem), 52rem);
  margin-inline: auto;
  text-align: center;
}

.hb-hero-kicker {
  margin-block: 0 .75rem;
  color: var(--site-blue);
  font-size: .85rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#hero.hb-hero {
  min-height: 0;
  padding-block: calc(var(--hb-header-height) + 4rem) 3.5rem;
  background-image: linear-gradient(135deg, #f5f7fb 0%, #e8eef9 100%);
}

#hero.hb-hero h1 {
  max-width: 22ch;
  margin-inline: auto;
  margin-block: 0 1rem;
  color: var(--site-navy);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.18;
}

#hero.hb-hero .hb-hero-sub {
  max-width: 58ch;
  margin-inline: auto;
  margin-block: 0 1.75rem;
  color: var(--site-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
}

.hb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem 1rem;
}

.hb-btn-primary,
.hb-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8rem 1.35rem;
  border-radius: .65rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.hb-btn-primary {
  border: 1px solid var(--site-blue);
  color: #fff;
  background: var(--site-blue);
}

.hb-btn-primary:hover {
  color: #fff;
  border-color: var(--site-blue-hover);
  background: var(--site-blue-hover);
}

.hb-btn-primary .hb-arrow {
  margin-inline-start: .5rem;
}

[dir="rtl"] .hb-btn-primary .hb-arrow {
  transform: scaleX(-1);
}

.hb-btn-secondary {
  border: 1px solid var(--site-line);
  color: var(--site-navy);
  background: #fff;
}

.hb-btn-secondary:hover {
  border-color: var(--site-blue);
  color: var(--site-blue-hover);
}

.hb-hero-alt {
  margin-block: 1.4rem 0;
  font-size: .95rem;
}

.home-stages {
  width: min(calc(100% - 2rem), var(--hb-shell-width));
  margin-inline: auto;
  padding-block: 3rem;
}

.home-stages > h2 {
  margin-block: 0 .5rem;
  color: var(--site-navy);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 750;
  letter-spacing: -.025em;
  text-align: center;
}

.home-stages > p {
  max-width: 62ch;
  margin: 0 auto 2rem;
  color: var(--site-muted);
  text-align: center;
}

.home-stage-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}

.home-stage-list > li {
  display: flex;
}

.home-stage-list a {
  display: flex;
  width: 100%;
  flex-direction: column;
  padding: 1.2rem 1.15rem;
  border: 1px solid var(--site-line);
  border-radius: .75rem;
  background: var(--site-surface);
  box-shadow: 0 4px 14px rgba(1, 41, 112, .04);
  text-decoration: none;
}

.home-stage-list a:hover {
  border-color: var(--site-blue);
  box-shadow: 0 8px 20px rgba(1, 41, 112, .1);
}

.home-stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-block-end: .75rem;
  border-radius: 50%;
  color: #fff;
  background: var(--site-blue);
  font-size: .95rem;
  font-weight: 750;
}

.home-stage-list h3 {
  margin-block: 0 .4rem;
  color: var(--site-navy);
  font-size: 1.1rem;
}

.home-stage-list p {
  margin: 0;
  color: var(--site-muted);
  font-size: .92rem;
}

.home-stage-more {
  margin-block-start: 1.75rem;
  text-align: center;
}

/* ===== Responsive ===== */

@media (max-width: 1199.98px) {
  .hb-shell {
    grid-template-columns: 15.5rem minmax(0, 1fr);
  }

  .hb-toc-col {
    display: none;
  }

  .hb-toc-inline {
    display: block;
  }
}

@media (max-width: 1200px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .hb-nav #primary-menu {
    display: none;
  }

  .hb-nav.navbar-mobile #primary-menu {
    position: absolute;
    inset-block-start: calc(100% + .25rem);
    inset-inline: 1rem;
    z-index: 1001;
    display: flex;
    max-height: calc(100vh - 6rem);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .2rem;
    overflow-y: auto;
    padding: .65rem;
    border: 1px solid var(--site-line);
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(1, 41, 112, .18);
  }

  .hb-nav.navbar-mobile #primary-menu > li,
  .hb-nav.navbar-mobile #primary-menu > li > a {
    width: 100%;
    justify-content: flex-start;
  }

  .hb-nav.navbar-mobile #primary-menu > li > a.getstarted {
    justify-content: center;
    margin-inline-start: 0;
  }

  .hb-nav.navbar-mobile #primary-menu > li:has(.language-control-group) {
    justify-content: center;
    padding-block-start: .35rem;
  }

  html.no-js .hb-header {
    position: static;
  }

  html.no-js .hb-nav .mobile-nav-toggle {
    display: none;
  }

  html.no-js .hb-nav #primary-menu {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 992px) {
  .hb-shell {
    display: block;
    padding-block-start: calc(var(--hb-header-height) + 1.25rem);
  }

  .hb-sidenav-col {
    display: none;
  }

  .hb-mobile-nav {
    display: block;
    margin-block-end: 1.25rem;
    border: 1px solid var(--site-line);
    border-radius: .65rem;
    background: var(--site-surface);
  }

  .hb-article {
    max-width: none;
  }

  .hb-pagination {
    max-width: none;
  }

  .home-stage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}



@media (max-width: 600px) {
  .hb-header-inner {
    width: min(calc(100% - 1.25rem), var(--hb-shell-width));
    min-height: 3.5rem;
  }

  .hb-logo img {
    max-height: 28px;
    margin-inline-end: .4rem;
  }

  .hb-logo span {
    font-size: 1.1rem;
  }

  .hb-shell {
    width: min(calc(100% - 1.25rem), var(--hb-shell-width));
  }

  .resource-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-stage-list {
    grid-template-columns: minmax(0, 1fr);
  }

  #hero.hb-hero {
    padding-block: calc(var(--hb-header-height) + 2.5rem) 2.5rem;
  }
}

@media (max-width: 900px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .resource-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== Details/summary shared styling ===== */

.hb-mobile-nav > summary,
.hb-toc-inline > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: .7rem 1rem;
  color: var(--site-navy);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.hb-mobile-nav > summary::-webkit-details-marker,
.hb-toc-inline > summary::-webkit-details-marker {
  display: none;
}

.hb-mobile-nav > summary::after,
.hb-toc-inline > summary::after {
  content: "▾";
  font-size: .9rem;
  transition: transform .15s ease;
}

.hb-mobile-nav[open] > summary::after,
.hb-toc-inline[open] > summary::after {
  transform: rotate(180deg);
}

.hb-mobile-nav > .hb-sidenav,
.hb-toc-inline > nav {
  padding: .5rem 1rem 1rem;
  border-block-start: 1px solid var(--site-line);
}

.hb-mobile-nav .hb-sidenav {
  position: static;
  max-height: none;
  overflow: visible;
  padding-inline-end: 0;
}

.hb-toc-inline {
  margin-block: 0 1.5rem;
  border: 1px solid var(--site-line);
  border-radius: .65rem;
  background: var(--site-surface);
}

.hb-toc-inline > nav > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-toc-inline a {
  display: block;
  padding-block: .25rem;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hb-header,
  .hb-footer,
  .hb-sidenav-col,
  .hb-toc-col,
  .hb-mobile-nav,
  .hb-toc-inline,
  .hb-pagination,
  .skip-link {
    display: none !important;
  }

  .hb-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .hb-article,
  .hb-main {
    max-width: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  li,
  .resource-card {
    break-inside: avoid;
  }
}
