/* ==========================================================================
   Modern Footer — 3 Column Layout
   Matches style.css palette: ink-navy bg, brass/tea-green accents
   ========================================================================== */

/* --- Inherit project palette & fonts --- */
.modern-footer {
  --f-ink-navy: #13233d;
  --f-paper: #f2f3ec;
  --f-brass: #b8842e;
  --f-brass-hover: #a3752a;
  --f-tea-green: #073f78;
  --f-muted-brick: #a8452e;
  --f-slate: #4a5568;
  --f-white: #ffffff;

  --f-text-primary: #eef1f6;
  --f-text-secondary: #b5bdcb;
  --f-text-muted: #8690a3;

  --f-font-display: "Space Grotesk", sans-serif;
  --f-font-body: "Inter", sans-serif;
  --f-font-mono: "IBM Plex Mono", monospace;
}

/* --- Footer base --- */
.modern-footer {
  position: relative;
  background-color: var(--f-ink-navy);
  color: var(--f-text-primary);
  font-family: var(--f-font-body);
  padding: 4.5rem 0 2rem;
  overflow: hidden;
  border-top: 3px solid transparent;
  background-image: linear-gradient(var(--f-ink-navy), var(--f-ink-navy)),
    linear-gradient(90deg, var(--f-brass), var(--f-tea-green), var(--f-muted-brick), var(--f-brass));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* --- Subtle grid background --- */
.footer-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 132, 46, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 107, 74, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

/* --- Network / hex-style connecting lines (SVG-like via gradients) --- */
.footer-network {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(184, 132, 46, 0.14), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(47, 107, 74, 0.12), transparent 30%),
    radial-gradient(circle at 50% 85%, rgba(168, 69, 46, 0.10), transparent 32%),
    radial-gradient(circle at 92% 72%, rgba(184, 132, 46, 0.09), transparent 25%);
}

.modern-footer .container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   THREE-COLUMN MAIN GRID
   ========================================================================== */
.footer-main-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* --- Column heading --- */
.col-heading {
  font-family: var(--f-font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--f-text-muted);
  margin: 0 0 1.5rem;
  padding-bottom: 0.7rem;
  position: relative;
}

.col-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, var(--f-brass), transparent);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.footer-col:hover .col-heading::after {
  width: 80px;
}

.col-subheading {
  margin-top: 2rem;
}

/* ==========================================================================
   COLUMN 1: BRAND
   ========================================================================== */
.brand-block {
  margin-bottom: 1.75rem;
}

.footer-brand-logo {
  display: block;
  max-height: 72px;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.06);
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.brand-block:hover .footer-brand-logo {
  transform: translateY(-3px) rotate(-1.5deg);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(184, 132, 46, 0.22);
  border-color: rgba(184, 132, 46, 0.45);
  background-color: rgba(255, 255, 255, 0.09);
}

/* --- Quote --- */
.brand-quote {
  font-family: var(--f-font-display);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--f-brass);
  margin: 0 0 1rem;
  padding: 0;
  position: relative;
  transition: color 0.3s ease;
}

.brand-quote:hover {
  color: #c99740;
}

/* --- Description --- */
.brand-desc {
  color: var(--f-text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
  margin: 0 0 1.75rem;
  max-width: 440px;
}

/* --- Social icons --- */
.social-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--f-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.35s ease;
}

.social-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--f-brass), var(--f-tea-green));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.social-btn i {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.social-btn:hover {
  transform: translateY(-4px);
  color: var(--f-white);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.social-btn:hover::before {
  opacity: 1;
}

.social-btn:hover i {
  transform: scale(1.1);
}

/* ==========================================================================
   COLUMN 2 & 3: CONTACT LISTS
   ========================================================================== */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  transition:
    background-color 0.3s ease,
    transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.35s ease;
  position: relative;
}

.contact-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 2px;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
}

.contact-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.contact-item:hover::before {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}

/* Accent bar per-icon color on hover */
.contact-item:has(.icon-brass):hover::before { background: var(--f-brass); }
.contact-item:has(.icon-green):hover::before { background: var(--f-tea-green); }
.contact-item:has(.icon-brick):hover::before { background: var(--f-muted-brick); }
.contact-item:has(.icon-navy):hover::before  { background: #4a6fa5; }

/* --- Icon wrapper --- */
.contact-icon-wrap {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--f-white);
  position: relative;
  transition:
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.4s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.icon-brass  { background-color: rgba(184, 132, 46, 0.18);  color: #d7a24a; }
.icon-green  { background-color: rgba(47, 107, 74, 0.18);  color: #4e9a72; }
.icon-brick  { background-color: rgba(168, 69, 46, 0.18);  color: #cc6b52; }
.icon-navy   { background-color: rgba(74, 111, 165, 0.22); color: #7ea6d8; }

.contact-item:hover .contact-icon-wrap {
  transform: scale(1.08) rotate(-4deg);
}

.contact-item:hover .icon-brass { box-shadow: 0 0 0 3px rgba(184, 132, 46, 0.18), 0 8px 22px rgba(184, 132, 46, 0.35); }
.contact-item:hover .icon-green { box-shadow: 0 0 0 3px rgba(47, 107, 74, 0.18), 0 8px 22px rgba(47, 107, 74, 0.35); }
.contact-item:hover .icon-brick { box-shadow: 0 0 0 3px rgba(168, 69, 46, 0.18), 0 8px 22px rgba(168, 69, 46, 0.35); }
.contact-item:hover .icon-navy  { box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2), 0 8px 22px rgba(74, 111, 165, 0.35); }

/* --- Contact text --- */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding-top: 2px;
}

.contact-label {
  font-family: var(--f-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--f-text-muted);
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-value {
  color: var(--f-text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  word-break: break-word;
  transition: color 0.25s ease;
}

a.contact-value:hover {
  color: var(--f-brass);
}

.contact-item:hover .contact-label {
  color: var(--f-text-secondary);
}

/* ==========================================================================
   FOOTER BOTTOM BAR
   ========================================================================== */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.75rem;
}

.legal-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-bottom: 1.25rem;
}

.legal-link {
  font-family: var(--f-font-body);
  font-size: 0.88rem;
  color: var(--f-text-muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.25s ease;
}

.legal-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--f-brass);
  transition: width 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.legal-link:hover {
  color: var(--f-brass);
}

.legal-link:hover::after {
  width: 100%;
}

.bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.copyright-text {
  font-family: var(--f-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--f-text-muted);
  margin: 0;
}

/* --- Back to top --- */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--f-text-secondary);
  font-family: var(--f-font-display);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.35s ease;
}

.back-to-top i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--f-brass), var(--f-tea-green));
  color: var(--f-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: transform 0.35s ease;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background-color: rgba(184, 132, 46, 0.1);
  border-color: rgba(184, 132, 46, 0.35);
  color: var(--f-white);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover i {
  transform: translateY(-2px);
}

/* ==========================================================================
   SCROLL-REVEAL ANIMATIONS (fade up on load)
   ========================================================================== */
.footer-main-grid > .footer-col,
.footer-bottom {
  opacity: 0;
  transform: translateY(24px);
  animation: footer-fade-up 0.75s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.footer-main-grid > .footer-col:nth-child(1) { animation-delay: 0.05s; }
.footer-main-grid > .footer-col:nth-child(2) { animation-delay: 0.18s; }
.footer-main-grid > .footer-col:nth-child(3) { animation-delay: 0.31s; }
.footer-bottom { animation-delay: 0.44s; }

@keyframes footer-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contact items stagger */
.contact-item {
  opacity: 0;
  transform: translateX(-10px);
  animation: contact-slide-in 0.55s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.footer-contact-col .contact-item:nth-child(1) { animation-delay: 0.32s; }
.footer-contact-col .contact-item:nth-child(2) { animation-delay: 0.40s; }
.footer-contact-col .contact-item:nth-child(3) { animation-delay: 0.48s; }
.footer-contact-col .contact-item:nth-child(4) { animation-delay: 0.56s; }

.footer-support-col .contact-item:nth-child(1) { animation-delay: 0.38s; }
.footer-support-col .contact-item:nth-child(2) { animation-delay: 0.46s; }
.footer-support-col .contact-item:nth-child(3) { animation-delay: 0.60s; }
.footer-support-col .contact-item:nth-child(4) { animation-delay: 0.68s; }

@keyframes contact-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1099.98px) {
  .footer-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .modern-footer {
    padding: 3.5rem 0 1.75rem;
  }

  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    margin-bottom: 2.25rem;
  }

  .footer-brand-col {
    grid-column: auto;
  }

  .brand-block {
    justify-content: center;
    text-align: center;
  }

  .brand-quote,
  .brand-desc {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .social-row {
    justify-content: center;
  }

  .legal-links-row {
    justify-content: center;
    gap: 0.6rem 1.25rem;
  }

  .bottom-row {
    flex-direction: column-reverse;
    text-align: center;
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .footer-main-grid > .footer-col,
  .footer-bottom,
  .contact-item {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .modern-footer *,
  .modern-footer *::before,
  .modern-footer *::after {
    transition: none !important;
    animation: none !important;
  }
}
