/* ═══════════════════════════════════════════════════════════════
   GPB Footer (footer.php) + back-to-top button
   Loaded after the RedStar theme so it wins over theme_style.css /
   responsive.css .page-footer rules. The .page-footer class is kept
   for the theme's sidebar offsets and layout.js height maths.

   Floating buttons share one right-hand axis:
     Buddy FAB      56px, right 20px, bottom 20px  (inc/buddy-widget.php)
     Back to top    44px, centred on the same axis, 12px above Buddy
   The footer keeps a right-hand gutter so neither button covers it.
   ═══════════════════════════════════════════════════════════════ */

.gpb-footer {
  --gpb-blue: var(--blue, #0d10cc);
  --gpb-ink: #1d2433;
  --gpb-text: #4a5267;
  --gpb-muted: #8a93a6;
  --gpb-line: #e8ebf1;
  --gpb-hover: #f3f5fa;
  --gpb-fab-gutter: 96px;
}

.page-footer.gpb-footer {
  clear: both;
  padding: 0 !important;
  background: #fff !important;
  border-top: 1px solid var(--gpb-line);
  font-size: 13px;
  color: var(--gpb-text);
}

.gpb-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px var(--gpb-fab-gutter) 0 32px;
}

/* ── Top: brand + link columns ── */
.gpb-footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px 48px;
  padding-bottom: 28px;
}

.gpb-footer-brand { max-width: 280px; }

.gpb-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gpb-ink) !important;
  text-decoration: none !important;
}
.gpb-footer-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d10cc 0%, #0a0c9e 55%, #070a6b 100%);
  box-shadow: 0 4px 12px rgba(13, 16, 204, .2);
}
.gpb-footer-mark img { width: 24px; height: auto; }
.gpb-footer-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

.gpb-footer-tagline {
  margin: 10px 0 0;
  color: var(--gpb-muted);
  line-height: 1.5;
}

.gpb-footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 56px;
}

.gpb-footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 120px;
}
.gpb-footer-col h6 {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gpb-muted);
}
.gpb-footer-col > a,
.gpb-footer-col > .gpb-footer-bug {
  color: var(--gpb-text);
  text-decoration: none;
  transition: color .15s;
}
.gpb-footer-col > a:hover,
.gpb-footer-col > a:focus-visible,
.gpb-footer-col > .gpb-footer-bug:hover,
.gpb-footer-col > .gpb-footer-bug:focus-visible {
  color: var(--gpb-blue);
}

/* Report a bug: a link-styled button (global.js binds .bug-btn) */
.gpb-footer .gpb-footer-bug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.gpb-footer-bug i { font-size: 12px; color: #d64545; }

.gpb-footer-social { display: flex; gap: 8px; }
.gpb-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gpb-line);
  color: var(--gpb-text);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s, border-color .15s, background-color .15s;
}
.gpb-footer-social a:hover,
.gpb-footer-social a:focus-visible {
  color: #fff;
  background: var(--gpb-blue);
  border-color: var(--gpb-blue);
}

.gpb-footer-apps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.gpb-footer-apps img { height: 34px; width: auto; }

/* ── Bottom bar ── */
.gpb-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--gpb-line);
  color: var(--gpb-muted);
  font-size: 12px;
}
.gpb-footer-render { font-variant-numeric: tabular-nums; opacity: .8; }

/* ── Phones / tablets: stack, and leave room under the floating buttons ── */
@media (max-width: 991.98px) {
  .gpb-footer { --gpb-fab-gutter: 20px; }
  .gpb-footer-inner { padding: 28px 20px 0; }
  .gpb-footer-brand { max-width: none; }
  .gpb-footer-cols { gap: 24px 40px; }
  /* Buddy (and back-to-top) float over this band instead of the links */
  .gpb-footer-bottom { padding-bottom: 92px; padding-right: 76px; }
}

@media (max-width: 575.98px) {
  .gpb-footer-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .gpb-footer-col:last-child { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════
   Back-to-top button
   ═══════════════════════════════════════════════════════════════ */
.gpb-scroll-top {
  position: fixed;
  right: 26px;            /* 20px + (56 - 44) / 2: centred on Buddy */
  bottom: 88px;           /* 20px + 56px Buddy + 12px gap */
  z-index: 9998;          /* below the Buddy widget so its open panel covers it */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e8ebf1;
  border-radius: 50%;
  background: #fff;
  color: var(--blue, #0d10cc);
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .14);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s, box-shadow .2s, background-color .2s, color .2s;
}
.gpb-scroll-top.no-buddy { right: 20px; bottom: 20px; }
.gpb-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.gpb-scroll-top:hover,
.gpb-scroll-top:focus-visible {
  background: var(--blue, #0d10cc);
  border-color: var(--blue, #0d10cc);
  color: #fff;
  box-shadow: 0 6px 18px rgba(13, 16, 204, .25);
}
/* Hide while the Buddy chat panel is open */
body:has(.buddy-fab.open) .gpb-scroll-top {
  opacity: 0;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .gpb-scroll-top { transition: none; transform: none; }
}

@media print {
  .gpb-scroll-top { display: none !important; }
}
