/* ==========================================================================
   FOOTER — Ongwacho Cherop Associates & Advocates
   ========================================================================== */

.footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  color: var(--color-cream);
  background:
    radial-gradient(ellipse 55% 75% at 100% 100%, rgba(155, 24, 64, 0.80) 0%, rgba(122, 14, 46, 0.40) 45%, transparent 75%),
    radial-gradient(ellipse 30% 40% at 100% 100%, rgba(201, 169, 97, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(92, 10, 34, 0.55) 0%, transparent 70%),
    linear-gradient(180deg, #120408 0%, #26060f 40%, var(--color-primary-dk) 100%);
}

/* Gold hairline along the top edge */
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 169, 97, 0.65) 50%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* Perspective grid floor, fading upward */
.footer::after {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: 0;
  height: 60%;
  background-image:
    linear-gradient(rgba(201, 169, 97, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 97, 0.10) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 85%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 85%);
  z-index: 0;
  pointer-events: none;
}

.footer__inner,
.footer__feature,
.footer__bottom {
  position: relative;
  z-index: 1;
}

/* ---------- Columns ---------- */

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr;
  column-gap: clamp(2rem, 4vw, 4rem);
  row-gap: 3rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5.5rem 0 4rem;
}

.footer__col-title {
  margin: 0 0 1.6rem;
  font-family: var(--ff-body);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.footer__col-title::before {
  content: "//";
  margin-right: 0.7em;
  color: rgba(201, 169, 97, 0.45);
  letter-spacing: 0;
}

/* ---------- Brand ---------- */

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.footer__emblem { display: block; flex: 0 0 auto; height: 64px; width: auto; }

.footer__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer__brand-name {
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-cream);
}

.footer__brand-sub {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  line-height: 1.2;
  color: rgba(250, 246, 239, 0.62);
}

.footer__tagline {
  margin: 1.9rem 0 1rem;
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-accent-lt);
}

.footer__descriptor {
  max-width: 34ch;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(250, 246, 239, 0.62);
}

/* ---------- Link lists ---------- */

.footer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.footer__nav-list li {
  font-size: 0.85rem;
  line-height: 1.4; /* tight, so wrapped lines read as ONE link */
}

.footer__nav-link {
  color: rgba(250, 246, 239, 0.78);
  text-decoration: none;
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 0.25s ease, background-size 0.35s ease;
}

.footer__nav-link:hover,
.footer__nav-link:focus-visible {
  color: var(--color-accent-lt);
  background-size: 100% 1px;
}

/* ---------- Contact ---------- */

.footer__address {
  display: grid;
  gap: 1.15rem;
  font-style: normal;
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(250, 246, 239, 0.82);
}

.footer__icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  color: var(--color-accent);
}

.footer__contact-link {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.25s ease;
}

.footer__contact-link:hover,
.footer__contact-link:focus-visible {
  color: var(--color-accent-lt);
}

/* ---------- Feature row ---------- */

.footer__feature-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 0;
  border-top: 1px solid rgba(201, 169, 97, 0.22);
}

.footer__feature-title {
  margin: 0 0 0.6rem;
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-cream);
}

.footer__feature-text {
  max-width: 46ch;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(250, 246, 239, 0.6);
}

.footer__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 1rem 2.2rem;
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-primary-dk);
  background: var(--color-cream);
  border: 1px solid var(--color-cream);
  border-radius: 999px;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.footer__cta:hover,
.footer__cta:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

/* ---------- Bottom bar ---------- */

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.6rem 0 2rem;
  border-top: 1px solid rgba(201, 169, 97, 0.12);
  font-size: 0.75rem;
  color: rgba(250, 246, 239, 0.5);
}

.footer__copyright,
.footer__credit {
  margin: 0;
}

.footer__heart {
  color: var(--color-accent);
}

/* ---------- Responsive (the only place footer breakpoints live) ---------- */

@media (max-width: 1100px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
  }
  .footer__col--brand {
    grid-column: 1 / -1;
  }
  .footer__descriptor {
    max-width: 52ch;
  }
}

@media (max-width: 720px) {
  .footer__inner {
    padding: 4rem 0 3rem;
  }
  .footer__feature-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
    padding: 2.5rem 0;
  }
  .footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 5.5rem; /* keeps the last line clear of the back-to-top button */
  }
}

/* The back-to-top button sits over the right end of the bottom bar from 721px up
   to where the 1200px container clears it (about 1376px). */
@media (min-width: 721px) and (max-width: 1375px) {
  .footer__bottom-inner {
    padding-right: 4rem;
  }
}

@media (max-width: 560px) {
  .footer__inner {
    grid-template-columns: 1fr;
  }
}

/* Touch screens only: 44px hit areas for the footer links (line-height stays 1.4). */
@media (pointer: coarse) {
  .footer__nav-list {
    gap: 0;
  }
  .footer__nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    background-position: 0 calc(50% + 0.65rem);
  }
  .footer__address {
    gap: 0.35rem;
  }
  .footer__contact-item:has(.footer__contact-link) {
    align-items: center;
  }
  .footer__contact-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer__nav-link,
  .footer__contact-link,
  .footer__cta {
    transition: none;
  }
  .footer__cta:hover,
  .footer__cta:focus-visible {
    transform: none;
  }
}
