/* ==========================================================================
   Dr. Osama Al-Dereai — draldereai.com
   Shared stylesheet (LTR + RTL via CSS logical properties)
   ========================================================================== */

:root {
  --navy-900: #081b30;
  --navy-800: #0e2a47;
  --navy-700: #163a5f;
  --gold-500: #c19a4b;
  --gold-400: #d4b473;
  --gold-100: #f3e8d3;
  --cream-050: #faf8f4;
  --cream-100: #f3efe6;
  --ink-900: #1c2a38;
  --ink-600: #4b5b6b;
  --ink-400: #7c8a97;
  --line: #e4ddcd;
  --white: #ffffff;

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Tajawal', 'Tahoma', sans-serif;

  --container: 1160px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(8, 27, 48, 0.08);
  --shadow-md: 0 8px 28px rgba(8, 27, 48, 0.12);
  --shadow-lg: 0 20px 50px rgba(8, 27, 48, 0.18);
}

html[lang="ar"] {
  --font-heading: var(--font-arabic);
  --font-body: var(--font-arabic);
  /* Tajawal's x-height/cap-height reads smaller than Playfair Display/Inter
     at an identical rem size, so scale the root up to match visual weight —
     every rem-based size in this stylesheet inherits the bump. */
  font-size: 113%;
}

/* Small-caps label elements are sized/spaced for uppercase Latin text;
   Arabic has no case and letter-spacing breaks cursive letter connections,
   so bump size and zero out spacing for Arabic pages. */
html[lang="ar"] .eyebrow,
html[lang="ar"] .brand .role,
html[lang="ar"] .timeline-item .period,
html[lang="ar"] .entry .tag,
html[lang="ar"] .footer-grid h4 {
  letter-spacing: 0;
  text-transform: none;
}
html[lang="ar"] .eyebrow { font-size: 0.92rem; }
html[lang="ar"] .brand .role { font-size: 0.8rem; }
html[lang="ar"] .timeline-item .period { font-size: 0.88rem; }
html[lang="ar"] .entry .tag { font-size: 0.88rem; padding: 6px 14px; }
html[lang="ar"] .footer-grid h4 { font-size: 0.95rem; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--cream-050);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--navy-900);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--ink-600); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  font-weight: 700;
  margin-bottom: 12px;
}

.section {
  padding-block: 72px;
}
.section--tight { padding-block: 48px; }
.section--navy {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800) 60%, var(--navy-700));
  color: var(--cream-100);
}
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: #c9d3dd; }
.section--cream { background: var(--cream-100); }

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color .15s ease;
}
.btn-primary {
  background: var(--gold-500);
  color: var(--navy-900);
}
.btn-primary:hover { background: var(--gold-400); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-outline-navy {
  background: transparent;
  border-color: var(--navy-700);
  color: var(--navy-800);
}
.btn-outline-navy:hover { background: var(--navy-800); color: var(--white); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
  gap: 20px;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand .name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.28rem;
  color: var(--navy-900);
}
.brand .role {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-500);
  font-weight: 600;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink-600);
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--navy-800);
  color: var(--navy-800);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.lang-switch[lang="ar"] {
  font-family: var(--font-arabic);
  font-size: 0.88rem;
}
.lang-switch:hover { background: var(--navy-800); color: var(--white); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy-900);
  margin: 5px 0;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------------- Hero ---------------- */
.hero {
  background: radial-gradient(ellipse at top, #12335690, transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-800) 55%, var(--navy-700));
  color: var(--white);
  padding-block: 88px 96px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset-block-end: -120px;
  inset-inline-end: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(212,180,115,0.25);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero h1 { color: var(--white); }
.hero .tagline {
  font-size: 1.15rem;
  color: var(--gold-100);
  max-width: 540px;
  margin-bottom: 28px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
  margin-top: 44px;
}
.hero-stats .stat b {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: var(--gold-400);
}
.hero-stats .stat span {
  font-size: 0.8rem;
  color: #b9c5d1;
  letter-spacing: 0.02em;
}
.portrait-frame {
  width: 260px;
  height: 260px;
  margin-inline: auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--gold-400), var(--gold-500));
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.portrait-frame .portrait-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--navy-800);
  border: 3px solid var(--navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3.6rem;
  color: var(--gold-400);
  letter-spacing: 0.05em;
  overflow: hidden;
}
.portrait-frame img.portrait-inner {
  object-fit: cover;
  object-position: center 15%;
}

/* ---------------- Cards / grids ---------------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--gold-100);
  color: var(--gold-500);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.card p { margin-bottom: 0; font-size: 0.94rem; }

/* ---------------- Timeline ---------------- */
.timeline { border-inline-start: 2px solid var(--line); padding-inline-start: 28px; }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  inset-inline-start: -34px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold-500);
  border: 3px solid var(--cream-050);
  box-shadow: 0 0 0 2px var(--gold-500);
}
.timeline-item .period {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.timeline-item h3 { margin: 4px 0 6px; font-size: 1.1rem; }
.timeline-item .org { color: var(--ink-400); font-size: 0.9rem; margin-bottom: 6px; display: block; }

/* ---------------- Video embeds ---------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.video-card .video-embed {
  position: relative;
  padding-top: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--navy-900);
}
.video-card .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-card h3 {
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 1.05rem;
}
.video-card p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* ---------------- List rows (boards, publications) ---------------- */
.entry-list { display: flex; flex-direction: column; gap: 0; }
.entry-list--boxed {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 28px;
  box-shadow: var(--shadow-sm);
}
.entry-list--boxed .entry:first-child { padding-top: 24px; }
.entry-list--boxed .entry:last-child { border-bottom: none; padding-bottom: 24px; }

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.chip-cloud .chip {
  display: inline-flex;
  align-items: center;
  background: var(--cream-100);
  border: 1px solid var(--line);
  color: var(--navy-800);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
}
.entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.entry:first-child { padding-top: 0; }
.entry .tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-700);
  background: var(--gold-100);
  border-radius: 999px;
  padding: 5px 12px;
  align-self: start;
  text-align: center;
}
.entry h3 { margin-bottom: 6px; }
.entry .meta { font-size: 0.85rem; color: var(--ink-400); margin-bottom: 8px; }
.entry .meta a { color: var(--navy-700); text-decoration: underline; }

/* ---------------- Quote / statement ---------------- */
.statement {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--navy-900);
  border-inline-start: 3px solid var(--gold-500);
  padding-inline-start: 24px;
  margin: 0;
}

/* ---------------- CTA band ---------------- */
.cta-band {
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--white); margin-bottom: 6px; }
.cta-band p { color: #c9d3dd; margin-bottom: 0; }

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--navy-900);
  color: #b9c5d1;
  padding-block: 56px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer-grid h4 {
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-grid a { display: block; font-size: 0.9rem; color: #b9c5d1; margin-bottom: 10px; transition: color .15s ease; }
.footer-grid a:hover { color: var(--gold-400); }
.footer-grid p { color: #91a0af; font-size: 0.88rem; }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0;
}
.social-row a:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #7f8fa0;
}
.footer-bottom a { color: #a9b8c6; }

/* ---------------- Breadcrumb / page hero ---------------- */
.page-hero {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  padding-block: 64px 56px;
}
.page-hero .eyebrow { color: var(--gold-400); }
.page-hero h1 { color: var(--white); margin-bottom: 10px; }
.page-hero p { color: #c9d3dd; max-width: 620px; margin-bottom: 0; }
.breadcrumb { font-size: 0.82rem; color: #91a0af; margin-bottom: 18px; }
.breadcrumb a { color: #c9d3dd; }
.breadcrumb span { margin-inline: 6px; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--navy-900); }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-900);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--gold-500);
  outline-offset: 1px;
}
.form-note { font-size: 0.82rem; color: var(--ink-400); margin-top: 14px; }
.form-status {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.form-status.success { background: #e6f4ea; color: #1e6b3a; border: 1px solid #b7dfc4; }
.form-status.error { background: #fbe9e7; color: #a3341f; border: 1px solid #f1c3ba; }

.contact-info-card {
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius);
  padding: 34px;
}
.contact-info-card h3 { color: var(--white); }
.contact-info-card .row { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.contact-info-card .row .icon { color: var(--gold-400); flex-shrink: 0; margin-top: 3px; }
.contact-info-card .row a, .contact-info-card .row span { color: #d8e0e8; font-size: 0.92rem; }

/* ---------------- Utilities ---------------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--line); border: none; margin-block: 56px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .portrait-frame { order: -1; width: 180px; height: 180px; }
  .hero .portrait-frame .portrait-inner { font-size: 2.4rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .header-inner.open .main-nav {
    display: flex;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--cream-050);
    flex-direction: column;
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--line);
    gap: 16px;
  }
  .grid-3, .grid-2, .form-grid, .video-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .entry .tag { justify-self: start; }
  .cta-band { flex-direction: column; align-items: flex-start; text-align: start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
