/**
 * EmaR Foster GC Academy — Site Footer
 */

footer.site-footer,
#site-footer.site-footer {
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --footer-bg: #0c1524;
  --footer-bg-deep: #060b14;
  --footer-border: rgba(255, 255, 255, 0.1);
  --footer-text: rgba(255, 255, 255, 0.78);
  --footer-text-muted: rgba(255, 255, 255, 0.52);
  --footer-accent: #d3ae42;
  --footer-primary: #DC721F;

  box-sizing: border-box;
  display: block;
  /* Full viewport breakout — works even inside containers/sidebars */
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 0 !important;
  background: linear-gradient(180deg, var(--footer-bg) 0%, var(--footer-bg-deep) 100%) !important;
  color: var(--footer-text) !important;
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
  isolation: isolate;
  flex-shrink: 0;
}

@supports (width: 100dvw) {
  footer.site-footer,
  #site-footer.site-footer {
    width: 100dvw !important;
    max-width: 100dvw !important;
    margin-left: calc(50% - 50dvw) !important;
    margin-right: calc(50% - 50dvw) !important;
  }
}

.site-footer__backdrop {
  display: none;
}

footer.site-footer *,
#site-footer.site-footer * {
  box-sizing: border-box;
}

footer.site-footer::before,
#site-footer.site-footer::before {
  content: '' !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto !important;
  height: 3px !important;
  width: 100% !important;
  background: linear-gradient(90deg, var(--footer-primary), var(--footer-accent), var(--footer-primary)) !important;
  opacity: 1 !important;
  z-index: 3;
  pointer-events: none;
}

footer.site-footer::after,
#site-footer.site-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 0% 0%, rgba(220, 113, 31, 0.14), transparent 55%),
    radial-gradient(ellipse 45% 40% at 100% 100%, rgba(211, 174, 66, 0.1), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.site-footer__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-left: clamp(1rem, 4vw, 3rem);
  padding-right: clamp(1rem, 4vw, 3rem);
}

.site-footer__main {
  position: relative;
  z-index: 2;
  padding: clamp(3.25rem, 6vw, 5rem) 0 clamp(2.25rem, 4vw, 3.25rem);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: start;
  width: 100%;
}

.site-footer__brand {
  max-width: 400px;
}

.site-footer__logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.site-footer__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

footer.site-footer h5.site-footer__brand-name,
#site-footer.site-footer h5.site-footer__brand-name {
  font-family: var(--font-heading) !important;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  color: #ffffff !important;
  line-height: 1.3;
  margin: 0 !important;
}

.site-footer__tagline {
  font-family: var(--font-body) !important;
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--footer-text) !important;
  margin: 0 0 1.65rem !important;
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid var(--footer-border) !important;
  color: #ffffff !important;
  font-size: 1rem;
  text-decoration: none !important;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.site-footer__social-link:hover {
  background: rgba(220, 113, 31, 0.35) !important;
  border-color: rgba(211, 174, 66, 0.55) !important;
  color: var(--footer-accent) !important;
  transform: translateY(-3px);
}

footer.site-footer h6.site-footer__heading,
#site-footer.site-footer h6.site-footer__heading {
  font-family: var(--font-heading) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff !important;
  margin: 0 0 1rem !important;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--footer-border);
  display: block;
  width: 100%;
}

.site-footer__heading--spaced {
  margin-top: 1.5rem !important;
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links li {
  margin-bottom: 0.55rem;
}

.site-footer__link {
  display: inline-block;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem;
  color: var(--footer-text) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
  line-height: 1.45;
}

.site-footer__link:hover {
  color: #ffffff !important;
}

.site-footer__contact-panel {
  display: block;
}

.site-footer__contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--footer-text) !important;
}

.site-footer__contact-item:last-child {
  margin-bottom: 0;
}

.site-footer__contact-item i {
  color: var(--footer-accent) !important;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.site-footer__contact-item a {
  color: var(--footer-text) !important;
  text-decoration: none !important;
}

.site-footer__contact-item a:hover {
  color: #ffffff !important;
}

.site-footer__bottom {
  border-top: 1px solid var(--footer-border);
  padding: 1.15rem 0;
  background: rgba(0, 0, 0, 0.35) !important;
  position: relative;
  z-index: 2;
}

.site-footer__bottom::before {
  display: none;
}

.site-footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.site-footer__copyright {
  font-family: var(--font-body) !important;
  font-size: 0.875rem;
  color: var(--footer-text-muted) !important;
  margin: 0 !important;
}

.site-footer__bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__bottom-links a {
  font-family: var(--font-body) !important;
  font-size: 0.875rem;
  color: var(--footer-text-muted) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.site-footer__bottom-links a:hover {
  color: var(--footer-accent) !important;
}

.site-footer__back-top {
  display: none;
}

/* Floating back-to-top */
.back-to-top {
  position: fixed;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  right: calc(1.1rem + env(safe-area-inset-right, 0px));
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #DC721F 0%, #B85A0F 100%) !important;
  color: #ffffff !important;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(220, 113, 31, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.92);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.back-to-top[hidden] {
  display: none !important;
}

.back-to-top.is-visible {
  display: inline-flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  box-shadow: 0 8px 28px rgba(220, 113, 31, 0.55);
  transform: translateY(-3px) scale(1.04);
}

.back-to-top:focus-visible {
  outline: 2px solid #d3ae42;
  outline-offset: 3px;
}

/* Tablet */
@media (max-width: 1199px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 991px) {
  .site-footer__brand {
    text-align: center;
    max-width: 100%;
  }

  .site-footer__logo-row {
    justify-content: center;
  }

  .site-footer__social {
    justify-content: center;
  }

  .site-footer__tagline {
    text-align: center;
    max-width: 520px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Mobile — compact 2-column link grid */
@media (max-width: 767px) {
  .site-footer__main {
    padding: 2rem 0 1.5rem;
  }

  .site-footer__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 0.85rem;
    text-align: left;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
    text-align: center;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--footer-border);
    margin-bottom: 0.25rem;
  }

  .site-footer__logo {
    width: 44px;
    height: 44px;
  }

  footer.site-footer h5.site-footer__brand-name,
  #site-footer.site-footer h5.site-footer__brand-name {
    font-size: 1.05rem;
  }

  .site-footer__tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.15rem !important;
  }

  .site-footer__social {
    justify-content: center;
    gap: 0.5rem;
  }

  .site-footer__social-link {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  footer.site-footer h6.site-footer__heading,
  #site-footer.site-footer h6.site-footer__heading {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.65rem !important;
    padding-bottom: 0.45rem;
  }

  .site-footer__links li {
    margin-bottom: 0.4rem;
  }

  .site-footer__link {
    font-size: 0.84rem;
  }

  .site-footer__col--contact {
    grid-column: 1 / -1;
  }

  .site-footer__contact-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--footer-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
  }

  .site-footer__contact-item {
    font-size: 0.84rem;
    margin-bottom: 0.6rem;
  }

  .site-footer__legal-block {
    display: none;
  }

  .site-footer__bottom {
    padding: 0.9rem 0;
  }

  .site-footer__bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.65rem;
  }

  .site-footer__copyright {
    font-size: 0.75rem;
    line-height: 1.45;
    max-width: 280px;
    margin: 0 auto !important;
  }

  .site-footer__bottom-links {
    justify-content: center;
    gap: 0.85rem 1.25rem;
  }

  .site-footer__bottom-links a {
    font-size: 0.78rem;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .site-footer__grid {
    gap: 1rem 0.65rem;
  }

  .site-footer__bottom-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
