/* === CSS Variables === */
:root {
  /* Colors */
  --color-primary: #1e40af;
  --color-secondary: #059669;
  --color-accent: #fbbf24;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-background: #adb9ed;
  --color-background-alt: #ccceeb;
  --color-border: #e2e8f0;
  --color-primary-light: #d6efff;

  /* Typography */
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-headings: "Lora", serif;

  /* Spacing */
  --section-padding: 80px 0;
  --card-padding: 2rem;

  /* Borders */
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* === Reset and Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  padding-top: 80px; /* To prevent content from being hidden by the fixed navbar */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Typography === */
.section-title {
  font-family: var(--font-headings);
  font-size: 2.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-subtitle {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === Components === */
/* Buttons */
.btn-primary,
.btn-secondary,
.btn-download {
  padding: 14px 28px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, var(--color-primary));
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3),
    0 0 20px var(--color-primary-light);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.btn-download {
  background: var(--color-secondary);
  color: white;
  padding: 10px 20px;
  width: 100%;
  margin-top: 1rem;
}

.btn-download:hover {
  background: #047857; /* Darker shade of secondary */
  transform: translateY(-1px);
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.nav-container {
  width: 100%;
  max-width: 1440px; /* Wider container for nav */
  margin: 0 auto;
  padding: 0 40px; /* More padding for a wider feel */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
  margin-right: 10px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

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

.nav-link {
  text-decoration: none;
  color: var(--color-text-light);
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background: var(--color-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* --- Dropdown Menu Styles --- */
.dropdown {
  position: relative;
  padding-bottom: 20px; /* Creates an invisible buffer zone */
  margin-bottom: -20px; /* Prevents layout shift */
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  background-color: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  min-width: 220px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform-origin: top center;
  transform: translateX(-50%) translateY(0);
}
.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}
.dropdown-link:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}
.dropdown .nav-link .feather {
  transition: transform 0.3s ease;
}
.dropdown:hover .nav-link .feather {
  transform: rotate(180deg);
}

/* === Section Styles === */
section {
  padding: var(--section-padding);
  position: relative;
}

.services,
.testimonials,
.resources,
.contact,
#partners {
  background-color: var(--color-background-alt);
}

/* Hero Section */
.hero {
  padding: 80px 0;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: var(--color-background);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  animation: pan-background 60s linear infinite;
  z-index: 0;
}
@keyframes pan-background {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(100px) translateY(100px);
  }
}
.hero-container {
  position: relative;
  z-index: 1;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

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

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

.hero-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
}

/* About Section */
.about {
  background-color: var(--color-background);
}
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--color-text-light);
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.highlight-icon {
  font-size: 2rem;
  flex-shrink: 0;
  color: var(--color-primary);
}

.highlight-text h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.highlight-text p {
  color: var(--color-text-light);
}

.about-img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

/* Partners & Affiliations Section */
#partners {
  padding: 60px 0;
}
.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin-top: 2rem;
}
.partner-logo {
  height: 60px;
  opacity: 0.6;
  transition: opacity 0.3s ease, filter 0.3s ease;
  filter: grayscale(100%);
}
.partner-logo:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* Grids & Cards */
.services-grid,
.testimonials-grid,
.resources-grid,
.articles-grid {
  display: grid;
  gap: 2rem;
}

.services-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.testimonials-grid,
.resources-grid,
.articles-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.service-card,
.testimonial-card,
.resource-card,
.article-card,
.contact-form {
  background-color: var(--color-background);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--card-padding);
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card {
  border-top: 4px solid var(--color-border);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--color-primary);
}

.services-grid .service-card:nth-child(3n + 2):hover {
  border-top-color: var(--color-secondary);
}
.services-grid .service-card:nth-child(3n + 3):hover {
  border-top-color: var(--color-accent);
}

.resource-card:hover,
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.service-icon,
.resource-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}
.resource-card {
  text-align: center;
}
.testimonial-card {
  border-left: 4px solid var(--color-primary);
}
.testimonial-author {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

/* Article Card Specifics */
.article-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.article-thumbnail {
  position: relative;
  width: calc(100% + 4rem);
  padding-top: 60%;
  margin: -2rem -2rem 1.5rem -2rem; /* Overlap padding */
}

.article-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.article-category {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}
.article-category.article {
  background-color: var(--color-primary);
}
.article-category.video {
  background-color: var(--color-secondary);
}
.article-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.article-content h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.article-content .article-excerpt {
  flex-grow: 1;
  margin-bottom: 1rem;
}
.article-link {
  display: inline-block;
  margin-top: auto;
  font-weight: 700;
  color: var(--color-primary);
}
.article-card:hover .article-link {
  color: var(--color-secondary);
}

/* Contact & Form */
.contact-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: flex-start;
}

.form-group {
  margin-bottom: 1.5rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.contact-info .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--color-background);
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
}

.contact-info .contact-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-top: 5px;
}

.contact-info h4 {
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.contact-info a {
  color: var(--color-text-light);
  text-decoration: none;
}
.contact-info a:hover {
  color: var(--color-primary);
}

/* === Footer === */
.footer {
  background: var(--color-text);
  color: #a0aec0;
  padding: 3rem 0;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3,
.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a {
  text-decoration: none;
  color: inherit;
}
.footer-links a:hover {
  color: white;
}
.footer-bottom {
  border-top: 1px solid #4a5568;
  padding-top: 2rem;
  text-align: center;
}

/* === Accessibility & Responsive === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 20px;
  }
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 80px; /* Adjust based on navbar height */
    flex-direction: column;
    align-items: flex-start;
    background: white;
    width: 100%;
    text-align: left;
    transition: 0.3s ease;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem;
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-toggle {
    display: flex;
  }
  .hero-container,
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image {
    order: -1; /* Move image to top on mobile */
    margin-bottom: 2rem;
  }
  .hero-stats,
  .hero-buttons {
    justify-content: center;
  }
  .logo-img {
    height: 40px;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  /* Mobile Dropdown Styles */
  .dropdown {
    width: 100%;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  .dropdown .nav-link {
    justify-content: space-between;
    width: 100%;
  }
  .dropdown-menu {
    display: none; /* Hidden by default */
    position: static;
    transform: none;
    box-shadow: none;
    padding: 0.5rem 0 0.5rem 2rem;
    opacity: 1;
    visibility: visible;
    min-width: unset;
  }
  .dropdown-menu.open {
    display: block; /* Shown with JS */
  }
  .dropdown:hover .dropdown-menu {
    display: none; /* Disable hover on mobile */
  }
  .dropdown.open .dropdown-menu {
    display: block;
  }
  .dropdown.open .nav-link .feather {
    transform: rotate(180deg);
  }

  /* === Dark Mode & Theme Toggle Styles === */

  /* Container for buttons on the right */
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  /* Theme toggle button */
  .theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
  }

  .theme-toggle:hover {
    background-color: #f0f0f0;
  }

  /* Core Dark Mode Styles */
  html.dark {
    background-color: #111827;
    color-scheme: dark;
  }

  html.dark body {
    background-color: #111827;
    color: #f9fafb;
  }

  html.dark .navbar {
    background: rgba(31, 41, 55, 0.95);
    border-bottom-color: #374151;
  }

  html.dark .logo-text,
  html.dark .nav-link {
    color: #d1d5db;
  }

  html.dark .post-full {
    background: #1f2937;
  }

  /* Add more dark mode styles for other sections as needed... */
  /* Example: */
  /*
html.dark .footer {
    background-color: #0f172a;
}
*/
}
