/* ESNAAD — Dr. Mustafa Abu-Salhah */
:root {
  --ivory: #F8F5EE;
  --ivory-2: #F1ECE1;
  --paper: #FFFDF8;
  --logo-bg: #F6F5F1;
  --navy: #0F1E33;
  --navy-2: #172A45;
  --charcoal: #1E242C;
  --ink: #26303C;
  --muted: #5B6573;
  --gold: #B08D57;
  --gold-light: #CDAE78;
  --gold-text: #7E5F2C;       /* gold for text on ivory (AA) */
  --line: rgba(15, 30, 51, .12);
  --line-light: rgba(255, 255, 255, .14);
  --radius: 14px;
  --shadow: 0 18px 40px -22px rgba(15, 30, 51, .35);
  --font-body: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
  --font-head: "Amiri", "Cormorant Garamond", Georgia, serif;
  --header-h: 84px;
}
html[lang="en"] {
  --font-body: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-head: "Cormorant Garamond", "Amiri", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
html[lang="en"] h1, html[lang="en"] h2 { font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.5em; border-radius: 999px;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn .icon { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
.btn-sm { min-height: 42px; padding: .55em 1.2em; font-size: .95rem; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(176, 141, 87, .8); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost-light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost-light:hover { border-color: var(--gold-light); color: var(--gold-light); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 245, 241, .94);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(15, 30, 51, .5); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand-logo { width: auto; height: 76px; background: var(--logo-bg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.brand-sub { font-size: .78rem; color: var(--muted); }

.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav a {
  display: block; padding: 10px 14px; text-decoration: none; color: var(--charcoal);
  font-weight: 500; font-size: .98rem; border-radius: 8px; position: relative;
}
.main-nav a::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 4px; height: 1.5px;
  background: var(--gold); transform: scaleX(0); transition: transform .3s;
}
.main-nav a:hover::after, .main-nav a.is-active::after { transform: scaleX(1); }
.main-nav .nav-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper);
}
.lang-btn {
  border: 0; background: transparent; cursor: pointer; padding: 7px 13px; border-radius: 999px;
  font: 500 .9rem/1 var(--font-body); color: var(--muted); min-height: 36px;
}
.lang-btn[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.lang-btn[lang="en"] { font-family: "Inter", sans-serif; }
.lang-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.lang-btn:not([aria-pressed="true"]):hover { color: var(--navy); }

.menu-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--navy); transition: transform .3s, opacity .3s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: #E9E4DA;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(176,141,87,.18), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, #0B1626 100%);
}
html[dir="rtl"] .hero { background:
    radial-gradient(900px 500px at 15% -10%, rgba(176,141,87,.18), transparent 60%),
    linear-gradient(200deg, var(--navy) 0%, #0B1626 100%); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-image: linear-gradient(var(--gold) 1px, transparent 1px), linear-gradient(90deg, var(--gold) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.hero-inner {
  position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center;
  padding-block: 88px 104px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; color: var(--gold-light);
  font-size: .95rem; font-weight: 500; letter-spacing: .02em; margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--gold); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-bottom: .45em; }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: #D8D2C6; max-width: 36em; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 34px; }
.hero-facts li {
  border: 1px solid var(--line-light); border-radius: 999px; padding: 6px 16px; font-size: .92rem; color: #E9E4DA;
  background: rgba(255,255,255,.03);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-portrait { margin: 0; position: relative; }
.portrait-frame { position: relative; border-radius: 6px; }
.portrait-frame::before {
  content: ""; position: absolute; inset: 0; transform: translate(18px, 18px);
  border: 1.5px solid var(--gold); border-radius: 6px; z-index: 0;
}
html[dir="rtl"] .portrait-frame::before { transform: translate(-18px, 18px); }
.portrait-frame img {
  position: relative; z-index: 1; width: 100%; aspect-ratio: 856 / 732; object-fit: cover;
  border-radius: 6px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
}

/* Sections */
.section { padding-block: 104px; }
.section-tint { background: var(--ivory-2); }
.section-navy { background: var(--navy); color: #DCD6CB; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head h2, .about-intro h2, .contact-info h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.section-head p:last-child { color: var(--muted); font-size: 1.08rem; }
.section-navy .section-head p:last-child { color: #BFC6D1; }
.kicker {
  color: var(--gold-text); font-weight: 600; font-size: .9rem; letter-spacing: .04em; margin-bottom: 10px;
  display: inline-flex; align-items: center; gap: 10px;
}
html[lang="en"] .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.kicker::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.section-navy .kicker { color: var(--gold-light); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.about-intro p { color: #3A4452; }
.languages { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.languages h3 { font-size: 1.15rem; margin: 0; }
.languages ul { display: flex; gap: 8px; }
.languages li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 16px; font-size: .95rem; }
.about-roles {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px;
  box-shadow: var(--shadow); position: relative;
}
.about-roles::before {
  content: ""; position: absolute; top: 0; inset-inline: 36px; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px;
}
.card-title { font-size: 1.4rem; margin-bottom: 18px; }
.role-list li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.role-list li:last-child { border-bottom: 0; }
.role-mark { width: 8px; height: 8px; flex: none; transform: rotate(45deg) translateY(-2px); background: var(--gold); }

/* Practice */
.practice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.practice-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px;
  transition: transform .35s, box-shadow .35s, border-color .35s;
}
.practice-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(176,141,87,.5); }
.p-icon { width: 46px; height: 46px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.practice-card h3 { font-size: 1.3rem; }
.practice-card p { color: var(--muted); margin: 0; font-size: .98rem; }

/* Education */
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; position: relative; }
.tl-item {
  position: relative; padding: 30px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.tl-degree {
  display: inline-block; font-size: .85rem; font-weight: 600; color: var(--navy); background: rgba(176,141,87,.18);
  padding: 3px 12px; border-radius: 999px; margin-bottom: 14px;
}
.tl-item h3 { font-size: 1.35rem; margin-bottom: .3em; }
.tl-item p { color: var(--muted); margin: 0; }
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.extra-card { border: 1px dashed rgba(15,30,51,.22); border-radius: var(--radius); padding: 26px 28px; }
.extra-card h3 { font-size: 1.15rem; }
.extra-card p, .extra-card li { color: var(--muted); font-size: .98rem; }
.extra-card p { margin: 0; }
.extra-card li { position: relative; padding-inline-start: 18px; }
.extra-card li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

/* Books */
.books-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: stretch; }
.book-card {
  display: flex; flex-direction: column; background: var(--navy-2); border: 1px solid var(--line-light);
  border-radius: var(--radius); overflow: hidden; transition: transform .35s, border-color .35s;
}
.book-card:hover { transform: translateY(-4px); border-color: rgba(205,174,120,.5); }
.book-cover {
  display: flex; align-items: center; justify-content: center; height: 420px; padding: 28px;
  background: radial-gradient(circle at 50% 40%, #FBF8F1 0%, #E9E2D3 100%);
  border: 0; cursor: zoom-in; width: 100%;
}
.book-cover img {
  max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(15,30,51,.35)); transition: transform .4s;
}
.book-cover:hover img { transform: scale(1.03); }
.book-body { padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.book-num { font-family: "Cormorant Garamond", serif; font-size: 1.1rem; color: var(--gold-light); letter-spacing: .1em; }
.book-title-ar { font-family: "Amiri", serif; font-size: 1.32rem; line-height: 1.6; margin: 0; text-align: start; }
html[lang="en"] .book-title-ar { text-align: right; }
.book-title-en { font-family: "Cormorant Garamond", serif; font-size: 1.2rem; font-weight: 600; color: var(--gold-light); line-height: 1.4; margin: 0; }
.book-desc { color: #BFC6D1; font-size: .96rem; margin: 6px 0 0; }
html[lang="ar"] [data-show="en"] { display: none; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-info > p { color: #3A4452; }
.contact-list { margin: 30px 0; display: grid; gap: 14px; }
.contact-list li {
  display: flex; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 20px;
}
.contact-list .icon { width: 22px; height: 22px; fill: var(--gold); flex: none; }
.contact-list div { display: flex; flex-direction: column; }
.c-label { font-size: .85rem; color: var(--muted); }
.contact-list a { color: var(--navy); font-weight: 600; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.c-links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.contact-list a.c-alt { font-weight: 500; font-size: .92rem; color: var(--gold-text); }
.contact-list a[dir="ltr"] { unicode-bidi: isolate; text-align: start; }
.contact-logo {
  width: 150px; background: var(--logo-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
}

.consult-form {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow); border-top: 3px solid var(--gold);
}
.consult-form h3 { font-size: 1.5rem; margin-bottom: 22px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .95rem; color: var(--navy); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid rgba(15,30,51,.22); border-radius: 10px; padding: 12px 14px; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,87,.25); }
.field input.is-fixed { background: var(--ivory-2); color: var(--navy); font-weight: 600; cursor: default; }
.field [aria-invalid="true"] { border-color: #A3322A; }
.field-error { color: #A3322A; font-size: .88rem; margin: 6px 0 0; min-height: 0; }
.field-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.form-actions .btn { flex: 1 1 220px; }
.form-note {
  margin: 20px 0 0; font-size: .9rem; color: var(--muted); background: var(--ivory); border-radius: 10px; padding: 12px 16px;
  border-inline-start: 3px solid var(--gold);
}
.form-status { margin: 12px 0 0; font-size: .92rem; color: var(--navy); }
.form-status:empty { display: none; }

/* Footer */
.site-footer { background: #0A1524; color: #BFC6D1; padding-top: 64px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--line-light); }
.footer-brand { display: flex; align-items: center; gap: 18px; }
.footer-brand img { width: 86px; background: var(--logo-bg); border-radius: 10px; padding: 6px; }
.footer-brand p { margin: 0; font-size: .95rem; }
.footer-name { font-family: var(--font-head); color: #fff; font-size: 1.25rem !important; font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { text-decoration: none; color: #DCD6CB; padding: 6px 0; }
.footer-nav a:hover { color: var(--gold-light); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px 28px; font-size: .86rem; color: #8F99A8; }
.footer-bottom p { margin: 0; }

/* Floating WhatsApp */
.wa-float {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 90; width: 58px; height: 58px; border-radius: 50%;
  background: var(--navy); border: 2px solid var(--gold); display: grid; place-items: center;
  box-shadow: 0 14px 30px -10px rgba(15,30,51,.6); transition: transform .25s;
}
.wa-float svg { width: 28px; height: 28px; fill: var(--gold-light); }
.wa-float:hover { transform: scale(1.06); }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(92vw, 720px); max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 15, 27, .85); backdrop-filter: blur(4px); }
.lightbox img { max-height: 88vh; max-width: 100%; width: auto; margin: auto; border-radius: 6px; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: -18px; inset-inline-end: -18px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--gold); background: var(--navy); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Responsive */
@media (max-width: 1120px) {
  .main-nav a { padding: 10px 9px; font-size: .94rem; }
  .main-nav a::after { inset-inline: 9px; }
  .brand-sub { display: none; }
}
@media (max-width: 980px) {
  :root { --header-h: 72px; }
  .brand-logo { height: 58px; }
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; inset-inline: 0; background: var(--logo-bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -20px rgba(15,30,51,.4); display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 16px 16px; width: min(1180px, 100%); margin-inline: auto; }
  .main-nav a { padding: 14px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .main-nav a::after { display: none; }
  .header-inner { gap: 12px; }
  .header-actions { margin-inline-start: auto; }

  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-inner { padding-block: 56px 72px; }
  .hero-portrait { max-width: 620px; width: 100%; margin-inline: auto; }
  .practice-grid, .timeline, .books-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: 80px; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand-text { display: none; }
  .brand-logo { height: 54px; }
  .header-cta { display: none; }
  .main-nav .nav-cta { display: block; padding-top: 14px; }
  .main-nav .nav-cta a { display: flex; color: var(--navy); border-radius: 999px; border-bottom: 0; padding: .7em 1.5em; font-weight: 600; }
  .lang-btn { padding: 7px 11px; }
  .hero-inner { padding-block: 28px 64px; gap: 36px; }
  .hero-portrait { order: -1; }
  .hero-actions .btn { flex: 1 1 100%; }
  .portrait-frame::before { transform: translate(10px, 10px); }
  html[dir="rtl"] .portrait-frame::before { transform: translate(-10px, 10px); }
  .practice-grid, .timeline, .books-grid, .extra-grid { grid-template-columns: 1fr; }
  .section { padding-block: 64px; }
  .section-head { margin-bottom: 36px; }
  .about-roles, .consult-form { padding: 26px 20px; }
  .about-roles::before { inset-inline: 20px; }
  .book-cover { height: 380px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .wa-float { width: 54px; height: 54px; bottom: 16px; inset-inline-end: 16px; }
}
