/* ============================================================
   global.css — charitablegiving.ca Design System
   Built on the same design language as studentfinancial.ca:
   DM Sans + Fraunces, cream/green/amber/coral palette, pill
   buttons, sticky cream nav, light footer.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

/* ── Custom Properties ── */
:root {
  /* Core palette — shared with studentfinancial.ca */
  --primary: #1A6B5A;
  --primary-light: #248c77;
  --secondary: #E8A020;
  --secondary-light: #f5b94d;
  --accent: #E8614A;
  --bg: #FAF7F2;
  --text: #2D2D2D;
  --muted: #7A8A85;
  --white: #FFFFFF;
  --shadow: 0 4px 20px rgba(26, 107, 90, 0.08);
  --shadow-hover: 0 10px 30px rgba(26, 107, 90, 0.12);
  --radius: 16px;
  --transition: 0.25s ease;

  /* charitablegiving.ca's richer token set, remapped onto the shared
     palette above so every existing page keeps working unchanged. */
  --color-navy: var(--primary);
  --color-navy-dark: #123F35;
  --color-navy-light: var(--primary-light);
  --color-teal: var(--primary-light);
  --color-teal-light: #4DA695;
  --color-teal-pale: #EAF3F0;
  --color-green: var(--secondary);
  --color-green-light: var(--secondary-light);
  --color-green-pale: #FBF1DD;
  --color-cream: var(--bg);
  --color-linen: var(--white);
  --color-ink: var(--text);
  --color-muted: var(--muted);
  --color-white: var(--white);
  --color-border: rgba(26, 107, 90, 0.15);
  --color-success: var(--primary);
  --color-error: #C0392B;
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: var(--font-body);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: var(--shadow);
  --shadow-md: var(--shadow-hover);
  --shadow-lg: 0 20px 60px rgba(26, 107, 90, 0.18);
  --max-width: 1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }
p { line-height: 1.75; }
.text-muted { color: var(--color-muted); }
.text-green { color: var(--primary); }
.text-teal { color: var(--color-teal); }
.text-white { color: var(--color-white); }
.text-navy { color: var(--color-navy); }
.italic { font-style: italic; }

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section-padding { padding: 100px 0; }
@media (max-width: 768px) { .section-padding { padding: 60px 0; } }

/* ── Navigation ──
   Sticky, solid cream bar — same treatment as studentfinancial.ca. */
.site-nav {
  background-color: var(--bg);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-icon {
  height: 40px;
  width: auto;
  display: block;
}
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #0A2E5C;
  white-space: nowrap;
}
.nav-logo-accent { color: #7DB950; }
.nav-links {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0 auto;
  gap: 32px;
}
.nav-links a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 700; }
.nav-cta { flex-shrink: 0; }
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  transition: background var(--transition);
}
.nav-hamburger:hover { background: rgba(26, 107, 90, 0.08); }

@media (max-width: 992px) {
  .nav-links { display: none; }
  .nav-container .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}

/* Mobile Nav Overlay — kept as charitablegiving's own full-screen treatment */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--color-navy-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-white);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.nav-mobile-close:hover { background: rgba(255,255,255,0.1); }
.nav-mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.nav-mobile-links a {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-white);
  transition: color var(--transition);
}
.nav-mobile-links a:hover,
.nav-mobile-links a.active { color: var(--secondary-light); }

/* ── Buttons ──
   Pill-shaped, same recipe as studentfinancial.ca. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(26, 107, 90, 0.3);
}
.btn-secondary {
  background: var(--secondary);
  color: var(--text);
  border-color: var(--secondary);
}
.btn-secondary:hover {
  background: var(--secondary-light);
  border-color: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(232, 160, 32, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline-white:hover { background: var(--white); color: var(--primary); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
  padding-left: 0; padding-right: 0;
}
.btn-ghost:hover { color: var(--primary-light); box-shadow: none; transform: none; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-body { padding: 24px; }
.card-header { padding: 24px 24px 0; }
.card-footer { padding: 0 24px 24px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-navy { background: var(--color-navy); color: var(--color-white); }
.badge-teal { background: var(--color-teal-pale); color: var(--color-teal); }
.badge-green { background: var(--color-green-pale); color: #B87A0F; }
.badge-muted { background: var(--color-linen); color: var(--color-muted); }
.badge-advanced { background: var(--color-navy); color: var(--color-white); }
.badge-intermediate { background: var(--color-teal-pale); color: var(--color-teal); }
.badge-beginner { background: var(--color-green-pale); color: #B87A0F; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
}
.form-control {
  padding: 14px 20px;
  border: 1px solid rgba(26, 107, 90, 0.2);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-control:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 107, 90, 0.05);
}
.form-control::placeholder { color: var(--color-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A8A85' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 0.8rem; color: var(--color-muted); }
.form-error { font-size: 0.8rem; color: var(--color-error); }
.form-success {
  background: var(--color-green-pale);
  border: 1px solid var(--secondary);
  color: #8a5c0d;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  display: none;
}
.form-success.visible { display: block; }

/* ── Scroll Animations ── */
.fade-in { opacity: 0; transition: opacity 0.6s ease; }
.fade-in.visible { opacity: 1; }
.slide-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.slide-up.visible { opacity: 1; transform: translateY(0); }
.slide-up:nth-child(2) { transition-delay: 0.1s; }
.slide-up:nth-child(3) { transition-delay: 0.2s; }
.slide-up:nth-child(4) { transition-delay: 0.3s; }

/* ── FAQ Accordion ── */
.accordion-item {
  border-bottom: 1px solid var(--color-border);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 16px;
  transition: color var(--transition);
}
.accordion-trigger:hover { color: var(--primary); }
.accordion-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: transform var(--transition);
}
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding var(--transition);
}
.accordion-item.open .accordion-content { max-height: 800px; }
.accordion-content-inner { padding-bottom: 20px; color: var(--color-muted); line-height: 1.75; }

/* ── Section Headers ── */
.section-header { margin-bottom: 48px; }
.section-header .section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 16px; color: var(--primary); }
.section-header p { color: var(--color-muted); max-width: 600px; font-size: 1.05rem; }
.text-center { text-align: center; }
.section-header.text-center p { margin-left: auto; margin-right: auto; }

/* ── CRA Number ── */
.cra-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.05em;
}

/* ── Footer ──
   Light cream footer — same treatment as studentfinancial.ca. */
.site-footer {
  background-color: var(--bg);
  color: var(--text);
  padding: 80px 0 40px;
  border-top: 1px solid rgba(26, 107, 90, 0.1);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  padding-bottom: 48px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-logo-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo-icon {
  height: 48px;
  width: auto;
  display: block;
}
.footer-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: #0A2E5C;
  white-space: nowrap;
}
.footer-logo-accent { color: #7DB950; }
.footer-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.footer-nav-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary); }
.footer-divider {
  height: 1px;
  background: rgba(26, 107, 90, 0.1);
  margin: 0 0 24px;
}
.footer-disclaimer {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.65;
  padding-bottom: 20px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(26, 107, 90, 0.1);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-bottom a { transition: color var(--transition); }
.footer-bottom a:hover { color: var(--primary); }
.footer-maple { font-size: 0.85rem; }

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-nav-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .footer-nav-columns { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Utility grids ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── Scroll padding for sticky nav ── */
html { scroll-padding-top: 90px; }

/* ── Disclaimer box ── */
.disclaimer-box {
  background: var(--color-teal-pale);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.65;
}

/* ── Callouts ── */
.callout-tip {
  background: var(--color-green-pale);
  border-left: 4px solid var(--secondary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
}
.callout-warning {
  background: var(--color-teal-pale);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
}
