/* =========================================================================
   site-footer.css
   The site footer (<footer class="site-footer">), shared by index.html and
   the /privacy pages. Load it AFTER style-website.css: it relies on that
   file's design tokens and on its .container layout primitive.

   The generic class names (.social, .copyrights, .legal) are scoped under
   .site-footer so nothing leaks into the page content.

   Layout: three columns (about + app, page links, contact) over a bottom
   bar (copyright, payment methods, legal). Stacked and centred below
   992px, side by side from there; the columns mirror on their own in RTL.

   Latin pages keep their tighter line-heights; the Arabic block at the end
   restores the extra leading Tajawal needs.
   ========================================================================= */

.site-footer {
  padding-block: clamp(2.5rem, 1.75rem + 3vw, 4rem) var(--space-lg);
  background-color: var(--clr-primary-light-05);
  border-top: 1px solid var(--clr-primary-light-20);
}

.site-footer__top {
  display: grid;
  justify-items: center;
  gap: clamp(2rem, 1.5rem + 2vw, 2.5rem);
  text-align: center;
}

.site-footer__about {
  display: grid;
  justify-items: inherit;
  gap: var(--space-lg);
}

/* Desktop only: shown from 992px. */
.site-footer__download {
  display: none;
  width: fit-content;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  max-width: 26rem;
}

.site-footer__logo {
  max-height: 32px;
}

.site-footer__name {
  font-family: var(--font-primary);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--clr-primary);
}

.site-footer__tagline {
  margin-top: 0.35rem;
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--clr-text-body);
  text-wrap: pretty;
}

.site-footer__heading {
  margin-bottom: var(--space-md);
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--clr-text-heading);
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-lg);
}

.site-footer__nav a,
.site-footer__contact-list a {
  display: inline-block;
  padding-block: 0.25rem;
  font-family: var(--font-secondary);
  font-size: 0.9375rem;
  color: var(--clr-text-body);
  transition: color var(--duration-medium) var(--ease-standard);
}

/* Email and postal address, each behind its icon. */
.site-footer__contact-list {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
}

.site-footer__contact-list li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--clr-text-body);
}

.site-footer__contact-list img,
.site-footer__secure img {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.site-footer .social {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Roboto on every page: the "in" / "f" glyphs stay Latin on Arabic pages. */
.site-footer .social :is(a, button) {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  aspect-ratio: 1;
  background-color: var(--clr-white);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--clr-primary);
  transition: background-color var(--duration-medium) var(--ease-standard),
    color var(--duration-medium) var(--ease-standard),
    transform var(--duration-medium) var(--ease-standard);
}

/* Bottom bar */
.site-footer__bottom {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--clr-primary-light-20);
  text-align: center;
}

.site-footer .copyrights,
.site-footer .legal,
.site-footer__secure {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--clr-text-body);
}

.site-footer .copyrights {
  font-family: var(--font-primary);
}

.site-footer .legal,
.site-footer__secure {
  font-family: var(--font-secondary);
}

/* Desktop only: shown from 992px. */
.site-footer__secure {
  display: none;
  align-items: center;
  gap: var(--space-xs);
}

.site-footer__secure img {
  width: 0.875rem;
  height: 0.875rem;
}

.site-footer .legal a {
  transition: color var(--duration-medium) var(--ease-standard);
  font-weight: 500;
}

@media (min-width: 992px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
    justify-items: start;
    column-gap: clamp(2rem, 5vw, 5rem);
    text-align: start;
  }

  .site-footer__brand {
    flex-direction: row;
  }

  .site-footer__nav ul {
    flex-direction: column;
    gap: 0.375rem;
  }

  .site-footer__contact-list {
    justify-items: start;
  }

  .site-footer .social {
    justify-content: center;
  }

  .site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    column-gap: var(--space-lg);
  }

  .site-footer__download {
    display: flex;
  }

  .site-footer__secure {
    display: inline-flex;
  }
}

/* Hover only where a pointer can hover */
@media (hover: hover) {
  .site-footer__nav a:hover,
  .site-footer__contact-list a:hover,
  .site-footer .legal a:hover {
    color: var(--clr-primary);
  }

  .site-footer .social :is(a, button):hover {
    background-color: var(--clr-primary);
    color: var(--clr-white);
    transform: translateY(-2px);
  }

  .site-footer .social :is(a, button):hover .svg-icon {
    filter: brightness(0) invert(1);
  }
}

/* Highlight after a "learn more" link (.text-link) or the navbar's Contact
   Us is followed: site.js adds .is-highlighted for a few seconds. Each
   button briefly takes its hover look and sends out a ring, one after the
   other in reading order. */
.site-footer .social li:nth-child(2) {
  --i: 1;
}

.site-footer .social li:nth-child(3) {
  --i: 2;
}

.site-footer .social li:nth-child(4) {
  --i: 3;
}

.site-footer .social li:nth-child(5) {
  --i: 4;
}

@media (prefers-reduced-motion: no-preference) {
  .site-footer .social.is-highlighted :is(a, button) {
    animation: social-nudge 1.2s var(--ease-emphasized) calc(var(--i, 0) * 0.1s) 2 both;
  }

  .site-footer .social.is-highlighted .svg-icon {
    animation: social-nudge-icon 1.2s var(--ease-emphasized) calc(var(--i, 0) * 0.1s) 2 both;
  }

  .site-footer .social.is-highlighted :is(a, button)::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--clr-primary-light);
    border-radius: inherit;
    pointer-events: none;
    animation: social-ring 1.2s ease-out calc(var(--i, 0) * 0.1s) 2 both;
  }
}

/* Reduced motion: the same cue, held still. */
@media (prefers-reduced-motion: reduce) {
  .site-footer .social.is-highlighted :is(a, button) {
    outline: 2px solid var(--clr-primary-light);
    outline-offset: 3px;
  }
}

@keyframes social-nudge {
  30%,
  60% {
    translate: 0 -4px;
    background-color: var(--clr-primary);
    color: var(--clr-white);
    box-shadow: var(--shadow-card-hover);
  }
}

@keyframes social-nudge-icon {
  30%,
  60% {
    filter: brightness(0) invert(1);
  }
}

@keyframes social-ring {
  from {
    opacity: 0.9;
    scale: 1;
  }

  to {
    opacity: 0;
    scale: 1.6;
  }
}

/* Arabic: Tajawal needs more leading than the Latin fonts. */
html[lang="ar"] .site-footer__tagline {
  line-height: 1.7;
}

html[lang="ar"] .site-footer__contact-list li {
  line-height: 1.7;
}

html[lang="ar"] .site-footer .copyrights,
html[lang="ar"] .site-footer .legal,
html[lang="ar"] .site-footer__secure {
  line-height: 1.6;
}
