/* ============================================================
   Agratix page upgrades (About, Case Studies, Approach, Contact)
   Same count-aware card-grid standardization as the service pages,
   so leftover cards centre/balance instead of stranding blank space.
   Loaded last + !important to win over inline <style> rules.
   ============================================================ */

:is(
  .values-grid, .case-studies-grid, .methodology-grid,
  .principles-grid, .process-grid, .info-grid
) {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 1.75rem !important;
}

:is(
  .values-grid, .case-studies-grid, .methodology-grid,
  .principles-grid, .process-grid, .info-grid
) > * {
  flex: 1 1 300px !important;
  max-width: 380px !important;
  margin: 0 !important;
}

/* 2 or 4 cards -> two per row (4 becomes a tidy 2x2) */
:is(
  .values-grid, .case-studies-grid, .methodology-grid,
  .principles-grid, .process-grid, .info-grid
):has(> :last-child:nth-child(2)) > *,
:is(
  .values-grid, .case-studies-grid, .methodology-grid,
  .principles-grid, .process-grid, .info-grid
):has(> :last-child:nth-child(4)) > * {
  flex: 1 1 calc(50% - 1rem) !important;
  max-width: 520px !important;
}

@media (max-width: 900px) {
  :is(
    .values-grid, .case-studies-grid, .methodology-grid,
    .principles-grid, .process-grid, .info-grid
  ) > * { flex-basis: calc(50% - 1rem) !important; max-width: none !important; }
}

@media (max-width: 560px) {
  :is(
    .values-grid, .case-studies-grid, .methodology-grid,
    .principles-grid, .process-grid, .info-grid
  ) > * { flex-basis: 100% !important; }
}

/* ---------- About: "who you work with" section ---------- */
.about-team { padding: 40px 5% 20px; }
.about-team-inner { max-width: 1080px; margin: 0 auto; }
.about-team-eyebrow {
  display: inline-block; padding: 0.4rem 1rem; background: rgba(72,145,86,.1); color: #489156;
  border-radius: 50px; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 1rem;
}
.about-team h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; color: #1a1a1a; margin: 0 0 1rem; }
.about-team-lead { font-size: 1.12rem; line-height: 1.65; color: #4a5568; max-width: 760px; margin: 0 0 2.4rem; }
.about-team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.about-team-point {
  background: #fff; border: 1px solid rgba(28,55,101,.08); border-radius: 16px; padding: 26px 26px 24px;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease, border-color .3s ease;
}
.about-team-point:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(72,145,86,.12); border-color: rgba(72,145,86,.3); }
.att-ico {
  width: 48px; height: 48px; border-radius: 13px; margin-bottom: 14px;
  background: linear-gradient(135deg, #5da86a, #489156); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.about-team-point h3 { font-size: 1.15rem; color: #1c3765; margin: 0 0 8px; }
.about-team-point p { font-size: .95rem; line-height: 1.6; color: #4a5568; margin: 0; }
.about-founder {
  margin: 34px 0 0; padding: 28px 32px; background: #f7f9fc; border-left: 4px solid #489156; border-radius: 0 16px 16px 0;
}
.about-founder blockquote { margin: 0 0 12px; font-size: 1.18rem; line-height: 1.6; color: #23303f; font-style: italic; }
.about-founder figcaption { font-weight: 700; color: #1c3765; font-size: .95rem; }
body.dark-theme .about-team h2 { color: #f8f9fa; }
body.dark-theme .about-team-lead, body.dark-theme .about-team-point p { color: rgba(226,232,240,.8); }
body.dark-theme .about-team-point { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
body.dark-theme .about-team-point h3 { color: #e2e8f0; }
body.dark-theme .about-founder { background: rgba(255,255,255,.04); }
body.dark-theme .about-founder blockquote { color: #e2e8f0; }
@media (max-width: 640px) { .about-team-grid { grid-template-columns: 1fr; } }

/* ============================================================
   "Five Stages to Success" (approach page) — a 5-step sequential
   process reads best as an even row of five numbered steps, so it
   never leaves an orphan 3+2 row. Auto-numbered via a counter.
   ============================================================ */
.process-grid:has(> :last-child:nth-child(5)) {
  counter-reset: pstep;
  justify-content: center !important;
}
.process-grid:has(> :last-child:nth-child(5)) > .process-card {
  flex: 1 1 calc(20% - 1.4rem) !important;
  max-width: calc(20% - 1.4rem) !important;
  position: relative;
}
.process-grid:has(> :last-child:nth-child(5)) > .process-card .process-icon {
  counter-increment: pstep;
}
.process-grid:has(> :last-child:nth-child(5)) > .process-card .process-icon::after {
  content: counter(pstep);
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1c3765;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(28,55,101,.3);
}
.process-grid:has(> :last-child:nth-child(5)) > .process-card .process-icon {
  position: relative;
}
@media (max-width: 1000px) {
  .process-grid:has(> :last-child:nth-child(5)) > .process-card {
    flex-basis: calc(33.333% - 1.2rem) !important;
    max-width: calc(33.333% - 1.2rem) !important;
  }
}
@media (max-width: 700px) {
  .process-grid:has(> :last-child:nth-child(5)) > .process-card {
    flex-basis: calc(50% - 1rem) !important;
    max-width: none !important;
  }
}
@media (max-width: 480px) {
  .process-grid:has(> :last-child:nth-child(5)) > .process-card {
    flex-basis: 100% !important;
  }
}

/* ============================================================
   Contact page — "Book a free call" option in the sidebar,
   giving visitors a scheduling path alongside the message form.
   ============================================================ */
.contact-book-cta {
  margin-top: 1.5rem;
  padding: 1.6rem 1.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(72,145,86,0.09), rgba(72,145,86,0.02));
  border: 1px solid rgba(72,145,86,0.22);
  text-align: center;
}
.contact-book-cta h3 { margin: 0 0 0.35rem; color: #1c3765; font-size: 1.1rem; }
.contact-book-cta p { margin: 0 0 1rem; color: #5b6573; font-size: 0.92rem; line-height: 1.55; }
.contact-book-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #1c3765, #489156);
  color: #fff; font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(28,55,101,0.2);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.contact-book-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(28,55,101,0.28); filter: brightness(1.05); }
body.dark-theme .contact-book-cta h3 { color: #e2e8f0; }
body.dark-theme .contact-book-cta p { color: rgba(226,232,240,.8); }
