/* ============================
   Base & Layout
   ============================ */

:root {
  --primary-color: #047857;
  --secondary-color: #059669;
  --accent-color: #10b981;
  --bg-soft: #eff6ff;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
  --radius-lg: 20px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  background: linear-gradient(180deg, #ecfdf5 0%, var(--bg-soft) 40%, #ffffff 100%);
  color: var(--text-main);
}

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

a:hover {
  color: var(--accent-color);
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 3rem 0 2rem;
}

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

/* Small utility classes used in header/footer */
.max-w-7xl {
  max-width: 1200px;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

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

/* ============================
   Header & Navigation
   ============================ */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
}

.site-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 0.1rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background-color: #bbf7d0;
  transition: width 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: #ffffff;
}

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.dropdown-arrow {
  font-size: 0.75rem;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: #ffffff;
  min-width: 230px;
  border-radius: 0.75rem;
  padding: 0.35rem 0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease-out;
  pointer-events: none;
  z-index: 1001;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.dropdown-menu a:hover {
  background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
  color: var(--primary-color);
}

/* Mobile nav */

.mobile-menu-btn {
  appearance: none;
  border: none;
  background: none;
  color: #ffffff;
  font-size: 1.7rem;
  display: none;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.mobile-nav {
  display: none;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.32);
  overflow: hidden;
}

.mobile-nav a {
  display: block;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover {
  background: rgba(15, 118, 110, 0.4);
  color: #ffffff;
}

.mobile-nav.open {
  display: block;
}

/* ============================
   Hero & Sections
   ============================ */

.hero-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 3rem 3rem 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 2rem;
}

.hero-subtitle a {
  font-weight: 600;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
}

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

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-color);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Search */

.search-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.5rem;
  margin-bottom: 3rem;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.9rem 3.1rem 0.9rem 1.1rem;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  font-size: 1rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.search-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Categories */

.categories-section {
  margin-bottom: 3rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

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

.category-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.7rem 1.6rem;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  border: 2px solid transparent;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.category-icon {
  font-size: 2.1rem;
  color: var(--primary-color);
  margin-bottom: 0.8rem;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.category-description {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.category-count {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Featured */

.featured-section {
  margin-bottom: 3.5rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.featured-article {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.featured-article:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.featured-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.featured-image svg {
  width: 100%;
  height: 100%;
}

.featured-badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  background: linear-gradient(135deg, #10b981, #22c55e);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
}

.featured-content {
  padding: 1.5rem 1.6rem 1.3rem;
}

.featured-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.featured-category {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary-color);
  font-weight: 500;
}

.featured-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.featured-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.featured-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Blog grid */

.blog-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.5rem 2.5rem 2.2rem;
  margin-bottom: 3rem;
}

.blog-header {
  text-align: center;
  margin-bottom: 2.3rem;
}

.blog-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blog-subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.blog-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
}

.article-card {
  background: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  border: 2px solid transparent;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  border-color: rgba(34, 197, 94, 0.4);
}

.article-image {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #ffffff;
}

.article-image-label {
  font-weight: 700;
}

/* simple color variants */
.article-image-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.article-image-blue { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.article-image-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.article-image-orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.article-image-teal { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.article-image-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.article-image-slate { background: linear-gradient(135deg, #64748b, #111827); }
.article-image-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.article-image-indigo { background: linear-gradient(135deg, #4f46e5, #1d4ed8); }
.article-image-gold { background: linear-gradient(135deg, #facc15, #eab308); }

.article-content {
  padding: 1.35rem 1.4rem 1.1rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.article-category {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  font-weight: 500;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.article-excerpt {
  font-size: 0.93rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.article-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid #e5e7eb;
  padding-top: 0.5rem;
}

/* FAQ section */

.faq-section {
  margin-bottom: 3rem;
}

.faq-inner {
  background: #0f172a;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.5rem 2.2rem;
  color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
}

.faq-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.faq-intro {
  font-size: 0.96rem;
  color: #cbd5f5;
  margin-bottom: 1.8rem;
}

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

.faq-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.faq-item p {
  font-size: 0.93rem;
  color: #e5e7eb;
}

.faq-item a {
  color: #bbf7d0;
}

.faq-item a:hover {
  color: #22c55e;
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  padding: 1.3rem 1.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  border: none;
  background: rgba(15, 23, 42, 0.25);
  color: #ffffff;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.8rem 2rem 2rem;
  overflow-y: auto;
}

.modal-body h2 {
  font-size: 1.25rem;
  margin: 1.3rem 0 0.6rem;
}

.modal-body h3 {
  font-size: 1.05rem;
  margin: 1rem 0 0.4rem;
}

.modal-body p {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.modal-body ul,
.modal-body ol {
  margin: 0.5rem 0 0.8rem 1.2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-highlight {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  margin: 0.9rem 0;
  font-size: 0.95rem;
}

/* ============================
   Footer
   ============================ */

.footer {
  background: linear-gradient(135deg, #111827, #020617);
  color: #e5e7eb;
  padding: 3rem 0 1.5rem;
  margin-top: 2.5rem;
}

.grid {
  display: grid;
}

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

/* simple 4-column on desktop */
.md-grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* we used md-grid-cols-4 as a custom class */
.md-grid-cols-4,
.md-grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-12 {
  gap: 3rem;
}

.footer-column h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
  color: #9ca3af;
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: 0.35rem;
}

.footer-column a {
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-column a:hover {
  color: #22c55e;
}

.footer-text {
  font-size: 0.92rem;
  color: #9ca3af;
  max-width: 320px;
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  margin-top: 2.2rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ============================
   Animations
   ============================ */

.category-card,
.featured-article,
.article-card {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.category-card.in-view,
.featured-article.in-view,
.article-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-logo {
    width: 34px;
    height: 34px;
  }

  .site-title {
    font-size: 1.05rem;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-section,
  .blog-section,
  .search-section,
  .faq-inner {
    padding: 1.9rem 1.6rem;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-stats {
    gap: 1.4rem;
  }

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

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

  .blog-posts {
    grid-template-columns: 1fr;
  }

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

  .grid.md-grid-cols-4 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .mobile-nav {
    display: block;
    max-height: 0;
    transition: max-height 0.22s ease-out;
  }

  .mobile-nav.open {
    max-height: 540px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.6rem;
  }
}
