/*
  Genesis Lawn Landscaping Styles
  Mobile‑first responsive CSS for a family‑owned landscaping company website.
*/

/* Import Google Fonts for a fresh look */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Poppins:wght@500;700&display=swap');

/* Reset & Typography */
*,*::before,*::after { box-sizing: border-box; }
body {
  margin: 0;
  /* Use Open Sans for body text for better readability */
  font-family: var(--body-font);
  line-height: 1.6;
  color: #222;
  /* soft page background tone */
  background: var(--page-bg);
}

/* Prevent horizontal scrolling due to angled hero or other layout features */
html, body {
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:focus { outline: 2px dashed var(--primary); outline-offset: 2px; }
img { display: block; max-width: 100%; height: auto; }

/* Theme Colors */
:root {
  /* refreshed earthy palette for an inviting vibe */
  /* Earthy palette refresh: softer greens and warm accent */
  --primary: #3c6943; /* medium forest green */
  --secondary: #709255; /* sage green */
  --accent: #b67d3e; /* warm bronze */
  --bg-light: #f8f6ef; /* light cream background for cards */
  --page-bg: #f5f7f2; /* pale sage tint for page background */
  --text-light: #ffffff;
  /* font families */
  --heading-font: 'Poppins', sans-serif;
  --body-font: 'Open Sans', sans-serif;
}

/* Dark mode color variables override when body has .dark class */
body.dark {
  --primary: #142f1b;
  --secondary: #365c2e;
  --accent: #9c6a2f;
  --bg-light: #2b2b2b;
  --page-bg: #1a1a1a;
  --text-light: #f5f5f5;
}

body.dark {
  background: var(--page-bg);
  color: #e6e6e6;
}
body.dark p {
  color: #ccc;
}
body.dark .faq-answer {
  background: #333;
  border-color: #444;
  color: #ddd;
}
body.dark .faq-item button {
  color: var(--text-light);
}
body.dark footer p,
body.dark footer a {
  color: #c9d8c9;
}
body.dark .service-card {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}
body.dark .service-card p,
body.dark .trust-item p,
body.dark .how-item p {
  color: #ddd;
}
body.dark .trust-item,
body.dark .how-item,
body.dark .service-card {
  background: var(--bg-light);
}
body.dark .faq-item button {
  background: var(--primary);
}
body.dark .faq-item button[aria-expanded="true"] span:last-child {
  color: var(--accent);
}
body.dark .gallery-grid img:hover {
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.25);
}
body.dark #backToTop {
  background: var(--accent);
  color: var(--text-light);
}

/* Lighten headings in dark mode */
body.dark h1,
body.dark h2,
body.dark h3 {
  color: var(--text-light);
}

/* Ensure service card headings and buttons are legible in dark mode */
body.dark .service-card h2,
body.dark .service-card h3 {
  color: var(--text-light);
}
body.dark .service-card a {
  color: var(--text-light);
}

/* Nav icon buttons */
.nav-icon-btn {
  background: none;
  border: none;
  color: var(--bg-light);
  margin-left: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.nav-icon-btn:hover {
  color: var(--secondary);
}
/* Dark mode styling for nav icons (language & dark mode toggles) */
body.dark .nav-icon-btn {
  color: var(--text-light);
}
body.dark .nav-icon-btn:hover {
  color: var(--secondary);
}

/* Specific styling for the language toggle to improve visibility */
#langToggle {
  font-weight: 600;
  border: 1px solid var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  color: var(--accent);
  background: transparent;
}
#langToggle:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}
body.dark #langToggle {
  color: var(--accent);
  border-color: var(--accent);
}
body.dark #langToggle:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}
@media (max-width: 768px) {
  .nav-icon-btn {
    margin-left: 0.75rem;
  }
}

/* Dark mode nav link colors for better contrast */
body.dark .nav-links a {
  color: var(--text-light);
}
body.dark .nav-links a:hover,
body.dark .nav-links a[aria-current="page"] {
  color: var(--secondary);
}

/* Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.navbar .logo {
  font-weight: 700;
  color: var(--text-light);
  font-size: 1.3rem;
  font-family: var(--heading-font);
}
.nav-links a {
  margin-left: 1rem;
  font-weight: 600;
  color: var(--bg-light);
  padding: 0.25rem;
  transition: color 0.2s;
  font-family: var(--body-font);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--secondary);
}
.nav-links a:hover {
  color: var(--secondary);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  z-index: 1000;
  text-decoration: none;
  font-family: var(--body-font);
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 0.3rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: var(--body-font);
}
.btn-primary {
  background: var(--accent);
  color: var(--text-light);
}
.btn-secondary {
  background: var(--primary);
  color: var(--text-light);
}
.btn-primary:hover,
.btn-secondary:hover {
  opacity: 0.9;
}

/* Sections */
.section {
  padding: 4rem 1rem;
}
.section h2 {
  margin-top: 0;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 2rem;
  color: var(--primary);
}

/* Hero */
.hero {
  position: relative;
  /* new hero background using lush garden image */
  background: url('../assets/images/hero-image.webp') center/cover no-repeat;
  /* taller hero for more visual impact */
  min-height: 70vh;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}

/* decorative diagonal shape at bottom of hero */
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 70px;
  background: var(--page-bg);
  /* diagonal cut */
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}
.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  font-family: var(--heading-font);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-light);
}
.hero p {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-family: var(--body-font);
  color: var(--bg-light);
}

/* Service Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.service-card {
  background: var(--bg-light);
  border-top: 4px solid var(--accent);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  /* Allow cards to grow naturally to fit their content instead of forcing a fixed height */
  height: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0,0,0,0.12);
}
.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.service-card h3 {
  margin: 1rem;
  font-size: 1.4rem;
  color: var(--primary);
  font-family: var(--heading-font);
  font-weight: 600;
}
.service-card p {
  margin: 0 1rem 1rem;
  flex-grow: 1;
  font-size: 0.95rem;
  font-family: var(--body-font);
}
.service-card a {
  margin: 0 1rem 1rem;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--text-light);
  text-align: center;
  border-radius: 0.3rem;
  font-weight: 600;
  transition: background 0.2s;
  font-family: var(--body-font);
}

/* On small screens, stack service card content vertically to prevent cramped layouts */
@media (max-width: 768px) {
  .service-card {
    flex-direction: column !important;
  }
}
.service-card a:hover {
  background: var(--primary);
}

/* Trust Section */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* tighten spacing below the trust section to reduce gap before the gallery */
.section.trust {
  padding-bottom: 2rem;
}
.trust-item {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-light);
  border-top: 4px solid var(--accent);
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Decorative tick for trust items */
.trust-item::before {
  content: '✓';
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-light);
  line-height: 42px;
  font-size: 1.5rem;
}
.trust-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-family: var(--heading-font);
}
.trust-item p {
  font-size: 0.95rem;
  font-family: var(--body-font);
}

/* Testimonials */
.testimonials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}
.testimonial {
  background: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-style: italic;
}
.testimonial p:last-child {
  font-style: normal;
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* reduce spacing above the gallery section to tighten gap after Why Choose Us */
.section.gallery {
  padding-top: 2rem;
}
.gallery-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* FAQ */
.faq-item {
  max-width: 800px;
  margin: 0 auto 1rem;
}
.faq-item button {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.faq-item button span {
  margin-left: 1rem;
  transition: transform 0.3s;
}
/* Only rotate the plus icon when expanded */
.faq-item button[aria-expanded="true"] .faq-toggle-icon {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 0.3rem 0.3rem;
  display: none;
}
.faq-answer p {
  margin: 0;
  font-size: 0.95rem;
}

/* Forms */
form input, form select, form textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  font-size: 1rem;
}
form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 154, 84, 0.25);
}
form button[type="submit"] {
  margin-top: 1rem;
}

/* Footer */
footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 2rem 1rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
footer h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--accent);
  font-family: var(--heading-font);
}
footer p, footer a {
  font-size: 0.9rem;
  margin: 0.2rem 0;
  color: #e5f4e4;
  font-family: var(--body-font);
}
footer a:hover {
  text-decoration: underline;
}

/* Media Queries */
@media (min-width: 768px) {
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.4rem; }
}

/* Typography overrides */
h1, h2, h3 {
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

p {
  font-family: var(--body-font);
  color: #333;
  line-height: 1.6;
}

/* === Enhanced Navigation & Interactions === */
/* Call to action link inside nav for free estimates */
.nav-links .cta {
  background: var(--accent);
  color: var(--text-light);
  padding: 0.5rem 0.8rem;
  border-radius: 0.3rem;
  margin-left: 1.5rem;
  transition: background 0.2s;
}
.nav-links .cta:hover {
  background: var(--secondary);
}

/* Hamburger menu toggle – hidden on larger screens */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.menu-toggle span {
  height: 3px;
  width: 100%;
  background: var(--bg-light);
  margin-bottom: 5px;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-toggle span:last-child {
  margin-bottom: 0;
}

/* Ensure hamburger icon lines are visible in dark mode */
body.dark .menu-toggle span {
  background: var(--text-light);
}
/* Cross animation when menu is open */
.menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Back to Top button */
#backToTop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--accent);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 999;
}
#backToTop.show {
  display: block;
}
#backToTop:hover {
  opacity: 0.9;
}

/* Scroll animation classes */
.animate-item {
  opacity: 0;
  transform: translateY(40px);
}
.animate-item.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease-out;
}

/* Mobile nav styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    margin: 0.5rem 0;
    color: var(--bg-light);
  }
  .nav-links .cta {
    margin: 1rem 0 0;
  }
}

/* How It Works Section */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.how-item {
  text-align: center;
  background: var(--bg-light);
  padding: 2rem 1rem;
  border-top: 4px solid var(--accent);
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.how-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-light);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.how-item h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--primary);
}
.how-item p {
  font-size: 0.95rem;
}


/* Mobile sticky CTA bar */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary);
  padding: 0.5rem;
  justify-content: space-around;
  align-items: center;
  z-index: 998;
}
.mobile-cta-bar a {
  flex: 1;
  margin: 0 0.5rem;
  padding: 0.7rem 0;
  text-align: center;
  background: var(--accent);
  color: var(--text-light);
  border-radius: 0.3rem;
  font-weight: 600;
  font-family: var(--body-font);
  font-size: 0.95rem;
}
.mobile-cta-bar a:last-child {
  background: var(--secondary);
}
@media (max-width: 768px) {
  .mobile-cta-bar {
    display: flex;
  }
  #backToTop {
    bottom: 4rem;
  }
}