/*
 * TherapyBuilt -- footer.css
 *
 * Footer layout and surface treatments are controlled by TB_Footer. Every
 * color derives from the active TherapyBuilt palette; no practice-specific
 * values live here.
 */

/* Shell and semantic surfaces */
.tb-footer {
  --tb-footer-bg: var(--tb-surface-2, #e8e4e0);
  --tb-footer-fg: var(--tb-on-surface-2, var(--tb-text, #26352b));
  --tb-footer-heading: var(--tb-heading-on-surface-2, var(--tb-heading, #203126));
  --tb-footer-muted: var(--tb-muted-on-surface-2, var(--tb-text-muted, #657168));
  --tb-footer-border: rgba(0, 0, 0, .1);
  --tb-footer-link-hover: var(--tb-brand-on-surface-2, var(--tb-primary, #5a7a5e));
  background-color: var(--tb-footer-bg);
  background-image: none;
  color: var(--tb-footer-fg);
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: 0;
}

.tb-footer--surface-auto,
.tb-footer--surface-soft {
  --tb-footer-bg: var(--tb-surface-2, var(--tb-surface, #eee8e2));
}

.tb-footer--surface-base {
  --tb-footer-bg: var(--tb-bg, #faf9f6);
  --tb-footer-fg: var(--tb-on-bg, var(--tb-text, #26352b));
  --tb-footer-heading: var(--tb-heading-on-bg, var(--tb-heading, #203126));
  --tb-footer-muted: var(--tb-muted-on-bg, var(--tb-text-muted, #657168));
  --tb-footer-link-hover: var(--tb-brand-on-bg, var(--tb-primary, #5a7a5e));
}

.tb-footer--surface-wash {
  --tb-footer-bg: color-mix(in srgb, var(--tb-primary-light, #d4e5d6) 38%, var(--tb-bg, #faf9f6));
  --tb-footer-fg: var(--tb-on-wash, var(--tb-text, #26352b));
  --tb-footer-heading: var(--tb-on-wash, var(--tb-heading, #203126));
  --tb-footer-muted: var(--tb-muted-on-wash, var(--tb-text-muted, #657168));
  --tb-footer-link-hover: var(--tb-brand-on-bg, var(--tb-primary, #5a7a5e));
  background-image: linear-gradient(
    130deg,
    color-mix(in srgb, var(--tb-primary-light, #d4e5d6) 58%, var(--tb-bg, #faf9f6)),
    color-mix(in srgb, var(--tb-accent-light, #f0ddd3) 18%, var(--tb-bg, #faf9f6)) 68%,
    var(--tb-bg, #faf9f6)
  );
}

.tb-footer--surface-emphasis {
  --tb-footer-bg: var(--tb-emphasis-start, var(--tb-primary-dark, #35523b));
  --tb-footer-fg: var(--tb-on-emphasis, var(--tb-white));
  --tb-footer-heading: var(--tb-on-emphasis, var(--tb-white));
  --tb-footer-muted: var(--tb-muted-on-emphasis, var(--tb-on-emphasis, var(--tb-white)));
  --tb-footer-border: color-mix(in srgb, var(--tb-on-emphasis, var(--tb-white)) 24%, transparent);
  --tb-footer-link-hover: var(--tb-on-emphasis, var(--tb-white));
  background-image: linear-gradient(
    135deg,
    var(--tb-emphasis-start, var(--tb-primary-dark, #35523b)),
    color-mix(in srgb, var(--tb-emphasis-mid, var(--tb-primary, #5a7a5e)) 86%, var(--tb-emphasis-end, var(--tb-accent-dark, #80523f)))
  );
}

.tb-footer__inner {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
}

/* Content grid -- count classes prevent an empty visual column. */
.tb-footer__grid {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--tb-footer-border);
}

.tb-footer__grid--columns-1 {
  grid-template-columns: minmax(0, 1fr);
  max-width: 680px;
}

.tb-footer__grid--columns-2 {
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 1fr);
}

.tb-footer__grid--columns-3 {
  grid-template-columns: minmax(0, 1.45fr) minmax(180px, .8fr) minmax(220px, 1fr);
}

/* Brand column */
.tb-footer__logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  line-height: 0;
  margin-bottom: var(--space-3);
}

/*
 * Footer logos use their own bounded dimensions. Do not inherit the header's
 * --tb-logo-height value: a wide header lockup can otherwise become oversized
 * in compact or centered footers. The two-axis cap works for horizontal,
 * square, and portrait practice marks without stretching or cropping them.
 */
.tb-footer__logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, var(--tb-footer-logo-max-width, 260px));
  max-height: var(--tb-footer-logo-max-height, 117px);
  object-fit: contain;
  object-position: left center;
}

.tb-footer__logo-text {
  display: inline-block;
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--tb-footer-heading);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.tb-footer__tagline {
  font-size: var(--text-sm);
  color: var(--tb-footer-muted);
  line-height: var(--line-height-relaxed);
  max-width: 38ch;
  margin: 0 0 var(--space-5);
}

.tb-footer__cta {
  display: flex;
  align-items: center;
  margin-top: var(--space-5);
}

/* Link columns */
.tb-footer__col-heading {
  font-size: .7rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--tb-footer-muted);
  margin-bottom: var(--space-4);
}

.tb-footer__nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tb-footer__nav li { margin: 0; }

.tb-footer__nav li,
.tb-footer__nav li a,
.tb-footer__nav li span,
.tb-footer__nav li p {
  font-size: var(--text-sm);
  color: var(--tb-footer-fg);
  font-family: var(--font-body);
  line-height: var(--line-height-relaxed);
}

.tb-footer__nav a {
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.tb-footer__nav a:hover {
  color: var(--tb-footer-link-hover);
  opacity: .92;
}

/* Compact layout: smaller vertical footprint, same information. */
.tb-footer--layout-compact {
  padding-top: clamp(38px, 5vw, 60px);
}

.tb-footer--layout-compact .tb-footer__grid {
  gap: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(32px, 4vw, 48px);
}

.tb-footer--layout-compact .tb-footer__grid--columns-3 {
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(170px, .8fr));
}

.tb-footer--layout-compact .tb-footer__tagline {
  margin-bottom: var(--space-4);
}

.tb-footer--layout-compact .tb-footer__cta {
  margin-top: var(--space-4);
}

.tb-footer--layout-compact .tb-footer__logo-img {
  max-width: min(100%, var(--tb-footer-logo-max-width-compact, 224px));
  max-height: var(--tb-footer-logo-max-height-compact, 101px);
}

/* Centered layout: intentionally simple for solo-practice sites. */
.tb-footer--layout-centered .tb-footer__grid {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  text-align: center;
  gap: var(--space-10);
}

.tb-footer--layout-centered .tb-footer__brand,
.tb-footer--layout-centered .tb-footer__col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tb-footer--layout-centered .tb-footer__logo-link {
  justify-content: center;
}

.tb-footer--layout-centered .tb-footer__logo-img {
  max-width: min(100%, var(--tb-footer-logo-max-width, 260px));
  max-height: var(--tb-footer-logo-max-height, 117px);
  object-position: center;
}

.tb-footer--layout-centered .tb-footer__tagline {
  max-width: 58ch;
}

.tb-footer--layout-centered .tb-footer__nav {
  align-items: center;
}

.tb-footer--layout-centered .tb-footer__quick-links .tb-footer__nav {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
}

/* Bottom bar --------------------------------------------------------------
 * Keep required privacy access easy to find without turning the final row
 * into a second navigation menu. Legal links and site utilities are visually
 * grouped, and mobile receives deliberate rows instead of accidental wraps.
 */
.tb-footer__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4) clamp(24px, 4vw, 52px);
  padding: var(--space-5) 0 var(--space-6);
}

.tb-footer__bottom--solo {
  border-top: 1px solid var(--tb-footer-border);
}

.tb-footer__bottom-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.4vw, 30px);
  min-width: 0;
}

.tb-footer__copyright,
.tb-footer__legal-links a,
.tb-footer__staff-login,
.tb-footer__privacy-choices,
.tb-footer__credit {
  font-size: clamp(.72rem, .7rem + .08vw, .78rem);
  line-height: 1.45;
}

.tb-footer__copyright {
  color: var(--tb-footer-muted);
  margin: 0;
  white-space: nowrap;
}

.tb-footer__legal-links,
.tb-footer__utility-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.tb-footer__legal-links {
  justify-content: flex-end;
}

.tb-footer__utility-links {
  position: relative;
  justify-content: flex-end;
  padding-left: clamp(18px, 2vw, 28px);
}

.tb-footer__utility-links::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 18px;
  background: var(--tb-footer-border);
  transform: translateY(-50%);
}

.tb-footer__legal-links a,
.tb-footer__staff-login,
.tb-footer__privacy-choices,
.tb-footer__credit,
.tb-footer__credit a {
  color: var(--tb-footer-muted);
}

.tb-footer__legal-links a,
.tb-footer__staff-login,
.tb-footer__privacy-choices,
.tb-footer__credit a {
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}

.tb-footer__legal-links a:hover,
.tb-footer__staff-login:hover,
.tb-footer__privacy-choices:hover,
.tb-footer__credit a:hover {
  color: var(--tb-footer-link-hover);
}

.tb-footer__staff-login,
.tb-footer__privacy-choices,
.tb-footer__credit a {
  font-weight: var(--font-weight-semibold);
}

.tb-footer__legal-sep {
  color: var(--tb-footer-muted);
  opacity: .42;
  font-size: .72rem;
  line-height: 1;
}

.tb-footer__credit {
  white-space: nowrap;
}

.tb-footer--layout-centered .tb-footer__bottom {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.tb-footer--layout-centered .tb-footer__bottom-right,
.tb-footer--layout-centered .tb-footer__legal-links,
.tb-footer--layout-centered .tb-footer__utility-links {
  justify-content: center;
}

/* Responsive */
@media (max-width: 860px) {
  .tb-footer__grid--columns-3 {
    grid-template-columns: 1fr 1fr;
  }
  .tb-footer__grid--columns-3 .tb-footer__brand {
    grid-column: 1 / -1;
  }
  .tb-footer--layout-compact .tb-footer__grid--columns-3 {
    grid-template-columns: 1fr 1fr;
  }

  .tb-footer__bottom {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tb-footer__bottom-right,
  .tb-footer__legal-links,
  .tb-footer__utility-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .tb-footer {
    padding-top: var(--space-12);
  }
  .tb-footer__grid,
  .tb-footer__grid--columns-2,
  .tb-footer__grid--columns-3,
  .tb-footer--layout-compact .tb-footer__grid--columns-3 {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
  .tb-footer__grid--columns-3 .tb-footer__brand {
    grid-column: auto;
  }

  .tb-footer__bottom {
    gap: var(--space-3);
    padding-top: var(--space-5);
  }

  .tb-footer__bottom-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    width: 100%;
  }

  .tb-footer__legal-links,
  .tb-footer__utility-links {
    gap: var(--space-2) var(--space-3);
  }

  .tb-footer__utility-links {
    padding-left: 0;
  }

  .tb-footer__utility-links::before {
    display: none;
  }

  .tb-footer__copyright {
    white-space: normal;
  }

  .tb-footer--layout-centered .tb-footer__bottom,
  .tb-footer--layout-centered .tb-footer__bottom-right,
  .tb-footer--layout-centered .tb-footer__legal-links,
  .tb-footer--layout-centered .tb-footer__utility-links {
    justify-items: center;
    justify-content: center;
    text-align: center;
  }
}

/* Enhanced contact block ---------------------------------------------------
 * Contact details are important conversion information, so they receive a
 * slightly larger type scale and clear visual anchors without competing with
 * the practice brand or primary appointment CTA.
 */
.tb-footer__contact .tb-footer__col-heading {
  margin-bottom: var(--space-5);
}

.tb-footer__contact-list {
  gap: var(--space-4);
}

.tb-footer__contact-item {
  width: 100%;
}

.tb-footer__contact-link {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: 100%;
  min-height: 38px;
  color: var(--tb-footer-fg);
  text-decoration: none;
  text-align: left;
}

.tb-footer__contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tb-primary-light, #d4e5d6) 46%, transparent);
  color: var(--tb-primary-dark, #35523b);
  transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.tb-footer__contact-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.tb-footer__contact-value {
  min-width: 0;
  padding-top: 5px;
  font-size: clamp(.96rem, .25vw + .91rem, 1.06rem);
  line-height: 1.55;
  font-weight: var(--font-weight-medium, 500);
  color: var(--tb-footer-fg);
  overflow-wrap: anywhere;
}

.tb-footer__contact-item--phone .tb-footer__contact-value {
  font-variant-numeric: tabular-nums;
}

.tb-footer__contact-link[href]:hover .tb-footer__contact-icon,
.tb-footer__contact-link[href]:focus-visible .tb-footer__contact-icon {
  transform: translateY(-1px);
  background: var(--tb-primary, #5a7a5e);
  color: var(--tb-on-primary, var(--tb-white));
}

.tb-footer__contact-link[href]:hover .tb-footer__contact-value,
.tb-footer__contact-link[href]:focus-visible .tb-footer__contact-value {
  color: var(--tb-footer-link-hover);
}

.tb-footer__contact-link[href]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--tb-primary, #5a7a5e) 64%, transparent);
  outline-offset: 4px;
  border-radius: var(--radius-sm, 6px);
}

.tb-footer--surface-emphasis .tb-footer__contact-icon {
  background: color-mix(in srgb, var(--tb-on-emphasis, var(--tb-white)) 14%, transparent);
  color: var(--tb-on-emphasis, var(--tb-white));
}

.tb-footer--surface-emphasis .tb-footer__contact-link[href]:hover .tb-footer__contact-icon,
.tb-footer--surface-emphasis .tb-footer__contact-link[href]:focus-visible .tb-footer__contact-icon {
  background: var(--tb-bg, #faf9f6);
  color: var(--tb-brand-on-bg, var(--tb-primary-dark, #35523b));
}

.tb-footer--layout-centered .tb-footer__contact-list {
  width: min(100%, 440px);
  align-items: stretch;
}

.tb-footer--layout-centered .tb-footer__contact-link {
  justify-content: flex-start;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .tb-footer__contact-list {
    gap: var(--space-3);
  }

  .tb-footer__contact-value {
    font-size: 1rem;
  }
}


/* rc48: visible verified profile links */
.tb-footer__profile-heading{margin:22px 0 9px;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--tb-footer-muted,currentColor)}
.tb-footer__profile-links{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.tb-footer__profile-links a{display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;border:1px solid color-mix(in srgb,currentColor 20%,transparent);border-radius:999px;font-size:.82rem;line-height:1.2;text-decoration:none}
.tb-footer__profile-links a:hover,.tb-footer__profile-links a:focus-visible{text-decoration:underline;text-underline-offset:3px}


/* rc149 — compact sitewide crisis/emergency information. Kept neutral and
 * readable so it is available without turning the footer into an alarm. */
.tb-footer__crisis{
  display:flex;
  align-items:flex-start;
  gap:var(--space-3);
  padding:var(--space-4) 0;
  border-bottom:1px solid var(--tb-footer-border);
  color:var(--tb-footer-muted);
}
.tb-footer__crisis-icon{
  display:grid;
  place-items:center;
  flex:0 0 24px;
  width:24px;
  height:24px;
  border:1px solid var(--tb-footer-border);
  border-radius:999px;
  font-size:.78rem;
  font-weight:900;
  line-height:1;
  color:var(--tb-footer-heading);
}
.tb-footer__crisis-copy{min-width:0;max-width:980px}
.tb-footer__crisis-copy strong{display:block;margin:1px 0 3px;color:var(--tb-footer-heading);font-size:.82rem}
.tb-footer__crisis-copy p{margin:0;color:var(--tb-footer-muted);font-size:.78rem;line-height:1.55}
.tb-footer--layout-centered .tb-footer__crisis{justify-content:center;text-align:left}
@media(max-width:640px){.tb-footer__crisis{padding:var(--space-4) 0}.tb-footer__crisis-copy p{font-size:.76rem}}
