/* ════════════════════════════════════════════════════════════
   Humrahi Foundation — Shared Design System
   Extracted from the homepage so every page breathes the same air.
   Tokens, type, buttons, nav, footer, scroll reveals.
   ════════════════════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
  --cloud:   #F0EDE6; --red:    #BB1C2A; --crimson: #7E1A20;
  --ink:     #2C2827; --sand:   #E5D9C2; --taupe:   #B8A78D;
  --whisper: #F8F6F1; --soft:   #5A4F4A;
  --taupe-dark: #6B5D45; /* AA-contrast taupe for small text on light bg */
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; background: var(--cloud); color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1,h2,h3,h4 { font-family: 'Lora', serif; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; line-height: 1.05; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 600; line-height: 1.18; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
p  { color: var(--soft); line-height: 1.8; font-size: 0.96rem; }
a  { text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.eyebrow { display: block; font-family: 'Inter', sans-serif; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--taupe-dark); margin-bottom: 14px; }
.u-red { border-bottom: 2.5px solid var(--red); padding-bottom: 2px; }
.section { padding: 96px 0; }

/* ─── Buttons ─── */
.btn { display: inline-block; font-family: 'Inter', sans-serif; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 14px 32px; border-radius: 2px; transition: all 0.25s var(--ease); cursor: pointer; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--crimson); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(187,28,42,0.3); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--taupe); padding: 13px 32px; }
.btn-outline:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.45); padding: 13px 32px; }
.btn-ghost:hover { border-color: #fff; transform: translateY(-2px); }

/* ─── Form status messages (forms.js) ─── */
.form-status { margin-top: 14px; padding: 12px 16px; border-radius: 3px; font-size: 0.9rem; line-height: 1.5; outline: none; }
.form-status.success { background: rgba(46,125,50,0.1); border-left: 3px solid #2e7d32; color: #1b5e20; }
.form-status.error { background: rgba(187,28,42,0.08); border-left: 3px solid var(--red); color: var(--crimson); }
.form-status a { text-decoration: underline; color: inherit; }

/* ─── Scroll animations ─── */
.reveal { opacity: 0; transform: translateY(48px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-56px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(56px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.92); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }
.d1 { transition-delay: 0.05s; } .d2 { transition-delay: 0.12s; } .d3 { transition-delay: 0.19s; }
.d4 { transition-delay: 0.26s; } .d5 { transition-delay: 0.33s; } .d6 { transition-delay: 0.40s; }
.d7 { transition-delay: 0.47s; } .d8 { transition-delay: 0.54s; } .d9 { transition-delay: 0.61s; }

/* ═══ NAV ════════════════════════════════ */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 300; transition: background 0.4s, box-shadow 0.4s, padding 0.4s; }
#nav.scrolled, #nav.solid { background: rgba(240,237,230,0.97); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--sand); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; max-width: 1180px; margin: 0 auto; padding: 0 28px; transition: height 0.4s; }
#nav.scrolled .nav-inner { height: 64px; }
.nav-logo img { height: 40px; width: auto; transition: height 0.4s; }
.nav-logo.on-dark img { filter: brightness(0) invert(1); }
#nav.scrolled .nav-logo img, #nav.solid .nav-logo img { height: 34px; filter: none; }
.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em; transition: color 0.2s; color: var(--soft); }
.nav-links.on-dark a { color: rgba(255,255,255,0.8); }
#nav.scrolled .nav-links a, #nav.solid .nav-links a { color: var(--soft); }
.nav-links a:hover { color: var(--red) !important; }
.nav-links .cta { background: var(--red); color: #fff !important; padding: 9px 22px; border-radius: 2px; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; transition: background 0.2s, transform 0.2s; }
.nav-links .cta:hover { background: var(--crimson) !important; transform: translateY(-1px); }
/* Humrahi App entry — quiet, distinct from the red CTA */
.nav-links .humrahi-signin-link { border: 1px solid currentColor; padding: 7px 16px; border-radius: 2px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; opacity: 0.75; transition: opacity 0.2s, color 0.2s; }
.nav-links .humrahi-signin-link:hover { opacity: 1; color: var(--red) !important; }
/* social icons in nav */
.nav-social { display: flex; gap: 14px; align-items: center; }
.nav-social a { display: inline-flex; color: var(--soft); transition: color 0.2s, transform 0.2s; }
.nav-social.on-dark a { color: rgba(255,255,255,0.8); }
#nav.scrolled .nav-social a, #nav.solid .nav-social a { color: var(--soft); }
.nav-social a:hover { color: var(--red); transform: translateY(-2px); }
.nav-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ═══ Sub-page hero band ═══ */
.page-hero { position: relative; padding: 168px 0 72px; background: var(--ink); overflow: hidden; }
.page-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(187,28,42,0.18), transparent 60%); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero .eyebrow { color: var(--taupe); }
.page-hero h1 { color: #fff; max-width: 14ch; }
.page-hero h1 em { font-style: italic; color: #f8a8b0; }
.page-hero p { color: rgba(240,237,230,0.7); max-width: 60ch; margin-top: 20px; font-size: 1.05rem; }
.page-hero .crumbs { font-size: 0.74rem; letter-spacing: 0.04em; color: var(--taupe); margin-bottom: 22px; }
.page-hero .crumbs a { color: var(--taupe); }
.page-hero .crumbs a:hover { color: #fff; }

/* ═══ FOOTER ══════════════════════════════ */
footer { background: var(--ink); padding: 72px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-logo { height: 48px; width: auto; margin-bottom: 20px; }
.footer-brand p { font-size: 0.86rem; color: var(--taupe); max-width: 280px; line-height: 1.75; }
.footer-tagline { margin-top: 22px; font-family: 'Lora', serif; font-style: italic; font-size: 0.84rem; color: rgba(184,167,141,0.5); }
.footer-col h4 { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cloud); margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.86rem; color: var(--taupe); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--cloud); }
.footer-social { display: flex; gap: 14px; margin-top: 22px; }
.footer-social a { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid rgba(184,167,141,0.3); border-radius: 50%; color: var(--taupe); transition: all 0.25s var(--ease); }
.footer-social a:hover { color: #fff; border-color: var(--red); background: var(--red); transform: translateY(-2px); }
.footer-social svg { width: 17px; height: 17px; fill: currentColor; }
.footer-bottom { border-top: 1px solid rgba(184,167,141,0.1); padding-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.footer-bottom p { font-size: 0.74rem; color: rgba(184,167,141,0.5); }
.footer-bottom a { color: var(--red); }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-social { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .page-hero { padding: 140px 0 56px; }
}

/* ═══ MOBILE MENU (shared) ════════════════ */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; z-index: 320; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
#nav.scrolled .nav-toggle span, #nav.solid .nav-toggle span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(28,24,23,0.5); opacity: 0; visibility: hidden; transition: opacity 0.3s; z-index: 305; }
.nav-backdrop.open { opacity: 1; visibility: visible; }
.mobile-menu { position: fixed; inset: 0 0 0 auto; width: min(82vw, 340px); background: var(--cloud); box-shadow: -8px 0 40px rgba(28,24,23,0.18); transform: translateX(100%); visibility: hidden; transition: transform 0.35s var(--ease), visibility 0.35s; z-index: 310; display: flex; flex-direction: column; padding: 92px 32px 32px; }
.mobile-menu.open { transform: translateX(0); visibility: visible; }
.mobile-menu a { font-family: 'Lora', serif; font-size: 1.15rem; color: var(--ink); padding: 15px 0; border-bottom: 1px solid var(--sand); transition: color 0.2s; }
.mobile-menu a:hover, .mobile-menu a:focus-visible { color: var(--red); }
.mobile-menu .m-cta { color: var(--red); font-weight: 700; }
.mobile-social { display: flex; gap: 20px; margin-top: 28px; }
.mobile-social a { padding: 0; border: 0; }
.mobile-social svg { width: 22px; height: 22px; fill: var(--ink); }
body.menu-open { overflow: hidden; }

/* ═══ SDG COMMITMENT (shared) ═════════════ */
.sdg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 40px; }
.sdg { padding: 26px 24px; color: #fff; display: flex; flex-direction: column; min-height: 168px; }
.sdg .no { font-family: 'Lora', serif; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em; opacity: 0.9; }
.sdg h3 { font-size: 1.05rem; color: #fff; margin: 4px 0 10px; }
.sdg p { font-size: 0.83rem; color: rgba(255,255,255,0.9); line-height: 1.6; }
.sdg-2 { background: #DDA63A; } .sdg-3 { background: #4C9F38; } .sdg-4 { background: #C5192D; }
.sdg-11 { background: #FD9D24; } .sdg-12 { background: #BF8B2E; } .sdg-17 { background: #19486A; }
@media (max-width: 1024px) { .sdg-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sdg-grid { grid-template-columns: 1fr; } }

/* ═══ TRUST BADGES (shared) ═══════════════ */
.trust-badges { text-align: center; padding: 28px 24px; background: var(--whisper); border: 1px solid var(--sand); border-radius: 4px; }
.trust-badges .tb-label { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--taupe-dark); margin-bottom: 16px; }
.trust-badges .tb-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 16px; padding: 0; }
.trust-badges .tb-list li { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--crimson); background: #fff; border: 1px solid var(--sand); padding: 8px 14px; border-radius: 999px; }
.trust-badges .tb-more { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.trust-badges .tb-more:hover { text-decoration: underline; }

/* ═══ COOKIE CONSENT (shared) ═════════════ */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 500; max-width: 720px; margin: 0 auto; background: var(--ink); color: var(--cloud); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; box-shadow: 0 14px 44px rgba(0,0,0,0.4); padding: 18px 22px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cookie-banner .cookie-text { font-size: 0.86rem; line-height: 1.6; color: rgba(240,237,230,0.82); flex: 1; min-width: 240px; margin: 0; }
.cookie-banner .cookie-text a { color: #f8a8b0; font-weight: 600; }
.cookie-banner .cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-banner .btn { padding: 10px 22px; }
.cookie-banner .cookie-decline { color: var(--cloud); border-color: rgba(255,255,255,0.4); }
.cookie-banner .cookie-decline:hover { color: #fff; border-color: #fff; }
@media (max-width: 520px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 14px; }
  .cookie-banner .cookie-actions { justify-content: flex-end; }
}

/* ═══ ACCESSIBILITY (shared) ══════════════ */
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 400; background: var(--red); color: #fff; padding: 10px 18px; border-radius: 2px; font-size: 0.82rem; font-weight: 600; transition: top 0.2s; }
.skip-link:focus { top: 16px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
html:not(.js) .reveal, html:not(.js) .reveal-left, html:not(.js) .reveal-right, html:not(.js) .reveal-scale { opacity: 1 !important; transform: none !important; }
@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, .reveal-left, .reveal-right, .reveal-scale { opacity: 1 !important; transform: none !important; }
}
