:root {
    /* Official brand colours — exact values from the client Brand Guidelines PDF. */
    --ha-green: #64ac3a;      /* primary green  (logo "سفراء") */
    --ha-blue: #399ae3;       /* primary blue   (logo "السعادة") */
    --ha-light: #f4f5f5;      /* light grey     (backgrounds) */
    --ha-blue-dark: #07608c;  /* blue shade — dark (footer / sidebar / hover) */
    --ha-blue-mid: #167fbf;   /* blue shade — medium */
    --ha-green-dark: #1a4200; /* green shade — dark */
}

body {
    font-family: "Zain", "Roboto", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
    color: #22303f;
    background: #fff;
}

a { color: var(--ha-blue); }
a:hover { color: var(--ha-blue-dark); }

.navbar-brand { font-weight: 700; color: var(--ha-blue) !important; }
.text-ha-blue { color: var(--ha-blue) !important; }
.text-ha-green { color: var(--ha-green) !important; }
.bg-ha-blue { background-color: var(--ha-blue) !important; }
.bg-ha-green { background-color: var(--ha-green) !important; }
.bg-ha-light { background-color: var(--ha-light) !important; }

.btn-ha-primary { background-color: var(--ha-blue); border-color: var(--ha-blue); color: #fff; }
.btn-ha-primary:hover { background-color: var(--ha-blue-dark); border-color: var(--ha-blue-dark); color: #fff; }
.btn-ha-green { background-color: var(--ha-green); border-color: var(--ha-green); color: #fff; }
.btn-ha-green:hover { filter: brightness(0.94); color: #fff; }

/* Donation calls-to-action: blue pill, white label, and a distinct red heart. */
.btn-ha-donate { background-color: var(--ha-blue); border-color: var(--ha-blue); color: #fff; }
.btn-ha-donate:hover,
.btn-ha-donate:focus { background-color: var(--ha-blue-dark); border-color: var(--ha-blue-dark); color: #fff; }
.btn-ha-donate .bi-heart-fill { color: #e53935; }

.ha-hero {
    background: linear-gradient(120deg, var(--ha-blue-dark) 0%, var(--ha-blue) 42%, var(--ha-green) 100%);
    background-size: 220% 220%;
    color: #fff;
    padding: 6rem 0 7rem;
    position: relative;
    overflow: hidden;
}
.ha-hero .container { position: relative; z-index: 2; }
/* Optional full-bleed hero background video (drop-in: uploads/site/hero-bg.mp4). */
.ha-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.ha-hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(120deg, rgba(7,96,140,.80), rgba(26,66,0,.45) 55%, rgba(57,154,227,.62));
}
.ha-hero.has-video { padding-top: 7rem; }
/* Optional hero background image (drop-in: uploads/site/hero-bg.jpg). */
.ha-hero.has-image {
    padding-top: 7rem;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    animation: none;
}

/* ---- Immersive media hero (LinkFlow-style) ---- */
.ha-hero.has-video, .ha-hero.has-image {
    min-height: 92vh; display: flex; flex-direction: column; justify-content: center;
    padding-top: 7rem; padding-bottom: 7rem;
}
/* Don't overlap stats onto an immersive media hero. */
.ha-nav-over .ha-stats-wrap { margin-top: 2rem; }

/* Bottom-left glass info card + bottom-right watch link (desktop only). */
.ha-hero-card {
    position: absolute; inset-inline-start: 2.5rem; bottom: 2.2rem; z-index: 3; max-width: 340px;
    background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.22); border-radius: 1.1rem; padding: 1.2rem 1.3rem; color: #fff;
}
.ha-hero-card .ha-chip { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; margin-bottom: .5rem; }
.ha-hero-watch {
    position: absolute; inset-inline-end: 2.5rem; bottom: 2.4rem; z-index: 3;
    display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 600;
}
.ha-hero-watch:hover { color: #fff; opacity: .88; }
.ha-hero-watch .ha-play {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.22); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.35);
}
@media (prefers-reduced-motion: no-preference) { .ha-hero-watch .ha-play { animation: haPulse 2.6s infinite; } }

/* ---- Transparent navbar floating over the hero (home only) ---- */
.ha-nav-over .navbar {
    position: fixed; top: 0; inset-inline: 0; z-index: 1040;
    background: transparent !important; border-color: transparent !important;
    transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.ha-nav-over .navbar:not(.ha-solid) { text-shadow: 0 1px 4px rgba(0,0,0,.35); }
/* White logo over the hero image, with a shadow for contrast. */
.ha-nav-over .navbar:not(.ha-solid) .navbar-brand img { filter: brightness(0) invert(1) drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
.ha-nav-over .navbar:not(.ha-solid) .nav-link,
.ha-nav-over .navbar:not(.ha-solid) .dropdown-toggle,
.ha-nav-over .navbar:not(.ha-solid) .btn-link { color: #fff !important; }
.ha-nav-over .navbar:not(.ha-solid) .nav-link::after { background: #fff; }
.ha-nav-over .navbar:not(.ha-solid) .btn-outline-primary,
.ha-nav-over .navbar:not(.ha-solid) .btn-outline-secondary {
    color: #fff !important; border-color: rgba(255,255,255,.65) !important;
}
.ha-nav-over .navbar:not(.ha-solid) .btn-outline-primary:hover,
.ha-nav-over .navbar:not(.ha-solid) .btn-outline-secondary:hover { background: rgba(255,255,255,.16) !important; }
.ha-nav-over .navbar:not(.ha-solid) .navbar-toggler { border-color: rgba(255,255,255,.5); }
.ha-nav-over .navbar:not(.ha-solid) .navbar-toggler-icon { filter: invert(1) brightness(2); }
.ha-nav-over .navbar.ha-solid {
    background: var(--bs-body-bg) !important; border-color: var(--bs-border-color) !important;
    box-shadow: 0 .2rem .9rem rgba(0,0,0,.09);
}
/* The mobile collapsed menu needs a solid panel even when nav is transparent. */
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show,
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.collapsing {
    background: var(--bs-body-bg); border-radius: 0 0 1rem 1rem; padding: 1rem; margin-top: .5rem;
}
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show .nav-link,
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show .dropdown-toggle,
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show .btn-link { color: var(--bs-body-color) !important; text-shadow: none; }
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show .btn-outline-primary,
.ha-nav-over .navbar:not(.ha-solid) .navbar-collapse.show .btn-outline-secondary { color: var(--ha-blue) !important; border-color: var(--ha-blue) !important; }

@media (max-width: 991.98px) {
    .ha-hero-card, .ha-hero-watch { display: none; }
    .ha-hero.has-video, .ha-hero.has-image { min-height: 78vh; }
}
.ha-hero h1 { font-weight: 800; text-shadow: 0 2px 14px rgba(0,0,0,.18); }
/* Soft floating light orbs for depth (decorative, behind the content). */
.ha-hero::before, .ha-hero::after {
    content: ""; position: absolute; z-index: 1; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,.20), rgba(255,255,255,0) 70%);
}
.ha-hero::before { width: 440px; height: 440px; top: -150px; inset-inline-end: -90px; }
.ha-hero::after  { width: 300px; height: 300px; bottom: -140px; inset-inline-start: 5%;
    background: radial-gradient(circle, rgba(255,255,255,.13), rgba(255,255,255,0) 70%); }
@media (prefers-reduced-motion: no-preference) {
    .ha-hero { animation: haGradient 16s ease infinite; }
    .ha-hero::before { animation: haFloat 9s ease-in-out infinite; }
    .ha-hero::after  { animation: haFloat 12s ease-in-out infinite reverse; }
}
@keyframes haGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes haFloat   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-26px); } }

.ha-brand-mark {
    display: inline-flex; align-items: center; gap: .5rem; font-weight: 800;
}
.ha-brand-mark .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ha-green); display: inline-block; }

.card-hover { transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.card-hover:hover { transform: translateY(-6px); box-shadow: 0 1rem 2rem rgba(7,96,140,.16); }
/* Gentle image zoom on card hover. */
.card-hover .card-img-top { transition: transform .45s ease; }
.card-hover:hover .card-img-top { transform: scale(1.06); }

.progress { height: .6rem; background-color: rgba(7,96,140,.10); border-radius: 1rem; }
.progress-bar { background: linear-gradient(90deg, var(--ha-green), var(--ha-blue-mid)); transition: width 1.3s cubic-bezier(.2,.7,.3,1); }

.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--ha-blue); }

.admin-sidebar { background: var(--ha-blue-dark); min-height: calc(100vh - 56px); }
.admin-sidebar .nav-link { color: #d5e0f2; border-radius: .375rem; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }

footer.ha-footer { background: var(--ha-blue-dark); color: #cdd8ec; }
footer.ha-footer a { color: #fff; }

.object-cover { object-fit: cover; }

/* ---- Light / dark theme adaptations (Bootstrap 5.3 data-bs-theme) ---- */
[data-bs-theme="dark"] body { color: var(--bs-body-color); background: var(--bs-body-bg); }
[data-bs-theme="dark"] .bg-white { background-color: var(--bs-body-bg) !important; }
[data-bs-theme="dark"] .bg-ha-light { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--bs-body-color) !important; }
[data-bs-theme="dark"] .navbar.bg-body { border-color: var(--bs-border-color) !important; }
[data-bs-theme="dark"] .text-ha-blue { color: #6fb6ee !important; }
[data-bs-theme="dark"] .stat-number { color: #6fb6ee; }
[data-bs-theme="dark"] .card { --bs-card-bg: var(--bs-tertiary-bg); }

/* Logical margins so bi icon spacing (me-1) flips correctly under RTL */
[dir="rtl"] .navbar-nav { text-align: right; }

/* Portrait-safe cover images — client posters are 3:4; show the whole image, never cropped. */
.ha-cover { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background-color: #0e1c2e; }
.ha-cover-lg { width: 100%; max-height: 70vh; object-fit: contain; background-color: #0e1c2e; }

/* Dark-mode readability for the brand green (used on headings/icons). */
[data-bs-theme="dark"] .text-ha-green { color: #6fce5f !important; }

/* Floating WhatsApp contact button (shown only when a WhatsApp number is configured). */
.ha-whatsapp-float {
    position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 1030;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: #fff !important;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; box-shadow: 0 .4rem 1rem rgba(0,0,0,.25);
    transition: transform .15s ease;
}
.ha-whatsapp-float:hover { transform: scale(1.08); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
    .ha-whatsapp-float { animation: haPulse 2.6s infinite; }
}
@keyframes haPulse {
    0%   { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 0 rgba(37,211,102,.55); }
    70%  { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 16px rgba(37,211,102,0); }
    100% { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 0 rgba(37,211,102,0); }
}

/* Floating PDF download button — WhatsApp-style pill on the opposite
   (start) side of the screen so the two never overlap. Shows a label
   on hover/first load, and always on touch devices. */
.ha-pdf-float {
    position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 1030;
    display: inline-flex; align-items: center; gap: .55rem;
    height: 56px; padding: 0 16px; border-radius: 2rem;
    background: #e2574c; color: #fff !important; text-decoration: none;
    font-weight: 700; white-space: nowrap;
    box-shadow: 0 .4rem 1rem rgba(0,0,0,.25);
    transition: transform .15s ease, background .15s ease;
}
.ha-pdf-float:hover { transform: scale(1.06); background: #c9483e; color: #fff; }
.ha-pdf-float .bi { font-size: 1.5rem; }
.ha-pdf-float .ha-pdf-label {
    max-width: 0; opacity: 0; overflow: hidden; transition: max-width .3s ease, opacity .3s ease, margin .3s ease;
    margin-inline-end: -.55rem; /* cancel the gap while collapsed */
}
.ha-pdf-float:hover .ha-pdf-label,
.ha-pdf-float.ha-pdf-open .ha-pdf-label {
    max-width: 200px; opacity: 1; margin-inline-end: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .ha-pdf-float { animation: haPdfPulse 2.6s infinite 2s; }
}
@keyframes haPdfPulse {
    0%   { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 0 rgba(226,87,76,.5); }
    70%  { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 16px rgba(226,87,76,0); }
    100% { box-shadow: 0 .4rem 1rem rgba(0,0,0,.25), 0 0 0 0 rgba(226,87,76,0); }
}
/* Touch devices: no hover — keep the label visible permanently. */
@media (hover: none) {
    .ha-pdf-float .ha-pdf-label { max-width: 200px; opacity: 1; margin-inline-end: 0; }
    .ha-pdf-float { padding: 0 20px; }
}
/* Small screens: icon-only round button above the WhatsApp one. */
@media (max-width: 575.98px) {
    .ha-pdf-float { bottom: 88px; padding: 0; width: 48px; height: 48px; justify-content: center; border-radius: 50%; inset-inline-start: 14px; }
    .ha-pdf-float .ha-pdf-label { display: none; }
    .ha-pdf-float .bi { font-size: 1.35rem; }
}

/* ============================================================
   Motion & visual polish — scroll reveal, counters, entrances.
   Hidden states apply ONLY when JS is active and the user has not
   requested reduced motion (the <html>.js-anim flag is set in the
   layout head before first paint, so there is no content flash).
   ============================================================ */
.js-anim main .card,
.js-anim main h2.text-ha-blue,
.js-anim main .stat-number,
.js-anim .ha-reveal { opacity: 0; }

.js-anim main .card.ha-play,
.js-anim main h2.text-ha-blue.ha-play,
.js-anim main .stat-number.ha-play,
.js-anim .ha-reveal.ha-play { animation: haReveal .7s cubic-bezier(.2,.7,.3,1) forwards; }

/* Persistent visible state once the entrance finishes (no transform, so
   the card hover-lift keeps working). */
.js-anim main .card.ha-in,
.js-anim main h2.text-ha-blue.ha-in,
.js-anim main .stat-number.ha-in,
.js-anim .ha-reveal.ha-in { opacity: 1; }

@keyframes haReveal { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Hero action buttons entrance (headline + subtitle use the word reveal below). */
.js-anim .ha-hero .d-flex   { animation: haUp .75s .5s both; }
@keyframes haUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---- Heading reveal (hero headline/subtitle + "who we are" intro).
   Animated as ONE intact run — never split into per-word boxes — so Arabic
   (RTL) word order is always correct. ---- */
/* Auto-detect text direction per element so Arabic content always renders
   right-to-left even when the page language (and <html dir>) is English. */
.ha-hero h1, .ha-hero .lead, main h1.text-ha-blue, main h2.text-ha-blue, .ha-words {
    unicode-bidi: plaintext;
}
.js-anim .ha-words { opacity: 0; }
.js-anim .ha-words.ha-go { animation: haHeadIn .7s cubic-bezier(.2,.7,.3,1) both; }
@keyframes haHeadIn {
    from { opacity: 0; transform: translateY(22px); filter: blur(4px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}

/* Section-title accent draws itself in when the heading reveals. */
.js-anim main h2.text-ha-blue::after { width: 0; transition: width .6s cubic-bezier(.2,.7,.3,1) .25s; }
.js-anim main h2.text-ha-blue.ha-in::after { width: 52px; }

/* Sweeping light shine across primary buttons on hover. */
.btn-ha-green, .btn-ha-primary, .btn-ha-donate, .ha-hero .btn-light { position: relative; overflow: hidden; }
.btn-ha-green::before, .btn-ha-primary::before, .btn-ha-donate::before, .ha-hero .btn-light::before {
    content: ""; position: absolute; top: 0; bottom: 0; width: 45px; left: -70px;
    background: rgba(255,255,255,.4); transform: skewX(-20deg); filter: blur(6px);
    pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
    .btn-ha-green:hover::before, .btn-ha-primary:hover::before, .btn-ha-donate:hover::before, .ha-hero .btn-light:hover::before { animation: haShine .75s ease; }
}
@keyframes haShine { from { left: -70px; } to { left: 118%; } }

/* Gentle attention pulse on the navbar Donate call-to-action. */
@media (prefers-reduced-motion: no-preference) {
    .ha-cta { animation: haCta 2.8s ease-in-out infinite; }
}
@keyframes haCta { 0%, 100% { box-shadow: 0 0 0 0 rgba(100,172,58,.55); } 50% { box-shadow: 0 0 0 9px rgba(100,172,58,0); } }

/* Bouncing scroll-down cue at the foot of the hero. */
.ha-scroll-cue {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 2; color: #fff; font-size: 1.7rem; opacity: .85; text-decoration: none;
}
.ha-scroll-cue:hover { color: #fff; opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
    .ha-scroll-cue i { display: inline-block; animation: haBounce 1.8s ease-in-out infinite; }
}
@keyframes haBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); } }

/* ============================================================
   FULL EXPERIENCE LAYER (9 feature groups)
   All motion is gated behind prefers-reduced-motion where it
   isn't purely functional.
   ============================================================ */

/* --- (1) Scroll animations: word reveal now also covers every page
   title (hero h1/lead + inner-page h1.text-ha-blue). Hidden at parse
   time via element selectors so there is no flash before JS runs. --- */
.js-anim .ha-hero h1,
.js-anim .ha-hero .lead,
.js-anim main h1.text-ha-blue { opacity: 0; }

/* --- (5) Page loader / splash --- */
#ha-loader {
    position: fixed; inset: 0; z-index: 2000;
    background: #fff; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 1.1rem;
    transition: opacity .5s ease, visibility .5s ease;
    /* CSS fail-safe: hide after 4s even if JS never fires. */
    animation: haLoaderFailsafe 0s linear 4s forwards;
}
[data-bs-theme="dark"] #ha-loader { background: #0e1c2e; }
#ha-loader.ha-hidden { opacity: 0; visibility: hidden; }
/* Splash shows once per session; subsequent navigations skip it. */
.ha-nosplash #ha-loader { display: none; }
#ha-loader img { height: 62px; }
#ha-loader .ha-spin {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(57,154,227,.25); border-top-color: var(--ha-blue);
    animation: haSpin .8s linear infinite;
}
@keyframes haSpin { to { transform: rotate(360deg); } }
@keyframes haLoaderFailsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: no-preference) {
    #ha-loader img { animation: haLogoPulse 1.2s ease-in-out infinite; }
}
@keyframes haLogoPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .72; } }

/* --- (3) Page transition: gentle fade-in of the whole page on load --- */
@media (prefers-reduced-motion: no-preference) {
    .js-anim main { animation: haPageIn .45s ease both; }
}
@keyframes haPageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- (4)+(8) Top bar: doubles as reading-progress and navigation-loading --- */
#ha-topbar {
    position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0;
    z-index: 1100; background: linear-gradient(90deg, var(--ha-green), var(--ha-blue));
    transition: width .15s ease;
}
#ha-topbar.loading { width: 90%; transition: width 8s cubic-bezier(.1,.6,.2,1); }
#ha-topbar.done { width: 100%; transition: width .25s ease; }

/* --- (2) Hover effects --- */
.navbar-nav .nav-link { position: relative; }
.navbar-nav .nav-link::after {
    content: ""; position: absolute; bottom: 3px; inset-inline-start: .5rem; inset-inline-end: .5rem;
    height: 2px; border-radius: 2px; background: var(--ha-green);
    transform: scaleX(0); transition: transform .25s ease;
}
.navbar-nav .nav-link:hover::after, .navbar-nav .nav-link.active::after { transform: scaleX(1); }
footer.ha-footer .d-flex a { display: inline-block; transition: transform .2s ease, color .2s ease; }
footer.ha-footer .d-flex a:hover { transform: translateY(-3px) scale(1.18); }
.badge { transition: transform .18s ease; }
.card-hover:hover .badge { transform: scale(1.06); }
.list-group-item, .table tbody tr { transition: background-color .18s ease; }
.btn { transition: transform .12s ease, box-shadow .18s ease, background-color .2s ease, border-color .2s ease, filter .2s ease; }
.btn:active { transform: translateY(1px) scale(.98); }
a.text-decoration-none.text-dark:hover { color: var(--ha-blue) !important; }

/* --- (6) Form micro-interactions --- */
.form-control, .form-select { transition: border-color .2s ease, box-shadow .2s ease; }
.form-control:focus, .form-select:focus {
    border-color: var(--ha-blue);
    box-shadow: 0 0 0 .22rem rgba(57,154,227,.22);
}
@media (prefers-reduced-motion: no-preference) {
    .is-invalid { animation: haShake .4s ease; }
}
@keyframes haShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
.btn.ha-busy { pointer-events: none; opacity: .85; }
.ha-btn-spin {
    display: inline-block; width: 1em; height: 1em; margin-inline-end: .4em; vertical-align: -.125em;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: haSpin .7s linear infinite;
}

/* Ripple on buttons (element injected by JS). */
.ha-ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    background: rgba(255,255,255,.5); pointer-events: none;
    animation: haRipple .6s ease-out;
}
@keyframes haRipple { to { transform: scale(2.4); opacity: 0; } }

/* --- (7) Toasts: slide-in polish over Bootstrap's fade --- */
.ha-toast { border: 0; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.2); }
@media (prefers-reduced-motion: no-preference) {
    .ha-toast.showing, .ha-toast.show { animation: haToastIn .35s cubic-bezier(.2,.7,.3,1); }
}
@keyframes haToastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .ha-toast.showing, [dir="rtl"] .ha-toast.show { animation-name: haToastInRtl; }
@keyframes haToastInRtl { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* --- (9) Subtle background texture on the light-grey sections --- */
section.bg-ha-light { position: relative; }
section.bg-ha-light::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(rgba(7,96,140,.055) 1.5px, transparent 1.6px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
}
section.bg-ha-light > .container { position: relative; z-index: 1; }

/* ============================================================
   PREMIUM DESIGN REFRESH — modern charity-template look
   (rounded cards, campaign cards, hero media, stat cards,
   step band, CTA band, section eyebrows). Brand palette kept.
   ============================================================ */

/* Softer, rounder, more premium cards everywhere. */
.card { border-radius: 1rem; }
.card-hover:hover { box-shadow: 0 1.25rem 2.5rem rgba(7,96,140,.18); }
.shadow-sm { box-shadow: 0 .4rem 1.4rem rgba(16,42,63,.07) !important; }

/* Pill badges. */
.badge { border-radius: 2rem; padding: .45em .85em; font-weight: 600; letter-spacing: .01em; }

/* Rounded, premium branded buttons. */
.btn-ha-green, .btn-ha-primary, .btn-ha-donate, .btn-lg, .btn-outline-light { border-radius: 2rem; font-weight: 600; }
.btn-lg { padding-inline: 1.6rem; }

/* Section eyebrow (small uppercase label above a heading). */
.ha-eyebrow {
    display: inline-block; color: var(--ha-green); font-weight: 800;
    letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; margin-bottom: .35rem;
}
[data-bs-theme="dark"] .ha-eyebrow { color: #6fce5f; }

/* ---- Campaign card (projects / cases) ---- */
.ha-campaign { position: relative; }
.ha-campaign .ha-media { position: relative; overflow: hidden; border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
.ha-campaign .ha-media .badge {
    position: absolute; top: .75rem; inset-inline-start: .75rem; z-index: 2;
    box-shadow: 0 .3rem .8rem rgba(0,0,0,.25);
}
.ha-campaign .ha-media .ha-deadline {
    position: absolute; top: .75rem; inset-inline-end: .75rem; z-index: 2;
}
.ha-campaign .card-title a { font-weight: 700; }
.ha-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-raise-row { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.ha-raise-row .ha-amount { font-weight: 800; color: var(--ha-green-dark); font-size: 1.05rem; }
[data-bs-theme="dark"] .ha-raise-row .ha-amount { color: #8fd873; }
.ha-raise-row .ha-goal { font-size: .8rem; }
.ha-pct-pill {
    background: rgba(57,154,227,.12); color: var(--ha-blue); font-weight: 700;
    border-radius: 2rem; padding: .1rem .6rem; font-size: .8rem; white-space: nowrap;
}
[data-bs-theme="dark"] .ha-pct-pill { color: #6fb6ee; }

/* ---- Small "Download brochure as PDF" pill ---- */
.ha-download-pdf { display: inline-flex; align-items: center; gap: .5rem; transition: transform .2s ease, box-shadow .2s ease; }
.ha-download-pdf .bi-file-earmark-pdf { color: #e2574c; }
.ha-download-pdf:hover { transform: translateY(-2px); box-shadow: 0 .4rem 1rem rgba(100,172,58,.28); }
@@keyframes haPdfWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.ha-download-pdf:hover .bi-file-earmark-pdf { animation: haPdfWiggle .4s ease; }

/* ---- Hero two-column media + floating impact badge ---- */
.ha-hero { padding-bottom: 8rem; }
.ha-hero-media { position: relative; }
.ha-hero-media img {
    width: 100%; border-radius: 1.25rem; box-shadow: 0 1.5rem 3rem rgba(0,0,0,.28);
    aspect-ratio: 4 / 5; object-fit: cover;
}
.ha-hero-badge {
    position: absolute; inset-inline-start: -14px; bottom: 24px; z-index: 3;
    background: #fff; color: #22303f; border-radius: 1rem; padding: .7rem 1rem;
    box-shadow: 0 .8rem 2rem rgba(0,0,0,.25); display: flex; align-items: center; gap: .6rem;
}
[data-bs-theme="dark"] .ha-hero-badge { background: #17293b; color: #e7eef6; }
.ha-hero-badge .ha-ico {
    width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ha-green), var(--ha-blue)); color: #fff; font-size: 1.2rem; flex: none;
}
.ha-hero-badge .h5 { line-height: 1; }

/* ---- Stat cards that overlap the hero ---- */
.ha-stats-wrap { margin-top: -6rem; position: relative; z-index: 3; }
.ha-stat-card {
    background: #fff; border-radius: 1rem; padding: 1.4rem 1rem; text-align: center; height: 100%;
    box-shadow: 0 .6rem 1.8rem rgba(16,42,63,.10);
}
[data-bs-theme="dark"] .ha-stat-card { background: var(--bs-tertiary-bg); }
.ha-stat-card .ha-ico {
    width: 54px; height: 54px; border-radius: 50%; margin: 0 auto .6rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff;
    background: linear-gradient(135deg, var(--ha-blue), var(--ha-green));
}

/* ---- "How we work" steps ---- */
.ha-step { text-align: center; padding: 1rem; }
.ha-step .ha-ico {
    width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    color: var(--ha-blue); background: rgba(57,154,227,.10); position: relative;
    transition: transform .25s ease, background-color .25s ease, color .25s ease;
}
.ha-step:hover .ha-ico { transform: translateY(-6px); background: linear-gradient(135deg, var(--ha-blue), var(--ha-green)); color: #fff; }
.ha-step .ha-num {
    position: absolute; top: -6px; inset-inline-end: -6px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--ha-green); color: #fff; font-size: .8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Full-width CTA band ---- */
.ha-cta-band {
    background: linear-gradient(120deg, var(--ha-blue-dark), var(--ha-blue) 55%, var(--ha-green));
    background-size: 200% 200%; color: #fff; border-radius: 1.5rem; padding: 3rem 2rem; position: relative; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) { .ha-cta-band { animation: haGradient 16s ease infinite; } }
.ha-cta-band::before {
    content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; top: -120px; inset-inline-end: -80px;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); pointer-events: none;
}

@media (max-width: 991.98px) {
    .ha-hero { padding-bottom: 6rem; }
    .ha-stats-wrap { margin-top: -4rem; }
    .ha-hero-media { margin-top: 2.5rem; max-width: 420px; }
}

/* ---- Impact photo gallery ("our impact in action") ---- */
.ha-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .ha-gallery { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
.ha-gallery-item {
    position: relative; overflow: hidden; border-radius: 1rem; aspect-ratio: 4 / 3;
    box-shadow: 0 .4rem 1.4rem rgba(16,42,63,.08);
}
.ha-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.ha-gallery-item:hover img { transform: scale(1.09); }
.ha-gallery-item .ha-cap {
    position: absolute; inset: 0; display: flex; align-items: flex-end; padding: .85rem; color: #fff;
    background: linear-gradient(to top, rgba(7,96,140,.82), rgba(7,96,140,.12) 55%, transparent);
    font-weight: 700; font-size: .95rem; opacity: 0; transition: opacity .3s ease;
}
.ha-gallery-item:hover .ha-cap { opacity: 1; }
@media (hover: none) { .ha-gallery-item .ha-cap { opacity: 1; background: linear-gradient(to top, rgba(7,96,140,.75), transparent 55%); } }

/* ============================================================
   DONATION FLOW — form page + thank-you page
   ============================================================ */

/* ---- Donation form: amount presets & aside ---- */
.ha-amount-preset { border-radius: 2rem !important; font-weight: 700; }
.ha-amount-preset.active { background: var(--ha-green); border-color: var(--ha-green); color: #fff; }
.ha-amount-input { font-size: 1.4rem; font-weight: 700; text-align: center; }

.ha-donate-aside { position: sticky; top: 90px; }
.ha-donate-aside .ha-aside-card {
    background: linear-gradient(155deg, var(--ha-blue-dark), var(--ha-blue) 60%, var(--ha-green));
    color: #fff; border-radius: 1.25rem; padding: 1.6rem; position: relative; overflow: hidden;
}
.ha-donate-aside .ha-aside-card::before {
    content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; top: -90px; inset-inline-end: -70px;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%);
}
.ha-donate-aside ul { list-style: none; padding: 0; margin: 0; position: relative; z-index: 1; }
.ha-donate-aside li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .9rem; }
.ha-donate-aside li i { font-size: 1.2rem; flex: none; margin-top: .1rem; }
.ha-pay-badges { display: flex; gap: .5rem; align-items: center; font-size: 1.8rem; opacity: .95; }

/* ---- Thank-you (Success) page ---- */
.ha-thanks {
    background: linear-gradient(135deg, var(--ha-green-dark), var(--ha-green) 55%, var(--ha-blue));
    background-size: 200% 200%; color: #fff; padding: 4.5rem 0 5.5rem; text-align: center;
    position: relative; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) { .ha-thanks { animation: haGradient 16s ease infinite; } }
.ha-thanks .container { position: relative; z-index: 2; }
.ha-success-check {
    width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 1.2rem;
    background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; position: relative;
}
.ha-success-check i { font-size: 3.4rem; color: #fff; }
@media (prefers-reduced-motion: no-preference) {
    .ha-success-check { animation: haPop .55s cubic-bezier(.2,1.5,.4,1) both; }
    .ha-success-check::before, .ha-success-check::after {
        content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.55);
        animation: haRing 1.9s ease-out infinite;
    }
    .ha-success-check::after { animation-delay: .7s; }
}
@keyframes haPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes haRing { from { transform: scale(1); opacity: .7; } to { transform: scale(1.85); opacity: 0; } }
.ha-thanks-amount {
    display: inline-block; background: rgba(255,255,255,.16); border-radius: 2rem;
    padding: .45rem 1.3rem; font-size: 1.5rem; font-weight: 800; margin-top: .5rem;
}
.ha-reassure-card { border-radius: 1rem; padding: 1.2rem; text-align: center; height: 100%; }
.ha-reassure-card .ha-ico {
    width: 54px; height: 54px; border-radius: 50%; margin: 0 auto .6rem; color: #fff; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ha-blue), var(--ha-green));
}

/* Gradient accent underline beneath the section titles. */
main h2.text-ha-blue { position: relative; padding-bottom: .55rem; }
main h2.text-ha-blue::after {
    content: ""; position: absolute; bottom: 0; inset-inline-start: 0;
    width: 52px; height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--ha-green), var(--ha-blue));
}

/* Back-to-top button (injected by site.js), opposite corner to WhatsApp.
   When the PDF float button is present (About page), it stacks ABOVE it
   instead of covering it. */
.ha-to-top {
    position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 1030;
    width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: var(--ha-blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    box-shadow: 0 .3rem .8rem rgba(0,0,0,.25);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .3s ease, transform .3s ease, background-color .2s ease, bottom .3s ease;
}
.ha-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.ha-to-top:hover { background: var(--ha-blue-dark); color: #fff; }
/* Stack above the PDF pill when both share the start corner
   (flagged via body.ha-has-pdf from site.js — more reliable than :has()). */
body.ha-has-pdf .ha-to-top.show { bottom: 90px; }
@media (max-width: 575.98px) {
    body.ha-has-pdf .ha-to-top.show { bottom: 148px; }
}
