/* ==========================================================================
   FOOTER — site-wide section (Footer Settings options page)
   .footer__bottom-list holds the WYSIWYG <li> bottom links;
   .footer__credit is the fixed Smudge credit line.
   ========================================================================== */

/* ── stacking context: keep main content painting ABOVE the sticky
      footer while scrolling ───────────────────────────────────────────
   .site-container is the shared parent: .site-header, every content
   section and .site-footer are its direct children.

   .site-container itself gets the base background here — it's a normal,
   non-positioned element, so its background paints in the same layer as
   regular page content, above the footer's z-index:-1 layer. That covers
   the whole content area, including gaps between sections. */
.site-container {
  background: var(--bg);
}

.site-container > section,
.site-container > div:not(.site-footer) {
  position: relative;
  z-index: 1;
}
/*
 * Per-section fallback: keeps each section's own box opaque too, while
 * :where()'s zero specificity lets a real background/image win.
 */
:where(.site-container > section, .site-container > div:not(.site-footer)) {
  background: var(--bg);
}

.site-footer > .wrap {
  width: auto;
  max-width: none;
  margin: 0;
}
/*
 * .site-footer and .footer are the same element (footer-inc.php + the
 * genesis_attr_footer filter in functions.php). Background/colour go on
 * .site-footer so the look doesn't depend on that filter adding .footer.
 */
.site-footer { position: sticky; bottom: 0; z-index: 0; background: #131313; color: #fff; }
.footer__inner { width: min(1240px, 92vw); margin: 0 auto; padding: clamp(56px, 7vh, 88px) 0 30px; }
.footer__top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: clamp(32px, 4vw, 72px); align-items: start;
}
.footer__brand { max-width: 430px; }
/* .footer__brand prefix: outranks WooCommerce's `.woocommerce-page img
   { height: auto }`, which blew the logo up on product pages (Lumart, 21 Nov). */
.footer__brand .footer__logo { height: 30px; width: auto; display: block; margin-bottom: 24px; }

/* footer_intro is a single WYSIWYG (title + intro copy together), so style
   whatever tags the editor actually uses rather than fixed title/sub classes. */
.footer__cta { margin: 0 0 22px; }
.footer__cta h1, .footer__cta h2, .footer__cta h3, .footer__cta h4 {
  font-family: var(--sans); font-weight: 500; font-size: clamp(20px, 1.8vw, 27px);
  letter-spacing: -0.01em; color: #fff; margin: 0 0 10px;
}
.footer__cta p {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.55;
  color: rgba(255, 255, 255, 0.6); margin: 0 0 8px; text-wrap: pretty;
}
.footer__cta p:last-child { margin-bottom: 0; }

.signup { max-width: 430px; }
.signup .wpcf7-form { width: 100%; }
.signup .wpcf7-form .hidden-fields-container { display: none; }

/* CF7's default markup wraps everything in a <p> with a raw "Your Email"
   text label + <br> before the input — no custom classes needed on the
   CF7 side. font-size:0 hides that raw label text (kept for screen
   readers), then each child resets its own font-size. */
.signup .wpcf7-form > p {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px;
  margin: 0; font-size: 0;
}
.signup .wpcf7-form > p br { display: none; }

.signup .wpcf7-form-control-wrap { flex: 1; min-width: 140px; display: block; }
.signup input.wpcf7-form-control {
  font-size: 14.5px; font-family: var(--sans);
}
.signup input[type="email"].wpcf7-form-control {
  width: 100%; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
  padding: 13px 20px; color: #fff; outline: none;
  transition: border-color 0.18s ease;
}
.signup input[type="email"].wpcf7-form-control::placeholder { color: rgba(255, 255, 255, 0.45); }
.signup input[type="email"].wpcf7-form-control:focus { border-color: rgba(255, 255, 255, 0.4); }
.signup input[type="submit"].wpcf7-form-control {
  flex: none; background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 13px 26px; font-weight: 600; cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.signup input[type="submit"].wpcf7-form-control:hover { background: #e2611c; transform: translateY(-1px); }

.signup .wpcf7-spinner { flex: none; align-self: center; display: none;}
.signup .wpcf7-not-valid-tip {
  display: block; width: 100%; font-size: 12.5px; color: #ff8a6a; margin-top: 2px;
}
.signup .wpcf7-response-output {
  order: 2; flex-basis: 100%; margin: 10px 0 0; font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.footer__col { display: flex; flex-direction: column; gap: 13px; }
.footer__coltitle { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); margin-bottom: 4px; }
.footer__col a { font-family: var(--sans); font-size: 14.5px; color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color 0.18s ease; cursor: pointer; }
.footer__col a:hover { color: #fff; }
/* WYSIWYG output wraps links in <p> tags — collapse that back to the
   .footer__col flex spacing instead of stacked paragraph margins. */
.footer__col p { margin: 0; }

.socials { display: flex; gap: 12px; }
.social-ic {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.82);
  text-decoration: none; cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.social-ic:hover { border-color: var(--accent); color: #fff; background: rgba(239, 108, 35, 0.16); }
.social-ic svg { width: 18px; height: 18px; }
.social-ic .gly { font-size: 16px; font-weight: 600; font-family: var(--sans); line-height: 1; }

.footer__bottom {
  margin-top: clamp(40px, 5vh, 64px); padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  justify-content: space-between;
}
.footer__bottom-list ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin: 0; padding: 0; list-style: none;
}
.footer__bottom-list li {
  font-family: var(--sans); font-size: 13px; color: rgba(255, 255, 255, 0.5);
  display: flex; align-items: center; gap: 18px;
}
.footer__bottom-list li:not(:last-child)::after {
  content: "|"; color: rgba(255, 255, 255, 0.22); margin-left: 18px;
}
.footer__bottom-list a { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.footer__bottom-list a:hover { color: #fff; }

.footer__credit { font-family: var(--sans); font-size: 13px; color: rgba(255, 255, 255, 0.5); text-align: right; }
.footer__credit a { color: rgba(255, 255, 255, 0.5); text-decoration: none; transition: color 0.18s ease; }
.footer__credit a:hover { color: #fff; }

@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__social { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  /* compact footer so the brand + email capture stay fully visible
     within the sticky-reveal viewport (not cut off at the top) */
  .footer__inner { padding: 30px 22px 22px; }
  .footer__top { gap: 24px 26px; }
  .footer__brand .footer__logo { height: 23px; margin-bottom: 14px; }
  .footer__cta-title { font-size: 21px; margin-bottom: 7px; }
  .footer__cta-sub { font-size: 13.5px; line-height: 1.45; margin-bottom: 15px; }
  .footer__col { gap: 10px; }
  .social-ic { width: 36px; height: 36px; }
  .footer__bottom { margin-top: 22px; padding-top: 16px; }
  .footer__credit { text-align: left; }
}
@media (max-width: 560px) {
  /* keep the two link columns side-by-side and signup on one row
     to keep the whole footer within one screen height */
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__social { grid-column: 1 / -1; }
  .signup { max-width: none; }
  .signup .wpcf7-form > p { flex-wrap: nowrap; }
  .signup input[type="submit"].wpcf7-form-control { padding: 13px 20px; }
}

/* footer-reveal.js: keep the footer invisible until the end of the page is near */
.site-footer.is-tucked { visibility: hidden; }

/* Phones (Jacques, 12 Nov): the "|" separators dangled at line ends and the
   wrapped row looked indented. Drop them and wrap the links from the left. */
@media (max-width: 700px) {
  .footer__bottom-list ul { gap: 10px 22px; justify-content: flex-start; }
  .footer__bottom-list li { gap: 0; }
  .footer__bottom-list li:not(:last-child)::after { content: none; }
}

/* Lumart, 12 Nov (iPhone): Safari tints its bottom toolbar from whatever is
   stuck to the bottom edge of the screen. The tucked footer (sticky, bottom 0,
   hidden behind the page) made that a black bar on every page, where other
   sites run their content under the toolbar. While tucked it now sits in normal
   flow below the page (no layout change: a sticky box keeps its place in flow),
   and it becomes sticky again just before it is revealed. */
.site-footer.is-tucked { position: relative; }

/* Lumart, 15 Nov: "Live a hundred healthy years." a bit bigger and bold
   white on every footer (the first line of footer_intro; the landing pages'
   .footer__cta-title). */
.footer__cta > p:first-child,
.footer .footer__cta-title {
  font-family: var(--sans); font-size: clamp(20px, 1.7vw, 24px); font-weight: 600; line-height: 1.25;
  letter-spacing: -0.01em; color: #fff; margin: 0 0 10px;
}

/* Lumart, 15 Nov: "Sticky sections are messing things up on mobile ... make
   the footer fixed after the final sections on each page, not pinned." On
   phones and tablets the footer is a plain block after the last section: no
   reveal from behind the page. Desktop keeps the reveal. */
@media (max-width: 960px) {
  .site-footer, .site-footer.is-tucked { position: relative; bottom: auto; visibility: visible; }
}
