/* ═══════════════════════════════════════════
   DR. MOHAMMAD KHUDADAH — SHARED STYLES v2
   dr.khudadah.com
═══════════════════════════════════════════ */

/* Fonts loaded via preconnect + <link> in HTML head for offline reliability */
/* Fallback stack ensures Arabic text renders even without internet */

:root {
  --navy:        #003566;
  --blue:        #0077B6;
  --blue-mid:    #0096C7;
  --blue-pale:   #E1F0F7;
  --amber:       #E9C46A;
  --amber-light: #F4D58D;
  --amber-pale:  #FEF9EC;
  --warm-white:  #FFFCF7;
  --white:       #FFFFFF;
  --gray-50:     #F8FAFC;
  --gray-100:    #F0F4F8;
  --gray-200:    #DCE3EB;
  --gray-400:    #9AABB8;
  --gray-600:    #506070;
  --gray-800:    #1D3557;
  --text:        #1D3557;
  --font-en-h:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-en-b:   'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ar-h:   'Tajawal', 'Arabic UI Display', 'Geeza Pro', 'Traditional Arabic', sans-serif;
  --font-ar-b:   'Noto Sans Arabic', 'Arabic UI Text', 'Geeza Pro', 'Arabic Typesetting', sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en-b);
  color: var(--text);
  background: var(--warm-white);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
body.ar {
  font-family: var(--font-ar-b);
  direction: rtl;
}
body.ar h1,body.ar h2,body.ar h3,body.ar h4 {
  font-family: var(--font-ar-h);
  letter-spacing: 0;
}
/* RTL LAYOUT
   body.ar sets direction:rtl — flex rows reverse automatically.
   Nav result: brand on RIGHT, tabs right→left (الرئيسية first), cta on LEFT.
   Do NOT add row-reverse — that doubles back to LTR. */
body.ar .nav-brand-text  { text-align: right; }
body.ar .footer-bottom   { flex-direction: row-reverse; }
body.ar .footer-inner    { direction: rtl; }
body.ar .footer-links    { direction: rtl; }
body.ar .footer-col      { align-items: flex-start; }
body.ar .section-divider { margin-right: 0; margin-left: auto; }

/* ── NAVBAR ── */
.navbar {
  position: fixed; top:0; left:0; right:0; z-index:1000;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,53,102,0.3);
}
.nav-inner {
  max-width:1200px; margin:0 auto; padding:20px 64px;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
}
.nav-brand { display:flex; align-items:center; gap:12px; text-decoration:none; flex-shrink:0; }
.nav-logo {
  width:42px; height:42px; background:var(--amber); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-en-h); font-size:17px; font-weight:700; color:var(--navy); flex-shrink:0;
}
.nav-brand-text { line-height:1.2; }
.nav-name { display:block; font-size:14px; font-weight:600; color:var(--white); }
.nav-title-small { display:block; font-size:10.5px; color:rgba(255,255,255,0.45); }
.nav-links { display:flex; gap:2px; }
.nav-link {
  color:rgba(255,255,255,0.7); text-decoration:none; font-size:13.5px;
  font-weight:500; padding:8px 13px; border-radius:4px;
  transition:color 0.2s, background 0.2s;
}
.nav-link:hover { color:var(--white); background:rgba(255,255,255,0.08); }
.nav-link.active { color:var(--amber); }
.nav-right { display:flex; align-items:center; gap:11px; flex-shrink:0; }
.lang-toggle {
  background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.18);
  color:rgba(255,255,255,0.8); padding:7px 13px; border-radius:4px;
  font-size:12.5px; font-weight:600; cursor:pointer;
  display:flex; align-items:center; gap:6px;
  transition:all 0.2s; font-family:var(--font-en-b);
}
.lang-toggle:hover { border-color:var(--amber); color:var(--amber); }
.nav-cta {
  background:var(--amber); color:var(--navy); padding:10px 22px;
  border-radius:4px; font-size:13px; font-weight:700;
  text-decoration:none; white-space:nowrap; transition:background 0.2s, transform 0.15s;
}
.nav-cta:hover { background:var(--amber-light); transform:translateY(-1px); }

/* ── BUTTONS ── */
.btn-primary {
  display:inline-block; background:var(--amber); color:var(--navy);
  padding:13px 28px; border-radius:4px; font-size:13.5px; font-weight:700;
  text-decoration:none; transition:background 0.2s, transform 0.15s;
}
.btn-primary:hover { background:var(--amber-light); transform:translateY(-1px); }
.btn-outline {
  display:inline-block; border:1.5px solid rgba(255,255,255,0.28);
  color:rgba(255,255,255,0.85); padding:13px 28px; border-radius:4px;
  font-size:13.5px; font-weight:500; text-decoration:none;
  transition:border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color:var(--amber); color:var(--amber); }
.btn-blue {
  display:inline-block; background:var(--blue); color:var(--white);
  padding:12px 26px; border-radius:4px; font-size:13.5px; font-weight:600;
  text-decoration:none; transition:background 0.2s;
}
.btn-blue:hover { background:var(--blue-mid); }
.btn-dark {
  display:inline-block; background:var(--navy); color:var(--white);
  padding:13px 30px; border-radius:4px; font-size:13.5px; font-weight:700;
  text-decoration:none; transition:background 0.2s; white-space:nowrap;
}
.btn-dark:hover { background:var(--blue); }

/* ── SVG ICON SYSTEM ── */
.icon { display:inline-block; width:20px; height:20px; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.icon-lg { width:28px; height:28px; }
.icon-xl { width:38px; height:38px; }
.icon-wrap { width:52px; height:52px; background:var(--blue-pale); border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--blue); }
.icon-wrap-navy { background:rgba(255,255,255,0.08); color:var(--amber); }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  background:var(--navy); padding:140px 64px 80px;
  position:relative; overflow:hidden;
}
.page-hero::before {
  content:''; position:absolute; inset:0;
  background:
    radial-gradient(ellipse 60% 80% at 85% 20%, rgba(0,150,199,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 5% 85%, rgba(233,196,106,0.06) 0%, transparent 50%);
}
.page-hero::after {
  content:''; position:absolute; inset:0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 30px 30px;
}
.page-hero-inner { max-width:1200px; margin:0 auto; position:relative; z-index:1; }
.page-hero-eyebrow { font-size:11px; letter-spacing:3px; text-transform:uppercase; color:var(--amber); font-weight:600; margin-bottom:14px; }
.page-hero-title { font-family:var(--font-en-h); font-size:50px; font-weight:700; color:var(--white); line-height:1.1; margin-bottom:16px; }
body.ar .page-hero-title { font-family:var(--font-ar-h); }
.page-hero-sub { font-size:16px; color:rgba(255,255,255,0.58); font-weight:300; max-width:580px; line-height:1.75; }

/* ── SECTION UTILITIES ── */
.section-wrap { max-width:1200px; margin:0 auto; padding:96px 64px; }
.section-label { font-size:11px; letter-spacing:3px; text-transform:uppercase; color:var(--blue); font-weight:700; margin-bottom:10px; }
.section-heading { font-family:var(--font-en-h); font-size:40px; font-weight:700; color:var(--navy); line-height:1.15; margin-bottom:16px; }
body.ar .section-heading { font-family:var(--font-ar-h); }
.section-divider { width:48px; height:3px; background:var(--amber); margin-bottom:28px; }
.section-body { font-size:15px; line-height:1.85; color:var(--gray-600); }

/* ── BACKGROUND UTILITIES ── */
.bg-warm { background:var(--warm-white); }
.bg-light { background:var(--gray-50); }
.bg-blue-pale { background:var(--blue-pale); }
.bg-navy { background:var(--navy); }
.bg-dots {
  background-color:var(--gray-50);
  background-image: radial-gradient(circle, rgba(0,53,102,0.055) 1px, transparent 1px);
  background-size: 26px 26px;
}
.bg-navy-rich {
  background-color: var(--navy);
  background-image:
    radial-gradient(ellipse 70% 60% at 80% 25%, rgba(0,150,199,0.28) 0%, transparent 60%),
    radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: auto, 30px 30px;
}

/* ── FOOTER ── */
.footer {
  background-color: var(--navy);
  background-image: radial-gradient(ellipse 80% 60% at 90% 10%, rgba(0,119,182,0.18) 0%, transparent 55%);
  padding: 64px 64px 0;
}
.footer-inner {
  max-width:1200px; margin:0 auto;
  display:grid; grid-template-columns:1.2fr 1fr;
  gap:60px; padding-bottom:48px;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.footer-name { font-family:var(--font-en-h); font-size:20px; font-weight:700; color:var(--white); margin-bottom:6px; }
body.ar .footer-name { font-family:var(--font-ar-h); }
.footer-spec { font-size:13px; color:rgba(255,255,255,0.42); margin-bottom:3px; line-height:1.55; }
.footer-links { display:grid; grid-template-columns:1fr 1fr; gap:32px; }
.footer-col { display:flex; flex-direction:column; gap:10px; }
.footer-col-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:2px; color:var(--amber); margin-bottom:4px; }
.footer-col a, .footer-col span { font-size:13.5px; color:rgba(255,255,255,0.48); text-decoration:none; transition:color 0.2s; display:flex; align-items:center; gap:8px; }
.footer-col a:hover { color:var(--amber); }
.footer-bottom {
  max-width:1200px; margin:0 auto; padding:20px 0;
  display:flex; justify-content:space-between;
  font-size:12px; color:rgba(255,255,255,0.22);
}

/* ── CONTACT STRIP ── */
.contact-strip { background:var(--amber); padding:52px 64px; }
.contact-strip-inner { max-width:1200px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; gap:32px; }
.contact-strip h2 { font-family:var(--font-en-h); font-size:34px; font-weight:700; color:var(--navy); }
body.ar .contact-strip h2 { font-family:var(--font-ar-h); }
.contact-strip p { font-size:14px; color:rgba(0,53,102,0.65); margin-top:6px; }

/* ── RESPONSIVE ── */
@media (max-width:960px) {
  /* NAV */
  .nav-inner { padding:14px 20px; gap:10px; }
  .nav-links { display:none; }
  .nav-name { font-size:13px; }
  .nav-title-small { display:none; }
  .nav-right { gap:8px; }
  .nav-cta { padding:8px 14px; font-size:12px; }
  .lang-toggle { padding:6px 10px; font-size:11.5px; }

  /* HERO */
  .page-hero { padding:100px 20px 48px; }
  .page-hero-title { font-size:34px; }
  .page-hero-sub { font-size:14px; }

  /* SECTIONS */
  .section-wrap { padding:52px 20px; }
  .section-heading { font-size:28px; }

  /* FOOTER */
  .footer { padding:40px 20px 0; }
  .footer-inner { grid-template-columns:1fr; gap:32px; }
  .footer-links { grid-template-columns:1fr 1fr; }

  /* CONTACT STRIP */
  .contact-strip { padding:36px 20px; }
  .contact-strip-inner { flex-direction:column; text-align:center; gap:20px; }
  .contact-strip h2 { font-size:26px; }
}

@media (max-width:640px) {
  /* NAV */
  .nav-inner { padding:12px 16px; }
  .nav-logo { width:36px; height:36px; font-size:14px; }
  /* Hide Book Appointment on very small screens, keep lang toggle */
  .nav-cta { display:none; }

  /* PAGE HERO */
  .page-hero-title { font-size:28px; }
  .page-hero { padding:90px 16px 40px; }

  /* FOOTER */
  .footer-links { grid-template-columns:1fr; gap:24px; }
  .footer-bottom { flex-direction:column; gap:6px; text-align:center; }

  /* PREVENT HORIZONTAL OVERFLOW */
  body { overflow-x:hidden; }
  * { max-width:100%; }
  img { max-width:100%; height:auto; }
}

/* ── GLOBAL MOBILE GRID FIXES ── */
@media (max-width:768px) {
  /* Force all two-column grids to single column */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns:1fr !important;
  }
}
