/* ════════════════════════════════════════════════
   04 — NAVIGATION
   Cinematic header: italic title eyebrow,
   hamburger, lang/X icons, scroll-spy
   ════════════════════════════════════════════════ */

.site-nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 1000;
  padding: 24px 0;
  transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}

.site-nav.transparent { background: transparent; }
.site-nav.solid {
  background: rgba(82, 22, 36, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 0;
  box-shadow: 0 1px 0 rgba(184, 168, 124, 0.12), 0 4px 20px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* Left side — hamburger + italic title eyebrow */
.nav-left { display: flex; align-items: center; gap: 24px; }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--cream);
  transition: all 0.3s ease;
}
.hamburger span:nth-child(2) { width: 16px; }
.hamburger:hover span { background: var(--olive-gold); }
.hamburger:hover span:nth-child(2) { width: 22px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); width: 22px; }

/* Brand logo (replaces former italic title text) */
.nav-title {
  display: inline-flex;
  align-items: center;
  line-height: 0; /* prevents the <a>'s descent from adding stray vertical space */
}
.nav-logo {
  display: block;
  /* Long-name (ALDOSARY) logo: 1200x355, aspect 3.38:1, includes two Arabic
     lines + English subtitle. Needs more vertical room than the old wide
     horizontal short-name logo did to stay readable. */
  height: 32px;
  width: auto;
  opacity: 0.95;
  transition: opacity 0.3s ease;
}
.nav-title:hover .nav-logo { opacity: 1; }

/* Center — pillar nav (homepage only, hidden on inner pages) */
.nav-pillars {
  display: flex;
  justify-content: center;
  gap: 56px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.site-nav.solid .nav-pillars { opacity: 1; }

.nav-pillars a {
  font-family: var(--font-arabic);
  font-weight: 400;
  font-size: 15px;
  color: var(--cream);
  opacity: 0.7;
  position: relative;
  padding-bottom: 6px;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.nav-pillars a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--olive-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s ease;
}
.nav-pillars a:hover { opacity: 1; color: var(--olive-gold); }
.nav-pillars a:hover::after { transform: scaleX(1); }
.nav-pillars a.active {
  opacity: 1;
  color: var(--olive-gold);
}
.nav-pillars a.active::after { transform: scaleX(1); }

/* Right side is intentionally empty after removing the contact icon and language label.
   Kept as a 0-width grid placeholder so the existing `auto 1fr auto` template doesn't
   need to change — the trailing gap reads as natural breathing room on the edge. */
.nav-right { display: flex; align-items: center; }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  background: var(--maroon-deep);
  z-index: 999;
  padding: 100px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1);
  overflow-y: auto;
}
.nav-drawer.active { transform: translateX(0); }
.nav-drawer__title {
  /* Renders Arabic ("المحاور", "الصفحات") — switched to the Arabic stack,
     dropped italic (no italic axis in the font + Arabic has no italic),
     dropped letter-spacing (it breaks Arabic letter joins), and dropped
     text-transform (no-op on Arabic anyway). */
  font-family: var(--font-arabic);
  font-weight: 500;
  color: var(--olive-gold);
  font-size: 14px;
  margin-bottom: 16px;
  margin-top: 32px;
}
.nav-drawer__title:first-of-type { margin-top: 0; }
.nav-drawer a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-arabic);
  font-size: 22px;
  font-weight: 300;
  color: var(--cream);
  border-bottom: 1px solid rgba(227,227,213,0.08);
  transition: color 0.3s ease, padding 0.3s ease;
}
.nav-drawer a:hover {
  color: var(--olive-gold);
  padding-inline-start: 8px;
}

/* Inner pages: drop pillar nav, keep solid nav */
body:not(.home) .site-nav { background: rgba(82, 22, 36, 0.96); backdrop-filter: blur(14px); padding: 14px 0; }
body:not(.home) .nav-pillars { opacity: 1; }

@media (max-width: 768px) {
  .nav-pillars { display: none; }
  .nav-inner { grid-template-columns: auto 1fr auto; position: relative; }
  .nav-logo { height: 28px; }

  /* Center the logo horizontally in the nav. With pillars hidden on mobile,
     the center is free — we absolute-position the logo there so it stays
     centered regardless of how wide the hamburger column ends up. */
  .nav-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
}
