/*
Theme Name:   Compassion Foundation
Theme URI:    https://compassionfoundation.charity
Description:  Hello Elementor child theme for Compassion Foundation Corp. WCAG 2.2 AAA compliant. Warm & illustrative design with Navy, Cream, Teal, Gold, and Green palette.
Author:       Compassion Foundation Corp.
Author URI:   https://compassionfoundation.charity
Template:     hello-elementor
Version:      1.0.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  compassion-foundation
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand palette */
  --navy:           #1A2D5A;   /* 10.7:1 on cream */
  --navy-light:     #243972;
  --gold:           #D4A82E;   /* decorative only on light; large text on navy: 5.2:1 */
  --gold-light:     #E8C35A;
  --green:          #2B6645;   /* 9.7:1 on cream */

  /* Teal — two tiers */
  --teal:           #0D5E53;   /* 7.0:1 on cream, 7.7:1 on white — AAA */
  --teal-hover:     #0A4A42;
  --teal-bright:    #2A9D8F;   /* decorative only */

  /* Backgrounds */
  --cream:          #FAF3E8;
  --cream-mid:      #F2E8D8;
  --cream-dark:     #E8DCC8;
  --white:          #FFFFFF;

  /* Text — AAA on cream (7:1+) */
  --text:           #1A2D5A;   /* 10.7:1 on cream */
  --text-muted:     #3D4A6A;   /* 7.07:1 on cream */
  --border:         #E2D9C8;

  /* Typography */
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Layout */
  --max-w:   1160px;
  --px:      clamp(1.25rem, 5vw, 2.5rem);
  --section: 5rem;

  /* Shape */
  --radius:    14px;
  --radius-sm:  8px;

  /* Shadows */
  --shadow:    0 1px 3px rgba(26,45,90,.07), 0 4px 16px rgba(26,45,90,.09), 0 8px 28px rgba(26,45,90,.05);
  --shadow-md: 0 2px 6px rgba(26,45,90,.10), 0 8px 28px rgba(26,45,90,.14), 0 18px 52px rgba(26,45,90,.09);
}


/* ============================================================
   BASE STYLES
   ============================================================ */
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--navy); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p  { color: var(--text-muted); }


/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--px); }
.section   { padding: var(--section) 0; }


/* ============================================================
   GLOBAL FOCUS INDICATOR — WCAG 2.4.13 AAA
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }


/* ============================================================
   SKIP NAVIGATION — WCAG 2.4.1
   ============================================================ */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .9375rem;
  transition: top .1s;
}
.skip-nav:focus { top: 1rem; }


/* ============================================================
   BUTTONS (44px min touch target — WCAG 2.5.5 AAA)
   ============================================================ */
.btn {
  display: inline-block;
  padding: .9375rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: .02em;
  transition: background .2s, transform .2s, box-shadow .2s;
  text-align: center;
  min-height: 44px;
  line-height: 1.3;
}
.btn-teal   { background: var(--teal); color: #fff; }
.btn-teal:hover {
  background: var(--teal-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,94,83,.35);
}
.btn-navy   { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.75);
}
.btn-outline:hover { background: #fff; color: var(--navy); }


/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(26,45,90,.06);
}
/* Hello Elementor sets display:flex on .site-header — .container must fill it */
.site-header .container {
  width: 100%;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo-link img,
.custom-logo {
  height: 72px;
  width: auto;
  max-width: none;
}

/* Nav list — works with wp_nav_menu output */
.nav-list,
.nav-list ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li { list-style: none; }
.nav-list a {
  display: block;
  padding: 14px 6px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-list a:hover,
.nav-list .current-menu-item > a,
.nav-list a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 4px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: #fff;
  padding: 4.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 2rem;
}
.footer-brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  margin-bottom: .25rem;
  text-transform: uppercase;
}
.footer-brand-tagline {
  font-size: .8125rem;
  color: rgba(255,255,255,.82);
  margin-bottom: 1.25rem;
  font-style: italic;
}
.footer-brand > p {
  color: rgba(255,255,255,.82);
  font-size: .875rem;
  line-height: 1.7;
  max-width: 300px;
}
.footer-col h4 {
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.footer-nav a {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,.82);
  font-size: .9rem;
  padding: 8px 0;
  min-height: 44px;
  transition: color .2s;
}
.footer-nav a:hover { color: #fff; }

/* Footer wp_nav_menu resets */
.footer-nav ul,
.footer-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-address {
  font-style: normal;
  color: rgba(255,255,255,.82);
  font-size: .875rem;
  line-height: 1.9;
}
.footer-address a { color: rgba(255,255,255,.82); transition: color .2s; }
.footer-address a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}
.footer-bottom p {
  color: rgba(255,255,255,.82);
  font-size: .8rem;
}


/* ============================================================
   SECTION HELPERS (used via Elementor CSS Classes)
   ============================================================ */
.section-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .75rem;
  display: block;
}


/* ============================================================
   HELLO ELEMENTOR OVERRIDE
   theme.css caps .site-header/.site-footer at 1140px on ≥1200px
   screens. The header-full-width / footer-full-width classes
   handle the outer elements; this overrides the .header-inner cap.
   ============================================================ */
@media (min-width: 1200px) {
  .site-header .header-inner {
    max-width: var(--max-w);
  }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2.25rem; }
}

@media (max-width: 720px) {
  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: .5rem var(--px) 1rem;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 8px 24px rgba(26,45,90,.10);
  }
  .nav-list.open { display: flex; }
  .nav-list a {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
  }
  .nav-list a:last-child { border-bottom: none; }
  .nav-list li:last-child a { border-bottom: none; }
  .nav-toggle { display: flex; }

  .footer-bottom { flex-direction: column; text-align: center; }

  :root { --section: 3.5rem; }
}


/* ============================================================
   REDUCED MOTION — WCAG 2.3.3 AAA
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .btn:hover,
  .btn-teal:hover,
  .btn-navy:hover { transform: none; box-shadow: none; }
}
