/* =========================================================
   جمعية الإمام البخاري الخيرية — Global Stylesheet
   RTL-first Arabic design system
   ========================================================= */

:root {
  /* Brand colors */
  --color-primary: #1A5D3A;
  --color-primary-dark: #124528;
  --color-primary-light: #E8F1EC;
  --color-secondary: #C5A059;
  --color-secondary-dark: #A58444;
  --color-secondary-light: #F5EEDC;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-off-white: #FAF8F3;
  --color-text: #1A1A1A;
  --color-text-muted: #5A5A5A;
  --color-border: #EAEAEA;
  --color-dark-overlay: rgba(15, 40, 25, 0.72);

  /* Typography */
  --font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --container-width: 1200px;
  --header-height: 82px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.12);

  --transition: 0.3s ease;

  /* Islamic geometric pattern (low-opacity overlay) */
  --pattern-bg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'><path fill='none' stroke='%231A5D3A' stroke-width='1' d='M40 0 L48 16 L64 16 L52 28 L56 44 L40 36 L24 44 L28 28 L16 16 L32 16 Z'/><circle cx='40' cy='40' r='2' fill='%23C5A059'/></svg>");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-white);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 5rem 0; position: relative; }
.section-alt { background: var(--color-off-white); }
.section-dark { background: var(--color-primary); color: var(--color-white); }

.section-header { text-align: center; max-width: 720px; margin: 0 auto 3.5rem; }
.section-eyebrow {
  display: inline-block;
  color: var(--color-secondary-dark);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.section-dark .section-title { color: var(--color-white); }
.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.9;
}
.section-dark .section-subtitle { color: rgba(255, 255, 255, 0.85); }

/* Ornamental divider */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin: 1.25rem auto 1.5rem; max-width: 240px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to left, transparent, var(--color-secondary), transparent);
}
.divider svg { flex-shrink: 0; }

/* ---------- Typography helpers ---------- */
h1, h2, h3, h4 { line-height: 1.35; color: var(--color-text); }
h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.4rem; font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 700; }
p { margin-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(26, 93, 58, 0.25);
}
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 12px 28px rgba(26, 93, 58, 0.35); }
.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.28);
}
.btn-secondary:hover { background: var(--color-secondary-dark); box-shadow: 0 12px 28px rgba(197, 160, 89, 0.4); }
.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn-outline:hover { background: var(--color-white); color: var(--color-primary); }
.btn-outline-dark {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-dark:hover { background: var(--color-primary); color: var(--color-white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  height: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex-shrink: 1;
  margin-inline-end: auto; /* pushes nav + lang-switch + toggle to the far edge (RTL & LTR) */
}
.brand img {
  height: 56px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.brand-name-ar {
  font-weight: 900;
  color: var(--color-primary);
  font-size: 1.1rem;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.brand-name-en {
  font-weight: 600;
  color: var(--color-secondary-dark);
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav > ul { display: flex; gap: 0.5rem; align-items: center; }
.main-nav a.nav-link {
  padding: 0.5rem 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  position: relative;
}
.main-nav a.nav-link:hover { color: var(--color-primary); }
.main-nav a.nav-link.active { color: var(--color-primary); font-weight: 700; }
.main-nav a.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 25%;
  width: 50%;
  height: 3px;
  background: var(--color-secondary);
  border-radius: 3px;
}
.nav-cta { padding: 0.65rem 1.4rem; font-size: 0.95rem; }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: transform var(--transition), opacity var(--transition);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-dark-overlay), rgba(15, 40, 25, 0.85)), url('../../hero.jpeg') center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 120px;
  opacity: 0.08;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 4rem 0;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(197, 160, 89, 0.15);
  color: var(--color-secondary);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(197, 160, 89, 0.4);
}
.hero h1 { color: var(--color-white); margin-bottom: 1.25rem; }
.hero h1 span { color: var(--color-secondary); }
.hero p.lead {
  font-size: 1.15rem;
  line-height: 2;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: 640px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Scroll-down indicator */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  z-index: 2;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

/* ---------- Page header (interior pages) ---------- */
.page-header {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  text-align: center;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 100px;
  opacity: 0.07;
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.page-header .breadcrumbs {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}
.page-header .breadcrumbs a { color: var(--color-secondary); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}
.card-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  transition: background var(--transition), color var(--transition);
}
.card:hover .card-icon { background: var(--color-primary); color: var(--color-white); }
.card-icon svg { width: 32px; height: 32px; }
.card h3 { margin-bottom: 0.75rem; color: var(--color-primary); }
.card p { color: var(--color-text-muted); font-size: 0.98rem; margin-bottom: 0; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 1.75rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- About brief (home) ---------- */
.about-brief {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-brief-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: var(--shadow-lg);
}
.about-brief-media img { width: 100%; height: 100%; object-fit: cover; }
.about-brief-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26, 93, 58, 0.4), transparent 60%);
}
.about-brief-content h2 { color: var(--color-primary); margin-bottom: 1rem; }
.about-brief-content .lead { font-size: 1.1rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }
.about-brief-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-secondary-light);
  color: var(--color-secondary-dark);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* ---------- Counters ---------- */
.counters {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.counters::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 100px;
  opacity: 0.08;
}
.counters .container { position: relative; z-index: 2; }
.counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.counter-item .counter {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 900;
  color: var(--color-secondary);
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}
.counter-item .counter-label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 1rem;
}
.counter-item .counter-plus::after { content: '+'; margin-right: 4px; }

/* ---------- Project cards (home + projects page) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}
.project-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.project-card-visual {
  height: 190px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-card-visual::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 90px;
  opacity: 0.14;
}
.project-card-visual svg {
  width: 72px; height: 72px;
  color: var(--color-secondary);
  position: relative; z-index: 2;
}
.project-card-body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.project-card-body h3 { color: var(--color-primary); margin-bottom: 0.75rem; }
.project-card-body p { color: var(--color-text-muted); flex: 1; margin-bottom: 1.25rem; }
.project-card-body .btn { align-self: flex-start; }

/* ---------- Project detail (projects.html) ---------- */
.project-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--color-border);
}
.project-detail:last-child { border-bottom: none; }
.project-detail.reverse { direction: ltr; }
.project-detail.reverse > * { direction: rtl; }

.project-detail-visual {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.project-detail-visual::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 110px;
  opacity: 0.14;
}
.project-detail-visual svg {
  width: 120px; height: 120px;
  color: var(--color-secondary);
  position: relative; z-index: 2;
}
.project-detail-content .project-tag {
  display: inline-block;
  background: var(--color-secondary-light);
  color: var(--color-secondary-dark);
  padding: 0.35rem 0.95rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.project-detail-content h2 { color: var(--color-primary); margin-bottom: 1rem; }
.project-detail-content .project-highlights {
  display: flex; flex-wrap: wrap;
  gap: 1rem; margin: 1.5rem 0;
}
.project-detail-content .highlight {
  background: var(--color-off-white);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-primary-dark);
  border-right: 3px solid var(--color-secondary);
}

/* ---------- Quote block ---------- */
.quote-block {
  background: var(--color-primary-light);
  border-right: 5px solid var(--color-secondary);
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  position: relative;
}
.quote-block::before {
  content: '❝';
  position: absolute;
  top: -8px;
  right: 1rem;
  font-size: 2.5rem;
  color: var(--color-secondary);
  line-height: 1;
  font-family: Georgia, serif;
}
.quote-block cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-weight: 700;
  color: var(--color-secondary-dark);
  font-size: 0.9rem;
}

/* ---------- About page: vision/mission ---------- */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}
.vm-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  border-top: 4px solid var(--color-secondary);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.vm-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.vm-card .vm-icon {
  width: 60px; height: 60px;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}
.vm-card h3 { color: var(--color-primary); margin-bottom: 0.75rem; font-size: 1.5rem; }
.vm-card p { color: var(--color-text-muted); line-height: 2; }

/* Goals list */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.goal-item {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--color-off-white);
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-md);
  transition: transform var(--transition), background var(--transition);
}
.goal-item:hover { transform: translateY(-3px); background: var(--color-primary-light); }
.goal-item .goal-number {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.goal-item p { margin: 0; color: var(--color-text); line-height: 1.7; }

/* Facilities layout */
.facilities-wrap {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}
.facilities-summary {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  position: sticky;
  top: calc(var(--header-height) + 20px);
  overflow: hidden;
}
.facilities-summary::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 90px;
  opacity: 0.1;
}
.facilities-summary > * { position: relative; z-index: 2; }
.facilities-summary .big-number {
  font-size: 4rem;
  font-weight: 900;
  color: var(--color-secondary);
  line-height: 1;
  display: block;
}
.facilities-summary p { color: rgba(255, 255, 255, 0.9); margin-top: 0.75rem; }
.facilities-list { display: grid; gap: 1.25rem; }
.facility-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.facility-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.facility-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.facility-badge {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-secondary);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.facility-header h3 { color: var(--color-primary); margin: 0; }
.facility-card ul {
  display: grid; gap: 0.4rem;
}
.facility-card ul li {
  padding-right: 1.25rem;
  position: relative;
  color: var(--color-text-muted);
}
.facility-card ul li::before {
  content: '';
  position: absolute;
  right: 0; top: 0.75em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-secondary);
}

/* ---------- Timeline (future page) ---------- */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  right: 50%;
  transform: translateX(50%);
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary-light));
}
.timeline-item {
  position: relative;
  width: 50%;
  padding: 1.5rem 2.5rem;
}
.timeline-item:nth-child(odd) {
  margin-right: 50%;
  text-align: left;
  padding-left: 2.5rem;
  padding-right: 0;
}
.timeline-item:nth-child(even) {
  margin-right: 0;
  margin-left: 50%;
  text-align: right;
  padding-right: 2.5rem;
  padding-left: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 2rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: 4px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-primary);
  z-index: 2;
}
.timeline-item:nth-child(odd)::before { right: -9px; }
.timeline-item:nth-child(even)::before { left: -9px; }
.timeline-content {
  background: var(--color-white);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.timeline-content:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.timeline-content .timeline-tag {
  display: inline-block;
  background: var(--color-secondary-light);
  color: var(--color-secondary-dark);
  padding: 0.25rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.timeline-content h3 { color: var(--color-primary); margin-bottom: 0.5rem; }
.timeline-content p { color: var(--color-text-muted); margin: 0; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
}
.cta-banner::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 100px;
  opacity: 0.1;
}
.cta-banner > * { position: relative; z-index: 2; }
.cta-banner h2 { color: var(--color-white); margin-bottom: 1rem; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}
.contact-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}
.contact-card .contact-icon {
  width: 60px; height: 60px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  transition: background var(--transition), color var(--transition);
}
.contact-card:hover .contact-icon { background: var(--color-primary); color: var(--color-white); }
.contact-card h4 { color: var(--color-primary); margin-bottom: 0.5rem; }
.contact-card p, .contact-card a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
  direction: ltr;
  display: inline-block;
}
.contact-card p.ar-text, .contact-card a.ar-text { direction: rtl; }

.contact-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-form-wrap {
  background: var(--color-white);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.contact-form-wrap h3 { color: var(--color-primary); margin-bottom: 0.5rem; }
.contact-form-wrap p { color: var(--color-text-muted); margin-bottom: 1.5rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--color-text);
  font-size: 0.95rem;
}
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-row textarea { resize: vertical; min-height: 130px; }
.form-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  display: none;
  font-weight: 500;
}
.form-message.success { background: var(--color-primary-light); color: var(--color-primary-dark); display: block; }
.form-message.error { background: #fdecec; color: #9b2323; display: block; }

.map-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  height: 100%;
  min-height: 460px;
  box-shadow: var(--shadow-sm);
}
.map-wrap iframe { width: 100%; height: 100%; min-height: 460px; border: 0; display: block; }

.social-strip {
  display: flex; justify-content: center; gap: 1rem;
  margin-top: 2rem;
}
.social-strip a {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  transition: background var(--transition), transform var(--transition);
}
.social-strip a:hover { background: var(--color-secondary); transform: translateY(-3px); }
.social-strip svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 4rem 0 0;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern-bg);
  background-size: 100px;
  opacity: 0.05;
}
.site-footer .container { position: relative; z-index: 2; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-col h4 {
  color: var(--color-white);
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
  position: relative;
  padding-bottom: 0.6rem;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  right: 0; bottom: 0;
  width: 40px; height: 3px;
  background: var(--color-secondary);
  border-radius: 3px;
}
.footer-brand {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
}
.footer-brand img {
  height: 60px; width: auto;
  background: var(--color-white);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.footer-brand-text {
  font-weight: 900;
  color: var(--color-white);
  font-size: 1.05rem;
  line-height: 1.2;
}
.footer-col p { color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; }
.footer-col ul { display: grid; gap: 0.6rem; }
.footer-col ul a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition), padding var(--transition);
  display: inline-block;
}
.footer-col ul a:hover { color: var(--color-secondary); padding-right: 4px; }
.footer-contact li {
  display: flex; gap: 0.75rem; align-items: flex-start;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.footer-contact li svg { flex-shrink: 0; margin-top: 4px; color: var(--color-secondary); }
.footer-contact li span, .footer-contact li a {
  direction: ltr; text-align: left; display: inline-block;
}
.footer-contact li.ar-text span, .footer-contact li.ar-text {
  direction: rtl; text-align: right;
}
.footer-social {
  display: flex; gap: 0.6rem;
  margin-top: 1rem;
}
.footer-social a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: background var(--transition), transform var(--transition);
}
.footer-social a:hover { background: var(--color-secondary); transform: translateY(-3px); }
.footer-social svg { width: 18px; height: 18px; color: var(--color-white); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}
.footer-bottom a { color: var(--color-secondary); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-brief { grid-template-columns: 1fr; gap: 2.5rem; }
  .facilities-wrap { grid-template-columns: 1fr; }
  .facilities-summary { position: static; }
  .contact-main { grid-template-columns: 1fr; }
  .project-detail { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .menu-toggle { display: flex; }
  .header-inner { gap: 0.5rem; }
  .brand { gap: 0.6rem; }
  .brand img { height: 46px; }
  .brand-name-ar { font-size: 0.95rem; }
  .brand-name-en { font-size: 0.58rem; letter-spacing: 0.5px; margin-top: 2px; }
  .main-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform var(--transition);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    border-top: 1px solid var(--color-border);
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a.nav-link {
    display: block;
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }
  .main-nav a.nav-link.active::after { display: none; }
  .nav-cta { margin-top: 1rem; text-align: center; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1rem; }
  .vm-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .cta-actions { flex-direction: column; align-items: stretch; }

  /* Timeline collapses to single column */
  .timeline::before { right: 12px; transform: none; }
  .timeline-item {
    width: 100%;
    padding-right: 40px !important;
    padding-left: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    text-align: right !important;
  }
  .timeline-item::before { right: 4px !important; left: auto !important; }
}

@media (max-width: 400px) {
  .brand img { height: 42px; }
  .brand-name-ar { font-size: 0.85rem; letter-spacing: -0.3px; }
  .brand-name-en { display: none; }
}

/* =========================================================
   PHASE C — «Impact Blueprint» visual layer (2026-07-28)
   Additive only: deeper brand green on dark bands, a faint
   architectural blueprint grid on light sections, warm cream,
   and corner-bracket frames (echoing the brochure's boxes).
   Nothing above is restructured; these rules layer on top.
   ========================================================= */
:root {
  --color-primary-deep: #0F3D28;   /* deeper forest green from the brochure */
  --color-tan: #C9A867;
  --color-tan-soft: #E7DCC4;
  --color-cream: #F5F2EA;          /* warm cream for alternating sections */
  /* Fine architectural blueprint grid — dark-green hairlines, for light bands */
  --blueprint-bg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='34' height='34'><path d='M34 0H0V34' fill='none' stroke='%230F3D28' stroke-width='0.6'/></svg>");
}

/* Richer, deeper green on the dark gradient bands (brochure depth) */
.page-header,
.counters,
.cta-banner,
.project-card-visual,
.project-detail-visual {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
}
.facilities-summary { background: linear-gradient(150deg, var(--color-primary), var(--color-primary-deep)); }

/* Warm cream on alternating light sections + faint blueprint grid texture */
.section-alt { background: var(--color-cream); position: relative; }
.section-alt::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--blueprint-bg);
  background-size: 34px 34px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
.section-alt > .container { position: relative; z-index: 1; }

/* Corner-bracket frame utility (echoes the brochure's bracketed boxes) */
.frame { position: relative; }
.frame::before, .frame::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  border: 2px solid var(--color-secondary);
  pointer-events: none;
  opacity: 0.85;
}
.frame::before { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.frame::after  { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }

/* Signature bracket accents on the vision/mission cards */
.vm-card { position: relative; overflow: hidden; }
.vm-card::before, .vm-card::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid var(--color-secondary);
  pointer-events: none;
  opacity: 0.7;
}
.vm-card::before { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.vm-card::after  { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }

/* Warm the gold accents used on highlights/tags toward the brochure tan */
.project-detail-content .highlight { border-right-color: var(--color-tan); }

/* =========================================================
   PHASE D — infographics (2026-07-28)
   3-domains (Venn) + integrated-system matrix. Responsive,
   RTL, collapse to stacked cards on mobile.
   ========================================================= */

/* --- 3 domains (Venn) --- */
.domains-venn {
  position: relative;
  width: 100%;
  max-width: 470px;
  height: 370px;
  margin: 2.5rem auto 2rem;
}
.venn-circle {
  position: absolute;
  width: 205px; height: 205px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: var(--color-white);
  font-weight: 800;
  font-size: 1.15rem;
  padding: 1rem;
  background: rgba(26, 93, 58, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.venn-circle:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.venn-circle:nth-child(2) { bottom: 0; right: 7%; }
.venn-circle:nth-child(3) { bottom: 0; left: 7%; }
.domains-desc {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto;
}
.domain-desc-item { text-align: center; padding: 0.5rem 1rem; }
.domain-desc-item h4 { color: var(--color-primary); margin-bottom: 0.4rem; }
.domain-desc-item p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* --- Integrated-system matrix --- */
.sys-matrix-wrap { max-width: 1000px; margin: 2.5rem auto 0; overflow-x: auto; }
.sys-matrix {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.98rem;
}
.sys-matrix thead th {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  color: var(--color-white);
  font-weight: 700;
  padding: 1rem 1.1rem;
  text-align: right;
}
.sys-matrix tbody th.proj {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 800;
  padding: 1rem 1.1rem;
  text-align: right;
  white-space: nowrap;
}
.sys-matrix td {
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  vertical-align: top;
  line-height: 1.7;
}
.sys-matrix tbody tr:nth-child(even) td { background: var(--color-cream); }

@media (max-width: 768px) {
  .sys-matrix, .sys-matrix thead, .sys-matrix tbody,
  .sys-matrix tr, .sys-matrix th, .sys-matrix td { display: block; }
  .sys-matrix thead { display: none; }
  .sys-matrix { box-shadow: none; background: transparent; }
  .sys-matrix tbody tr {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
  }
  .sys-matrix tbody th.proj {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
    color: var(--color-white);
    white-space: normal;
  }
  .sys-matrix td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: transparent !important;
  }
  .sys-matrix td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .domains-venn {
    height: auto; max-width: 340px;
    display: flex; flex-direction: column; gap: 0.75rem;
  }
  .venn-circle {
    position: static; transform: none;
    width: 100%; height: auto; min-height: 76px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    font-size: 1.05rem;
  }
  .domains-desc { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* =========================================================
   PHASE E — accessibility (2026-07-28)
   Keyboard focus ring, skip link, reduced-motion.
   ========================================================= */
:where(a, button, .btn, input, textarea, select, .nav-link, .menu-toggle):focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  right: 12px;
  top: -60px;
  z-index: 1000;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }
[id="main"]:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   PHASE F — bilingual (AR/EN) support (2026-07-30)
   Anti-FOUC hide, the language switcher, and LTR overrides.
   ========================================================= */

/* Anti-FOUC: the inline <head> script adds .i18n-loading to <html>;
   i18n.js removes it once content is bound (or after a 2s safety, or on no-JS it's never added). */
html.i18n-loading body { visibility: hidden; }

/* Language switch — segmented AR/EN pill in the header */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  background: var(--color-white);
  flex-shrink: 0;
}
.lang-switch .lang-switch-icon { color: var(--color-text-muted); margin: 0 4px; flex-shrink: 0; }
.lang-switch .lang-opt {
  padding: 0.32rem 0.62rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 50px;
  transition: background var(--transition), color var(--transition);
  min-width: 30px;
}
.lang-switch .lang-opt.active { background: var(--color-primary); color: var(--color-white); }
.lang-switch .lang-opt:not(.active):hover { color: var(--color-primary); }

@media (max-width: 400px) {
  .lang-switch .lang-switch-icon { display: none; }
  .lang-switch .lang-opt { padding: 0.3rem 0.5rem; font-size: 0.78rem; min-width: 26px; }
}

/* ---- LTR (English) overrides: flip the RTL-physical accents ---- */
[dir="ltr"] body { direction: ltr; text-align: left; }
/* Neutralize RTL-only direction hacks so English flows LTR */
[dir="ltr"] .project-detail.reverse,
[dir="ltr"] .project-detail.reverse > * { direction: ltr; }
[dir="ltr"] .contact-card p.ar-text,
[dir="ltr"] .contact-card a.ar-text { direction: ltr; }
[dir="ltr"] .brand-name-en { text-align: left; }
[dir="ltr"] .skip-link { right: auto; left: 12px; }
[dir="ltr"] .quote-block { border-right: 0; border-left: 5px solid var(--color-secondary); }
[dir="ltr"] .quote-block::before { right: auto; left: 1rem; }
[dir="ltr"] .project-detail-content .highlight { border-right: 0; border-left: 3px solid var(--color-tan); }
[dir="ltr"] .footer-col h4::after { right: auto; left: 0; }
[dir="ltr"] .facility-card ul li { padding-right: 0; padding-left: 1.25rem; }
[dir="ltr"] .facility-card ul li::before { right: auto; left: 0; }
[dir="ltr"] .footer-col ul a:hover { padding-right: 0; padding-left: 4px; }
[dir="ltr"] .sys-matrix thead th,
[dir="ltr"] .sys-matrix tbody th.proj { text-align: left; }
[dir="ltr"] .counter-item .counter-plus::after { margin-right: 0; margin-left: 4px; }
