/* ==== FOOTER ==== */
.footer {
  background: var(--forest-900);
  color: rgba(255,255,255,0.78);
  padding: 64px 0 calc(92px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-on-forest);
}
.footer > .container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: clamp(20px, 4vw, 56px);
  padding-right: clamp(20px, 4vw, 56px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  margin-bottom: 44px;
}
.footer h4 {
  color: var(--white);
  font-size: 0.83rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-about p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
  margin: 16px 0 20px;
  max-width: 42ch;
}
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 36px; height: 36px;
  border: 1px solid var(--line-on-forest);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: border-color var(--fast), color var(--fast);
}
.social-row a:hover { border-color: var(--gold-400); color: var(--gold-400); }

.footer-links li { margin-bottom: 4px; }
.footer-links a {
  color: rgba(255,255,255,0.62);
  font-size: 0.9rem;
  padding: 6px 0;
  display: inline-flex;
  transition: color var(--fast);
}
.footer-links a:hover { color: var(--gold-400); }

/* ==== Office address ==== */
.footer-address a { display: flex; flex-direction: column; line-height: 1.5; }

.footer-bottom {
  border-top: 1px solid var(--line-on-forest-soft);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom .coord-readout { color: rgba(255,255,255,0.4); }
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: rgba(255,255,255,0.55); }
.footer-bottom-links a:hover { color: var(--gold-400); }

/* ==== BACK TO TOP ==== */
.back-to-top {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  right: 28px;
  width: 46px; height: 46px;
  background: var(--gold-500);
  color: var(--forest-900);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  opacity: 0; visibility: hidden;
  transition: opacity var(--fast), visibility var(--fast), transform var(--fast);
  z-index: 500;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); }
@media (max-width: 950px) {
  .footer { padding: 56px 0 calc(92px + env(safe-area-inset-bottom, 0px)); }
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 36px 32px;
    margin-bottom: 32px;
    text-align: center;
  }
  .footer-about .logo { justify-content: center; }
  .footer-about p {
    margin: 14px auto 16px;
  }
  .social-row { justify-content: center; }
  .footer-links li { margin-bottom: 0; }
  .footer-links a {
    display: block;
    padding: 10px 0;
    text-align: center;
  }
  .footer-grid > div:last-child {
    grid-column: 1 / -1;
    padding-top: 24px;
    border-top: 1px solid var(--line-on-forest-soft);
    text-align: left;
  }
  .footer-grid > div:last-child h4 { margin-bottom: 14px; }
  .footer-grid > div:last-child ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 28px;
  }
  .footer-grid > div:last-child li { margin-bottom: 0; }
  .footer-grid > div:last-child ul.footer-links {
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    align-items: start;
    gap: 6px 20px;
  }
  .footer-grid > div:last-child ul.footer-links a { text-align: left; white-space: nowrap; }
  .footer-grid > div:last-child li:nth-child(1) { grid-area: 1 / 1; }
  .footer-grid > div:last-child li:nth-child(2) { grid-area: 1 / 3; }
  .footer-grid > div:last-child .footer-address { grid-area: 1 / 2 / 3 / 3; }
  .footer-grid > div:last-child li:nth-child(4) { grid-area: 2 / 3; }
  .footer-grid > div:last-child .footer-address a { display: flex; align-items: flex-start; text-align: left; }
  .footer-grid > div:last-child a { font-size: 0.88rem; }
}
@media (max-width: 768px) {
  .footer { padding: 48px 0 calc(92px + env(safe-area-inset-bottom, 0px)); }
  .footer-grid {
    gap: 30px 22px;
    margin-bottom: 26px;
  }
  .footer h4 { font-size: 0.78rem; margin-bottom: 12px; }
  .footer-about p {
    font-size: 0.85rem;
    line-height: 1.65;
    margin: 12px auto 14px;
    max-width: none;
  }
  .footer-links a { padding: 9px 0; font-size: 0.86rem; }
  .social-row { gap: 8px; }
  .social-row a { width: 34px; height: 34px; font-size: 0.78rem; }

  .footer-grid > div:last-child { padding-top: 20px; }
  .footer-grid > div:last-child ul { gap: 6px 20px; }
  .footer-grid > div:last-child a { font-size: 0.84rem; }

  .footer-bottom { font-size: 0.78rem; }
}
@media (max-width: 480px) {
  .footer { padding: 40px 0 calc(68px + env(safe-area-inset-bottom, 0px)); }
  .footer > .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px 12px;
    margin-bottom: 22px;
  }

  .footer h4 {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
  }
  .footer-about p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.5;
    margin: 8px auto 12px;
  }

  .footer-links a { padding: 8px 0; font-size: 0.78rem; }
  .social-row { gap: 5px; }
  .social-row a { width: 28px; height: 28px; font-size: 0.68rem; }

  .footer-grid > div:last-child { padding-top: 16px; }
  .footer-grid > div:last-child ul.footer-links {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 10px 12px;
  }
  .footer-grid > div:last-child li:nth-child(1) { grid-area: 1 / 1; }
  .footer-grid > div:last-child li:nth-child(2) { grid-area: 1 / 2; }
  .footer-grid > div:last-child .footer-address { grid-area: 2 / 1; }
  .footer-grid > div:last-child li:nth-child(4) { grid-area: 2 / 2; }
  .footer-grid > div:last-child ul.footer-links a { white-space: normal; }
  .footer-grid > div:last-child li:nth-child(-n+2) a { white-space: nowrap; }
  .footer-grid > div:last-child a { font-size: 0.76rem; }

  .footer-bottom {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-top: 16px;
    font-size: 0.72rem;
  }
  .footer-bottom .coord-readout { display: none; }
  .footer-bottom-links { gap: 14px; }

  .back-to-top {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 40px; height: 40px;
    font-size: 0.95rem;
  }
}
@media (max-width: 400px) {
  .footer-grid > div:last-child ul.footer-links { column-gap: 6px; }
  .footer-grid > div:last-child .footer-address a { font-size: 0.7rem; }
}

/* ==== Tablet: three aligned bands ==== */
@media (min-width: 481px) and (max-width: 950px) {
  .footer-grid > div:last-child { text-align: center; }
  .footer-grid > div:last-child ul.footer-links {
    grid-template-columns: repeat(3, 1fr);
    justify-content: stretch;
    justify-items: center;
    column-gap: 32px;
  }
  .footer-grid > div:last-child ul.footer-links a { text-align: center; }
  .footer-grid > div:last-child .footer-address a { align-items: center; white-space: normal; }
  .footer-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    justify-items: center;
    text-align: center;
  }
  .footer-bottom { align-items: center; }
  .footer-bottom > span:first-child { grid-column: 1; }
  .footer-bottom .coord-readout { grid-column: 2; }
  .footer-bottom-links { grid-column: 3; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .footer-grid > div:last-child ul.footer-links,
  .footer-bottom { column-gap: 22px; }
  .footer-bottom .rights { display: block; }
}

/* ==== Desktop: columns spread edge to edge ==== */
@media (min-width: 951px) {
  .footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 48px;
  }
  .footer-grid > div { flex: 0 0 auto; }
  .footer-grid > .footer-about { flex: 0 1 360px; }
  .footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
