:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --brand: #ddf1e9;
  --brand-strong: #1f7a5a;
  --text: #1d2a24;
  --muted: #5b6d64;
  --border: #d7e6df;
  --shadow: 0 14px 30px rgba(17, 45, 34, 0.08);
}

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: var(--brand);
  color: var(--brand-strong);
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  z-index: 50;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ─── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--brand-strong);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: var(--brand-strong);
  border: 1px solid #cfe9de;
}

.brand-badge i {
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-links a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.93rem;
  border: 1px solid transparent;
}

.nav-links a i {
  margin-right: 0.35rem;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 31, 24, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.drawer-open .drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--brand);
  color: var(--brand-strong);
  border-color: #c9e5d9;
}

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  padding: 4.4rem 0 3.2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.hero-main {
  background: linear-gradient(145deg, #ffffff, #f6fcf9);
  position: relative;
  overflow: hidden;
}

.hero-main::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.75;
}

.hero-main-content {
  position: relative;
  z-index: 1;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand);
  color: var(--brand-strong);
  border: 1px solid #cce5db;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.86rem;
}

.hero-image-panel {
  padding: 0;
  overflow: hidden;
  min-height: 420px;
}

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

.hero h1,
h1.page-title {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  line-height: 1.2;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-strong);
  background: var(--brand);
  padding: 0.35rem 0.58rem;
  border-radius: 999px;
}

.lead {
  color: var(--muted);
  max-width: 60ch;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.72rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.btn i {
  margin-right: 0.45rem;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-strong);
  border-color: #c8e2d7;
}

.btn-ghost:hover {
  border-color: #bfd7cc;
  background: #fbfefd;
}

.stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  background: #fbfefd;
}

.stat strong {
  display: block;
  font-size: 1.2rem;
}

section {
  padding: 1.4rem 0 2.5rem;
}

h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.section-head p {
  margin-top: 0.2rem;
  color: var(--muted);
}

/* ─── Grid Utilities ────────────────────────────────────────────── */
.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 1.2rem;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

/* Added for Analytics Page Desktop Styling */
.analytics-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.card h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.05rem;
}

.card h3 i,
h2 i,
.page-title i {
  color: var(--brand-strong);
  margin-right: 0.45rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.icon-dot {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand);
  border: 1px solid #cce3d9;
  color: var(--brand-strong);
  margin-bottom: 0.65rem;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ─── BREADCRUMBS ────────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

.breadcrumb ol li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb ol li a {
  color: var(--brand-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb ol li a:hover {
  text-decoration: underline;
  color: var(--text);
}

.breadcrumb ol li .separator {
  color: var(--muted);
  margin: 0 0.1rem;
}

.breadcrumb ol li .current {
  color: var(--text);
  font-weight: 500;
}

/* ─── Article Pages: Tighter spacing ─── */
.article-content {
  padding-top: 0rem !important;
}

.article-page .breadcrumb,
.article-content .breadcrumb {
  margin-bottom: 0rem !important;
}

/* ─── Article Top Grid: Equal height columns ─── */
.article-top-grid {
  align-items: stretch; /* Stretches both columns to the same height */
}

.article-top-grid .featured-image {
  height: 100%; /* Makes the image fill the column height */
  object-fit: cover; /* Crops the image to fit without distortion */
}

.article-top-grid .article-toc {
  height: 100%; /* Makes the TOC fill the column height */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically centers the TOC content */
}

/* ─── Responsive: Tablets and small laptops ───────────────────── */
@media (max-width: 900px) {
  /* Force all grids to stack vertically */
  .hero-grid,
  .analytics-hero,
  .grid-4,
  .grid-3,
  .grid-2,
  .stats,
  .analytics-metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero-main::after {
    display: none;
  }

  .hero-image-panel {
    min-height: 280px;
  }

  .topbar {
    padding: 0.8rem 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -320px;
    height: 100vh;
    width: 280px;
    background: #ffffff;
    border-left: 1px solid var(--border);
    box-shadow: -6px 0 20px rgba(10, 34, 25, 0.12);
    padding: 5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.4rem;
    transition: right 0.25s ease;
    z-index: 40;
    overflow-y: auto;
  }

  .drawer-open .nav-links {
    right: 0;
  }

  .nav-links a {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    background: #ffffff;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .drawer-overlay {
    z-index: 20;
  }

  .hero {
    padding: 2rem 0 1rem;
  }

  .hero .hero-grid {
    gap: 1rem;
  }

  .hero .panel {
    padding: 1rem;
  }

  .hero .hero-image-panel {
    min-height: 200px;
  }

  .hero .hero-image-panel img {
    height: auto;
    max-height: 280px;
    object-fit: cover;
  }

  .hero .hero-main-content .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .hero-main-content .button-row .btn {
    text-align: center;
  }

  .hero .hero-badges {
    justify-content: center;
  }

  .hero .hero-badges span {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .hero-bg-rotated {
    transform: rotate(-5deg) scale(1.05) !important;
    top: -5% !important;
    left: -5% !important;
    right: -5% !important;
    bottom: -5% !important;
  }
}

/* ─── Responsive: Mobile phones ────────────────────────────────── */
@media (max-width: 600px) {
  .container {
    width: min(100%, 94%);
  }

  .topbar {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  .brand {
    flex: 0 1 auto;
  }

  .menu-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    margin-left: auto;
  }

  .hero {
    padding: 1.25rem 0 0.75rem;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .hero .hero-main-content .hero-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .hero-badges span {
    justify-content: center;
  }

  .hero .hero-image-panel {
    min-height: 180px;
  }

  .hero .hero-image-panel img {
    max-height: 200px;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    gap: 0.85rem;
  }

  .section-head h2 {
    font-size: 1.2rem;
  }

  .card {
    padding: 0.75rem;
  }

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

  .hero-bg-rotated {
    transform: rotate(0deg) scale(1) !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
  }

  .breadcrumb {
    font-size: 0.78rem;
  }
}

/* Add this rule to your styles.css or inside a <style> block to ensure grid cards and hero grids stack properly on mobile devices */
@media (max-width: 768px) {
  .hero-grid,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }
}
