/* Base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  line-height: 1.6;
  color: #2a2a2a;
  background-color: #f9f9f9;
}

/* Prevent horizontal scrolling on mobile by constraining body width */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure images scale nicely and do not overflow on small screens */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  /*
   * Prevent the logo from being cropped. The height is capped but the
   * natural aspect ratio is preserved. The object-fit property ensures the
   * entire image is visible within the given height.
   */
  max-height: 60px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  /* Remove extra right margin so nav aligns nicely to the right via flex */
  margin-right: 0;
}

/* Position the nav on the far right of the header */
/*
 * Align the navigation to the right of the header. The header uses a flex
 * container (`header-inner`) with space-between alignment so the logo stays
 * to the left and the navigation hugs the right. Removing margin from
 * individual nav items prevents the list from drifting towards the center.
 */
.main-nav {
  margin-left: auto;
  position: relative;
}

/* Dropdown menus for the Services link. The parent list item gets the
 * class .has-menu in the HTML. When hovered or focused, reveal the nested
 * menu. On smaller devices the menu will stack below. */
.has-menu {
  position: relative;
}
.has-menu > .menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  padding: 0.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  min-width: 200px;
  z-index: 100;
}
.has-menu:hover > .menu,
.has-menu:focus-within > .menu {
  display: block;
}
.menu li {
  list-style: none;
}
.menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #228b22;
  font-weight: 600;
  white-space: nowrap;
}
.menu li a:hover {
  background: #f5f5f5;
  color: #1f7a1f;
}


.nav-link {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #228b22;
}

/* Special styles for contact and account links */
.contact-link,
.account-link {
  border: 2px solid #228b22;
  border-radius: 4px;
  color: #228b22;
  padding: 0.5rem 1rem;
  /* Match the same font size as other navigation links */
  font-size: 1rem;
  /* Remove auto margin so these buttons don't push other items */
  margin-left: 0;
}

.contact-link:hover,
.account-link:hover {
  background: #228b22;
  color: #fff;
}

/* Hero section */
.hero {
  background-size: cover;
  background-position: center;
  color: #fff;
  height: 60vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/*
 * The overlay in the hero section darkens the background image so that
 * text remains legible. Originally this was set to 50 % opacity which
 * was too heavy on large screens and especially distracting on mobile.
 * Reduce the opacity dramatically (75 % lighter) so the hero image shows
 * through while still providing sufficient contrast for the headline.
 */
.hero-overlay {
  background: rgba(0, 0, 0, 0.125);
  padding: 2rem;
  border-radius: 8px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn.primary {
  background: #228b22;
  color: #fff;
}

.btn.primary:hover {
  background: #1f7a1f;
}

.btn.secondary {
  background: #fff;
  color: #228b22;
  border: 2px solid #228b22;
}

.btn.secondary:hover {
  background: #228b22;
  color: #fff;
}

.btn.small {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border: 1px solid #228b22;
  color: #228b22;
  background: #fff;
}

.btn.small:hover {
  background: #228b22;
  color: #fff;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.services-overview .services-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 2rem;
}

.service-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #228b22;
}

.service-card p {
  flex: 1;
  margin-bottom: 1rem;
}

/*
 * Service card images. These images illustrate each service on the
 * homepage and maintain a consistent aspect ratio across cards. The
 * object-fit property ensures the image is cropped gracefully without
 * distortion and a subtle border-radius softens the edges. On
 * narrow viewports the image scales down naturally.
 */
.service-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  display: block;
}

.cta-section {
  background: #228b22;
  color: #fff;
  text-align: center;
}

.cta-section a.btn.primary {
  margin-top: 1rem;
  background: #fff;
  color: #228b22;
  border: 2px solid #fff;
}

.cta-section a.btn.primary:hover {
  background: #f0f0f0;
  color: #228b22;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
}

/* Footer */
.site-footer {
  background: #333;
  color: #fff;
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-inner a {
  color: #fff;
  text-decoration: underline;
}

.promo-link {
  font-weight: bold;
}

/* Responsive tweaks */
@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
  .hero p {
    font-size: 1.25rem;
  }
  .logo img {
    height: 80px;
  }
  /* Keep navigation text at the base size on larger screens */
  .nav-link,
  .contact-link,
  .account-link {
    font-size: 1rem;
  }
}