/* Global (shared by all pages) */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+SC:wght@600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;700&display=swap");

/* Reset / base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #111827;
  background: #f3f3f3; /* brand grey */
  line-height: 1.6;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: #064b1f;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid #0ea5e9;
  outline-offset: 2px;
}

/* Layout helpers */
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}
.section {
  padding: 35px 0;
}
.section--alt {
  background: #f8fafc;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* ← this is the key line */
}

.footer-nav {
  justify-self: center; /* Centers the entire column within the grid cell */
  text-align: center; /* Centers the link text inside it */
}

.footer-nav ul {
  list-style: none;
  margin: 0 auto; /* centre the grid block inside <nav> */
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, auto); /* columns sized to content */
  column-gap: 3rem; /* space between the two columns */
  row-gap: 0.5rem;
}

.footer-nav li {
  justify-self: start; /* keep each link left-aligned inside its cell */
}

.footer__links a {
  color: #cbd5e1;
}

.footer__legal {
  grid-column: 1 / -1;
  color: #94a3b8;
}

/* Layout helpers already present… add section__lead */
.section__lead {
  max-width: 68ch;
  color: #334155;
}

/* Buttons (used site-wide) */
.btn--primary {
  background: #064b1f;
  color: #fff;
}
.btn--primary:hover {
  background: #15803d;
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  border-color: #16a34a;
  color: #166534;
}
.btn--ghost:hover {
  background: #ecfdf5;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center; /* centers text vertically */
  justify-content: center; /* centers text horizontally */
  font-weight: 600;
  padding: 12px 24px; /* slightly more breathing room */
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn:hover {
  transform: translateY(-2px);
}

/* Nice subtle focus for header links */
.nav__list a:focus-visible {
  outline-color: #16a34a;
}

/* Headings used across pages */
h1,
h2,
h3 {
  line-height: 1.2;
}
h2 {
  font-size: clamp(24px, 2vw, 34px);
  margin: 0 0 8px;
}
h3 {
  font-size: 20px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Back-to-top (shared) */
.back-to-top {
  position: fixed;
  right: 22px; /* bottom-right */
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px; /* arrow size */
  line-height: 1;
  text-decoration: none;
  color: #fff;
  background: #064b1f; /* brand green */
  border: 1px solid #043517;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;

  /* appear after scroll */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}
.back-to-top:hover {
  background: #0a6b2a;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* slightly bigger tap target on mobile */
@media (max-width: 640px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    font-size: 30px;
  }
}

.client-logos {
  text-align: center;
  margin-top: 2rem;
}

.client-heading {
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.client-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.client-grid figure {
  margin: 0;
  text-align: center;
  max-width: 200px;
}

/* Envisage logo only */
.client-grid img[src*="envisage"] {
  border: 2px solid #eab0a4; /* soft peach */
  border-radius: 8px;
}

.client-grid img {
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1); /* faint universal edge */
}

.client-grid img[alt*="Envisage"],
.client-grid img[src*="envisage"] {
  border: 2px solid #eab0a4; /* override with peach */
  background: #fff;
  padding: 4px;
}

.client-grid figcaption {
  font-size: 0.95rem;
  font-weight: 600; /* emboldens text */
  color: #1e293b; /* darker for readability */
  line-height: 1.4;
}

.client-grid small {
  display: block;
  font-weight: 500; /* subtle emphasis */
  color: #475569; /* slate-600 tone */
  margin-top: 2px;
}

.site-footer {
  background: #0b0f19;
  color: #e5e7eb;
  margin-top: 36px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 64px;
  padding: 32px 0;
  align-items: start;
}

.footer-phone {
  color: #2cc00f;
  font-weight: 600;
  text-decoration: none;
}

.footer-nav li {
  margin: 8px 0;
}
.footer-nav a {
  color: #e5e7eb;
  text-decoration: none;
}
.footer-nav a:hover {
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}
.footer-social img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  transition: transform 0.2s, opacity 0.2s;
}
.footer-social a:hover img {
  transform: scale(1.1);
  opacity: 0.95;
}

.footer__legal {
  text-align: center;
  color: #94a3b8;
  padding: 16px 0 24px;
  border-top: 1px solid #1e293b;
  font-size: 14px;
}

.footer__credit {
  text-align: center;
  color: #94a3b8; /* same as .footer__legal */
  font-size: 14px;
  margin-top: 6px; /* small gap under © line */
}

.footer__credit a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
}

.footer__credit a:hover {
  text-decoration: underline;
}

/* Mobile stack */
@media (max-width: 820px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-social {
    justify-content: center;
  }
}

/* Tablet and small laptop */
@media (max-width: 900px) {
  .container {
    width: min(1100px, 96%);
  }

  .section {
    padding: 28px 0;
  }

  .page-hero {
    padding: 28px 0 16px;
  }

  .page-hero .lede {
    font-size: clamp(18px, 2.2vw, 22px);
  }
}

/* Phones */
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .section {
    padding: 22px 0;
  }

  /* Stack CTA content and make button full-width on small screens */
  .cta__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .cta__inner > p {
    width: 100%;
  }

  .cta__inner .btn {
    width: 100%;
    justify-content: center;
  }

  /* Slightly more breathing room inside the main container */
  .container {
    width: 94%;
  }
}

/* Force gallery to be visible on mobiles and tablets */
@media (max-width: 900px) {
  .gallery,
  .gallery-section,
  .gallery-grid,
  .gallery-card,
  .gallery-card img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}
