/* ============================================================
   Action for Wellbeing — Custom CSS
   Complements Tailwind CDN. Covers focus rings, typography,
   and utility classes that Tailwind CDN cannot purge-generate.
   ============================================================ */

/* ---------- CSS Variables (mirrors Tailwind config) --------- */
:root {
  --teal:        #1A6B6B;
  --teal-light:  #2A9090;
  --teal-pale:   #E6F4F4;
  --sage:        #5A8A5A;
  --sage-light:  #EAF2EA;
  --stone:       #F7F5F2;
  --charcoal:    #1F2937;
  --slate2:      #4B5563;
  --muted:       #9CA3AF;
  --amber:       #D97706;
  --crisis-red:  #B91C1C;
  --border:      #E5E7EB;
  --white:       #FFFFFF;
}

/* ---------- Base -------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--stone);
  color: var(--charcoal);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

/* ---------- Accessibility: Skip Link ----------------------- */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  z-index: 9999;
  background: var(--teal);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.375rem 0.375rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
}

/* ---------- Accessibility: Focus Rings --------------------- */
*:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Remove outline for mouse users but keep for keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Visually Hidden (screen-reader only) ----------- */
.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;
}

/* ---------- Typography Helpers ----------------------------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--charcoal);
}

.text-teal        { color: var(--teal); }
.bg-teal          { background-color: var(--teal); }
.bg-teal-pale     { background-color: var(--teal-pale); }
.bg-sage-light    { background-color: var(--sage-light); }
.bg-stone         { background-color: var(--stone); }
.border-teal      { border-color: var(--teal); }
.text-sage        { color: var(--sage); }
.text-crisis      { color: var(--crisis-red); }
.text-amber       { color: var(--amber); }
.bg-amber         { background-color: var(--amber); }

/* ---------- Buttons ---------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--teal);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px; /* WCAG 2.5.5 touch target */
}
.btn-primary:hover {
  background-color: var(--teal-light);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s;
  border: 2px solid #fff;
  cursor: pointer;
  min-height: 44px;
}
.btn-outline:hover {
  background-color: rgba(255,255,255,0.15);
}

.btn-outline-teal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--teal);
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.2s;
  border: 2px solid var(--teal);
  cursor: pointer;
  min-height: 44px;
}
.btn-outline-teal:hover {
  background-color: var(--teal-pale);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  min-height: 44px;
}

/* ---------- Navigation ------------------------------------- */
.nav-link {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: color 0.2s, background-color 0.2s;
  position: relative;
}
.nav-link:hover {
  color: var(--teal);
  background-color: var(--teal-pale);
}
.nav-link.active {
  color: var(--teal);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: var(--teal);
  border-radius: 2px;
}

/* ---------- Cards ------------------------------------------ */
.card {
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.crisis-card {
  background: var(--white);
  border: 2px solid var(--teal);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* ---------- Hero Sections ---------------------------------- */
.hero-section {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.45));
}
.hero-content {
  position: relative;
  z-index: 1;
}

/* ---------- Emergency Bar ---------------------------------- */
.emergency-bar {
  background-color: var(--crisis-red);
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
}
.emergency-bar a {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Cookie Banner ---------------------------------- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-top: 4px solid var(--amber);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  padding: 1.25rem 1.5rem;
  display: none;
}

/* ---------- FAQ Accordion ---------------------------------- */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.accordion-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--charcoal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
  transition: background-color 0.2s;
}
.accordion-btn:hover {
  background-color: var(--teal-pale);
  color: var(--teal);
}
.accordion-btn[aria-expanded="true"] {
  background-color: var(--teal-pale);
  color: var(--teal);
}
.accordion-btn[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}
.accordion-icon {
  transition: transform 0.25s;
  flex-shrink: 0;
}
.accordion-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  background: var(--white);
  color: var(--slate2);
  line-height: 1.7;
}
.accordion-body.open {
  display: block;
}

/* ---------- Section Spacing -------------------------------- */
.section-padding {
  padding: 4rem 0;
}
@media (min-width: 768px) {
  .section-padding {
    padding: 5rem 0;
  }
}

/* ---------- Responsive Utilities --------------------------- */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 640px) {
  .container { padding: 0 2rem; }
}

/* ---------- External Link Icon ----------------------------- */
a[target="_blank"]::after {
  content: '\00a0\f08e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75em;
  vertical-align: middle;
  opacity: 0.7;
}

/* ---------- Form Styles ------------------------------------ */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s;
  min-height: 44px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,107,107,0.15);
}
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--charcoal);
}
.form-required {
  color: var(--crisis-red);
  margin-left: 0.25rem;
}
.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ---------- Breadcrumb ------------------------------------- */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
}
.breadcrumb a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}
.breadcrumb span {
  color: rgba(255,255,255,0.6);
}

/* ---------- Partner Logos ---------------------------------- */
.partner-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

/* ---------- Stats Band ------------------------------------- */
.stat-item {
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.875rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

/* ---------- Print Styles ----------------------------------- */
@media print {
  #cookie-banner, nav, footer { display: none !important; }
  body { background: white; color: black; }
  a { color: inherit; text-decoration: none; }
  .hero-overlay { display: none; }
}
