/**
 * WDHC site footer · unified upgrade (desktop + mobile)
 * Loaded via link or injected by js/wdhc-site-footer.js
 */

.wdhc-site-footer {
  --wdhc-footer-cta-clearance: 0px;
  position: relative;
  isolation: isolate;
  margin-top: clamp(28px, 4vw, 48px);
  padding: clamp(36px, 5vw, 56px) clamp(16px, 4vw, 32px) clamp(36px, 4vw, 52px);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(212, 175, 55, 0.1) 0%, transparent 55%),
    linear-gradient(180deg, #0a0a0a 0%, #050505 55%, #030303 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.16);
  text-align: center;
  color: #9a9a9a;
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

.wdhc-site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.45) 30%,
    rgba(255, 229, 102, 0.55) 50%,
    rgba(212, 175, 55, 0.45) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.wdhc-site-footer__inner {
  position: relative;
  z-index: 2;
  width: min(920px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  box-sizing: border-box;
}

/* Each band is a full-width block so social/contact never paint over links */
.wdhc-site-footer__brand,
.wdhc-site-footer__nav,
.wdhc-site-footer__social,
.wdhc-site-footer__contact,
.wdhc-site-footer__legal,
.wdhc-site-footer__copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
  clear: both;
}

/* Brand mark */
.wdhc-site-footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-decoration: none;
  line-height: 0;
}

.wdhc-site-footer__logo,
.wdhc-site-footer .footer-logo {
  display: block;
  width: min(200px, 46vw);
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

/* Nav rows */
.wdhc-site-footer__nav {
  width: 100%;
  margin: 0;
}

.wdhc-site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 6px;
  margin: 0 auto;
  max-width: 52rem;
  padding: 0 4px;
}

.wdhc-site-footer__row:last-child {
  margin-bottom: 0;
}

.wdhc-site-footer__row a,
.wdhc-site-footer .footer-links a {
  color: #c8c8c8;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.wdhc-site-footer__row a:hover,
.wdhc-site-footer .footer-links a:hover {
  color: #ffe566;
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.28);
}

/* Secondary-only footer links (not in main nav) */
.wdhc-site-footer__row--muted {
  max-width: 48rem;
  margin-top: 0;
}

.wdhc-site-footer__row--muted a {
  color: #a8a8a8;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
}

.wdhc-site-footer__row--muted a:hover {
  color: #ffe566;
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.28);
}

/* Mobile keep row is hidden on desktop so the full footer stays. */
.wdhc-site-footer__row--keep {
  display: none;
}
.wdhc-site-footer__legal-compact,
.wdhc-site-footer__sep--legal {
  display: none;
}


/* Social brand icons */
.wdhc-site-footer__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 4px 0 0;
}

.wdhc-site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background:
    linear-gradient(160deg, rgba(40, 32, 12, 0.65) 0%, rgba(12, 10, 6, 0.9) 100%);
  color: #f0d878;
  text-decoration: none;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 240, 180, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.wdhc-site-footer__social-link:hover,
.wdhc-site-footer__social-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 229, 102, 0.55);
  color: #fff;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(212, 175, 55, 0.22);
  outline: none;
}

.wdhc-site-footer__social-link svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

/* Brand hover accents */
.wdhc-site-footer__social-link[data-brand="instagram"]:hover {
  border-color: rgba(214, 41, 118, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #feda75 0%, #fa7e1e 28%, #d62976 58%, #4f5bd5 100%);
  box-shadow: 0 8px 22px rgba(214, 41, 118, 0.35);
}

.wdhc-site-footer__social-link[data-brand="tiktok"]:hover {
  border-color: rgba(37, 244, 238, 0.55);
  color: #fff;
  background: #111;
  box-shadow:
    0 0 0 1px rgba(37, 244, 238, 0.35),
    0 0 16px rgba(254, 44, 85, 0.35);
}

.wdhc-site-footer__social-link[data-brand="youtube"]:hover {
  border-color: rgba(255, 0, 0, 0.55);
  color: #fff;
  background: #c00;
  box-shadow: 0 8px 22px rgba(200, 0, 0, 0.35);
}

.wdhc-site-footer__social-link[data-brand="x"]:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  background: #000;
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.12);
}

/* Contact line (phone / partner) */
.wdhc-site-footer__contact {
  margin: 0 auto;
  font-size: 0.95rem;
  color: #8a8a8a;
  line-height: 1.55;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 4px;
  max-width: 36rem;
}

.wdhc-site-footer__contact a {
  color: #e8c547;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.wdhc-site-footer__contact a:hover {
  color: #fff;
  background: rgba(212, 175, 55, 0.12);
  text-decoration: none;
}

.wdhc-site-footer__sep {
  margin: 0 0.15em;
  color: #4a4a4a;
  user-select: none;
}

/* Required legal links (Privacy, Terms, Rules, Medical) */
.wdhc-site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 4px;
  margin: 0 auto;
  max-width: 42rem;
  padding: 0 8px;
}
.wdhc-site-footer__legal a {
  color: #9a9a9a;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.wdhc-site-footer__legal a:hover {
  color: #ffe566;
  border-color: rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.08);
}
.wdhc-site-footer__legal a + a::before {
  content: none;
}

.wdhc-site-footer__copy,
.wdhc-site-footer .footer-copy {
  margin: 0;
  font-size: 0.78rem;
  color: #555;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Desktop refinements */
@media (min-width: 901px) {
  .wdhc-site-footer {
    padding: 52px 32px 48px;
  }

  .wdhc-site-footer__logo,
  .wdhc-site-footer .footer-logo {
    width: min(220px, 28vw);
  }

  .wdhc-site-footer__row {
    gap: 8px 8px;
  }

  .wdhc-site-footer__row a {
    font-size: 0.95rem;
    padding: 9px 14px;
  }

  .wdhc-site-footer__social-link {
    width: 48px;
    height: 48px;
  }

  .wdhc-site-footer__social-link svg {
    width: 23px;
    height: 23px;
  }
}

/* Mobile: spaced stack, 2-col link grid, room for floating sticky CTA */
@media (max-width: 900px) {
  .wdhc-site-footer {
    /* Sticky Submit bar must never cover footer links / copyright */
    --wdhc-footer-cta-clearance: calc(var(--wdhc-mobile-cta-h, 58px) + env(safe-area-inset-bottom, 0px) + 120px);
    margin-top: 28px;
    padding: 32px 16px var(--wdhc-footer-cta-clearance) !important;
    overflow: visible !important;
    isolation: isolate;
    z-index: 1;
    position: relative;
  }

  .wdhc-site-footer__inner {
    width: 100%;
    max-width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    box-sizing: border-box;
  }

  .wdhc-site-footer__brand,
  .wdhc-site-footer__nav,
  .wdhc-site-footer__social,
  .wdhc-site-footer__contact,
  .wdhc-site-footer__legal,
  .wdhc-site-footer__copy {
    position: relative !important;
    float: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .wdhc-site-footer__brand {
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    line-height: 0;
  }

  .wdhc-site-footer__logo,
  .wdhc-site-footer .footer-logo {
    width: min(132px, 38vw);
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* Header `nav` rules (height 72px, sticky, gold bar) must never apply here */
  .wdhc-site-footer nav,
  .wdhc-site-footer__nav,
  .wdhc-site-footer__legal {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 1 !important;
    float: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: 100% !important;
  }

  .wdhc-site-footer__nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }

  /* Even 2-column tiles; never let pills stack on top of each other */
  .wdhc-site-footer__row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 !important;
    max-width: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .wdhc-site-footer__row a,
  .wdhc-site-footer .footer-links a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.25;
    padding: 11px 10px;
    min-height: 42px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
  }

  .wdhc-site-footer__row--muted {
    margin: 0 !important;
    max-width: none;
    gap: 8px;
  }

  .wdhc-site-footer__row--muted a {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 11px 10px;
    min-height: 42px;
    color: #b0b0b0;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
  }

  .wdhc-site-footer__social {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 0 !important;
    padding: 8px 0 0 !important;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .wdhc-site-footer__social-link {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    position: relative !important;
    z-index: 1;
  }

  .wdhc-site-footer__social-link svg {
    width: 20px;
    height: 20px;
  }

  /* Contact: one item per row, no mid-line collisions with long emails */
  .wdhc-site-footer__contact {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 0 auto !important;
    padding: 4px 4px 0 !important;
    font-size: 0.9rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    line-height: 1.35;
  }

  .wdhc-site-footer__contact .wdhc-site-footer__sep {
    display: none !important;
  }

  .wdhc-site-footer__contact a {
    min-height: 40px;
    max-width: 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: center;
  }

  /* Cloudflare email obfuscation nodes */
  .wdhc-site-footer__contact .__cf_email__,
  .wdhc-site-footer__contact a[href*="/cdn-cgi/l/email-protection"] {
    display: inline !important;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  /* Legal: compact text line, not a second tile grid */
  .wdhc-site-footer__legal {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px 2px !important;
    margin: 0 !important;
    max-width: 100% !important;
    padding: 4px 0 0 !important;
    width: 100% !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .wdhc-site-footer__legal a {
    display: inline !important;
    width: auto !important;
    min-height: 0 !important;
    font-size: 0.7rem !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 8px !important;
    border-radius: 0;
    border: none !important;
    background: none !important;
    color: #888;
    text-align: center;
    white-space: nowrap;
  }

  .wdhc-site-footer__copy {
    font-size: 0.7rem;
    line-height: 1.45;
    padding: 4px 12px 0;
    max-width: 100%;
    margin: 0 !important;
    box-sizing: border-box;
    text-align: center;
  }

  /* Mobile trim: 8 keep links + social + contact + one Legal. No second pile. */
  .wdhc-site-footer__row--keep {
    display: grid !important;
  }
  .wdhc-site-footer__nav .wdhc-site-footer__row--muted,
  .wdhc-site-footer__legal {
    display: none !important;
  }
  .wdhc-site-footer__contact a.wdhc-site-footer__contact-gyms,
  .wdhc-site-footer__sep--gyms {
    display: none !important;
  }
  .wdhc-site-footer__legal-compact {
    display: inline-flex !important;
  }
}

/* Narrow phones */
@media (max-width: 380px) {
  .wdhc-site-footer {
    --wdhc-footer-cta-clearance: calc(var(--wdhc-mobile-cta-h, 58px) + env(safe-area-inset-bottom, 0px) + 56px);
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .wdhc-site-footer__row {
    gap: 7px;
  }

  .wdhc-site-footer__row a {
    font-size: 0.74rem;
    padding: 10px 6px;
    min-height: 40px;
  }

  .wdhc-site-footer__social {
    gap: 12px;
  }

  .wdhc-site-footer__social-link {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}

/* Legacy bare footer fallback (pages still on old markup) */
footer:not(.wdhc-site-footer) {
  text-align: center;
  padding: 40px 20px calc(56px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.14);
}

@media (max-width: 900px) {
  footer:not(.wdhc-site-footer) {
    padding-bottom: calc(var(--wdhc-mobile-cta-h, 58px) + env(safe-area-inset-bottom, 0px) + 36px) !important;
  }
}
