/*
 * Site chrome: header, desktop navigation, language switcher, mobile navigation panel,
 * breadcrumbs, footer. All shared across every page and both directions.
 */

/* ---- Header ---- */

.site-header {
  position: fixed;
  z-index: var(--z-header);
  inset-block-start: 0;
  inset-inline: 0;
  block-size: var(--header-h);
  border-block-end: 1px solid transparent;
  transition:
    block-size 220ms var(--ease),
    box-shadow 220ms ease,
    border-color 220ms ease;
}

/*
 * The bar's translucent blurred fill lives on this backdrop layer, NOT on .site-header itself.
 * backdrop-filter turns its element into a containing block for fixed-position descendants and
 * takes them out of the normal hit-testing order — with the filter on the header, the mobile
 * navigation panel (a fixed-position child) rendered on screen but every click passed straight
 * through it to the page content underneath. Caught by driving the real menu in a browser.
 */
.site-header::before {
  position: absolute;
  z-index: -1;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 100%;
  background: rgba(245, 247, 248, 0.92);
  backdrop-filter: blur(16px);
  transition: background-color 220ms ease;
  content: "";
}

.site-header.is-scrolled {
  block-size: var(--header-h-scrolled);
  border-block-end-color: rgba(7, 29, 47, 0.08);
  box-shadow: 0 8px 28px rgba(6, 23, 37, 0.06);
}

.site-header.is-scrolled::before {
  background: rgba(255, 255, 255, 0.96);
}

/* Every page's first section sits below the fixed header. */
.site-main {
  padding-block-start: var(--header-h);
}

/* Full-bleed heroes render their own top padding and sit *under* the header. */
.site-main--flush {
  padding-block-start: 0;
}

.header-shell {
  display: grid;
  inline-size: min(calc(100% - var(--gutter)), var(--container-wide));
  block-size: 100%;
  margin-inline: auto;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-9);
}

/*
 * Official logo. Fixed box + object-fit: contain, so the supplied lockup is never
 * cropped, stretched, recoloured or re-proportioned — it simply scales to fit.
 */
.brand {
  display: inline-flex;
  inline-size: 174px;
  block-size: 50px;
  align-items: center;
  text-decoration: none;
}

.brand img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  object-position: left center;
}

[dir="rtl"] .brand img {
  object-position: right center;
}

/* ---- Desktop navigation ---- */

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-7);
}

.desktop-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 2px;
  color: #304454;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
}

.desktop-nav a::after {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 6px;
  block-size: 2px;
  background: var(--brand-600);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--motion-micro) ease;
  content: "";
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--brand-700);
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---- Header actions ---- */

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--brand-700);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--motion-micro) ease;
}

.language-switch:hover {
  background: var(--blue-wash);
}

/* ---- Mobile menu toggle ---- */

.menu-toggle {
  position: relative;
  display: none;
  inline-size: 46px;
  block-size: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition:
    border-color var(--motion-micro) ease,
    background-color var(--motion-micro) ease;
}

/* The toggle had no hover or pressed feedback at all — the only control on mobile
   with nothing to confirm the tap registered. */
.menu-toggle:hover {
  border-color: var(--line-strong);
  background: var(--blue-wash);
}

.menu-toggle:active {
  background: var(--cyan-100);
}

.menu-toggle__bar {
  position: absolute;
  inline-size: 21px;
  block-size: 2px;
  background: var(--navy-900);
  transition: transform var(--motion-micro) ease;
}

.menu-toggle__bar:first-of-type { transform: translateY(-4px); }
.menu-toggle__bar:nth-of-type(2) { transform: translateY(4px); }

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:first-of-type { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-of-type(2) { transform: rotate(-45deg); }

/* ---- Mobile navigation panel ---- */

.mobile-panel {
  position: fixed;
  z-index: calc(var(--z-header) - 1);
  inset-block-start: var(--header-h-mobile);
  inset-block-end: 0;
  inset-inline: 0;
  overflow-y: auto;
  color: var(--white);
  background: var(--navy-900);
  overscroll-behavior: contain;
}

/* [hidden] must win over the panel's own display value. */
.mobile-panel[hidden] {
  display: none;
}

.mobile-panel__inner {
  display: flex;
  min-block-size: calc(100dvh - var(--header-h-mobile));
  flex-direction: column;
  padding: var(--space-9) var(--space-6) var(--space-7);
}

.mobile-nav {
  display: grid;
}

.mobile-nav a {
  display: flex;
  min-block-size: 64px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-block-end: 1px solid var(--line-dark);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: var(--tracking-display);
  text-decoration: none;
}

.mobile-nav a::after {
  color: var(--cyan-400);
  font-family: var(--font-body);
  content: "\2197"; /* north-east arrow */
}

[dir="rtl"] .mobile-nav a::after {
  content: "\2196"; /* north-west arrow — reading-direction "forward" in RTL */
}

.mobile-nav a[aria-current="page"] {
  color: var(--cyan-400);
}

.mobile-panel__footer {
  display: grid;
  gap: var(--space-4);
  margin-block-start: auto;
  padding-block-start: var(--space-8);
}

.language-card {
  display: flex;
  inline-size: 100%;
  min-block-size: 54px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 18px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  color: var(--white);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color var(--motion-micro) ease,
    background-color var(--motion-micro) ease;
}

/* Matches the desktop switcher's hover affordance, which this control lacked. */
.language-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.language-card::after {
  color: var(--cyan-400);
  font-size: 0.84rem;
  font-weight: 700;
  content: "A / \0639";
}

body.menu-open {
  overflow: hidden;
}

/* ---- Breadcrumbs ---- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-block-end: var(--space-9);
  color: #9fb2c0;
  font-size: 0.82rem;
  font-weight: 600;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--white);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--cyan-100);
}

/* The separator is a literal "/" — direction-neutral, so no mirroring is needed. */
.breadcrumb__separator {
  color: var(--cyan-400);
}

/* Breadcrumbs on a light page hero. */
.breadcrumb--light {
  color: var(--muted);
}

.breadcrumb--light a:hover {
  color: var(--brand-700);
}

.breadcrumb--light [aria-current="page"] {
  color: var(--navy-900);
}

/* ---- Footer ---- */

.site-footer {
  color: var(--footer-ink);
  background: var(--navy-950);
}

.footer-main {
  display: grid;
  padding-block: var(--space-11) var(--space-10);
  grid-template-columns: 1.2fr 0.7fr 0.85fr 1.1fr;
  gap: var(--space-10) var(--space-11);
}

.footer-brand img {
  inline-size: 210px;
  block-size: 74px;
  object-fit: contain;
  object-position: left center;
  /* Knock the navy lockup out to white on the deep-navy footer. Approved prototype
     treatment — proportions and artwork are untouched. */
  filter: brightness(0) invert(1);
}

[dir="rtl"] .footer-brand img {
  object-position: right center;
}

.footer-brand p {
  max-inline-size: 330px;
  margin-block: var(--space-6) 0;
  color: var(--footer-ink-muted);
  font-size: var(--text-small);
}

.footer-column h2 {
  margin-block-end: var(--space-6);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[lang="ar"] .footer-column h2 {
  letter-spacing: 0;
  text-transform: none;
}

.footer-column ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-column a,
.footer-column li {
  color: var(--footer-ink-muted);
  font-size: var(--text-small);
  text-decoration: none;
}

.footer-column a {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
}

.footer-column a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-contact {
  display: grid;
  gap: var(--space-4);
  font-style: normal;
}

.footer-contact p,
.footer-contact a {
  margin: 0;
  color: var(--footer-ink-soft);
  font-size: var(--text-small);
  text-decoration: none;
}

.footer-contact a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  min-block-size: 76px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-7);
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--footer-ink-dim);
  font-size: 0.76rem;
}

.footer-legal__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--white);
  text-decoration: underline;
}
