/* =========================================================
   Nirala Mosque & Madrasa — design system
   Serene, dignified, mobile-first
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --c-primary: #0F5132;        /* Mosque fund / brand */
  --c-primary-dark: #0a3d25;
  --c-primary-soft: #e6eee9;
  --c-secondary: #155E63;      /* Madrasa fund */
  --c-secondary-soft: #e3edee;
  --c-gold: #C9A961;           /* Scholarship fund */
  --c-gold-soft: #f6efd9;
  --c-bg: #FAF8F3;
  --c-surface: #ffffff;
  --c-text: #1F2937;
  --c-muted: #6B7280;
  --c-line: #E6E2D6;
  --c-success: #2F855A;
  --c-error: #C53030;
  --c-warning: #D69E2E;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 81, 50, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 81, 50, 0.08);
  --shadow-lg: 0 14px 34px rgba(15, 81, 50, 0.10);

  --container: 1200px;
  --gutter: 1.25rem;

  --font-bn: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --transition: 180ms ease;
}

html[lang="bn"] body { font-family: var(--font-bn); line-height: 1.7; }
html[lang="en"] body { font-family: var(--font-en); line-height: 1.6; }

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--c-primary-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  margin: 0 0 0.5em;
  color: var(--c-text);
  font-weight: 600;
  line-height: 1.3;
}
html[lang="bn"] h1, html[lang="bn"] h2, html[lang="bn"] h3 { font-weight: 600; }

p { margin: 0 0 1em; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 3rem 0;
}
.section--tight { padding: 2rem 0; }

.section-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.6rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3rem;
  height: 3px;
  background: var(--c-primary);
  border-radius: 2px;
}
.section-title--center { text-align: center; }
.section-title--center::after { left: 50%; transform: translateX(-50%); }

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- Header / nav (two-row, dark-nav design) ---------- */

/* Skip-to-content for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--c-primary-dark);
  color: white;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { top: 8px; color: white; text-decoration: none; }

.site-header {
  background: var(--c-surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Row 1 — brand + utility */
.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--c-primary-dark);
  font-weight: 600;
  line-height: 1.15;
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand__logo { transform: rotate(-4deg); }
.brand__logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -4px rgba(15,81,50,0.4);
  transition: transform var(--transition);
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name {
  font-size: 1.02rem;
  max-width: 360px;
  display: block;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__sub {
  font-size: 0.74rem;
  color: var(--c-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  display: block;
  margin-top: 3px;
}

/* Row 1 actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--c-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.55rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.header-link:hover {
  color: var(--c-primary-dark);
  text-decoration: none;
  background: var(--c-primary-soft);
}
.header-link svg { flex-shrink: 0; opacity: 0.75; }
.header-link:hover svg { opacity: 1; }

.header-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-gold), #b08f47);
  color: white;
  display: grid; place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--c-line);
  margin: 0 0.25rem;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--c-line);
  border-radius: 100px;
  overflow: hidden;
  background: var(--c-bg);
  padding: 2px;
  gap: 2px;
}
.lang-toggle a {
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-muted);
  border-radius: 100px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.lang-toggle a:hover { color: var(--c-primary-dark); text-decoration: none; }
.lang-toggle a.is-active {
  background: var(--c-primary);
  color: white;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px -3px rgba(201,169,97,0.5);
}
.header-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -3px rgba(201,169,97,0.55); }

/* Hamburger button — animated lines */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  width: 38px;
  height: 38px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  transition: background var(--transition);
}
.nav-toggle:hover { background: var(--c-primary-soft); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-primary-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.main-nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.main-nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.main-nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Row 2 — DARK premium nav */
.site-header__nav {
  background: linear-gradient(180deg, var(--c-primary-dark), #061d12);
  position: relative;
}
.site-header__nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(201,169,97,0.07) 0%, transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(21,94,99,0.12) 0%, transparent 40%);
  pointer-events: none;
}
.site-header__nav > .container {
  display: flex;
  align-items: stretch;
  min-height: 56px;
  position: relative;
  z-index: 1;
}
.main-nav__list {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: 0;
  align-items: stretch;
  flex-wrap: wrap;
  width: 100%;
}
.main-nav__list li { display: flex; position: relative; }
.main-nav__list a {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.82);
  padding: 0.7rem 1.1rem;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}
/* Animated gold underline that slides in from the left */
.main-nav__list a::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 6px;
  height: 2px;
  background: var(--c-gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition);
}
.main-nav__list a:hover {
  color: white;
  text-decoration: none;
  background: transparent;
}
.main-nav__list a:hover::after { transform: scaleX(1); }
.main-nav__list a.is-active {
  color: white;
  font-weight: 600;
}
.main-nav__list a.is-active::after {
  transform: scaleX(1);
}

/* ----- Submenu (dropdown) ----- */
.has-submenu { position: relative; }
.submenu-caret {
  font-size: 0.7em;
  margin-inline-start: 0.3rem;
  opacity: 0.7;
  transition: transform var(--transition);
}
.has-submenu:hover > a .submenu-caret,
.has-submenu:focus-within > a .submenu-caret { transform: rotate(180deg); }

.submenu {
  position: absolute;
  top: 100%;            /* touches the trigger — no hover-gap */
  inset-inline-start: 0;
  min-width: 220px;
  max-width: 280px;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  background: linear-gradient(180deg, var(--c-primary-dark), #061d12);
  border-radius: var(--r-md);
  box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility 0s linear var(--transition);
  z-index: 60;
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s, 0s, 0s;
}
.submenu li { display: block; width: 100%; position: relative; }
.submenu a {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.82) !important;
  margin: 0 !important;
  white-space: nowrap;
  border-bottom: 0 !important;
  position: relative;
}
.submenu a::after { display: none !important; }
.submenu a:hover {
  background: rgba(255,255,255,0.06) !important;
  color: white !important;
}
.submenu a.is-active {
  background: rgba(201,169,97,0.18) !important;
  color: white !important;
}
.submenu a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--c-gold);
}

/* Nested (2nd-level) submenu — flies out to the side, hover-bridge included */
.submenu .has-submenu--nested > a {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-inline-end: 0.85rem !important;
}
.submenu .has-submenu--nested:hover > a,
.submenu .has-submenu--nested:focus-within > a {
  background: rgba(255,255,255,0.08) !important;
  color: white !important;
}
.submenu-caret--side {
  font-size: 1.1em;
  opacity: 0.55;
  transition: transform var(--transition), opacity var(--transition);
  line-height: 1;
}
.submenu .has-submenu--nested:hover .submenu-caret--side,
.submenu .has-submenu--nested:focus-within .submenu-caret--side {
  transform: translateX(3px);
  opacity: 1;
}
/* Horizontal hover bridge between the row and the nested menu */
.submenu .has-submenu--nested > a::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 100%;
  width: 12px;
  height: 100%;
  pointer-events: auto;
}
.submenu--nested {
  top: -0.4rem;          /* align with the top padding of the parent submenu row */
  inset-inline-start: 100%;
  margin-inline-start: 0; /* the ::after on the row provides the hover bridge */
  border-radius: var(--r-md);
  box-shadow: 0 14px 32px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.05);
}
/* Flip the nested submenu to the LEFT side when the parent is near the right edge.
   The .submenu--flip-left class is added by JS when there isn't room on the right. */
.submenu--nested.submenu--flip-left {
  inset-inline-start: auto;
  inset-inline-end: 100%;
  margin-inline-start: 0;
  margin-inline-end: 0;
}
/* When flipping left, the bridge needs to live on the OTHER side of the row */
.submenu .has-submenu--nested:has(> .submenu--flip-left) > a::after {
  inset-inline-start: auto;
  inset-inline-end: 100%;
}

/* Tablet — hide phone label, keep icon; hide portal label */
@media (max-width: 1100px) {
  .header-link__text { display: none; }
  .header-link { padding: 0.5rem; }
}
@media (max-width: 900px) {
  .header-divider { display: none; }
  .header-link--phone { display: none; }
}

/* Mobile — collapse nav into a togglable panel */
@media (max-width: 768px) {
  .site-header__nav {
    background: var(--c-surface);
  }
  .site-header__nav::before { display: none; }
  .site-header__nav > .container {
    padding: 0 var(--gutter);
    min-height: 0;            /* collapse when the hamburger menu is closed */
  }
  .nav-toggle { display: inline-flex; }
  .main-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0 1rem;
    border-top: 1px solid var(--c-line);
    display: none;
  }
  .main-nav.is-open .main-nav__list { display: flex; }
  .main-nav__list a {
    color: var(--c-text);
    padding: 0.85rem 0;
    border-bottom: 1px solid transparent;
  }
  .main-nav__list a::after { display: none; }
  .main-nav__list a:hover { color: var(--c-primary-dark); }
  .main-nav__list a.is-active {
    color: var(--c-primary-dark);
    border-bottom-color: var(--c-primary);
  }
  /* ---- Submenu on mobile: inline tree, always visible inside open hamburger ---- */
  .submenu-caret,
  .submenu-caret--side { display: none !important; }

  /* Hover bridge isn't needed on touch — and could intercept taps. */
  .submenu .has-submenu--nested > a::after { display: none !important; }

  /* First-level submenu (e.g. items under About): indented, tree-style, all visible. */
  .submenu {
    position: static;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0.1rem 0 0.4rem 1rem;
    min-width: 0;
    max-width: none;
    border-inline-start: 2px solid rgba(15,81,50,0.12);
    margin-inline-start: 0.4rem;
  }
  .submenu li { position: relative; }
  .submenu a {
    color: var(--c-text) !important;
    padding: 0.55rem 0 0.55rem 1rem !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
  }
  /* Subtle dash leading each row so the tree structure reads at a glance. */
  .submenu li > a::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: 0.65rem;
    height: 1px;
    background: rgba(15,81,50,0.25);
  }
  .submenu a:hover,
  .submenu a.is-active {
    background: transparent !important;
    color: var(--c-primary-dark) !important;
  }
  .submenu a.is-active::before {
    display: block;
    background: var(--c-primary);
    width: 0.65rem;
    height: 2px;
    left: auto;
    inset-inline-start: 0;
    top: 50%;
  }

  /* Second-level submenu: deeper indent + smaller text + dotted leader. */
  .submenu--nested {
    margin-inline-start: 0.6rem;
    padding-inline-start: 0.85rem;
    border-inline-start: 1px dashed rgba(15,81,50,0.18);
  }
  .submenu--nested a {
    color: var(--c-muted) !important;
    font-size: 0.86rem !important;
    font-weight: 400 !important;
    padding: 0.45rem 0 0.45rem 0.85rem !important;
  }
  .submenu--nested li > a::before {
    width: 0.5rem;
    background: rgba(15,81,50,0.18);
  }

  /* Parent row of a nested submenu reads as a category header. */
  .submenu .has-submenu--nested > a {
    font-weight: 600 !important;
    color: var(--c-text) !important;
    text-transform: none;
  }

  /* ---- Two-row stacked header on mobile ---- */
  .site-header__top {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem var(--gutter) 0;
    min-height: 0;
  }
  .brand {
    width: 100%;
    justify-content: center;
    gap: 0.7rem;
    padding-bottom: 0.55rem;
  }
  .brand__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
  }
  .brand__name {
    font-size: 0.98rem;
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    line-height: 1.25;
  }
  .brand__sub {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    margin-top: 2px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--c-line);
  }
  /* Bring the phone link back as an icon on its own row */
  .header-link--phone { display: inline-flex; padding: 0.45rem; }
  /* The vertical divider doesn't fit a space-between layout — keep it hidden */
  .header-divider { display: none; }
  /* Show the donor portal label on mobile — easier to discover than a bare icon */
  .header-link--portal .header-link__text {
    display: inline;
    font-size: 0.82rem;
  }
  .header-link--portal {
    padding: 0.45rem 0.6rem;
    gap: 0.3rem;
  }
  /* Match the donate button to the icon-button heights */
  .header-cta { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .nav-toggle { padding: 0.45rem; }

  .lang-toggle a { padding: 0.25rem 0.55rem; font-size: 0.78rem; }
}

/* Very narrow phones: let the action row wrap so the portal label doesn't push things off-screen */
@media (max-width: 380px) {
  .header-actions { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--c-primary);
  color: white;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { background: var(--c-primary-dark); text-decoration: none; color: white; box-shadow: var(--shadow-sm); }
.btn--small { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn--ghost {
  background: transparent;
  color: var(--c-primary-dark);
  border-color: var(--c-primary);
}
.btn--ghost:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.btn--gold { background: var(--c-gold); color: white; }
.btn--gold:hover { background: #b08f47; color: white; }
.btn--teal { background: var(--c-secondary); }
.btn--teal:hover { background: #0e4448; color: white; }
.btn--danger { background: var(--c-error); }
.btn--danger:hover { background: #9b2424; }
.btn--block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.card__meta { font-size: 0.82rem; color: var(--c-muted); }
.card__image {
  border-radius: var(--r-md);
  overflow: hidden;
  margin: -1.25rem -1.25rem 1rem;
}
.card__image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Fund-tinted cards */
.card--mosque { border-top: 4px solid var(--c-primary); }
.card--madrasa { border-top: 4px solid var(--c-secondary); }
.card--scholarship { border-top: 4px solid var(--c-gold); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="none" stroke="white" stroke-width="0.5" opacity="0.07"><path d="M40 0 L80 40 L40 80 L0 40 Z M20 40 L40 20 L60 40 L40 60 Z"/></svg>');
  background-size: 80px 80px;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}
.hero__alt {
  display: block;
  font-size: 1rem;
  opacity: 0.85;
  font-weight: 400;
  margin-bottom: 1rem;
}
.hero__tagline {
  font-size: 1.05rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero__actions .btn { background: white; color: var(--c-primary-dark); }
.hero__actions .btn:hover { background: var(--c-bg); color: var(--c-primary-dark); }
.hero__actions .btn--ghost { background: transparent; color: white; border-color: rgba(255,255,255,0.6); }
.hero__actions .btn--ghost:hover { background: rgba(255,255,255,0.1); color: white; }

@media (max-width: 600px) {
  .hero { padding: 2.5rem 0; }
  .hero h1 { font-size: 1.6rem; }
}

/* ---------- Prayer times ---------- */
.prayer-times {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.prayer-times__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--c-line);
}
.prayer-times__list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}
@media (max-width: 700px) {
  .prayer-times__list { grid-template-columns: repeat(3, 1fr); }
}
.prayer-cell {
  text-align: center;
  padding: 0.6rem 0.4rem;
  border-radius: var(--r-sm);
  background: var(--c-bg);
}
.prayer-cell.is-next { background: var(--c-primary-soft); border: 1px solid var(--c-primary); }
.prayer-cell.is-current { background: var(--c-primary); color: white; }
.prayer-cell__name { font-size: 0.85rem; color: var(--c-muted); margin-bottom: 0.2rem; }
.prayer-cell.is-current .prayer-cell__name { color: rgba(255,255,255,0.85); }
.prayer-cell__time { font-weight: 600; font-size: 1rem; }

/* ---------- Donate cards row ---------- */
.fund-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 800px) { .fund-cards { grid-template-columns: 1fr; } }
.fund-card {
  padding: 1.5rem;
  border-radius: var(--r-md);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
}
.fund-card--mosque { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); }
.fund-card--madrasa { background: linear-gradient(135deg, var(--c-secondary), #0e4448); }
.fund-card--scholarship { background: linear-gradient(135deg, var(--c-gold), #a98b46); color: #1F2937; }
.fund-card h3 { color: inherit; font-size: 1.2rem; }
.fund-card p { font-size: 0.95rem; opacity: 0.95; flex: 1; }
.fund-card .btn { background: rgba(255,255,255,0.92); color: var(--c-primary-dark); align-self: flex-start; }
.fund-card .btn:hover { background: white; color: var(--c-primary-dark); }
.fund-card--scholarship .btn { color: #4a3a1e; }

/* ---------- Tags / pills ---------- */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.78rem;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  font-weight: 600;
}
.tag--gold { background: var(--c-gold-soft); color: #7a5e23; }
.tag--teal { background: var(--c-secondary-soft); color: #0e4448; }
.tag--muted { background: #f0eee5; color: var(--c-muted); }
.tag--warning { background: #fdf5d8; color: #8a6912; }
.tag--success { background: #dff5e6; color: #226a3d; }
.tag--error { background: #fdd; color: #8a2e2e; }

/* ---------- Forms ---------- */
.form {
  background: var(--c-surface);
  padding: 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 1rem; }
.form-row label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--c-text);
}
.form-row .hint { font-size: 0.8rem; color: var(--c-muted); margin-top: 0.25rem; display: block; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  font: inherit;
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.captcha {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--c-bg);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line);
}
.captcha input { max-width: 80px; padding: 0.4rem 0.6rem; }

/* ---------- Flash messages ---------- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
  border: 1px solid;
  font-size: 0.95rem;
}
.flash--success { background: #f0fdf4; border-color: #bbf7d0; color: #1f6c3d; }
.flash--error   { background: #fef2f2; border-color: #fecaca; color: #a02a2a; }
.flash--info    { background: #f0f9ff; border-color: #bae6fd; color: #075985; }

/* ---------- Footer ---------- */
.site-footer {
  background: #1A2520;
  color: #d8d4c7;
  margin-top: auto;
  padding: 2.5rem 0 1rem;
}
.site-footer h4 { color: white; font-size: 1rem; margin-bottom: 0.75rem; }
.site-footer a { color: #d8d4c7; }
.site-footer a:hover { color: white; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0.3rem 0; font-size: 0.92rem; }
.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  padding-top: 1rem;
  opacity: 0.8;
}
.admin-link { font-size: 0.78rem; opacity: 0.55; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
}
.pagination a:hover { background: var(--c-primary-soft); text-decoration: none; }
.pagination .current { background: var(--c-primary); color: white; border-color: var(--c-primary); font-weight: 600; }

/* ---------- Misc utilities ---------- */
.text-center { text-align: center; }
.text-muted  { color: var(--c-muted); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* ---------- Page intro banner ---------- */
.page-intro {
  background: var(--c-primary-soft);
  border-bottom: 1px solid var(--c-line);
  padding: 2.5rem 0 2rem;
}
.page-intro h1 { color: var(--c-primary-dark); margin-bottom: 0.3rem; }
.page-intro p { color: var(--c-muted); max-width: 720px; margin: 0; }

/* ---------- Pattern divider ---------- */
.divider {
  height: 24px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="24" viewBox="0 0 40 24" fill="none" stroke="%230F5132" stroke-opacity="0.18" stroke-width="1"><path d="M0 12 L10 2 L20 12 L30 2 L40 12 L30 22 L20 12 L10 22 Z"/></svg>');
  background-repeat: repeat-x;
  background-position: center;
  margin: 2rem 0;
}

/* ---------- Table (admin / library list) ---------- */
.table-wrap { overflow-x: auto; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
table.data th, table.data td {
  padding: 0.7rem 0.9rem;
  text-align: start;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
table.data th { background: var(--c-bg); font-weight: 600; color: var(--c-text); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: rgba(15,81,50,0.03); }

/* ---------- Post body (rich text) ---------- */
.post-body { line-height: 1.8; }
.post-body img { border-radius: var(--r-sm); margin: 1rem 0; }
.post-body p { margin: 0 0 1em; }
.post-body h2 { font-size: 1.4rem; margin-top: 1.5em; }
.post-body h3 { font-size: 1.15rem; margin-top: 1.5em; }
.post-body blockquote {
  border-inline-start: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: var(--r-sm);
}

/* ---------- Progress bar ---------- */
.progress {
  height: 10px;
  background: var(--c-line);
  border-radius: 100px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  border-radius: 100px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--c-line);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tabs a {
  padding: 0.7rem 1.1rem;
  color: var(--c-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
  white-space: nowrap;
}
.tabs a:hover { color: var(--c-primary-dark); text-decoration: none; }
.tabs a.is-active { color: var(--c-primary-dark); border-bottom-color: var(--c-primary); font-weight: 600; }

/* ---------- People list (committee/staff) ---------- */
.person-card { text-align: center; }
.person-card img,
.person-card .avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  background: var(--c-primary-soft);
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--c-primary);
  font-weight: 600;
}
.person-card h3 { margin-bottom: 0.15rem; font-size: 1.05rem; }
.person-card .role { color: var(--c-muted); font-size: 0.88rem; }

/* ---------- Method block ---------- */
.method-block {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 1.1rem;
}
.method-block h4 { display: flex; align-items: center; gap: 0.4rem; }
.method-block pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0.4rem 0 0;
  color: var(--c-text);
}

/* =========================================================
   HOME PAGE
   ========================================================= */

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-gold);
  margin-bottom: 0.6rem;
}
.eyebrow--gold { color: var(--c-gold); }
.eyebrow--light { color: rgba(255,255,255,0.7); }

.home-section-title {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--c-text);
  font-weight: 700;
}
.home-section-title--light { color: white; }
.home-section-title--center { text-align: center; }
.home-section-sub {
  color: var(--c-muted);
  max-width: 620px;
  margin: 0 auto 0;
  text-align: center;
  font-size: 1rem;
}
.home-section-head { margin-bottom: 2rem; text-align: center; }
.home-section-head .home-section-title { margin-bottom: 0.5rem; }
.home-section-head--row {
  text-align: start;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.home-section-head--row .home-section-sub { text-align: start; margin: 0; }
.home-section-link {
  color: var(--c-primary-dark);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* ----- Hero v3 — Dark + Bismillah calligraphy ----- */
.home-hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, #0c1714 0%, #060d0a 100%);
  color: white;
  padding: clamp(5rem, 10vw, 8rem) 0;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}

/* Subtle radial color vignette for depth */
.home-hero__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(15,81,50,0.25) 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(21,94,99,0.18) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Giant Bismillah calligraphy watermark */
.home-hero__bismillah {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  line-height: 1.1;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(180deg,
    rgba(201,169,97,0.22) 0%,
    rgba(201,169,97,0.12) 45%,
    rgba(255,255,255,0.04) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  z-index: 0;
  direction: rtl;
  letter-spacing: 0.02em;
  filter: drop-shadow(0 0 40px rgba(201,169,97,0.1));
}

/* Thin gold accent line at bottom */
.home-hero__gold-line {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 1px;
  width: min(620px, 80%);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(201,169,97,0.5) 20%,
    rgba(201,169,97,0.85) 50%,
    rgba(201,169,97,0.5) 80%,
    transparent 100%);
  z-index: 1;
}

.home-hero__inner {
  position: relative;
  z-index: 2;
}
.home-hero__content {
  max-width: 760px;
  margin: 0 auto;
}

/* Gold star ornament with thin lines */
.home-hero__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--c-gold);
  margin-bottom: 1.5rem;
}
.home-hero__ornament-line {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,97,0.6));
}
.home-hero__ornament-line + svg + .home-hero__ornament-line {
  background: linear-gradient(90deg, rgba(201,169,97,0.6), transparent);
}

.home-hero__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.5rem;
}

.home-hero__title {
  margin: 0 0 1.25rem;
  color: white;
  font-weight: 700;
}
.home-hero__title-bn {
  display: block;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.home-hero__title-en {
  display: block;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  font-weight: 400;
  opacity: 0.55;
  margin-top: 0.7rem;
  font-family: var(--font-en);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-hero__tagline {
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  opacity: 0.75;
  margin: 0 auto 2rem;
  max-width: 520px;
  line-height: 1.7;
  font-weight: 300;
}

.home-hero__actions {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.home-hero__actions .btn { padding: 0.75rem 1.4rem; font-size: 0.95rem; }

.btn--ghost-light {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.35);
}
.btn--ghost-light:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  border-color: rgba(255,255,255,0.6);
}

.home-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition);
}
.home-hero__pill:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(201,169,97,0.4);
  text-decoration: none;
  color: white;
}
.home-hero__pill-dot {
  width: 7px; height: 7px;
  background: var(--c-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(201,169,97,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,169,97,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(201,169,97,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,169,97,0); }
}

@media (max-width: 600px) {
  .home-hero { padding: 4rem 0 4.5rem; }
  .home-hero__bismillah {
    white-space: normal;
    line-height: 1.4;
    font-size: clamp(1.4rem, 9vw, 2.6rem);
    padding: 0 1rem;
    width: 100%;
    text-align: center;
  }
  .home-hero__ornament-line { width: 36px; }
  .home-hero__tagline { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero__pill-dot { animation: none; }
}

/* ----- Floating prayer-times card ----- */
.home-prayer-section {
  position: relative;
  margin-top: -4rem;
  padding-bottom: 3rem;
}
.prayer-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-line);
}
.prayer-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--c-line);
}
.prayer-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-gold);
  margin-bottom: 0.25rem;
}
.prayer-card__date { font-weight: 600; color: var(--c-text); }
.prayer-card .prayer-times__list { gap: 0.6rem; }
.prayer-card .prayer-cell {
  background: var(--c-bg);
  padding: 0.85rem 0.5rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}
.prayer-card .prayer-cell.is-next {
  background: linear-gradient(135deg, #0F5132, #155E63);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.prayer-card .prayer-cell.is-next .prayer-cell__name { color: rgba(255,255,255,0.85); }
.prayer-card .prayer-cell__time { font-size: 1.05rem; }

/* ----- Stats ----- */
.home-stats {
  padding: 3rem 0;
  background: var(--c-bg);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.home-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'><g fill='none' stroke='rgba(201,169,97,0.10)' stroke-width='0.6'><rect x='20' y='20' width='40' height='40'/><rect x='20' y='20' width='40' height='40' transform='rotate(45 40 40)'/></g></svg>");
  background-size: 80px 80px;
  background-repeat: repeat;
  mask-image: linear-gradient(90deg, transparent 0%, black 30%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 30%, black 70%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
.home-stats > .container { position: relative; z-index: 1; }
.home-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.home-stat {
  padding: 1.5rem 1rem;
  background: var(--c-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  transition: transform var(--transition), box-shadow var(--transition);
}
.home-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.home-stat__icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.home-stat__value {
  font-size: clamp(2rem, 3.6vw, 2.6rem);
  font-weight: 700;
  color: var(--c-primary-dark);
  line-height: 1;
}
.home-stat__value sup { font-size: 0.6em; color: var(--c-gold); }
.home-stat__label { font-size: 0.88rem; color: var(--c-muted); margin-top: 0.4rem; }

/* ----- Verse ----- */
.home-verse {
  padding: 4rem 0;
  background:
    radial-gradient(60% 80% at 50% 0%, var(--c-primary-soft) 0%, transparent 70%),
    var(--c-bg);
}
.home-verse__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.home-verse__mark {
  display: block;
  font-size: 4rem;
  color: var(--c-gold);
  line-height: 0.6;
  font-family: serif;
  margin-bottom: 0.5rem;
}
.home-verse__arabic {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 2;
  color: var(--c-primary-dark);
  margin: 0 0 1rem;
  direction: rtl;
}
.home-verse__translation {
  font-size: 1.1rem;
  color: var(--c-text);
  font-style: italic;
  margin: 0 0 1rem;
  line-height: 1.7;
}
.home-verse__cite { color: var(--c-muted); font-size: 0.9rem; }

/* ----- About (centered single column) ----- */
.home-about { padding: 4rem 0; }
.home-about__centered {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.home-about__lead {
  color: var(--c-muted);
  font-size: 1.08rem;
  line-height: 1.8;
  margin: 0 auto 1.75rem;
  max-width: 720px;
}
.home-about__highlights {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.home-about__highlights--row {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.home-highlight {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.95rem;
  text-align: start;
}
.home-highlight__icon {
  width: 28px; height: 28px;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* ----- OUR ACTIVITIES — full-width icon-card grid ----- */
.home-activities {
  padding: 4.5rem 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(15,81,50,0.04) 0%, transparent 50%),
    radial-gradient(circle at 20% 90%, rgba(201,169,97,0.05) 0%, transparent 50%),
    var(--c-bg);
  position: relative;
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1024px) { .activities-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .activities-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .activities-grid { grid-template-columns: 1fr; } }

.activity-card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 1.5rem 1.25rem;
  text-align: start;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}
.activity-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-primary);
}
.activity-card--education::before { background: var(--c-secondary); }
.activity-card--community::before { background: var(--c-gold); }
.activity-card--service::before   { background: var(--c-secondary); }
.activity-card--worship::before   { background: var(--c-primary); }

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.activity-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 0.85rem;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
}
.activity-card--education .activity-card__icon { background: var(--c-secondary-soft); color: #0e4448; }
.activity-card--community .activity-card__icon { background: var(--c-gold-soft);      color: #7a5e23; }
.activity-card--service   .activity-card__icon { background: var(--c-secondary-soft); color: #0e4448; }
.activity-card--worship   .activity-card__icon { background: var(--c-primary-soft);   color: var(--c-primary-dark); }

.activity-card__cat {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-muted);
  margin-bottom: 0.3rem;
}
.activity-card__title {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  color: var(--c-text);
}
.activity-card__desc {
  color: var(--c-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.activity-card__badge {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  background: var(--c-gold-soft);
  color: #7a5e23;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

/* ----- Activities (Services) PAGE — grouped by category ----- */
.activities-page__group { margin-bottom: 3rem; }
.activities-page__group:last-of-type { margin-bottom: 1.5rem; }
.activities-page__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-line);
}
.activities-page__head h2 {
  font-size: 1.45rem;
  margin: 0 0 0.2rem;
  color: var(--c-text);
}
.activities-page__head p { margin: 0; font-size: 0.95rem; }
.activities-page__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  flex-shrink: 0;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
}
.activities-page__group--education .activities-page__icon { background: var(--c-secondary-soft); color: #0e4448; }
.activities-page__group--community .activities-page__icon { background: var(--c-gold-soft);      color: #7a5e23; }
.activities-page__group--service   .activities-page__icon { background: var(--c-secondary-soft); color: #0e4448; }
.activities-page__group--worship   .activities-page__icon { background: var(--c-primary-soft);   color: var(--c-primary-dark); }

.activities-page__cta {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--c-primary-soft), var(--c-bg));
  border-radius: var(--r-md);
  text-align: center;
  border: 1px solid var(--c-line);
}
.activities-page__cta h3 { margin: 0 0 0.4rem; color: var(--c-primary-dark); font-size: 1.25rem; }
.activities-page__cta p { margin: 0 0 1.25rem; }
.activities-page__cta .btn + .btn { margin-inline-start: 0.5rem; }

/* ----- Madrasa highlight band ----- */
.home-madrasa-band {
  position: relative;
  background: linear-gradient(135deg, #073a23 0%, #0F5132 60%, #155E63 100%);
  color: white;
  padding: 5rem 0;
  overflow: hidden;
  isolation: isolate;
}

/* Subtle gold/white geometric mesh — properly tiled, no aspect-ratio stretching */
.home-madrasa-band__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'><g fill='none' stroke='rgba(201,169,97,0.16)' stroke-width='0.5'><path d='M30 4 L34 14 L44 14 L36 22 L40 32 L30 26 L20 32 L24 22 L16 14 L26 14 Z'/></g></svg>");
  background-size: 60px 60px;
  background-repeat: repeat;
  opacity: 0.9;
  mask-image: linear-gradient(90deg, black 0%, black 55%, transparent 90%);
  -webkit-mask-image: linear-gradient(90deg, black 0%, black 55%, transparent 90%);
}

/* Large faded "اِقْرَأْ" (Iqra — "Read", the first word of revelation) calligraphy on the right */
.home-madrasa-band__iqra {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', serif;
  font-weight: 700;
  font-size: clamp(6rem, 14vw, 14rem);
  line-height: 1.2;
  padding: 0.2em 0;
  color: transparent;
  background: linear-gradient(135deg,
    rgba(201,169,97,0.28) 0%,
    rgba(201,169,97,0.10) 60%,
    rgba(255,255,255,0.05) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  z-index: 0;
  direction: rtl;
  letter-spacing: 0.02em;
  filter: drop-shadow(0 0 40px rgba(201,169,97,0.12));
  user-select: none;
}

/* Soft gold radial glow behind the calligraphy */
.home-madrasa-band__glow {
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: 60%;
  height: 140%;
  background: radial-gradient(circle, rgba(201,169,97,0.16) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.home-madrasa-band__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.home-madrasa-band__text { font-size: 1.05rem; opacity: 0.92; line-height: 1.75; margin-bottom: 1.5rem; }
.home-madrasa-band__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

@media (max-width: 700px) {
  .home-madrasa-band__iqra { right: 1rem; opacity: 0.7; font-size: clamp(4rem, 22vw, 10rem); }
  .home-madrasa-band__mesh { mask-image: none; -webkit-mask-image: none; opacity: 0.5; }
}

/* ----- Fund trio ----- */
.home-funds {
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Soft Arabic word "البَرَكَة" (Barakah — blessing) as left-side watermark */
.home-funds::before {
  content: "البَرَكَة";
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-weight: 700;
  font-size: clamp(6rem, 12vw, 12rem);
  line-height: 1.2;
  padding: 0.2em 0;
  color: transparent;
  background: linear-gradient(135deg,
    rgba(201,169,97,0.15) 0%,
    rgba(15,81,50,0.08) 60%,
    rgba(255,255,255,0.04) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  direction: rtl;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
.home-funds > .container { position: relative; z-index: 1; }
@media (max-width: 900px) {
  .home-funds::before { font-size: clamp(4rem, 22vw, 7rem); left: -2rem; opacity: 0.6; }
}
.fund-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) { .fund-trio { grid-template-columns: 1fr; } }

.fund-trio__card {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.fund-trio__card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--c-primary);
}
.fund-trio__card--madrasa::before { background: var(--c-secondary); }
.fund-trio__card--scholarship::before { background: var(--c-gold); }
.fund-trio__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: transparent;
}
.fund-trio__icon {
  width: 56px; height: 56px;
  background: var(--c-primary-soft);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
.fund-trio__card--madrasa .fund-trio__icon { background: var(--c-secondary-soft); }
.fund-trio__card--scholarship .fund-trio__icon { background: var(--c-gold-soft); }
.fund-trio__name { font-size: 1.15rem; margin: 0 0 0.4rem; color: var(--c-text); }
.fund-trio__desc { color: var(--c-muted); font-size: 0.95rem; flex: 1; margin: 0 0 1rem; line-height: 1.6; }
.fund-trio__cta {
  font-weight: 600;
  color: var(--c-primary-dark);
  font-size: 0.95rem;
}
.fund-trio__card--madrasa .fund-trio__cta { color: #0e4448; }
.fund-trio__card--scholarship .fund-trio__cta { color: #7a5e23; }

/* ----- Featured grid ----- */
.home-featured { padding: 4rem 0; background: var(--c-bg); }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) { .featured-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card__image { aspect-ratio: 16/9; overflow: hidden; background: var(--c-primary-soft); }
.feature-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.feature-card:hover .feature-card__image img { transform: scale(1.04); }
.feature-card__image--placeholder {
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(15,81,50,0.08) 12px 13px),
    var(--c-primary-soft);
}
.feature-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.feature-card__title { font-size: 1.1rem; margin: 0 0 0.5rem; }
.feature-card__text { color: var(--c-muted); font-size: 0.93rem; line-height: 1.6; flex: 1; }
.feature-card__link {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--c-primary-dark);
  font-size: 0.9rem;
}

/* ----- Events + posts ----- */
.home-events-posts {
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.home-events-posts::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 90% 20%, rgba(15,81,50,0.06) 0%, transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(201,169,97,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
.home-events-posts > .container { position: relative; z-index: 1; }
.ep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 900px) { .ep-grid { grid-template-columns: 1fr; } }

.event-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--c-text);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.event-row:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
  text-decoration: none;
  transform: translateX(4px);
}
.event-row__date {
  text-align: center;
  width: 60px;
  flex-shrink: 0;
  background: var(--c-primary);
  color: white;
  border-radius: var(--r-sm);
  padding: 0.4rem 0;
  line-height: 1.1;
}
.event-row__month { display: block; font-size: 0.7rem; letter-spacing: 0.12em; opacity: 0.85; }
.event-row__day { display: block; font-size: 1.4rem; font-weight: 700; }
.event-row__body { flex: 1; min-width: 0; }
.event-row__title { font-size: 1.02rem; margin: 0 0 0.2rem; color: var(--c-text); }
.event-row__meta { font-size: 0.85rem; color: var(--c-muted); }
.event-row__arrow { color: var(--c-muted); font-size: 1.2rem; opacity: 0.5; transition: opacity var(--transition); }
.event-row:hover .event-row__arrow { opacity: 1; color: var(--c-primary-dark); }

.post-row {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--c-text);
  transition: transform var(--transition), border-color var(--transition);
}
.post-row:hover { border-color: var(--c-primary); transform: translateX(4px); text-decoration: none; }
.post-row__date { font-size: 0.82rem; color: var(--c-muted); margin-inline-start: 0.5rem; }
.post-row__title { font-size: 1.02rem; margin: 0.4rem 0 0.3rem; color: var(--c-text); }
.post-row__excerpt { font-size: 0.92rem; color: var(--c-muted); margin: 0; line-height: 1.55; }

/* ----- Development band ----- */
.home-development { padding: 4rem 0; background: var(--c-bg); }
.home-development__card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  box-shadow: var(--shadow-md);
}
@media (max-width: 900px) { .home-development__card { grid-template-columns: 1fr; gap: 1.5rem; } }
.home-development__text { color: var(--c-muted); line-height: 1.7; font-size: 1rem; }
.home-development__progress {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--c-primary-soft), #fff);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
}
.home-development__stat { text-align: center; margin-bottom: 1rem; }
.home-development__pct {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--c-primary-dark);
  line-height: 1;
}
.home-development__pct-label { color: var(--c-muted); font-size: 0.85rem; margin-top: 0.2rem; }
.home-development__amounts {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; margin-top: 0.5rem;
}

/* ----- CTA band ----- */
.home-cta {
  background:
    radial-gradient(120% 80% at 100% 0%, #155E63 0%, transparent 60%),
    linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%);
  color: white;
  padding: 4rem 0;
}
.home-cta__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 800px) { .home-cta__inner { grid-template-columns: 1fr; text-align: center; } }
.home-cta__text { opacity: 0.92; font-size: 1.05rem; max-width: 560px; line-height: 1.7; }
.home-cta__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 800px) { .home-cta__actions { justify-content: center; } }
.home-cta__actions .btn { background: white; color: var(--c-primary-dark); }
.home-cta__actions .btn:hover { background: var(--c-bg); color: var(--c-primary-dark); }

/* ----- Location ----- */
.home-location { padding: 4rem 0; }
.home-location__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 800px) { .home-location__grid { grid-template-columns: 1fr; } }
.home-location__info { display: flex; flex-direction: column; gap: 1rem; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}
.contact-item__icon {
  width: 40px; height: 40px;
  background: var(--c-primary-soft);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.contact-item__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); margin-bottom: 0.2rem; }
.contact-item__value { font-weight: 600; color: var(--c-text); display: block; word-break: break-word; }
a.contact-item__value:hover { color: var(--c-primary-dark); text-decoration: none; }
.home-location__map iframe { width: 100%; height: 400px; border: 0; border-radius: var(--r-md); }
.home-location__map > * { border-radius: var(--r-md); overflow: hidden; }
