/* ==========================================================================
   NAIRA MATH - Modern, Mobile-First Financial Styling
   Clean, Trustworthy, Fast & Optimized for AdSense (< 25KB unminified)
   ========================================================================== */

:root {
  --primary: #008751;           /* Nigerian Flag Emerald Green */
  --primary-dark: #065f38;      /* Deep Forest Green */
  --primary-light: #e8f5ee;     /* Soft Mint Background */
  --primary-hover: #007043;
  --navy: #0f172a;              /* Slate 900 */
  --slate-800: #1e293b;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  
  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-red: #dc2626;
  --accent-red-bg: #fee2e2;
  --accent-blue: #2563eb;
  --accent-blue-bg: #dbeafe;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease-in-out;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-800);
  background-color: var(--slate-50);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}

a:hover, a:focus {
  color: var(--primary);
}

/* Base Container & Grid */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.main-content {
  flex: 1 0 auto;
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}

/* Header & Navigation */
.site-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  text-decoration: none;
  color: var(--slate-600);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-dark);
  background-color: var(--primary-light);
}

.nav-cta {
  background-color: var(--primary);
  color: var(--white) !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.nav-cta:hover {
  background-color: var(--primary-dark) !important;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  color: var(--slate-800);
  font-size: 1.25rem;
}

/* Mobile Nav Drawer */
@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .site-nav {
    display: none;
    position: absolute;
    top: 4.25rem;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--slate-200);
    box-shadow: var(--shadow-lg);
    gap: 0.5rem;
  }
  
  .site-nav.open {
    display: flex;
  }
  
  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1rem 0 1.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--slate-600);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Calculator Wrapper Card */
.calc-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .calc-card {
    padding: 2.5rem;
  }
}

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

@media (min-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr 1.05fr;
    gap: 2.5rem;
  }
}

/* Forms & Inputs (High Contrast, Large Tap Targets) */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: 0.5rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--slate-600);
  margin-top: 0.35rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 0.875rem;
  font-weight: 700;
  color: var(--slate-600);
  pointer-events: none;
}

.form-input, .form-select {
  width: 100%;
  min-height: 48px; /* Tap target compliance */
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--slate-800);
  background-color: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-input.has-prefix {
  padding-left: 2rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.15);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  cursor: pointer;
  min-height: 44px;
}

.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Calculator Result Box */
.calc-results {
  background-color: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.results-header {
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}

.live-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background-color: #dcfce7;
  color: #166534;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.live-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #16a34a;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Stat Cards inside results */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-box {
  background: var(--white);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--slate-600);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.stat-value.danger {
  color: var(--accent-red);
}

.stat-value.success {
  color: var(--primary);
}

/* Plain language summary sentence banner */
.sentence-box {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Warning alert */
.alert-warning {
  background-color: var(--accent-red-bg);
  border-left: 4px solid var(--accent-red);
  color: #7f1d1d;
  padding: 0.875rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Chart Canvas Container */
.chart-container {
  position: relative;
  width: 100%;
  height: 240px;
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
  margin-bottom: 0.75rem;
}

.source-note {
  font-size: 0.75rem;
  color: var(--slate-600);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Tab Switching (For quick multi-tool access) */
.tool-nav {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
  scrollbar-width: thin;
}

.tool-tab {
  white-space: nowrap;
  padding: 0.625rem 0.875rem;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--white);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  min-height: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.tool-tab:hover, .tool-tab.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

@media (min-width: 992px) {
  /* Exactly 2 rows: 5 in Row 1, 4 in Row 2, all 9 with equal width and equal height */
  .tool-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 0.625rem;
  }
  .tool-tab {
    flex: 0 0 calc((100% - (4 * 0.625rem)) / 5);
    max-width: calc((100% - (4 * 0.625rem)) / 5);
    height: 46px;
    font-size: 0.825rem;
    padding: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Hub Grid for 9 Calculators - 2 Rows with Equal Width and Height */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.tool-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.15rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.875rem;
  flex-shrink: 0;
}

.tool-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.tool-card-desc {
  font-size: 0.835rem;
  color: var(--slate-600);
  line-height: 1.45;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.tool-card-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}

/* Responsive Grid Constraints: 2 Rows on Desktop (5 in row 1, 4 in row 2 centered) */
@media (min-width: 992px) {
  .card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
  }
  .card-grid .tool-card {
    flex: 0 0 calc((100% - (4 * 1.25rem)) / 5);
    max-width: calc((100% - (4 * 1.25rem)) / 5);
    height: 275px;
    min-height: 275px;
  }
}

@media (max-width: 991px) and (min-width: 640px) {
  .card-grid .tool-card {
    flex: 0 0 calc((100% - (2 * 1rem)) / 3);
    max-width: calc((100% - (2 * 1rem)) / 3);
    min-height: 260px;
  }
}

@media (max-width: 639px) {
  .card-grid .tool-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Article & Content Styling (SEO & AdSense Optimized) */
.article-container {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--white);
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .article-container {
    padding: 3rem 2.5rem;
  }
}

.article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-top: 0.75rem;
}

.article-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .article-content h1 {
    font-size: 2.5rem;
  }
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--slate-800);
  margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-callout {
  background-color: var(--slate-50);
  border-left: 4px solid var(--primary);
  padding: 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.75rem 0;
}

.article-callout h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.article-callout p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Tables (Responsive & Accessible) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

.data-table th {
  background-color: var(--slate-100);
  color: var(--navy);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--slate-200);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-800);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: var(--slate-50);
}

/* FAQ Accordion Styling */
.faq-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background-color: var(--white);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--slate-800);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* AdSense Slot Wrapper (for live ad units post-approval) */
.ad-slot-wrapper {
  margin: 2rem 0;
  text-align: center;
  clear: both;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--slate-600);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span.separator {
  color: var(--slate-400);
}

/* Footer */
.site-footer {
  background-color: var(--navy);
  color: var(--slate-400);
  padding: 3rem 0 2rem;
  margin-top: auto;
  border-top: 3px solid var(--primary);
}

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

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand h3 {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 380px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  color: var(--slate-400);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: underline;
}

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

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Cookie Banner (GDPR & Privacy Compliant) */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
  border-top: 2px solid var(--primary);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 1.25rem;
  z-index: 1000;
  display: none;
}

.cookie-banner.show {
  display: block;
}

.cookie-content {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-text {
  font-size: 0.875rem;
  color: var(--slate-800);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--slate-400);
  color: var(--slate-800);
}

.btn-outline:hover {
  background-color: var(--slate-100);
}

.btn-full {
  width: 100%;
}

/* ==========================================================================
   BLOG PAGE STYLES
   ========================================================================== */

/* Blog Controls Card (Search + Category Pills) */
.blog-controls-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.blog-search-form {
  margin-bottom: 1rem;
}

.search-input-wrapper {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blog-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--slate-50);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.1);
  background: var(--white);
}

.search-btn {
  white-space: nowrap;
}

/* Category Filter Pills */
.category-pills-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.category-pill:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.category-pill.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pill-count {
  background: rgba(255,255,255,0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.category-pill.active .pill-count {
  background: rgba(255,255,255,0.3);
}

/* Featured Post Banner */
.featured-post-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  border-radius: var(--radius-md);
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 2rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.featured-post-banner::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0,135,81,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.featured-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.featured-title a {
  color: var(--white);
  text-decoration: none;
}

.featured-title a:hover {
  text-decoration: underline;
}

.featured-excerpt {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  max-width: 700px;
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-author {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.65);
}

/* Post Meta Tags */
.post-category-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.post-read-time {
  font-size: 0.75rem;
  color: var(--slate-400);
  font-weight: 500;
}

.tool-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.article-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 135, 81, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--slate-100);
  padding-top: 0.75rem;
}

.post-date {
  font-size: 0.75rem;
  color: var(--slate-400);
}

.tool-mini-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.read-more-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

.read-more-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Empty State Card */
.empty-state-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--slate-50);
  border: 1.5px dashed var(--slate-200);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.empty-state-card h3 {
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.empty-state-card p {
  color: var(--slate-600);
  font-size: 0.95rem;
}

/* Tools CTA Banner */
.tools-cta-banner {
  background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
  border: 1px solid #bae6d0;
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.tools-cta-content h3 {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.tools-cta-content p {
  color: var(--slate-600);
  font-size: 0.9rem;
}

.tools-cta-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Post Single Page Meta Bar */
.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 1.5rem;
}

.post-meta-item {
  font-size: 0.8125rem;
  color: var(--slate-600);
}

/* Related Posts Section */
.related-posts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--slate-100);
}

.related-heading {
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

/* Responsive tweaks for blog */
@media (max-width: 640px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .featured-post-banner {
    padding: 1.5rem;
  }

  .featured-title {
    font-size: 1.2rem;
  }

  .tools-cta-banner {
    flex-direction: column;
    text-align: center;
  }

  .tools-cta-buttons {
    justify-content: center;
  }

  .search-input-wrapper {
    flex-direction: column;
  }

  .blog-search-input {
    min-width: unset;
  }

  .post-meta-bar {
    gap: 0.5rem;
  }
}

/* ==========================================================================
   HOMEPAGE LATEST BLOG POSTS SECTION (3x3 Landscape Cards)
   ========================================================================== */

.latest-posts-section {
  margin-bottom: 4rem;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-heading-group h2 {
  font-size: 1.85rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section-heading-group p {
  color: var(--slate-600);
  font-size: 1rem;
  margin-bottom: 0;
}

.landscape-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.landscape-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.2s;
  border-left: 4px solid #cbd5e1;
}

.landscape-card:hover {
  transform: translateY(-3px);
  border-left-color: var(--primary);
  border-color: #94a3b8;
  box-shadow: 0 10px 25px -5px rgba(0, 135, 81, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.landscape-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.landscape-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.landscape-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.landscape-card-title a:hover {
  color: var(--primary);
}

.landscape-card-excerpt {
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.landscape-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-100);
  font-size: 0.8125rem;
  color: var(--slate-500);
}

.landscape-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landscape-read-link {
  font-weight: 650;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s, color 0.15s;
}

.landscape-read-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  gap: 0.45rem;
}

.show-more-wrapper {
  text-align: center;
  margin-top: 1rem;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 2.25rem;
  font-size: 0.95rem;
  font-weight: 650;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 135, 81, 0.08);
}

.show-more-btn:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 135, 81, 0.2);
  transform: translateY(-1px);
}

.extra-posts-container {
  display: none;
}

.extra-posts-container.is-expanded {
  display: contents;
}

@media (max-width: 992px) {
  .landscape-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .landscape-posts-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Responsive Chart Container for Interactive Chart.js Visualizers */
.chart-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 260px;
  margin-top: 1.25rem;
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

@media (max-width: 640px) {
  .chart-container {
    height: 220px;
    padding: 0.5rem;
  }
}

