@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #0D3B66; /* Deep Navy Blue */
  --primary-light: #bfe4ff; /* Logo Light Blue */
  --accent: #53bd35; /* Logo Bright Green */
  --accent-hover: #409827;
  --text-dark: #2D3748;
  --text-light: #718096;
  --text-muted: #A0AEC0;
  --bg-light: #F7FAFC;
  --bg-light-gray: #EDF2F7;
  --bg-light-blue: #EBF8FF;
  --bg-grey: #2D3748;
  --bg-dark: #0D3B66; /* Using Primary as Dark BG */
  --white: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

ul.list-unstyled {
  list-style: none;
}

/* Typography & Utilities */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-fluid { width: 100%; padding: 0 40px; }

.fs-12 { font-size: 12px; }
.fs-14 { font-size: 14px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-24 { font-size: 24px; }
.fs-32 { font-size: 32px; }
.fs-36 { font-size: 36px; }
.fs-48 { font-size: 48px; }
.fs-60 { font-size: 60px; }

.fw-300 { font-weight: 300; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.text-accent { color: var(--accent); }
.text-white { color: var(--white); }
.text-muted { color: var(--text-muted); }
.text-dark { color: var(--text-dark); }
.text-center { text-align: center; }

.text-primary { color: var(--primary); }

.bg-white { background-color: var(--white); }
.bg-primary { background-color: var(--primary); }
.bg-light { background-color: var(--bg-light); }
.bg-light-blue { background-color: var(--bg-light-blue); }
.bg-light-gray { background-color: var(--bg-light-gray); }
.bg-grey { background-color: var(--bg-grey); }
.bg-dark { background-color: var(--bg-dark); }
.bg-accent { background-color: var(--accent); }

.position-relative { position: relative; }
.z-index-3 { z-index: 3; }

.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.me-3 { margin-right: 1rem; }
.p-lg-5 { padding: 3rem; }

.border-top { border-top: 1px solid #E2E8F0; }
.border-top-dark { border-top: 1px solid rgba(255,255,255,0.1); }
.rounded-lg { border-radius: 12px; }
.rounded-pill { border-radius: 50px; }
.shadow-img { box-shadow: var(--shadow-lg); }

.small-divider {
  height: 4px;
  width: 50px;
  background-color: var(--accent);
  border-radius: 2px;
}

.heading-1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}
.heading-1.text-white { color: var(--white); }
.font-secondary {
  font-family: 'Outfit', sans-serif; /* Can swap if you have a secondary font */
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: none;
}
.btn-primary { background-color: var(--accent); color: var(--white); box-shadow: 0 4px 14px rgba(229, 62, 62, 0.4); }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6); color: var(--white);}
.btn-outline { background-color: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background-color: var(--white); color: var(--primary); }
.btn-white { background-color: var(--white); color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.btn-white:hover { background-color: #f1f1f1; transform: translateY(-2px); }

/* Header & Navigation */
header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--glass-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
header.scrolled { padding: 0; background: rgba(255, 255, 255, 0.98); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 80px; transition: var(--transition); }
header.scrolled .nav-container { height: 70px; }
.logo img { height: 55px; width: auto; }
.optimized-logo {
  border-radius: 8px;
  mix-blend-mode: multiply; /* Removes white background effectively on light headers */
  transition: transform 0.3s ease;
}
.logo:hover .optimized-logo {
  transform: scale(1.05);
}

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links > li { position: relative; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--primary); }
.nav-links > li > a::after {
  content: ''; position: absolute; width: 0; height: 2px; bottom: -4px; left: 0;
  background-color: var(--accent); transition: width 0.3s ease;
}
.nav-links > li > a:hover::after, .nav-links > li > a.active::after { width: 100%; }

/* Dropdown */
.dropdown-menu {
  position: absolute; top: 100%; left: 0; background: var(--white);
  min-width: 200px; box-shadow: var(--shadow-md); border-radius: 8px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: var(--transition); list-style: none; padding: 10px 0;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li a { display: block; padding: 10px 20px; font-weight: 400; }
.dropdown-menu li a:hover { background: var(--bg-light); color: var(--accent); }
.dropdown-menu li a::after { display: none; }

.nav-links .btn-nav { background-color: var(--accent); color: var(--white); padding: 10px 24px; border-radius: 50px; }
.nav-links .btn-nav::after { display: none; }
.nav-links .btn-nav:hover { background-color: var(--accent-hover); color: var(--white); transform: translateY(-2px); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

/* Main Hero Carousel */
.hero { position: relative; height: 90vh; min-height: 600px; width: 100%; overflow: hidden; display: flex; align-items: center; }
.main-carousel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.main-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0;
  transition: opacity 1s ease-in-out; background-size: cover; background-position: center;
}
.main-slide.active { opacity: 1; }
.carousel-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%); z-index: 2;
}
.hero-content { position: relative; z-index: 3; width: 100%; height: 100%; display: flex; align-items: center; }
.hero-text { color: var(--white); opacity: 0; transform: translateY(30px); animation: fadeInUp 1s ease 0.5s forwards; }
.hero-text.left-align { max-width: 600px; text-align: left; }
.hero-text.center-align { max-width: 800px; text-align: center; margin: 0 auto; }
.hero-text h1 { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--white); margin-bottom: 2rem; line-height: 1.2; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero-text h2 { font-size: clamp(2rem, 4vw, 3rem); color: var(--white); margin-bottom: 2rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.main-indicators { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; }
.indicator { width: 12px; height: 12px; border-radius: 50%; background-color: rgba(255,255,255,0.5); cursor: pointer; border: none; transition: var(--transition); }
.indicator.active { background-color: var(--white); transform: scale(1.2); }

/* Standard Section */
.section { padding: 80px 0; }
.two-col-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.align-items-center { align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }

/* Impact Counters */
.impact-grid-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.impact-grid-bottom { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; max-width: 800px; margin: 0 auto; }
.impact-stat .number { font-size: 4rem; font-weight: 700; color: var(--primary); line-height: 1; }

/* Split Carousel Section */
.split-carousel-section { display: flex; height: 600px; }
.split-image { width: 50%; background-size: cover; background-position: center; }
.split-content { width: 50%; display: flex; flex-direction: column; justify-content: center; padding: 5rem; position: relative; }
.secondary-carousel { position: relative; height: 200px; }
.sec-slide { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.5s ease; width: 100%; }
.sec-slide.active { opacity: 1; }
.sec-slide h2 { color: var(--white); }
.sec-indicators { display: flex; gap: 10px; }
.sec-indicator { width: 30px; height: 4px; background-color: rgba(255,255,255,0.3); border: none; cursor: pointer; transition: var(--transition); }
.sec-indicator.active { background-color: var(--accent); }

/* How We Work */
.work-item { 
  display: flex; gap: 20px; align-items: flex-start; margin-bottom: 2rem; 
  padding: 20px; border-radius: 16px; transition: var(--transition);
  background: var(--white); border: 1px solid transparent;
}
.work-item:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-lg);
  border-color: rgba(0,0,0,0.05); background: linear-gradient(145deg, #ffffff, #f8faff);
}
.work-icon { width: 60px; text-align: center; }
.work-icon i { transition: transform 0.4s ease, color 0.4s ease; }
.work-item:hover .work-icon i { transform: scale(1.2); color: var(--accent); }
.work-content h3 { color: var(--primary); margin-bottom: 10px; }
.work-content .divider { width: 60px; height: 2px; background: #CBD5E0; margin-bottom: 10px; }

/* Removed News CSS */

/* Stories / Blog Cards */
.blog-card {
  height: 400px; border-radius: 20px; overflow: hidden; position: relative;
  background-size: cover; background-position: center; display: block;
}
.blog-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
  display: flex; align-items: flex-end; padding: 2rem; transition: var(--transition);
}
.blog-card:hover .blog-overlay { background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%); }
.blog-content h4 { color: var(--white); font-size: 1.25rem; margin: 10px 0; text-transform: uppercase; }
.read-more { color: var(--white); font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.blog-card:hover .read-more { color: var(--accent); }

/* Contribute Banner */
.contribute-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 150%);
  position: relative;
  overflow: hidden;
}
.contribute-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" stroke="rgba(255,255,255,0.05)" stroke-width="2" fill="none"/></svg>') repeat;
  opacity: 0.5;
}
.contribute-content { position: relative; z-index: 2; }
.btn-lg { padding: 15px 35px; font-size: 1.2rem; }
.ml-3 { margin-left: 1rem; }

/* Pulse Animation */
@keyframes pulse-shadow {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.pulse-animation {
  animation: pulse-shadow 2s infinite;
}

/* Footer */
.footer-top-grid { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 2fr; gap: 3rem; }
.footer-logo-box { background: var(--white); padding: 1rem; border-radius: 12px; display: inline-block; }
.footer-logo-box img { max-width: 150px; }
.footer-links-col ul li { margin-bottom: 0.8rem; }
.footer-links-col a { color: var(--text-muted); }
.footer-links-col a:hover { color: var(--accent); }
.form-control { width: 100%; padding: 12px 15px; border: none; border-radius: 4px; background: var(--white); }
.social-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: inline-flex; justify-content: center; align-items: center; color: var(--white); margin: 0 5px; }
.social-icon:hover { background: var(--accent); transform: translateY(-3px); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* Donate Page Styles */
.donate-widget { border-top: 6px solid var(--accent); }
.donate-type-toggle label { border-radius: 8px; font-weight: 600; padding: 12px; }
.btn-check { display: none; }
.btn-check:checked + .btn-outline-primary {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
}
.amount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-outline-accent {
  border: 2px solid var(--accent);
  color: var(--accent);
  background-color: transparent;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.btn-outline-accent:hover { background-color: rgba(83, 189, 53, 0.1); }
.btn-check:checked + .btn-outline-accent {
  background-color: var(--accent);
  color: var(--white);
}
.btn-accent {
  background-color: var(--accent);
  color: var(--white);
  border: none;
}
.btn-accent:hover {
  background-color: var(--accent-hover);
  color: var(--white);
}

/* --- Stepper Wizard Styles --- */
.stepper-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
  padding: 0 10px;
}
.stepper-container::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 2px;
  background-color: var(--bg-light-gray);
  z-index: 1;
}
.stepper-progress-bar {
  position: absolute;
  top: 20px;
  left: 30px;
  height: 2px;
  background-color: var(--accent);
  z-index: 1;
  transition: width 0.4s ease;
  width: 0%;
}
.step-item {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}
.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--white);
  border: 2px solid var(--bg-light-gray);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px auto;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.step-item.active .step-dot {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--white);
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(83, 189, 53, 0.3);
}
.step-item.completed .step-dot {
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--white);
}
.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}
.step-item.active .step-label {
  color: var(--primary);
}
.step-item.completed .step-label {
  color: var(--text-dark);
}

/* --- Form Field Validation Styling --- */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}
.form-control-validate {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--bg-light-gray);
  border-radius: 10px;
  background: var(--bg-light);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  color: var(--text-dark);
}
.form-control-validate:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(13, 59, 102, 0.1);
}
.form-control-validate.is-valid {
  border-color: var(--accent);
  background-color: rgba(83, 189, 53, 0.02);
  padding-right: 40px;
}
.form-control-validate.is-invalid {
  border-color: #fc8181;
  background-color: rgba(252, 129, 129, 0.02);
  padding-right: 40px;
}
.validation-feedback {
  font-size: 12px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.25s ease;
  height: 0;
  overflow: hidden;
}
.validation-feedback.show {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  margin-bottom: 5px;
}
.validation-feedback.invalid-feedback {
  color: #e53e3e;
}
.validation-feedback.valid-feedback {
  color: var(--accent);
}

/* Form Shake Animation for invalid submits */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake-element {
  animation: shake 0.4s ease-in-out;
}

/* Input Status Icons */
.field-wrapper {
  position: relative;
}
.field-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  transition: var(--transition);
  opacity: 0;
}
.form-control-validate.is-valid + .field-icon {
  color: var(--accent);
  opacity: 1;
}
.form-control-validate.is-invalid + .field-icon {
  color: #e53e3e;
  opacity: 1;
}

/* --- Toast Notification Styles --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: calc(100% - 48px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.toast-content {
  flex-grow: 1;
}
.toast-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}
.toast-message {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
  font-weight: 300;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}
.toast-close:hover {
  color: var(--text-dark);
}

/* Toast Color Varieties */
.toast-success { border-left: 5px solid var(--accent); }
.toast-success .toast-icon { color: var(--accent); }

.toast-error { border-left: 5px solid #e53e3e; }
.toast-error .toast-icon { color: #e53e3e; }

.toast-warning { border-left: 5px solid #dd6b20; }
.toast-warning .toast-icon { color: #dd6b20; }

.toast-info { border-left: 5px solid #3182ce; }
.toast-info .toast-icon { color: #3182ce; }

/* Copy and Mobile Buttons */
.copy-button {
  background: var(--bg-light-blue);
  color: var(--primary);
  border: 1px solid var(--primary-light);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  margin-left: 8px;
}
.copy-button:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-upi-mobile {
  background: linear-gradient(135deg, var(--primary) 0%, #1a5c9e 100%);
  color: var(--white) !important;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(13, 59, 102, 0.25);
  margin-top: 15px;
  transition: var(--transition);
}
.btn-upi-mobile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 59, 102, 0.35);
}

/* Media Queries for Mobile Toast placement */
@media (max-width: 576px) {
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
  .toast {
    transform: translateY(-120%);
  }
  .toast.show {
    transform: translateY(0);
  }
}


/* Gallery Styles */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.filter-btn {
  background: var(--white);
  border: 1px solid rgba(13, 59, 102, 0.15);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  padding: 20px 0;
}
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img {
  transform: scale(1.08);
}
.gallery-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(13, 59, 102, 0.95) 0%, rgba(13, 59, 102, 0.6) 50%, rgba(13, 59, 102, 0.2) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(2px);
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.gallery-info {
  width: 100%;
  color: var(--white);
  transform: translateY(15px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.gallery-item:hover .gallery-info {
  transform: translateY(0);
}
.gallery-tag {
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.gallery-info h3 {
  font-family: var(--font-secondary);
  font-size: 1.25rem;
  margin: 0 0 6px 0;
  font-weight: 600;
  color: var(--white);
}
.gallery-info p {
  font-size: 0.85rem;
  margin: 0 0 12px 0;
  opacity: 0.9;
  line-height: 1.4;
  font-weight: 300;
}
.gallery-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}
.gallery-item:hover .gallery-zoom-btn {
  background: var(--white);
  color: var(--primary);
  transform: scale(1.05);
}

/* Lightbox Dialog Styles */
#gallery-lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  outline: none;
  overflow: visible;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  margin: 0;
  display: block; /* Overrides default hidden state so browser can transition it */
}

/* Base (closed) state for lightbox dialog entry/exit animations */
#gallery-lightbox {
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

/* Open state */
#gallery-lightbox[open] {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@starting-style {
  #gallery-lightbox[open] {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
}

/* Backdrop styling */
#gallery-lightbox::backdrop {
  background-color: rgba(13, 59, 102, 0);
  backdrop-filter: blur(0px);
  transition: 
    display 0.35s allow-discrete,
    overlay 0.35s allow-discrete,
    background-color 0.35s ease,
    backdrop-filter 0.35s ease;
}

#gallery-lightbox[open]::backdrop {
  background-color: rgba(13, 59, 102, 0.85);
  backdrop-filter: blur(8px);
}

@starting-style {
  #gallery-lightbox[open]::backdrop {
    background-color: rgba(13, 59, 102, 0);
    backdrop-filter: blur(0px);
  }
}

/* Lightbox Wrapper & Layout */
.lightbox-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  max-width: 800px;
  width: 100%;
  margin: auto;
}

.lightbox-container {
  display: flex;
  flex-direction: column;
}

.lightbox-container img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #000;
  display: block;
}

.lightbox-caption {
  padding: 24px 30px;
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  text-align: left;
}

.lightbox-caption .gallery-tag {
  margin-bottom: 10px;
}

.lightbox-caption h3 {
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 10px 0;
  font-weight: 600;
}

.lightbox-caption p {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 300;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  z-index: 10;
  color: var(--primary);
}

.lightbox-close:hover {
  background: var(--primary);
  color: var(--white);
  transform: rotate(90deg);
}

/* Media Queries for Lightbox */
@media (max-width: 768px) {
  .lightbox-wrapper {
    border-radius: 16px;
    max-width: 95vw;
  }
  .lightbox-caption {
    padding: 16px 20px;
  }
  .lightbox-caption h3 {
    font-size: 1.25rem;
  }
  .lightbox-caption p {
    font-size: 0.85rem;
  }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  #gallery-lightbox {
    transform: translate(-50%, -50%) !important;
    transition-duration: 0.1s;
  }
  @starting-style {
    #gallery-lightbox[open] {
      transform: translate(-50%, -50%) !important;
    }
  }
}

/* Glassmorphism overlays */
.glass-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 60%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(4px);
}
.blog-card:hover .glass-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.6) 60%, rgba(255,255,255,0.15) 100%);
  backdrop-filter: blur(6px);
}

/* Responsive */
@media (max-width: 1024px) {
  .split-carousel-section { flex-direction: column; height: auto; }
  .split-image { width: 100%; height: 400px; }
  .split-content { width: 100%; padding: 4rem 2rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; padding: 0;}
  .footer-top-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: 70px; left: -100%; width: 100%; height: calc(100vh - 70px);
    background-color: var(--white); flex-direction: column; justify-content: center;
    transition: 0.4s; box-shadow: var(--shadow-md);
  }
  .nav-links.active { left: 0; }
  .mobile-menu-btn { display: block; }
  .dropdown-menu { position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none; display: none; }
  .dropdown:hover .dropdown-menu { display: block; }
  
  .two-col-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .order-1-mobile { order: 1; }
  .order-2-mobile { order: 2; margin-top: 2rem; }
  .grid-3 { grid-template-columns: 1fr; }
  .impact-grid-top, .impact-grid-bottom { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  
  .contribute-flex { flex-direction: column; text-align: center; gap: 2rem; }
  .footer-top-grid { grid-template-columns: 1fr; }
  
  .hero-text h1 { font-size: 2.2rem; }
}
