/* =========================================================
   Above Uganda — NGO Website Styles
   - Pure CSS (no frameworks)
   - Semantic structure, Flexbox + Grid
   - Accessible focus states
   - Clean, well-commented
   ========================================================= */

/* Color system */
:root {
    --red: #C62828;        /* primary red */
    --yellow: #FDD835;     /* accent yellow */
    --black: #111111;      /* deep black */
    --white: #FFFFFF;      /* pure white */
    --gray-100: #f7f7f7;   /* light gray section bg */
    --gray-300: #e2e2e2;   /* border gray */
    --text: #1a1a1a;       /* default text color */

    --container: 1200px;   /* max width container */
    --radius: 8px;         /* default radius */
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.12); /* soft shadow */
}

/* Base reset */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
}

/* Accessibility: focus styles */
:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    top: -40px; left: 16px;
    background: var(--yellow);
    color: var(--black);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 1000;
}
.skip-link:focus { top: 16px; }

/* Container utility */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-yellow {
    background: var(--yellow);
    color: var(--black);
}
.btn-yellow:hover { box-shadow: var(--shadow); }

.btn-red {
    background: var(--red);
    color: var(--white);
}
.btn-red:hover { box-shadow: var(--shadow); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}
.btn-large { padding: 14px 20px; font-size: 1.05rem; }

/* Utility Bar */
.utility-bar {
    background: var(--red);
    color: var(--white);
    font-size: 0.95rem;
}
.utility-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}
.utility-left .contact-item { margin-right: 16px; }
.utility-right .btn { margin-left: 10px; }

/* Header / Navigation (sticky) */
.main-header {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 999;
    box-shadow: 0 0 0 rgba(0,0,0,0); /* none by default; shadow on scroll */
    transition: box-shadow 0.2s ease, backdrop-filter 0.2s ease;
}
.main-header.scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    backdrop-filter: saturate(120%) blur(4px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

/* Branding */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.logo-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--yellow));
}
.brand-title {
    font-weight: 800;
    font-size: 1.25rem;
}
.brand-tagline {
    display: block;
    font-size: 0.85rem;
    color: #555;
}

/* Nav */
.primary-nav ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 22px;
}
.primary-nav a {
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 4px;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
    background: var(--gray-100);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid var(--black);
    color: var(--black);
    padding: 8px 10px;
    border-radius: 6px;
}
.hamburger {
    width: 18px; height: 12px;
    position: relative;
    display: inline-block;
}
.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px; height: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}
.hamburger::before { top: 0; }
.hamburger::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger::after { transform: translateY(-5px) rotate(-45deg); }
.nav-toggle-text { font-weight: 700; }

/* Hero */
.hero {
    position: relative;
    min-height: 60vh;
    background-image: url('photos/WhatsApp Image 2025-07-05 at 18.55.26.jpeg');
    /* Required: cover & center top */
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    color: var(--white);
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
}
.hero-content {
    position: relative;
    padding: 80px 0;
}
.hero-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 900;
    margin: 0 0 12px;
}
.hero-subtitle {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 0 20px;
}
.hero-actions .btn { margin-right: 10px; }

/* Title Banner */
.title-banner {
    background: var(--yellow);
    color: var(--black);
    padding: 30px 0;
}
.title-banner-text {
    font-weight: 900;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    letter-spacing: 0.5px;
}

/* Two-column content */
.content-two-col {
    padding: 50px 0;
    background: var(--white);
}
.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
}
.aside-actions {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
}
.aside-actions .aside-note {
    font-size: 0.9rem;
    color: #444;
}

/* Testimonial */
.testimonial {
    background: var(--yellow);
    color: var(--black);
    padding: 50px 0;
}
.testimonial-inner {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.quote-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 10px;
}
.testimonial-quote {
    font-size: 1.15rem;
    margin: 0;
}
.testimonial-cite {
    display: block;
    margin-top: 12px;
    font-weight: 700;
}

/* Placeholder sections */
.placeholder-section {
    padding: 40px 0;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-300);
}

/* Contact */
.contact-section {
    padding: 50px 0;
    background: var(--white);
}
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}
.contact-form {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}
.form-row { margin-bottom: 14px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font: inherit;
}
.form-actions { margin-top: 10px; }
.form-feedback {
    font-size: 0.95rem;
    margin-top: 10px;
    min-height: 1.4em;
}

/* Gallery Section */
.gallery-section {
    padding: 80px 0;
    background: var(--gray-100);
}

.gallery-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--black);
}

.gallery-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn-filter {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--gray-300);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-filter:hover,
.btn-filter:focus {
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-2px);
}

.btn-filter.active {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: var(--white);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    padding: 24px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.gallery-overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-filters {
        gap: 12px;
    }
    
    .btn-filter {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-section {
        padding: 60px 0;
    }
}

/* Footer */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding: 48px 0 24px;
}
.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}
.newsletter {
    text-align: center;
}
.newsletter-form {
    margin-top: 12px;
    display: inline-flex;
    gap: 10px;
    align-items: center;
}
.newsletter-form input {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #999;
    min-width: 260px;
    color: var(--black);
    background: var(--white);
}

.social {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: rgba(255,255,255,0.08);
    padding: 10px;
    border-radius: 50%;
    transition: background 0.15s ease;
}
.social-link:hover { background: rgba(255,255,255,0.18); }

.footer-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: var(--container);
}
.address-col h4 {
    margin: 0 0 8px;
}
.address-col address {
    font-style: normal;
    color: #ddd;
}

.trust-badges {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: center;
    padding-top: 10px;
}
.badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--white);
    opacity: 0.9;
}
.badge span {
    font-size: 0.9rem;
    color: #eee;
}

.footer-bottom {
    text-align: center;
    margin-top: 6px;
}
copyright, .copyright {
    color: #bbb;
    font-size: 0.9rem;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--red);
    color: var(--white);
    font-weight: 900;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: none; /* shown via JS */
    z-index: 1000;
}

/* Reveal animations (scroll-reveal) */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .grid-2 { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-addresses { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .primary-nav {
        position: fixed;
        top: 68px; right: 0; left: 0;
        background: var(--white);
        border-top: 1px solid var(--gray-300);
        transform: translateY(-110%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }
    .primary-nav.open { transform: translateY(0); }
    .primary-nav ul {
        flex-direction: column;
        padding: 14px 20px;
        gap: 8px;
    }
    .nav-toggle { display: inline-flex; }
}
/* Gallery Section */
/* Clean NGO look with brand colors, rounded corners, hover zoom, plenty of white space */
.gallery-section {
    background: var(--gray-100);
    padding: 56px 0;
}
.gallery-header {
    text-align: center;
    margin-bottom: 22px;
}
.gallery-title {
    font-weight: 900;
    margin: 0 0 6px;
}
.gallery-subtitle {
    color: #444;
    margin: 0 0 16px;
}
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.btn-filter[aria-selected="true"] {
    background: var(--red);
    color: var(--white);
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 per row on desktop */
    gap: 20px; /* generous spacing */
    margin-top: 20px;
}
.gallery-item {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.gallery-img {
    width: 100%;
    height: 240px; /* uniform height */
    object-fit: cover; /* cover with no distortion */
    display: block;
    transition: transform 0.25s ease;
}
.gallery-item:hover .gallery-img,
.gallery-item:focus-within .gallery-img {
    transform: scale(1.03); /* subtle hover zoom */
}
.gallery-caption {
    padding: 10px 12px;
    font-weight: 600;
    color: var(--black);
    background: #fafafa;
    border-top: 1px solid var(--gray-300);
}

/* Lightbox / Modal */
.gallery-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 1001;
}
.gallery-modal[hidden] {
    display: none;
}
.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.gallery-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: min(900px, 90vw);
    padding: 14px;
}
.gallery-modal-content img {
    width: 100%;
    height: 60vh;
    object-fit: contain; /* view full image inside modal */
    background: #000;    /* solid backdrop behind image */
    border-radius: 6px;
}
.gallery-modal-caption {
    margin-top: 10px;
    color: #333;
    text-align: center;
}
.gallery-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Responsive breakpoints for grid density */
@media (max-width: 992px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); } /* 2 per row on tablets */
    .gallery-img { height: 220px; }
}
@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; } /* 1 per row on mobile */
    .gallery-img { height: 200px; }
}