html { font-size: 14px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }

body { margin-bottom: 60px; }
body.public-body { margin-bottom: 0; }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ---------- Public site branding ---------- */
.public-body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.navbar-brand.d-flex {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2a44;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    line-height: 1;
}

.public-header .navbar {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.public-header .nav-link {
    font-weight: 500;
    color: #000;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
}

.public-header .nav-link:hover {
    color: #4f6ef7;
}

.public-header .nav-link.active {
    color: #000;
    font-weight: 700;
}

/* Donate button — keeps the same colour at rest, hover, focus and active */
.public-header .donate-btn,
.public-header .donate-btn:hover,
.public-header .donate-btn:focus,
.public-header .donate-btn:active,
.public-header .donate-btn.active {
    background-color: #ffb300;
    color: #1f2a44 !important;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.45rem 1.1rem !important;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .public-header .navbar-nav { gap: 0.25rem; padding-top: 0.5rem; }
    .public-header .donate-btn { display: inline-block; width: fit-content; }
}

.public-footer {
    background: #fafbfd;
}

/* ---------- Public footer (4-column + bottom bar) ---------- */
.public-footer { background: #fafbfd; padding: 0; border-top: none; color: #1f2a44; margin-top: 3.5rem !important; }

.public-footer-top {
    background: #e7dfdc;
    color: #1f2a44;
}
.pt-6 { padding-top: 5rem !important; }
@media (min-width: 992px) {
    .pt-6 { padding-top: 6.5rem !important; }
}
.public-footer-top .footer-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}
.public-footer-top a { color: #2563eb; text-decoration: none; }
.public-footer-top a:hover { text-decoration: underline; }

.footer-links li { padding: 0.2rem 0; }
.footer-links a { color: #2563eb; }

.footer-social li { padding: 0.25rem 0; }
.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #1f2a44;
    text-decoration: none;
    font-weight: 500;
}
.footer-social a:hover { color: #4f6ef7; text-decoration: none; }
.footer-social i { font-size: 1.25rem; width: 24px; text-align: center; }

.footer-feedback-form .form-control { border-radius: 4px; }
.footer-feedback-form .form-control:focus {
    border-color: #4f6ef7;
    box-shadow: 0 0 0 0.15rem rgba(79, 110, 247, 0.2);
}

.public-footer-bottom {
    background: #5d5b8a;
    color: #fff;
}
.public-footer-bottom a { color: #80e0e8; text-decoration: none; }
.public-footer-bottom a:hover { text-decoration: underline; }

/* Open the Media dropdown on hover (desktop only) */
@media (min-width: 992px) {
    .public-header .nav-item.dropdown:hover > .dropdown-menu,
    .public-header .nav-item.dropdown:focus-within > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
    .public-header .nav-item.dropdown > .dropdown-toggle::after {
        vertical-align: 0.15em;
    }
}

/* Match dropdown-item hover background/color to the active state */
.public-header .dropdown-menu .dropdown-item:hover,
.public-header .dropdown-menu .dropdown-item:focus {
    background-color: var(--bs-dropdown-link-active-bg);
    color: var(--bs-dropdown-link-active-color);
}

/* Add a small gap between dropdown items so the active and hovered items
   don't visually merge into a single block */
.public-header .dropdown-menu {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.public-header .dropdown-menu .dropdown-item {
    margin: 2px 0;
}

/* ---------- Photo gallery modal navigation arrows ---------- */
.photo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 5;
    transition: background-color 0.15s ease-in-out;
}

.photo-nav-btn:hover,
.photo-nav-btn:focus {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    outline: none;
}

.photo-nav-prev { left: 12px; }
.photo-nav-next { right: 12px; }

/* ---------- Executive Director page ---------- */
.director-photo {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background-color: #f1f3f5;
}

.text-justify {
    text-align: justify;
    text-justify: inter-word;
    line-height: 1.7;
}

/* ---------- About sub-pages ---------- */
.core-value-item {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.15s ease-in-out;
}
.core-value-item:hover {
    background-color: #f5f8ff;
}

.major-area-card {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.major-area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}
.major-area-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eef3ff;
    color: #4f6ef7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.vision-card {
    border-top: 4px solid #4f6ef7 !important;
}
.mission-card {
    border-top: 4px solid #ffb300 !important;
}
.vision-icon, .mission-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.vision-icon { background: #eef3ff; color: #4f6ef7; }
.mission-icon { background: #fff5d6; color: #c98700; }

.target-list .list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.85rem 0.25rem;
}
.target-list .list-group-item:last-child {
    border-bottom: none;
}

.staff-stat-card .staff-stat-icon {
    font-size: 2.25rem;
    color: #4f6ef7;
}
.staff-stat-card.highlight {
    background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 100%);
    border: 1px solid #d9e3ff !important;
}

.organogram-img {
    max-width: 100%;
    height: auto;
}

.goal-card {
    border-top: 4px solid #4f6ef7 !important;
}
.objectives-card {
    border-top: 4px solid #ffb300 !important;
}
.goal-icon, .objectives-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.goal-icon { background: #eef3ff; color: #4f6ef7; }
.objectives-icon { background: #fff5d6; color: #c98700; }

.objectives-list { list-style: none; }
.objective-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4f6ef7;
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* ---------- Geographical area page ---------- */
.area-card {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}
.area-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.area-icon-blue  { background: #eef3ff; color: #4f6ef7; }
.area-icon-amber { background: #fff5d6; color: #c98700; }
.area-icon-green { background: #e3f7e9; color: #198754; }

/* ---------- Public page side padding (gives breathing room on wide screens) ---------- */
@media (min-width: 768px) {
    .public-main > section.container-fluid {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}
@media (min-width: 992px) {
    .public-main > section.container-fluid {
        padding-left: 1.75rem !important;
        padding-right: 1.75rem !important;
    }
}
@media (min-width: 1400px) {
    .public-main > section.container-fluid {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
}
@media (min-width: 1800px) {
    .public-main > section.container-fluid {
        padding-left: 3.5rem !important;
        padding-right: 3.5rem !important;
    }
}

/* Gallery pages get lighter side padding than the rest so cards have more room */
.public-main > section.container-fluid.gallery-page {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}
@media (min-width: 768px) {
    .public-main > section.container-fluid.gallery-page {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}
@media (min-width: 992px) {
    .public-main > section.container-fluid.gallery-page {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}
@media (min-width: 1400px) {
    .public-main > section.container-fluid.gallery-page {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

/* ---------- Program cards & details ---------- */
.program-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}
.program-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,0.1) !important;
}
.program-card-image {
    display: block;
    width: 100%;
    height: auto;
}
.program-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: #f4f6f9;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.program-card-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    min-height: 3em;
}
.program-card .learn-more-btn {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border: 1px solid var(--bs-primary, #0d6efd);
    transition: background 0.15s ease, color 0.15s ease;
}
.program-card .learn-more-btn:hover,
.program-card .learn-more-btn:focus {
    background: transparent;
    color: var(--bs-primary, #0d6efd);
}
.program-detail-image-wrap {
    width: 100%;
    background: #f4f6f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.program-detail-image {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
}
.program-detail-meta dt {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.program-detail-meta dd {
    margin-bottom: 0.5rem;
}
.program-detail-text {
    white-space: pre-line;
    line-height: 1.65;
}

/* ---------- Appreciative Story page ---------- */
.appreciative-story-card {
    overflow: hidden;
}
.appreciative-story-header {
    background: #cfe9ee;
    border-bottom: 1px solid #b6dde4;
}
.appreciative-story-image {
    width: 100%;
    object-fit: cover;
}
.appreciative-story-text {
    white-space: pre-line;
    line-height: 1.65;
    color: #1f2a44;
}

/* ---------- Contact Us page ---------- */
.contact-map-ratio {
    --bs-aspect-ratio: 38%;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Map card sits narrower than the rest of the content */
@media (min-width: 768px) {
    .contact-map-card { margin-left: 2rem; margin-right: 2rem; }
}
@media (min-width: 992px) {
    .contact-map-card { margin-left: 4rem; margin-right: 4rem; }
}
@media (min-width: 1400px) {
    .contact-map-card { margin-left: 7rem; margin-right: 7rem; }
}
@media (min-width: 1800px) {
    .contact-map-card { margin-left: 10rem; margin-right: 10rem; }
}

/* Head/Liaison office address rows */
.address-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.address-row:last-child { border-bottom: none; }
.address-row .address-label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #1f2a44;
}
.address-row .address-body {
    flex: 1 1 auto;
    margin: 0;
    line-height: 1.6;
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.contact-icon-blue  { background: #eef3ff; color: #4f6ef7; }
.contact-icon-amber { background: #fff5d6; color: #c98700; }

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.contact-list li:last-child { border-bottom: none; }
.contact-list li i {
    font-size: 1.1rem;
    line-height: 1.5;
    flex-shrink: 0;
}
.contact-list a {
    color: inherit;
    text-decoration: none;
}
.contact-list a:hover { color: #4f6ef7; }

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

.home-page {
    background: #eef3ff;
}

body:has(.home-page),
body:has(.home-page) .public-main {
    background: #eef3ff;
}

/* -------- Hero (full-width slider + overlay text) -------- */
.home-hero {
    position: relative;
    overflow: hidden;
}

.home-hero-carousel,
.home-hero-carousel .carousel-inner,
.home-hero-carousel .carousel-item {
    height: 540px;
}

.home-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-fallback {
    height: 540px;
    background: #e7eaf3;
    color: #c4c9d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.home-hero-control {
    width: 6%;
    opacity: 0.9;
    z-index: 3;
}
.home-hero-control .carousel-control-prev-icon,
.home-hero-control .carousel-control-next-icon {
    background-color: rgba(31, 42, 68, 0.55);
    border-radius: 50%;
    padding: 1rem;
    background-size: 50% 50%;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}
.home-hero-overlay .container-fluid {
    width: 100%;
}
.home-hero-overlay .home-hero-card {
    padding-left: 2%;
}
@media (min-width: 992px) {
    .home-hero-overlay .home-hero-card {
        padding-left: 3%;
    }
}

.home-hero-card {
    max-width: 760px;
    padding: 0;
    background: transparent;
    pointer-events: auto;
}

.home-hero-title {
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.home-hero-sub {
    font-size: 1rem;
    line-height: 1.55;
    color: #f0f3fa;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-hero-btn-primary {
    background: #4f6ef7;
    color: #ffffff;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
}
.home-hero-btn-primary:hover {
    background: #3b58d8;
    color: #ffffff;
    transform: translateY(-1px);
}

.home-hero-btn-secondary {
    background: #ffffff;
    color: #1f2a44;
    border: 1px solid #c5cee0;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
}
.home-hero-btn-secondary:hover {
    background: #4f6ef7;
    color: #ffffff;
    border-color: #4f6ef7;
}

@media (max-width: 767.98px) {
    .home-hero-carousel,
    .home-hero-carousel .carousel-inner,
    .home-hero-carousel .carousel-item,
    .home-hero-fallback {
        height: 380px;
    }
    .home-hero-card {
        padding: 1.25rem 1.25rem;
    }
}

/* -------- About section (no cards) -------- */
.home-about-text {
    font-size: 1rem;
    line-height: 1.65;
    max-width: 620px;
}

.home-about-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
}

/* -------- Stats (white panel, larger numbers, static icons) -------- */
.home-stats-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
}

.home-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #dce5ff;
    color: #4f6ef7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.home-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2a44;
    line-height: 1.05;
}

.home-stat-label {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

@media (max-width: 575.98px) {
    .home-stat-value { font-size: 1.6rem; }
}

/* -------- View All button -------- */
.home-view-all-btn {
    background: transparent;
    color: #4f6ef7;
    border: 1px solid #4f6ef7;
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.home-view-all-btn:hover {
    background: #4f6ef7;
    color: #ffffff;
}

/* -------- Ongoing Projects card -------- */
.home-project-card {
    border-radius: 14px;
}

.home-project-body {
    padding-top: 1rem !important;
}

.home-project-image-frame {
    padding: 1rem;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.home-project-image {
    width: 100%;
    height: 100%;
    min-height: 260px;
    max-height: 340px;
    object-fit: cover;
    border-radius: 10px;
}

.home-project-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 260px;
    background: #f1f3f8;
    color: #c4c9d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-radius: 10px;
}

.home-project-details {
    white-space: pre-line;
    line-height: 1.55;
}

/* -------- Public Projects pages -------- */
.project-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.project-card-image-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f1f3f8;
    color: #c4c9d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.project-card-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-detail-image-wrap {
    width: 100%;
    background: #f1f3f8;
}

.project-detail-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    margin: 0 auto;
}

.project-detail-text {
    white-space: pre-line;
    line-height: 1.65;
    color: #4a5568;
}

.project-learn-more-btn {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border: 1px solid var(--bs-primary, #0d6efd);
    transition: background 0.15s ease, color 0.15s ease;
}

.project-learn-more-btn:hover {
    background: transparent;
    color: var(--bs-primary, #0d6efd);
    border: 1px solid var(--bs-primary, #0d6efd);
}

/* ===================== Scroll-triggered animations ===================== */
.anim-from-left,
.anim-from-right,
.anim-from-bottom {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.anim-from-left { transform: translateX(-160px); }
.anim-from-right { transform: translateX(160px); }
.anim-from-bottom { transform: translateY(120px); }


.anim-visible {
    opacity: 1 !important;
    transform: none !important;
}

.anim-stagger > *:nth-child(1) { transition-delay: 0s; }
.anim-stagger > *:nth-child(2) { transition-delay: 0.07s; }
.anim-stagger > *:nth-child(3) { transition-delay: 0.14s; }
.anim-stagger > *:nth-child(4) { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
    .anim-from-left,
    .anim-from-right,
    .anim-from-bottom {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
