/* ================================================================
   KEEPCARE Rwanda — Responsive, SEO & WCAG 2.1 AA Stylesheet
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS Custom Properties
   ---------------------------------------------------------------- */
:root {
  --color-primary:    #123B27;
  --color-accent:     #E27A2F;
  --color-bg:         #FAFAF7;
  --color-text:       #20291F;
  --color-text-light: #42513F;
  --color-muted:      #5A6B57;
  --color-border:     #E1D8C3;
  --font-heading:     'Poppins', sans-serif;
  --font-body:        'Work Sans', sans-serif;
  --max-w:            1280px;
  --px:               32px;
  --radius-card:      16px;
}

/* ----------------------------------------------------------------
   2. Base resets
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
body { margin: 0; background: var(--color-bg); }

/* ----------------------------------------------------------------
   3. Skip Navigation Link (WCAG 2.1 — 2.4.1)
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -120%;
  left: 0;
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 0 0 10px 0;
  text-decoration: none;
  transition: top 0.2s;
  white-space: nowrap;
}
.skip-link:focus { top: 0; }

/* ----------------------------------------------------------------
   4. Global Focus Styles (WCAG 2.4.7)
   ---------------------------------------------------------------- */
*:focus-visible {
  outline: 3px solid var(--color-accent) !important;
  outline-offset: 3px !important;
  border-radius: 4px !important;
}

/* ----------------------------------------------------------------
   5. Screen-reader utility
   ---------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------
   6. Hamburger / Mobile-nav button
   ---------------------------------------------------------------- */
.kc-hamburger {
  display: none;   /* shown only in mobile breakpoint */
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.kc-hamburger:hover { border-color: rgba(18,59,39,0.15); }
.kc-hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #17311F;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ----------------------------------------------------------------
   7. Mobile Navigation Overlay
   ---------------------------------------------------------------- */
.kc-mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 198;
  background: var(--color-bg);
  overflow-y: auto;
  flex-direction: column;
  padding: 80px 24px 40px;
  gap: 2px;
}
.kc-mobile-nav.open { display: flex; }

.kc-mobile-nav-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: #F1F0EB;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 18px;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kc-mobile-nav a {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  color: #17311F;
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
}
.kc-mobile-nav a:hover { background: rgba(18,59,39,0.06); }

.kc-mobile-nav details { border-radius: 10px; }
.kc-mobile-nav details summary {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  color: #17311F;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kc-mobile-nav details summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
  transition: transform 0.2s;
}
.kc-mobile-nav details[open] summary::after { transform: rotate(180deg); }
.kc-mobile-nav details summary::-webkit-details-marker { display: none; }

.kc-mobile-sub-links {
  padding: 4px 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kc-mobile-sub-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-light);
  padding: 10px 14px;
}

.kc-mobile-nav-contact {
  margin-top: 12px;
  background: var(--color-accent) !important;
  color: #fff !important;
  text-align: center;
  border-radius: 999px !important;
  padding: 16px 24px !important;
  font-size: 16px !important;
}
.kc-mobile-nav-contact:hover { background: #c96820 !important; }

/* ----------------------------------------------------------------
   8. Responsive Grid & Layout Classes
      (use class + inline style together; media queries use
       !important to override inline grid-template-columns)
   ---------------------------------------------------------------- */

/* Header inner */
.kc-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--px);
}

/* Desktop nav wrapper */
.kc-desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  position: relative;
}

/* 2-column symmetric */
.kc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }

/* 3-column */
.kc-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }

/* 4-column */
.kc-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; }

/* 5-column (team) */
.kc-grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 22px; }

/* 6-column (partners) */
.kc-grid-6 { display: grid; grid-template-columns: repeat(6,1fr); gap: 18px; }

/* Hero asymmetric */
.kc-grid-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }

/* About asymmetric */
.kc-grid-about { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; align-items: center; }

/* Why-trust asymmetric */
.kc-grid-why { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }

/* Stats (border-right between cols) */
.kc-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); }

/* Footer */
.kc-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; }

/* Footer bottom row */
.kc-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Contact */
.kc-grid-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

/* Form 2-col */
.kc-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Updates / blog 2-col */
.kc-updates-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }

/* CTA/Consult banner */
.kc-consult-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ----------------------------------------------------------------
   9. Responsive Breakpoints
   ---------------------------------------------------------------- */

/* --- XL: ≤ 1280px --- */
@media (max-width: 1280px) {
  :root { --px: 24px; }
  .kc-grid-6 { grid-template-columns: repeat(4,1fr) !important; }
}

/* --- LG: ≤ 1024px --- */
@media (max-width: 1024px) {
  .kc-grid-4  { grid-template-columns: repeat(2,1fr) !important; }
  .kc-grid-5  { grid-template-columns: repeat(3,1fr) !important; }
  .kc-grid-6  { grid-template-columns: repeat(3,1fr) !important; }
  .kc-stats-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Strip side-borders in stats when wrapping */
  .kc-stats-grid > * { border-right: none !important; }
  .kc-stats-grid > *:nth-child(-n+2) {
    border-bottom: 1px solid rgba(255,255,255,0.14);
    padding-bottom: 28px;
    margin-bottom: 4px;
  }

  .kc-grid-hero { gap: 36px !important; }
  .kc-grid-about { gap: 32px !important; }
  .kc-grid-why { gap: 32px !important; }
}

/* --- MD: ≤ 768px --- */
@media (max-width: 768px) {
  :root { --px: 20px; }

  /* Show hamburger, hide desktop nav */
  .kc-hamburger        { display: flex !important; }
  .kc-desktop-nav      { display: none !important; }
  .kc-contact-btn-desktop { display: none !important; }
  .kc-topbar           { display: none !important; }

  /* Stack all grids */
  .kc-grid-2,
  .kc-grid-3,
  .kc-grid-4,
  .kc-grid-5,
  .kc-grid-6,
  .kc-grid-hero,
  .kc-grid-about,
  .kc-grid-why,
  .kc-grid-contact,
  .kc-footer-grid {
    grid-template-columns: 1fr !important;
  }

  /* Stats — keep 2-col on tablet */
  .kc-stats-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* Strip all stat borders cleanly */
  .kc-stats-grid > * { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.14); padding-bottom: 24px; margin-bottom: 4px; }
  .kc-stats-grid > *:last-child { border-bottom: none; margin-bottom: 0; }

  /* Updates/blog */
  .kc-updates-grid { grid-template-columns: 1fr !important; }

  /* Form */
  .kc-form-2col { grid-template-columns: 1fr !important; }

  /* Footer bottom */
  .kc-footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Section padding overrides */
  .kc-section-xl { padding-top: 56px !important; padding-bottom: 56px !important; }
  .kc-section-lg { padding-top: 48px !important; padding-bottom: 48px !important; }
  .kc-section-md { padding-top: 40px !important; padding-bottom: 40px !important; }

  /* Hero image height */
  .kc-hero-img { height: 260px !important; }

  /* Heading size overrides */
  .kc-h1-xl { font-size: 36px !important; line-height: 1.2 !important; }
  .kc-h1-lg { font-size: 32px !important; }
  .kc-h2-lg { font-size: 26px !important; }

  /* About circular images – simplify */
  .kc-about-float-container { height: 260px !important; }
  .kc-about-float-main { width: 220px !important; height: 250px !important; left: 50% !important; transform: translateX(-50%) !important; }
  .kc-about-float-sm { display: none !important; }

  /* CTA overlay text */
  .kc-cta-overlay-inner { left: 24px !important; right: 24px !important; }
}

/* --- SM: ≤ 480px --- */
@media (max-width: 480px) {
  .kc-stats-grid { grid-template-columns: 1fr !important; }
  .kc-grid-6 { grid-template-columns: repeat(2,1fr) !important; }

  .kc-h1-xl { font-size: 30px !important; }
  .kc-h1-lg { font-size: 28px !important; }
  .kc-h2-lg { font-size: 22px !important; }

  /* Breadcrumb banner */
  .kc-breadcrumb-section { height: 200px !important; }

  /* Tighten card padding */
  .kc-card-sm-pad { padding: 18px !important; }
}

/* ----------------------------------------------------------------
   10. Accessibility & Interactivity
   ---------------------------------------------------------------- */

/* Visible hover on nav links */
.kc-nav-link:hover { background: rgba(18,59,39,0.07) !important; }

/* Dropdown link hover */
.kc-dropdown a:hover { background: rgba(18,59,39,0.07); }

/* Card hover (augments inline style-hover) */
.kc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(18,59,39,0.12) !important;
}

/* Ensure sufficient color contrast on muted text — WCAG AA 4.5:1 */
/* (Existing #5A6B57 on #fff → 5.1:1  ✓) */

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------
   12. Project pages — animations & enhanced components
   ---------------------------------------------------------------- */

/* Entrance animations */
@keyframes kc-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes kc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes kc-icon-spin-in {
  from { opacity: 0; transform: scale(0.7) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.kc-anim-fade  { animation: kc-fade-in  0.6s ease both; }
.kc-anim-up    { animation: kc-fade-up  0.65s ease both; }
.kc-anim-up-1  { animation: kc-fade-up  0.65s 0.08s ease both; }
.kc-anim-up-2  { animation: kc-fade-up  0.65s 0.16s ease both; }
.kc-anim-up-3  { animation: kc-fade-up  0.65s 0.24s ease both; }
.kc-anim-up-4  { animation: kc-fade-up  0.65s 0.32s ease both; }

/* Section pill label */
.kc-section-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(226,122,47,0.1);
  color: #C86A1E;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* Homepage featured project cards */
.kc-project-card {
  position: relative;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18,59,39,0.06);
  color: inherit;
  display: block;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(.2,0,0,1), box-shadow 0.3s;
  overflow: hidden;
}
.kc-project-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 48px rgba(18,59,39,0.15);
}
.kc-card-img-wrap { overflow: hidden; position: relative; }
.kc-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(.2,0,0,1);
}
.kc-project-card:hover .kc-card-img { transform: scale(1.07); }
.kc-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18,59,39,0.55) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.kc-project-card:hover .kc-card-overlay { opacity: 1; }
.kc-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  pointer-events: none;
}

/* Objective card with left accent border */
.kc-obj-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px 18px 16px;
  border-left: 4px solid #E27A2F;
  box-shadow: 0 6px 18px rgba(18,59,39,0.06);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.kc-obj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(18,59,39,0.11);
  border-color: #123B27;
}
.kc-obj-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(226,122,47,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E27A2F;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  animation: kc-icon-spin-in 0.5s 0.3s ease both;
}

/* Project hero / page header banner */
.kc-project-hero {
  position: relative;
  height: 380px;
  overflow: hidden;
}
.kc-project-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18,59,39,0.82) 0%, rgba(18,59,39,0.4) 55%, rgba(18,59,39,0.15) 100%);
}
.kc-project-hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 32px 40px;
  gap: 12px;
}
.kc-hero-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 7px 16px;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
}
.kc-hero-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(226,122,47,0.25);
  border: 1px solid rgba(232,178,122,0.45);
  border-radius: 999px;
  padding: 5px 14px;
  align-self: flex-start;
}
.kc-hero-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 42px;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0,0,0,0.2);
  line-height: 1.18;
}

@media (max-width: 768px) {
  .kc-project-hero { height: 300px; }
  .kc-project-hero-content { padding: 0 16px 28px; }
  .kc-hero-title { font-size: 28px !important; }
}
@media (max-width: 480px) {
  .kc-project-hero { height: 260px; }
  .kc-project-hero-content { padding: 0 14px 24px; }
}

/* ----------------------------------------------------------------
   11. Print styles
   ---------------------------------------------------------------- */
@media print {
  .kc-hamburger,
  .kc-mobile-nav,
  header { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 11px; }
}

/* ----------------------------------------------------------------
   WhatsApp Floating Button
   ---------------------------------------------------------------- */
.kc-whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.kc-whatsapp-btn:hover,
.kc-whatsapp-btn:focus {
  background: #1ebe5d;
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
}
.kc-whatsapp-btn:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
@media print {
  .kc-whatsapp-btn { display: none; }
}
