/* ==========================================================================
   Footer + Prefooter Visual Consistency
   Final layer for shared bottom sections. Linked last on every page.
   ========================================================================== */

.pre-footer-cta,
.cta-band {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--aim-sky-soft, #eaf5fb) 100%) !important;
  border-top: 1px solid rgba(79, 163, 217, 0.14) !important;
  padding: 0 !important;
}

.pre-footer-inner,
.cta-band-inner {
  width: min(var(--container-wide, 1320px), calc(100% - 56px)) !important;
  min-height: 138px !important;
  margin-inline: auto !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  gap: clamp(22px, 3vw, 42px) !important;
  align-items: center !important;
  padding-block: 28px !important;
}

.cta-leaf,
.pre-footer-mark {
  width: 74px !important;
  color: var(--aim-sky-500, #6fb2df) !important;
  opacity: 0.88 !important;
}

.pre-footer-copy h2,
.cta-band h2 {
  margin: 0 0 6px !important;
  color: var(--aim-blue, #042249) !important;
  font-size: clamp(30px, 3vw, 46px) !important;
  line-height: 0.98 !important;
  font-family: var(--font-heading) !important;
  font-weight: 500 !important;
}

.pre-footer-copy p,
.cta-band p {
  margin: 0 !important;
  color: var(--aim-text-soft, #4e5a67) !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

.footer-cta,
.pre-footer-cta .btn,
.cta-band .btn {
  min-height: 46px !important;
  white-space: nowrap !important;
  background: var(--aim-olive-900, #4f5d3c) !important;
  border-color: var(--aim-olive-900, #4f5d3c) !important;
  color: #ffffff !important;
}

/* Footer */
.site-footer {
  background:
    radial-gradient(circle at top right, rgba(79, 163, 217, 0.14), transparent 26rem),
    linear-gradient(135deg, #042249 0%, #06284f 100%) !important;
  color: #ffffff !important;
  padding: 58px 0 38px !important;
}

.footer-grid {
  width: min(var(--container-wide, 1320px), calc(100% - 56px)) !important;
  margin-inline: auto !important;
  display: grid !important;
  grid-template-columns: 1.4fr 0.85fr 1.08fr 1.45fr 1.18fr !important;
  gap: clamp(30px, 4vw, 62px) !important;
  align-items: start !important;
}

.footer-logo {
  width: 250px !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 0 18px !important;
}

.footer-brand p {
  max-width: 310px !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-family: var(--font-heading) !important;
  font-style: italic !important;
  font-size: 19px !important;
  line-height: 1.25 !important;
}

.footer-column h3 {
  margin: 0 0 16px !important;
  color: var(--aim-sky-300, #a9d5ee) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  font-family: var(--font-body) !important;
}

.footer-column a,
.footer-column p,
.footer-column li,
.hours-row {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.footer-column a {
  display: block !important;
  margin-bottom: 10px !important;
}

.footer-column a:hover {
  color: #ffffff !important;
}

.footer-contact-item {
  display: grid !important;
  grid-template-columns: 20px 1fr !important;
  gap: 12px !important;
  align-items: start !important;
  margin-bottom: 12px !important;
}

.footer-icon {
  color: var(--aim-sky-300, #a9d5ee) !important;
  line-height: 1.45 !important;
}

.hours-row {
  display: grid !important;
  grid-template-columns: 84px 1fr !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
}

.footer-note {
  margin-top: 12px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.footer-bottom {
  width: min(var(--container-wide, 1320px), calc(100% - 56px)) !important;
  margin: 38px auto 0 !important;
  padding-top: 22px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--space-4, 16px) !important;
  justify-content: space-between !important;
  color: rgba(255, 255, 255, 0.56) !important;
  font-size: 12px !important;
}

.footer-bottom-links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--space-4, 16px) !important;
}

/* Defensive: if a page still has an old dark prefooter class, force it to the normal light CTA style. */
.services-blue-cta,
.patients-blue-banner {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--aim-sky-soft, #eaf5fb) 100%) !important;
  color: var(--aim-text, #142033) !important;
  padding: 0 !important;
  border-top: 1px solid rgba(79, 163, 217, 0.14) !important;
}

.services-blue-cta h2,
.patients-blue-banner h2 {
  color: var(--aim-blue, #042249) !important;
}

.services-blue-cta p,
.patients-blue-banner p {
  color: var(--aim-text-soft, #4e5a67) !important;
}

@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  .pre-footer-inner,
  .cta-band-inner {
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }

  .footer-cta {
    width: fit-content !important;
  }
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-logo {
    width: 220px !important;
  }

  .footer-bottom {
    flex-direction: column !important;
  }

  .pre-footer-inner,
  .cta-band-inner {
    width: min(100% - 32px, var(--container, 1180px)) !important;
  }

  .footer-cta {
    width: 100% !important;
  }
}

/* Mobile footer compression: two-column layout for shorter site-wide mobile footer. */
@media (max-width: 720px) {
  .site-footer {
    padding: 42px 0 30px !important;
  }

  .footer-grid {
    width: min(100% - 32px, var(--container, 1180px)) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 22px !important;
    row-gap: 28px !important;
    align-items: start !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  .footer-logo {
    width: 210px !important;
    margin: 0 0 12px !important;
  }

  .footer-brand p {
    max-width: 100% !important;
    font-size: 17px !important;
    line-height: 1.28 !important;
  }

  .footer-column h3 {
    margin-bottom: 10px !important;
    font-size: 10px !important;
    letter-spacing: 0.13em !important;
  }

  .footer-column a,
  .footer-column p,
  .footer-column li,
  .hours-row {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .footer-column a {
    margin-bottom: 8px !important;
  }

  .footer-contact-item {
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
    overflow-wrap: anywhere !important;
  }

  .hours-row {
    grid-template-columns: minmax(52px, 0.75fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  .footer-note {
    margin-top: 8px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .footer-bottom {
    width: min(100% - 32px, var(--container, 1180px)) !important;
    margin-top: 28px !important;
    padding-top: 18px !important;
    gap: 14px !important;
  }

  .footer-bottom-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 16px !important;
  }

  .footer-bottom-links a,
  .footer-bottom-links button {
    font-size: 12px !important;
    line-height: 1.35 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 360px) {
  .footer-grid {
    column-gap: 16px !important;
  }

  .footer-column a,
  .footer-column p,
  .footer-column li,
  .hours-row {
    font-size: 12.5px !important;
  }
}

/* Final mobile footer override: keep footer link groups in two columns site-wide. */
@media (max-width: 720px) {
  .site-footer {
    padding-top: 32px !important;
    padding-bottom: 92px !important;
  }

  .site-footer .footer-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    width: min(100% - 32px, var(--container, 1180px)) !important;
    max-width: 100% !important;
    gap: 26px 20px !important;
    align-items: start !important;
  }

  .site-footer .footer-grid > .footer-brand {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .site-footer .footer-grid > .footer-column {
    grid-column: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    text-align: left !important;
  }

  .site-footer .footer-grid > .footer-column:nth-child(2) {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  .site-footer .footer-grid > .footer-column:nth-child(3) {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  .site-footer .footer-grid > .footer-column:nth-child(4) {
    grid-column: 1 / 2 !important;
    grid-row: 3 !important;
  }

  .site-footer .footer-grid > .footer-column:nth-child(5) {
    grid-column: 2 / 3 !important;
    grid-row: 3 !important;
  }

  .site-footer .footer-column h3 {
    margin: 0 0 8px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.13em !important;
    text-align: left !important;
  }

  .site-footer .footer-column a,
  .site-footer .footer-column p,
  .site-footer .footer-column li,
  .site-footer .hours-row {
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .site-footer .footer-column a {
    margin-bottom: 7px !important;
  }

  .site-footer .footer-contact-item {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
    margin-bottom: 8px !important;
  }

  .site-footer .footer-contact-item span:last-child {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  .site-footer .hours-row {
    display: grid !important;
    grid-template-columns: minmax(50px, 0.75fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
  }

  .site-footer .footer-note {
    margin-top: 8px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    text-align: left !important;
  }

  .site-footer .footer-bottom {
    width: min(100% - 32px, var(--container, 1180px)) !important;
    max-width: 100% !important;
    margin-top: 24px !important;
    padding-top: 16px !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .site-footer .footer-bottom-links {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px 16px !important;
  }
}

@media (max-width: 360px) {
  .site-footer .footer-grid {
    gap: 24px 16px !important;
  }

  .site-footer .footer-column a,
  .site-footer .footer-column p,
  .site-footer .footer-column li,
  .site-footer .hours-row {
    font-size: 12px !important;
  }
}
