/**
 * Core Metrics Consulting - Footer Stylesheet
 * Authoritative Visual & Design System implementation from final Build Guide Page 53
 * Deep navy background (#0F2F3A), white headings, light-gray text (#C9D6DA), 64px top / 32px bottom padding
 * Exactly 3 columns on desktop: Column 1 (wider) Company info, Column 2 Services (11), Column 3 Company (5)
 * Mobile: columns stack 1, 2, 3; Services and Company become accordions with 48px rows.
 */

.site-footer {
  background-color: var(--cmc-navy, #0F2F3A);
  color: #C9D6DA;
  padding: 64px 0 32px;
  border-top: 1px solid var(--cmc-gray, #D8E3E5);
  font-family: var(--font-sans);
}

.site-footer .wrap {
  width: var(--wrap);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   1. Exactly Three-Column Footer Grid (Page 53)
   "Column 1 (wider): white logo, the one-line description, phone, email, mailing address, social icons.
    Column 2: Services — the 11 services by their menu names.
    Column 3: Company — Who We Help, About Us, How We Work, Security & HIPAA, Contact Us."
   ========================================================================== */
.footer-grid,
.footer-grid-3col {
  display: grid;
  grid-template-columns: 4fr 3fr 3fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

/* Column 1 Branding & Details */
.footer-branding {
  margin-bottom: 16px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.footer-logo img {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.footer-company-desc {
  font-size: 15px;
  color: #C9D6DA;
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: 24px;
  max-width: 320px;
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  color: #C9D6DA;
  font-size: 15px;
  line-height: 1.5;
}

.footer-contact-item a,
.footer-office-item span {
  color: #C9D6DA;
  font-size: 15px;
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-contact-item a:hover,
.footer-contact-item a:focus {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Verified Social Profiles (A5: Instagram & Facebook, 44px tap target, left-aligned with contact text) */
.footer-social-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  margin-left: -12px; /* Aligns 20px centered SVG flush with contact text */
}

.footer-social-link {
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm, 8px);
  transition: background-color 200ms ease, color 200ms ease;
  text-decoration: none;
}

.footer-social-link:hover,
.footer-social-link:focus {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.12);
}

.footer-social-link svg {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF;
  fill: none;
}

/* ==========================================================================
   2. Column Headings & Links (Columns 2 & 3)
   ========================================================================== */
.footer-heading {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: #FFFFFF;
  margin-bottom: var(--space-24);
  margin-top: 0;
  text-transform: none;
  letter-spacing: normal;
}

/* On desktop, accordion toggle looks and acts like standard static heading */
.footer-accordion-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: #FFFFFF;
  text-align: left;
  display: block;
  width: 100%;
  pointer-events: none;
  cursor: default;
}

.footer-accordion-icon {
  display: none;
}

/* A3: Link spacing ~38px between baselines on desktop */
.footer-links {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-links li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.footer-links li a {
  color: #C9D6DA;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: color 200ms ease, text-decoration 200ms ease;
  display: inline-flex;
  align-items: center;
  line-height: 24px;
  min-height: 24px;
}

/* Footer links: hover turns white with underline (Page 53) */
.footer-links li a:hover,
.footer-links li a:focus {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   3. Bottom Bar (A7: Exact approved format and line structure)
   ========================================================================== */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-24);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: #C9D6DA;
}

.footer-bottom-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: #C9D6DA;
  line-height: 1.6;
}

.footer-copyright {
  font-size: 14px;
  color: #C9D6DA;
}

.footer-separator {
  color: #C9D6DA;
  padding: 0 2px;
  user-select: none;
}

.footer-legal-link,
.footer-legal-btn {
  color: #C9D6DA;
  font-size: 14px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 200ms ease;
  display: inline-block;
}

.footer-legal-link:hover,
.footer-legal-link:focus,
.footer-legal-btn:hover,
.footer-legal-btn:focus {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-no-phi-notice {
  width: 100%;
  margin-top: 4px;
  font-size: 14px;
  color: #C9D6DA;
  line-height: 1.5;
}

/* ==========================================================================
   4. Tablet Responsiveness (768px – 1023px)
   ========================================================================== */
@media (max-width: 1023px) and (min-width: 768px) {
  .footer-grid,
  .footer-grid-3col {
    grid-template-columns: 4fr 3fr 3fr;
    gap: 32px;
  }
}

/* ==========================================================================
   5. Mobile Footer (Below 768px)
   "Mobile: columns stack in order 1, 2, 3; Services and Company become accordions with 48 px rows."
   ========================================================================== */
@media (max-width: 767px) {
  .site-footer {
    padding: 48px 0 32px;
  }

  .footer-grid,
  .footer-grid-3col {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 36px;
  }

  /* Make accordion toggles interactive on mobile */
  .footer-heading {
    margin-bottom: 0;
  }

  .footer-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    pointer-events: auto;
    font-size: 16px;
  }

  .footer-accordion-toggle:focus {
    outline: 2px solid var(--cmc-teal, #135C68);
    outline-offset: 2px;
  }

  .footer-accordion-icon {
    display: inline-block;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    color: #FFFFFF;
  }

  /* Collapsed by default on mobile */
  .footer-col-services .footer-links,
  .footer-col-company .footer-links {
    display: none;
    flex-direction: column;
    gap: 0;
    padding-top: 4px;
    padding-bottom: 8px;
  }

  .footer-col-services .footer-links.is-open,
  .footer-col-company .footer-links.is-open {
    display: flex !important;
  }

  .footer-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .footer-links li a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 15px;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
  }
}
