/* ==========================================================================
   Premium Footer Bar — theme-native (not an Elementor widget)
   BEM: .jsf-footer-bar, .jsf-footer-bar__*
   Layout variants via modifier classes set in footer.php:
   --layout-default/grouped/centered/stacked/minimal
   Logical CSS properties for RTL; CSS variables throughout for
   automatic dark-mode readiness. Colours driven by Customizer values
   printed as --footer-bg-color / --footer-text-color (see customizer.php).
   ========================================================================== */

.jsf-footer-bar {
  position: relative;
  width: 100%;
  padding: 32px 24px;
  background: var(--footer-bg-color, var(--color-white));
  border-top: 1px solid var(--color-border);
}

.jsf-footer-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
}

/* ---------- Logo ---------- */

.jsf-footer-bar__logo {
  flex-shrink: 0;
  display: flex;
}

.jsf-footer-bar__logo-link {
  display: inline-flex;
  align-items: center;
}

.jsf-footer-bar__logo-link img {
  display: block;
  max-width: 90px;
  height: auto;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.jsf-footer-bar__logo-link:hover img {
  opacity: .85;
}

.jsf-footer-bar__site-title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
}

/* ---------- Copyright ---------- */

.jsf-footer-bar__copyright-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jsf-footer-bar__copyright {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: var(--footer-text-color, var(--color-light));
}

.jsf-footer-bar__copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.jsf-footer-bar__copyright a:hover {
  color: var(--color-primary);
}

.jsf-footer-bar__powered-by {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--footer-text-color, var(--color-light));
  opacity: .75;
}

/* ---------- Divider ---------- */

.jsf-footer-bar__divider {
  display: none;
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
}

.jsf-footer-bar--divider-yes .jsf-footer-bar__divider {
  display: block;
}

/* ---------- Social icons ---------- */

.jsf-footer-bar__social {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.jsf-footer-bar__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-background);
  color: var(--color-body);
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.jsf-footer-bar__social-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  max-width: none;
}

.jsf-footer-bar__social-link:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-3px);
}

/* ---------- Back to top ---------- */

.jsf-footer-bar__back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-sticky);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-medium);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background-color var(--transition-fast);
}

.jsf-footer-bar__back-to-top svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  max-width: none;
}

.jsf-footer-bar__back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.jsf-footer-bar__back-to-top:hover {
  background: var(--color-secondary);
  transform: translateY(-3px);
}

/* ==========================================================================
   LAYOUT VARIANTS
   ========================================================================== */

/* Layout 1 (default): logo | copyright | social, space-between (rules above) */

/* Layout 2: grouped — logo + copyright together on the left, social on the right */
.jsf-footer-bar--layout-grouped .jsf-footer-bar__inner {
  justify-content: space-between;
}

.jsf-footer-bar--layout-grouped .jsf-footer-bar__logo {
  margin-inline-end: 16px;
}

/* Layout 3: centered — everything stacked and centered */
.jsf-footer-bar--layout-centered .jsf-footer-bar__inner {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.jsf-footer-bar--layout-centered .jsf-footer-bar__social {
  justify-content: center;
}

.jsf-footer-bar--layout-centered .jsf-footer-bar__divider {
  display: none !important;
}

/* Layout 4: stacked — full-width rows, each centered, larger vertical rhythm */
.jsf-footer-bar--layout-stacked .jsf-footer-bar__inner {
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.jsf-footer-bar--layout-stacked .jsf-footer-bar__logo,
.jsf-footer-bar--layout-stacked .jsf-footer-bar__social {
  justify-content: center;
  width: 100%;
}

.jsf-footer-bar--layout-stacked .jsf-footer-bar__divider {
  display: none !important;
}

/* Layout 5: minimal — copyright | social only (logo omitted server-side) */
.jsf-footer-bar--layout-minimal .jsf-footer-bar__inner {
  justify-content: space-between;
}

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
  .jsf-footer-bar {
    padding: 24px 20px;
  }

  .jsf-footer-bar__inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .jsf-footer-bar__social {
    justify-content: center;
  }

  .jsf-footer-bar__divider {
    display: none !important;
  }

  .jsf-footer-bar__back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

/* ---------- Accessibility ---------- */

.jsf-footer-bar__social-link:focus-visible,
.jsf-footer-bar__logo-link:focus-visible,
.jsf-footer-bar__back-to-top:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Dark mode intentionally not implemented: the rest of the theme
   (header, body, sections) has no dark-mode styling yet, so a
   dark-only footer would create a broken-looking seam on OS-level
   dark mode. Revisit once the whole theme gets dark mode together. */

/* ---------- RTL ----------
   Flexbox direction and gap already flip automatically under
   [dir="rtl"]; only the grouped-layout margin needs a logical
   property, which is already used above (margin-inline-end). */

@media (prefers-reduced-motion: reduce) {
  .jsf-footer-bar__social-link,
  .jsf-footer-bar__logo-link img,
  .jsf-footer-bar__back-to-top {
    transition: none !important;
  }
}
