/* ============================================
   SAFEVILLE NGO - MAIN STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
    --ngo-red: #C81D25;
    --ngo-red-dark: #A0171E;
    --ngo-cream: #F4F1EC;
    --ngo-cream-dark: #E9E3DA;
    --ngo-charcoal: #1A1A1A;
    --ngo-gray: #6E6A62;
    --ngo-green: #4A7C59;
    --ngo-blue: #3D6A8E;
    --white: #FFFFFF;
    
    --font-serif: 'Merriweather', serif;
    --font-sans: 'Inter', sans-serif;
    
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 18px 40px rgba(0,0,0,0.15);
    
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--ngo-cream);
    color: var(--ngo-charcoal);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--ngo-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--ngo-red-dark);
    transform: translateY(-2px);
}

/* Donate button remains visible in both states */
.header .header-actions .btn-primary {
    background-color: var(--ngo-red);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--ngo-charcoal);
    border: 2px solid var(--ngo-charcoal);
}

.btn-outline:hover {
    background-color: var(--ngo-charcoal);
    color: var(--white);
}

.btn-white {
    background-color: var(--white);
    color: var(--ngo-red);
}

.btn-white:hover {
    background-color: var(--ngo-cream);
}

.btn-outline-white {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline-white:hover {
    background-color: var(--white);
    color: var(--ngo-red);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(200, 29, 37, 0.1);
    color: var(--ngo-red);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-success {
    background-color: rgba(74, 124, 89, 0.1);
    color: var(--ngo-green);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    transition: var(--transition);
    padding: 1rem 0;
}

.header.scrolled {
    background-color: rgba(244, 241, 236, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--ngo-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
}

.logo-image {
    height: 2.5rem;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ngo-charcoal);
}

.nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--ngo-red);
}

.header.scrolled .nav-link {
    color: var(--ngo-charcoal);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
    color: var(--ngo-red);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--white);
    cursor: pointer;
}

.header.scrolled .menu-toggle {
    color: var(--ngo-charcoal);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--ngo-charcoal);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-header .logo-text {
    color: var(--white);
}

.menu-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    padding: 1rem;
    color: var(--white);
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--ngo-red);
}

.mobile-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    padding-top: 6rem;
    padding-bottom: 4rem;
    background-color: var(--ngo-cream);
}

.hero-grid {
    display: grid;
    gap: 3rem;
}

.hero-content {
    max-width: 600px;
}

.hero-content .badge {
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    color: var(--ngo-charcoal);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--ngo-gray);
    margin-bottom: 2rem;
}

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

.hero-images {
    position: relative;
}

.hero-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.hero-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.hero-img-2 {
    margin-top: 2rem;
}

.hero-img-3 {
    margin-top: -2rem;
}

/* Hero slideshow (background images with left-side overlay for text) */
.hero {
    position: relative;
    padding-top: 6rem;
    padding-bottom: 4rem;
    min-height: 68vh;
    overflow: hidden;
    color: var(--white);
}

.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slideshow .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    animation: slideFade 18s infinite;
}

.hero-slideshow .slide-1 { background-image: url('../images/FFC1.jpg'); animation-delay: 0s; }
.hero-slideshow .slide-2 { background-image: url('../images/featured_school_handwashing.jpg'); animation-delay: 6s; }
.hero-slideshow .slide-3 { background-image: url('../images/hero_reflection_portrait.jpg'); animation-delay: 12s; }

@keyframes slideFade {
    0% { opacity: 0; }
    5% { opacity: 1; }
    30% { opacity: 1; }
    35% { opacity: 0; }
    100% { opacity: 0; }
}

.hero-overlay {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    bottom: 0;
    width: 58%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.55) 20%, rgba(0,0,0,0.25) 40%, rgba(0,0,0,0) 100%);
}

.hero .container,
.hero-grid {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    color: var(--white);
}

.hero-description {
    color: rgba(255,255,255,0.9);
}

.hero-actions .btn-outline {
    background-color: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.9);
}

.hero-actions .btn-outline:hover {
    background-color: rgba(255,255,255,0.12);
}

/* Ensure slides cover and are stacked correctly */
.hero-slideshow .slide:nth-child(1) { z-index: 0; }
.hero-slideshow .slide:nth-child(2) { z-index: 0; }
.hero-slideshow .slide:nth-child(3) { z-index: 0; }


.hero-card {
    background-color: var(--ngo-red);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--white);
}

.hero-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.hero-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.hero-card p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ============================================
   STATS SECTION
   ============================================ */

.stats {
    padding: 4rem 0;
    background-color: var(--ngo-cream-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    background-color: rgba(200, 29, 37, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--ngo-red);
    font-size: 1.5rem;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ngo-charcoal);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--ngo-gray);
    font-size: 0.875rem;
}

/* ============================================
   FOCUS AREAS
   ============================================ */

.focus-areas {
    padding: 4rem 0;
    background-color: var(--ngo-cream);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.section-header.flex-between {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    max-width: none;
    gap: 1rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.75rem;
    color: var(--ngo-charcoal);
}

.section-subtitle {
    color: var(--ngo-gray);
    font-size: 1.125rem;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.focus-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.focus-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.focus-icon {
    width: 3.5rem;
    height: 3.5rem;
    background-color: rgba(200, 29, 37, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--ngo-red);
    font-size: 1.5rem;
}

.focus-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--ngo-charcoal);
}

.focus-card p {
    color: var(--ngo-gray);
    font-size: 0.875rem;
}

/* ============================================
   PROJECTS
   ============================================ */

.featured-projects {
    padding: 4rem 0;
    background-color: var(--ngo-cream-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.project-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    height: 200px;
    background-color: var(--ngo-cream-dark);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ngo-gray);
    font-size: 3rem;
}

.project-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.project-content {
    padding: 1.5rem;
}

.project-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ngo-gray);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--ngo-charcoal);
}

.project-description {
    color: var(--ngo-gray);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-progress {
    margin-bottom: 1rem;
}

.project-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.project-progress-bar {
    height: 6px;
    background-color: var(--ngo-cream-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.project-progress-fill {
    height: 100%;
    background-color: var(--ngo-red);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-raised {
    font-weight: 600;
    color: var(--ngo-red);
}

.project-link {
    color: var(--ngo-red);
    font-size: 0.875rem;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* ============================================
   UPDATES
   ============================================ */

.latest-updates {
    padding: 4rem 0;
    background-color: var(--ngo-cream);
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.update-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.update-image {
    height: 200px;
    background-color: var(--ngo-cream-dark);
}

.update-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.update-content {
    padding: 1.5rem;
}

.update-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--ngo-cream-dark);
    color: var(--ngo-gray);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.update-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--ngo-charcoal);
}

.update-excerpt {
    color: var(--ngo-gray);
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta {
    padding: 5rem 0;
    background-color: var(--ngo-red);
}

.cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cta-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--ngo-charcoal);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1.5rem;
}

.footer-brand .logo-image {
    filter: brightness(0) invert(1);
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-description {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--ngo-red);
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: var(--white);
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul li a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--ngo-red);
}

.footer-contact ul li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.75rem;
}

.footer-contact ul li i {
    color: var(--ngo-red);
    width: 1rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-legal a {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--white);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    padding-top: 8rem;
    padding-bottom: 3rem;
    background-color: var(--ngo-cream);
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--ngo-charcoal);
    margin-bottom: 1rem;
}

.page-description {
    color: var(--ngo-gray);
    font-size: 1.125rem;
    max-width: 600px;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ngo-charcoal);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background-color: var(--ngo-cream-dark);
}

.tab-btn.active {
    background-color: var(--ngo-charcoal);
    color: var(--white);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ngo-charcoal);
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--white);
    border: 2px solid var(--ngo-cream-dark);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--ngo-charcoal);
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--ngo-red);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--ngo-red);
}

.form-checkbox span {
    font-size: 0.875rem;
    color: var(--ngo-gray);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.card-red {
    background-color: var(--ngo-red);
    color: var(--white);
}

.card-dark {
    background-color: var(--ngo-charcoal);
    color: var(--white);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-red {
    color: var(--ngo-red);
}

.bg-cream {
    background-color: var(--ngo-cream);
}

.bg-cream-dark {
    background-color: var(--ngo-cream-dark);
}

.py-4 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--ngo-gray);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--ngo-gray);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .focus-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .nav {
        display: flex;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .updates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
    
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .section-header.flex-between {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .focus-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .updates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ============================================
   DATATABLE CUSTOMIZATION
   ============================================ */

.dataTables_wrapper {
    padding: 1rem 0;
}

.dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--ngo-cream-dark);
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--ngo-red);
}

.dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 2px solid var(--ngo-cream-dark);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
}

table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

table.dataTable thead th {
    background-color: var(--ngo-cream-dark);
    color: var(--ngo-charcoal);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
}

table.dataTable tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--ngo-cream-dark);
}

table.dataTable tbody tr:hover {
    background-color: var(--ngo-cream);
}

.dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--radius-md);
    color: var(--ngo-charcoal) !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button:hover {
    background: var(--ngo-red) !important;
    color: var(--white) !important;
    border: none !important;
}

/* ============================================
   TEAM CARDS
   ============================================ */

.team-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.team-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.team-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.team-card:hover .team-image img {
    transform: scale(1.05);
}

.team-social {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.team-card:hover .team-social {
    opacity: 1;
}

.team-social a {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ngo-charcoal);
    transition: var(--transition);
}

.team-social a:hover {
    background-color: var(--ngo-red);
    color: var(--white);
}

.team-info {
    padding: 1.5rem;
    text-align: center;
}

.team-name {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--ngo-charcoal);
}

.team-role {
    color: var(--ngo-red);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-bio {
    color: var(--ngo-gray);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================
   PARTNER CARDS
   ============================================ */

.partner-card {
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.partner-card:hover {
    transform: translateY(-4px);
}

.partner-logo {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--ngo-cream-dark);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--ngo-cream-dark);
    border: 2px solid var(--ngo-gray);
}

.timeline-item.completed .timeline-marker {
    background-color: var(--ngo-green);
    border-color: var(--ngo-green);
}

.timeline-item.active .timeline-marker {
    background-color: var(--ngo-red);
    border-color: var(--ngo-red);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(200, 29, 37, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(200, 29, 37, 0);
    }
}

.timeline-content h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--ngo-charcoal);
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--ngo-red);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--ngo-gray);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================
   PROJECT HERO
   ============================================ */

.project-hero {
    position: relative;
    height: 500px;
    margin-top: 0;
    display: flex;
    align-items: flex-end;
}

.project-hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

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

.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.9), rgba(26, 26, 26, 0.3));
    z-index: 1;
}

.project-hero .container {
    position: relative;
    z-index: 2;
    padding-bottom: 3rem;
}

.project-hero-content {
    max-width: 800px;
    color: var(--white);
}

.project-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: var(--white);
}

.project-hero-description {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ============================================
   FEATURE LIST
   ============================================ */

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(200, 29, 37, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ngo-red);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ============================================
   LINK ARROW
   ============================================ */

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ngo-red);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.link-arrow::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: var(--transition);
}

.link-arrow:hover::after {
    transform: translateX(4px);
}

/* ============================================
   TEXT UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-green {
    color: var(--ngo-green);
}

.text-blue {
    color: var(--ngo-blue);
}

.text-red {
    color: var(--ngo-red);
}

/* ============================================
   GRID-6 (for volunteer grid)
   ============================================ */

.grid-6 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   BADGE VARIANTS
   ============================================ */

.badge-green {
    background-color: rgba(74, 124, 89, 0.1);
    color: var(--ngo-green);
}

.badge-blue {
    background-color: rgba(61, 106, 142, 0.1);
    color: var(--ngo-blue);
}

.badge-red {
    background-color: rgba(200, 29, 37, 0.1);
    color: var(--ngo-red);
}

/* ============================================
   IMPACT PAGE - STORY CARDS
   ============================================ */

.impact-story-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.impact-story-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@media (min-width: 640px) {
    .impact-story-card {
        flex-direction: row;
    }

    .impact-story-img {
        width: 40%;
        height: auto;
        min-height: 200px;
        border-radius: var(--radius-xl) 0 0 var(--radius-xl);
        flex-shrink: 0;
    }
}

/* ============================================
   ABOUT PAGE - IMAGE GRID
   ============================================ */

.about-img-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 767px) {
    .about-img-grid {
        grid-template-columns: 1fr;
    }

    .about-img-grid img {
        height: 200px !important;
    }
}

/* ============================================
   MOBILE-FIRST OVERFLOW & RESPONSIVENESS FIX
   ============================================ */

/* Prevent ANY element from causing horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

*, *::before, *::after {
    max-width: 100%;
}

/* Images always stay within their container */
img {
    max-width: 100%;
    height: auto;
}

/* Long words/emails/URLs break instead of overflow */
p, li, a, span, td, th, label {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   HEADER - MOBILE FIXES
   ============================================ */

/* On very small screens, shrink the donate button text */
@media (max-width: 400px) {
    .header-actions .btn-primary {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    .logo-image {
        height: 2rem;
    }
}

/* Keep header items from overflowing at any width */
.header .container {
    gap: 0.5rem;
    flex-wrap: nowrap;
}

/* ============================================
   HERO SECTION - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .hero {
        min-height: 80vh;
        padding-top: 7rem;
        padding-bottom: 3rem;
    }

    /* On mobile the overlay should cover the full width for legibility */
    .hero-overlay {
        width: 100%;
        background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.70) 60%, rgba(0,0,0,0.55) 100%);
    }

    .hero-title {
        font-size: clamp(1.6rem, 7vw, 2.25rem);
        line-height: 1.25;
    }

    .hero-description {
        font-size: 0.9375rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   STATS GRID - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem 1rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

/* ============================================
   FOCUS GRID - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .focus-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .focus-card {
        padding: 1.25rem 1rem;
    }

    .focus-card h3 {
        font-size: 0.9375rem;
    }

    .focus-card p {
        font-size: 0.8125rem;
    }
}

/* ============================================
   SECTION HEADER FLEX-BETWEEN - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .section-header.flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header.flex-between .btn {
        align-self: flex-start;
    }
}

/* ============================================
   CARDS - PADDING MOBILE
   ============================================ */

@media (max-width: 479px) {
    .card {
        padding: 1.25rem 1rem;
    }
}

/* ============================================
   DONATE PAGE - AMOUNT BUTTONS + CARD
   ============================================ */

/* Amount button grid: 2 cols on phones, 3 on wider */
.amount-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 480px) {
    .amount-btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 479px) {
    /* Donate form card padding */
    .card[style*="padding: 2.5rem"] {
        padding: 1.25rem !important;
    }

    /* Amount inline-grid override */
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   FORM ROWS - ALWAYS STACK ON PHONES
   ============================================ */

@media (max-width: 599px) {
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   CONTACT PAGE - EMAIL OVERFLOW
   ============================================ */

.footer-contact ul li,
.footer-contact ul li a {
    word-break: break-all;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    /* Contact info items wrap long emails */
    [style*="display: flex; align-items: flex-start"] a {
        word-break: break-all;
    }
}

/* ============================================
   FOOTER - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .footer {
        padding: 3rem 0 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* ============================================
   PAGE HEADER - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .page-header {
        padding-top: 6rem;
        padding-bottom: 2rem;
    }

    .page-title {
        font-size: clamp(1.5rem, 6vw, 2.25rem);
    }

    .page-description {
        font-size: 1rem;
    }
}

/* ============================================
   GRID LAYOUTS - MOBILE OVERRIDES
   ============================================ */

@media (max-width: 479px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TEAM CARDS - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .team-image {
        height: 200px;
    }
}

/* ============================================
   PROJECT HERO - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .project-hero {
        height: auto;
        min-height: 320px;
        padding-top: 6rem;
    }

    .project-hero-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .project-hero-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ============================================
   TABS - MOBILE (horizontal scroll)
   ============================================ */

@media (max-width: 599px) {
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ============================================
   CTA SECTION - MOBILE
   ============================================ */

@media (max-width: 599px) {
    .cta {
        padding: 3.5rem 0;
    }

    .cta-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .cta-description {
        font-size: 0.9375rem;
    }

    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   MOBILE MENU - FULL WIDTH ON TINY SCREENS
   ============================================ */

@media (max-width: 400px) {
    .mobile-menu {
        max-width: 100%;
    }
}

/* ============================================
   CONTAINER PADDING - EXTRA SMALL SCREENS
   ============================================ */

@media (max-width: 360px) {
    .container {
        padding: 0 1rem;
    }
}

/* ============================================
   GALLERY GRID - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .gallery-grid,
    [class*="gallery"] .grid-3,
    [class*="gallery"] .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
}

/* ============================================
   PARTNER LOGOS - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .partner-logo {
        height: 60px;
    }
}

/* ============================================
   TIMELINE - MOBILE
   ============================================ */

@media (max-width: 599px) {
    .timeline {
        padding-left: 1.5rem;
    }
}

/* ============================================
   TABLE OVERFLOW - WRAP IN SCROLLABLE DIV
   ============================================ */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   UTILITY: HIDE ON MOBILE / SHOW ON DESKTOP
   ============================================ */

@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .hide-desktop { display: none !important; }
}

/* ============================================
   TOUCH: PREVENT CALLOUT ON LONG-PRESS
   ============================================ */

img, a {
    -webkit-touch-callout: default;
}

button {
    touch-action: manipulation;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    left: auto;
    background: var(--ngo-charcoal);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-xl);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 9999;
    max-width: calc(100vw - 3rem);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success { border-left: 4px solid var(--ngo-green); }
.notification-error   { border-left: 4px solid var(--ngo-red); }

@media (max-width: 479px) {
    .notification {
        right: 1rem;
        left: 1rem;
        max-width: 100%;
        bottom: 1rem;
    }
}

/* ============================================
   CARD-BODY
   ============================================ */

.card-body {
    padding: 1.5rem;
}

/* ============================================
   VOLUNTEER OPPORTUNITY CARDS
   Icon + text row — stack on tiny screens
   ============================================ */

.volunteer-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

@media (max-width: 479px) {
    .volunteer-card-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .volunteer-card-inner > div:first-child {
        flex-shrink: 0;
    }
}

/* ============================================
   LARGE INLINE HEADINGS — SCALE ON MOBILE
   Targets h2 with font-size: 2.5rem inline
   ============================================ */

@media (max-width: 599px) {
    h2[style*="font-size: 2.5rem"],
    h2[style*="font-size:2.5rem"] {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        line-height: 1.25 !important;
    }

    h3[style*="font-size: 1.5rem"],
    h3[style*="font-size:1.5rem"] {
        font-size: clamp(1.1rem, 4.5vw, 1.5rem) !important;
    }
}

/* ============================================
   PARTNERS & GET-INVOLVED — BECOME A PARTNER
   Red card with large padding
   ============================================ */

@media (max-width: 599px) {
    .card.card-red {
        padding: 2rem 1.25rem !important;
    }

    .card.card-red h2 {
        font-size: clamp(1.4rem, 6vw, 2rem) !important;
    }

    .card.card-red > div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    .card.card-red > div[style*="display: flex"] .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ============================================
   WAYS TO GET INVOLVED CARDS
   Large padding cards — reduce on mobile
   ============================================ */

@media (max-width: 599px) {
    .card[style*="padding: 3rem 2rem"],
    .card[style*="padding:3rem 2rem"],
    .card[style*="padding: 3rem"],
    .card[style*="padding:3rem"] {
        padding: 1.75rem 1.25rem !important;
    }

    /* Volunteer form card */
    .card[style*="max-width: 800px"] {
        padding: 1.5rem 1rem !important;
    }
}

/* ============================================
   GRID-2 CONTENT+IMAGE ROWS
   (Partnership benefits, Fundraiser section)
   Image goes below text on mobile
   ============================================ */

@media (max-width: 767px) {
    .grid-2[style*="align-items: center"] {
        grid-template-columns: 1fr !important;
    }

    /* Ensure the image column never exceeds viewport */
    .grid-2[style*="align-items: center"] > div:last-child img {
        width: 100% !important;
        height: auto !important;
        max-height: 260px;
        object-fit: cover;
    }
}

/* ============================================
   TESTIMONIAL CARDS — AVATAR ROW
   On very small screens let avatar+name wrap
   ============================================ */

@media (max-width: 360px) {
    .card > div[style*="display: flex; align-items: center; gap: 1rem"] {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* ============================================
   CONTACT PAGE — EMAIL & INFO ITEMS
   ============================================ */

/* All email links everywhere break properly */
a[href^="mailto"] {
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Contact info icon+text rows on mobile */
@media (max-width: 479px) {
    /* Contact section info items */
    div[style*="display: flex; align-items: flex-start; gap: 1rem"] {
        gap: 0.75rem;
    }

    /* Map placeholder smaller on mobile */
    div[style*="height: 250px"] {
        height: 180px !important;
    }
}

/* Footer contact list — email wrapping */
.footer-contact ul li {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ============================================
   SECTION PADDING — REDUCE ON MOBILE
   ============================================ */

@media (max-width: 599px) {
    .py-5 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    /* Sub-section divs with mb-4rem */
    div[style*="margin-bottom: 4rem"],
    div[style*="margin-bottom:4rem"] {
        margin-bottom: 2rem !important;
    }
}

/* ============================================
   GALLERY PAGE — INLINE GRID OVERRIDE
   ============================================ */

@media (max-width: 479px) {
    /* gallery.html uses an inline style grid */
    [style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: repeat(auto-fill, minmax(200px, 1fr))"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   PROJECT DETAIL — SIDEBAR LAYOUT
   ============================================ */

@media (max-width: 767px) {
    /* project-detail sidebar stack */
    .project-content-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   BUTTONS — TOUCH-FRIENDLY MINIMUM SIZE
   ============================================ */

.btn {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================
   INPUT / SELECT / TEXTAREA — TOUCH-FRIENDLY
   Prevent iOS zoom on focus (font-size >= 16px)
   ============================================ */

.form-input,
.form-select,
.form-textarea {
    font-size: 1rem !important;
}

/* ============================================
   ABOUT PAGE GRID-2 — IMAGE+TEXT SECTIONS
   ============================================ */

@media (max-width: 767px) {
    /* About page: values grid with image */
    .about-content-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   INDEX.HTML — UPDATES GRID CARD PADDING
   ============================================ */

@media (max-width: 479px) {
    .update-card,
    .project-card {
        padding-bottom: 0;
    }

    .update-card .card-content,
    .project-card .card-content {
        padding: 1rem;
    }
}
