:root {
  /* -- PALETTE: "Modern Heritage" -- */
  /* Backgrounds: Warm Paper tones */
  --bg: #fdfbf7;       /* Off-white paper */
  --bg-alt: #f3efe9;   /* Slightly darker beige for sections */
  --card-bg: #ffffff;
  
  /* Text: Ink tones */
  --text-main: #2d333a; /* Soft Charcoal (easier to read than black) */
  --text-muted: #64748b;
  
  /* Branding */
  --brand: #1e3a8a;    /* Deep Islamic Blue / Navy (Trust & Wisdom) */
  --accent: #c05621;   /* Burnt Orange / Clay (Art & Warmth) */
  --gold: #d69e2e;     /* Subtle Gold for borders/highlights */

  /* UI Elements */
  --line: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px -10px rgba(30, 58, 138, 0.15); /* Blue-tinted shadow */
  --radius: 12px;
  --max: 1000px; /* Slightly tighter reading container */
  
  /* Fonts */
  --font-body: 'Inter', 'IBM Plex Sans Arabic', sans-serif;
  --font-head: 'Playfair Display', 'IBM Plex Sans Arabic', serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  /* Subtle grain texture overlay for "paper" feel */
  background-image: linear-gradient(var(--bg), var(--bg)); 
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  color: #1a202c;
  line-height: 1.2;
}

p { margin-bottom: 1.5rem; }

a { color: var(--brand); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent); }

/* --- Structure --- */
.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 20px; top: 20px; width: auto; height: auto;
  background: var(--brand); color: #fff; padding: 15px 20px; 
  z-index: 9999; border-radius: 8px;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(253, 251, 247, 0.95); /* Matches bg color */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-head);
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 15px; color: #1a202c; letter-spacing: -0.01em; }
.brand-tagline { font-size: 12px; color: var(--text-muted); }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
}
.nav-links a:hover { color: var(--brand); }
.nav-links a.pill {
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--brand);
}
.nav-links a.pill:hover { border-color: var(--brand); background: #ebf8ff; }

/* Mobile Menu Button */
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  color: var(--text-main);
}

/* --- Hero Section --- */
.hero {
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 100% 0%, #fef3c7 0%, transparent 25%),
              radial-gradient(circle at 0% 100%, #e0f2fe 0%, transparent 25%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  color: var(--brand);
  margin-bottom: 24px;
}
.hero .lead {
  font-size: 19px;
  color: #4a5568;
  font-weight: 400;
  max-width: 540px;
}

.cta-row { display: flex; gap: 12px; margin: 30px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}
.btn-primary:hover { background-color: #1e40af; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-main);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }

.trust-row { display: flex; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.trust-item div:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.trust-item div:last-child { font-weight: 700; color: var(--brand); margin-top: 4px; }

/* Hero Card (The "What we're building" box) */
.hero-card {
  background: #fff;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content:""; position:absolute; top:0; left:0; width:100%; height:4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.hero-card h2 { font-size: 20px; margin-top: 0; }
.checklist { list-style: none; padding: 0; margin: 20px 0; }
.checklist li {
  padding-left: 24px; margin-bottom: 12px; position: relative;
  color: #4a5568;
}
.checklist li::before {
  content: "•"; color: var(--accent); font-weight: bold;
  position: absolute; left: 0; top: 0;
}

/* --- Badge --- */
.badge {
  display: inline-block;
  font-size: 13px;
  padding: 8px 12px;
  background: #ebf8ff;
  color: #2c5282;
  border-radius: 6px;
  margin-top: 20px;
}
.badge-soft { background: #fffaf0; color: #9c4221; }

/* --- General Sections --- */
.section { padding: 80px 0; }
.section.alt { background-color: var(--bg-alt); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* Standard Card */
.card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card h3 { color: var(--brand); margin-top: 0; font-size: 18px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill-item {
  background: var(--bg-alt);
  padding: 6px 12px; border-radius: 100px;
  font-size: 12px; color: #4a5568;
  border: 1px solid transparent;
}
.note {
  margin-top: 20px; padding: 16px;
  background: #fffaf0; border-left: 3px solid var(--gold);
  border-radius: 4px; font-size: 14px; color: #744210;
}

/* Big Text (Mission) */
.big { font-size: 20px; font-family: var(--font-head); color: #2d3748; }

/* Programs Grid */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.cards-3 .card { transition: transform 0.2s; }
.cards-3 .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* Callout Box */
.callout {
  margin-top: 40px;
  background: linear-gradient(135deg, #1e3a8a, #2c5282);
  color: #fff;
  padding: 30px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
}
.callout strong { font-size: 18px; display: block; }
.callout .muted { color: #bfdbfe; font-size: 14px; }
.callout .btn-ghost { border-color: #fff; color: #fff; }
.callout .btn-ghost:hover { background: #fff; color: var(--brand); }

/* --- Form --- */
.form { display: flex; flex-direction: column; gap: 16px; }
input {
  width: 100%; padding: 12px; border: 1px solid #cbd5e0;
  border-radius: 6px; font-family: inherit;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,58,138,0.1); }

/* --- Contact & Footer --- */
.contact-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 20px; }
.contact-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-item:last-child { border: 0; }
.contact-label { color: var(--text-muted); font-size: 13px; }
.contact-value { font-weight: 600; color: var(--brand); }

.footer {
  background: #1a202c; color: #a0aec0;
  padding: 40px 0; font-size: 14px;
}
.footer-title { color: #fff; font-weight: 700; margin-bottom: 4px; }
.footer-right a { color: #a0aec0; }

/* --- Mobile --- */
@media (max-width: 768px) {
  .hero-inner, .grid-2, .cards-3, .callout { grid-template-columns: 1fr; display: grid; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 20px;
    border-bottom: 1px solid var(--line); align-items: flex-start;
  }
  .nav-links.is-open { display: flex; }
  .header-inner { flex-wrap: wrap; }
}


/* Clickable cards */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link:hover,
.card-link:focus {
  transform: translateY(-1px);
}



/* === Blog / Posts === */
.blog-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:18px;
}
.post-card{
  grid-column: span 6;
  overflow:hidden;
  padding:0;
}
.post-card .post-body{
  padding:20px;
}
.post-card .post-title{
  margin:0 0 8px;
  font-size:1.35rem;
  line-height:1.25;
}
.post-card .post-title a{
  color:inherit;
  text-decoration:none;
}
.post-card .post-title a:hover{ text-decoration:underline; }

.post-thumb{
  display:block;
  aspect-ratio: 16 / 9;
  overflow:hidden;
  background: var(--bg-alt);
}
.post-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform:scale(1.001);
}
.post-excerpt p{ margin-top:0; }
.post-actions{ margin-top:14px; }

@media (max-width: 900px){
  .post-card{ grid-column: span 12; }
}

/* Featured image on single post */
.single-card{
  padding:0;
  overflow:hidden;
}
.post-hero{
  margin:0;
  aspect-ratio: 21 / 9;
  background: var(--bg-alt);
}
.post-hero img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
@media (max-width: 900px){
  .post-hero{ aspect-ratio: 16 / 9; }
}
.single-header{
  padding:22px 22px 0;
}
.single-title{
  margin:0 0 10px;
  font-size:2.0rem;
  line-height:1.15;
}
.single-content{
  padding:0 22px 22px;
}
.single-card .divider{
  margin-left:22px;
  margin-right:22px;
}
