/* First Hijrah — shared public design system (approved redesign palette) */
:root {
  --fhf-green: #006B4F;
  --fhf-green-dark: #005540;
  --fhf-green-soft: rgba(0, 107, 79, 0.08);
  --fhf-navy: #0B2A3F;
  --fhf-navy-soft: #143048;
  --fhf-gold: #C79A2B;
  --fhf-gold-soft: #f4e8c4;
  --fhf-white: #ffffff;
  --fhf-bg: #f7f5f1;
  --fhf-bg-warm: #fbfaf7;
  --fhf-text: #1a2430;
  --fhf-muted: #5c6b7a;
  --fhf-border: #e4e8ee;
  --fhf-radius: 12px;
  --fhf-radius-sm: 8px;
  --fhf-shadow: 0 10px 30px rgba(11, 42, 63, 0.08);
  --fhf-container: 1180px;
  --fhf-header-h: 64px;
  --fhf-bottom-nav-h: 88px;
  --fhf-font: "Source Sans 3", "Noto Sans Ethiopic", "Segoe UI", sans-serif;
  --fhf-display: "Libre Baskerville", "Noto Naskh Arabic", Georgia, serif;
  --fhf-arabic: "Noto Naskh Arabic", "Amiri", "Libre Baskerville", serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Clip — not hide — so the closed off-canvas .fhf-nav-panel
     (translateX 100%) cannot expand document scrollWidth. */
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--fhf-font);
  color: var(--fhf-text);
  background: var(--fhf-bg-warm);
  line-height: 1.55;
  font-size: 1rem; /* 16px baseline — never globally shrink the site */
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}

body.fhf-has-bottom-nav {
  padding-bottom: calc(var(--fhf-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

body.fhf-rtl {
  font-family: var(--fhf-arabic), var(--fhf-font);
}
body.fhf-rtl .fhf-display,
body.fhf-rtl h1,
body.fhf-rtl h2,
body.fhf-rtl h3 {
  font-family: var(--fhf-arabic), var(--fhf-display);
}

img, picture, video, canvas, svg { max-width: 100%; height: auto; }

.fhf-container,
.container {
  width: min(100% - 2rem, var(--fhf-container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.fhf-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ===== Header ===== */
.fhf-public-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--fhf-border);
}

.fhf-navbar { min-height: var(--fhf-header-h); }

.fhf-nav-inner {
  width: min(100% - 1.25rem, var(--fhf-container));
  margin: 0 auto;
  min-height: var(--fhf-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fhf-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--fhf-navy);
  min-height: 44px;
  flex-shrink: 0;
}

.fhf-nav-logo {
  width: auto;
  max-width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.fhf-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.fhf-brand-text strong {
  font-family: var(--fhf-display);
  font-size: 1.05rem;
  color: var(--fhf-navy);
  font-weight: 700;
}
.fhf-brand-text small {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fhf-green);
  font-weight: 600;
}

.fhf-nav-utilities--mobile { display: none; align-items: center; gap: 0.45rem; }

.fhf-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px; min-width: 44px;
  padding: 0.35rem;
  border: 1px solid var(--fhf-border);
  border-radius: var(--fhf-radius-sm);
  background: var(--fhf-white);
  color: var(--fhf-navy);
  cursor: pointer;
}

.fhf-burger {
  width: 18px; height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}
.fhf-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--fhf-navy); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.fhf-public-header.is-open .fhf-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fhf-public-header.is-open .fhf-burger span:nth-child(2) { opacity: 0; }
.fhf-public-header.is-open .fhf-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.fhf-nav-panel {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

.fhf-nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 0.05rem;
}

.fhf-nav-link,
.fhf-sub-toggle {
  appearance: none; border: 0; background: transparent;
  color: var(--fhf-navy);
  font-family: var(--fhf-font);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.fhf-nav-link:hover,
.fhf-sub-toggle:hover {
  color: var(--fhf-green);
  background: var(--fhf-green-soft);
}

.fhf-nav-item.is-active > .fhf-nav-link,
.fhf-nav-link.active {
  color: var(--fhf-green);
}
.fhf-nav-item.is-active > .fhf-nav-link::after,
.fhf-nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.55rem; right: 0.55rem; bottom: 0.2rem;
  height: 2px;
  background: var(--fhf-gold);
  border-radius: 2px;
}

.fhf-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.fhf-has-sub { position: relative; }
.fhf-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 210px;
  margin: 0; padding: 0.4rem;
  list-style: none;
  background: var(--fhf-white);
  border: 1px solid var(--fhf-border);
  border-radius: var(--fhf-radius);
  box-shadow: var(--fhf-shadow);
  z-index: 20;
}
body.fhf-rtl .fhf-submenu { left: auto; right: 0; }
.fhf-has-sub:hover > .fhf-submenu,
.fhf-has-sub:focus-within > .fhf-submenu,
.fhf-has-sub.is-open > .fhf-submenu { display: block; }

.fhf-submenu-link {
  display: block;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  color: var(--fhf-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.fhf-submenu-link:hover { background: var(--fhf-green-soft); color: var(--fhf-green); }

.fhf-nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-inline-start: 0.35rem;
}

.fhf-icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--fhf-border);
  background: #fff;
  color: var(--fhf-navy);
  text-decoration: none;
}
.fhf-icon-btn:hover { border-color: var(--fhf-green); color: var(--fhf-green); }

.fhf-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--fhf-border);
  border-radius: 999px;
  background: #fff;
}
.fhf-lang__globe { opacity: 0.7; margin-inline: 0.15rem; }
.fhf-lang__opt {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fhf-muted);
  text-decoration: none;
  min-height: 32px;
  min-width: 34px;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fhf-lang__opt.is-active,
.fhf-lang__opt:hover {
  background: var(--fhf-green);
  color: #fff;
}

.fhf-donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--fhf-green);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fhf-donate-btn:hover { background: var(--fhf-green-dark); }
.fhf-donate-btn--compact {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
  gap: 0.3rem;
}

.fhf-menu-toggle:focus-visible,
.fhf-nav-link:focus-visible,
.fhf-donate-btn:focus-visible,
.fhf-submenu-link:focus-visible,
.fhf-lang__opt:focus-visible,
.fhf-icon-btn:focus-visible {
  outline: 2px solid var(--fhf-gold);
  outline-offset: 2px;
}

.fhf-nav-backdrop { display: none; }
body.fhf-nav-locked { overflow: hidden; }

/* ===== Footer ===== */
.fhf-public-footer {
  background: linear-gradient(180deg, var(--fhf-navy) 0%, #071820 100%);
  color: #e8eef5;
  margin-top: 3.5rem;
  padding: 2.75rem 0 1.25rem;
  border-top: 3px solid var(--fhf-gold);
}
.fhf-public-footer a { color: #e8eef5; text-decoration: none; }
.fhf-public-footer a:hover { color: var(--fhf-gold-soft); }

.fhf-footer-grid--redesign {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 1fr 1.1fr;
  gap: 1.75rem;
}
.fhf-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--fhf-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.fhf-footer-logo img {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 10px; background: #fff;
}
.fhf-footer-brand p {
  color: #c5d0db;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}
.fhf-footer-col h3 {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fhf-gold-soft);
  margin: 0 0 0.85rem;
}
.fhf-footer-spaced { margin-top: 1.35rem !important; }
.fhf-footer-links { list-style: none; margin: 0; padding: 0; }
.fhf-footer-links li { margin-bottom: 0.35rem; }
.fhf-footer-links a {
  display: inline-flex; min-height: 40px; align-items: center;
}
.fhf-footer-col p {
  margin: 0 0 0.45rem;
  color: #c5d0db;
  font-size: 0.92rem;
  line-height: 1.45;
}
.fhf-newsletter {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.fhf-newsletter input {
  flex: 1 1 140px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 16px;
}
.fhf-newsletter button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--fhf-green);
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
.fhf-footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #b7c3d0;
}
.fhf-footer-legal { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.fhf-public-footer .social-links { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.fhf-public-footer .social-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
}

/* ===== Floating mobile nav (Facebook-style pill) ===== */
.fhf-bottom-nav,
.fhf-mobile-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  min-height: 70px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 32px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.15),
    0 2px 8px rgba(15, 23, 42, 0.08);
  padding: 0.35rem 0.4rem;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.1rem;
  align-items: stretch;
}
.fhf-bottom-nav__item {
  appearance: none; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
  min-width: 44px;
  color: var(--fhf-navy);
  text-decoration: none;
  font-size: 0.72rem; /* ~11.5px labels */
  font-weight: 700;
  line-height: 1.15;
  border-radius: 22px;
  cursor: pointer;
  padding: 0.35rem 0.2rem;
}
.fhf-bottom-nav__item .fhf-icon,
.fhf-bottom-nav__item img {
  width: 22px;
  height: 22px;
  color: inherit;
}
.fhf-bottom-nav__item.is-active,
.fhf-bottom-nav__item[aria-current="page"] {
  color: var(--fhf-green);
  background: var(--fhf-green-soft);
}
.fhf-bottom-nav__item:hover { color: var(--fhf-green); }
.fhf-bottom-nav__item:focus-visible {
  outline: 2px solid var(--fhf-gold);
  outline-offset: 2px;
}
.fhf-more-sheet {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(11,42,63,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(90px + env(safe-area-inset-bottom, 0px));
}
.fhf-more-sheet[hidden] { display: none !important; }
.fhf-more-sheet__panel {
  width: min(100%, 480px);
  max-height: min(78vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 1rem 1.15rem 1.25rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
}
.fhf-more-sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.75rem;
}
.fhf-more-sheet__head strong {
  font-family: var(--fhf-display);
  font-size: 1.15rem;
  color: var(--fhf-navy);
}
.fhf-more-sheet__panel ul { list-style: none; margin: 0; padding: 0; }
.fhf-more-sheet__panel a {
  display: flex; align-items: center; min-height: 48px;
  color: var(--fhf-navy); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--fhf-border);
  gap: 0.55rem;
}
.fhf-more-sheet__close {
  border: 0; background: transparent;
  font-size: 1.5rem; min-width: 44px; min-height: 44px; cursor: pointer;
  color: var(--fhf-muted);
}
.fhf-more-search {
  display: flex; gap: 0.4rem; margin-bottom: 0.75rem;
}
.fhf-more-search input {
  flex: 1; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--fhf-border); padding: 0.5rem 0.75rem; font-size: 16px;
}
.fhf-more-search button {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 10px;
  background: var(--fhf-green); color: #fff; cursor: pointer;
}
.fhf-more-lang {
  display: flex; gap: 0.35rem; margin-bottom: 0.85rem; flex-wrap: wrap;
}
.fhf-more-lang__opt {
  min-height: 36px; min-width: 44px; padding: 0.25rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--fhf-border);
  text-decoration: none; color: var(--fhf-navy); font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.fhf-more-lang__opt.is-active { background: var(--fhf-green); color: #fff; border-color: var(--fhf-green); }
.fhf-more-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-bottom: 0.75rem;
}
.fhf-more-actions a {
  border: 1px solid var(--fhf-border) !important;
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  min-height: 64px;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center;
  gap: 0.35rem !important;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--fhf-border) !important;
}
.fhf-more-links { margin-top: 0.25rem; }
.fhf-more-sheet__panel ul { list-style: none; margin: 0; padding: 0; }
.fhf-more-sheet__panel a {
  display: flex; align-items: center; min-height: 48px;
  color: var(--fhf-navy); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--fhf-border);
}
.fhf-more-sheet__close {
  float: right; border: 0; background: transparent;
  font-size: 1.5rem; min-width: 44px; min-height: 44px; cursor: pointer;
}

/* ===== Responsive nav ===== */
@media (max-width: 1099.98px) {
  .fhf-nav-utilities--mobile { display: inline-flex; }
  .fhf-menu-toggle { display: inline-flex; }
  .fhf-nav-panel {
    position: fixed;
    top: var(--fhf-header-h);
    right: 0;
    bottom: 0;
    left: auto;
    width: min(100%, 360px);
    background: var(--fhf-white);
    border-left: 1px solid var(--fhf-border);
    box-shadow: var(--fhf-shadow);
    /* Keep the closed drawer inside the layout viewport: slide with
       translateX(100%) + visibility, and rely on html overflow-x:clip
       so document.scrollWidth never expands past the window. */
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, visibility 0.22s ease;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.75rem 1rem 1.5rem;
    z-index: 1045;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  body.fhf-rtl .fhf-nav-panel {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid var(--fhf-border);
    transform: translateX(-100%);
  }
  .fhf-public-header.is-open .fhf-nav-panel,
  .fhf-nav-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .fhf-nav-backdrop {
    display: none; position: fixed;
    inset: var(--fhf-header-h) 0 0 0;
    background: rgba(11, 42, 63, 0.45);
    z-index: 1041;
  }
  .fhf-nav-backdrop.is-visible,
  .fhf-public-header.is-open .fhf-nav-backdrop { display: block; }
  .fhf-nav-backdrop[hidden] { display: none !important; }
  .fhf-nav-list { flex-direction: column; align-items: stretch; width: 100%; }
  .fhf-nav-link, .fhf-sub-toggle { width: 100%; justify-content: space-between; min-height: 44px; }
  .fhf-nav-item.is-active > .fhf-nav-link::after,
  .fhf-nav-link.active::after { display: none; }
  .fhf-submenu {
    position: static; display: none; box-shadow: none; border: 0;
    background: var(--fhf-bg); margin: 0.15rem 0 0.35rem;
  }
  .fhf-has-sub.is-open > .fhf-submenu { display: block; }
  .fhf-nav-tools {
    margin: 1rem 0 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .fhf-nav-tools .fhf-donate-btn { width: 100%; }
  .fhf-footer-grid--redesign { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767.98px) {
  body.fhf-has-bottom-nav {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
  .fhf-bottom-nav,
  .fhf-mobile-nav { display: grid; }
  /* Donate must stay readable in the sticky header — never icon-only */
  .fhf-nav-utilities--mobile .fhf-donate-btn--compact span { display: inline; }
  .fhf-nav-utilities--mobile .fhf-donate-btn--compact {
    min-height: 40px;
    padding: 0.4rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 700;
  }
  .fhf-nav-inner {
    min-height: 60px;
    width: min(100% - 1.5rem, var(--fhf-container));
  }
  .fhf-brand-text strong { font-size: 0.95rem; }
  .fhf-brand-text small { display: none; }
  /* Keep floating widgets clear of the pill nav */
  #floatingMosqueBtn,
  .floating-mosque-btn,
  .chatbot-toggle,
  #chatbot-toggle,
  .fh-chatbot-widget {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 575.98px) {
  :root { --fhf-header-h: 60px; }
  .fhf-nav-logo { max-width: 40px; height: 40px; }
  .fhf-footer-grid--redesign { grid-template-columns: 1fr; }
  .fhf-footer-bottom { flex-direction: column; align-items: flex-start; }
  .fhf-nav-panel { width: min(100%, 100vw); }
  .fhf-container,
  .container { width: min(100% - 1.5rem, var(--fhf-container)); }
  .fhf-public-footer { font-size: 0.875rem; padding: 2rem 0 1rem; }
  .fhf-footer-col h3 { font-size: 0.8rem; }
  .fhf-footer-col p,
  .fhf-footer-links a { font-size: 0.875rem; }
}

@media (max-width: 360px) {
  .fhf-container,
  .container { width: min(100% - 1.25rem, var(--fhf-container)); }
  .fhf-bottom-nav,
  .fhf-mobile-nav {
    left: 8px;
    right: 8px;
    border-radius: 28px;
  }
  .fhf-bottom-nav__item { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
