/*
 * ===================================================================
 * Base & Global Styles (Largely Unchanged)
 * ===================================================================
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: #f8f9fa;
  color: #0B2038;
  line-height: 1.6;
}

/* Hero section */
.hero {
  background-color: #f2f4f7;
  text-align: center;
  padding: 2rem 1.5rem;
}
.hero h1 { color: #0B2038; font-size: 2rem; margin-bottom: 0.6rem; }
.hero p { color: #333333; font-size: 1.1rem; margin-bottom: 1.2rem; }

/* CTA button */
.cta-button {
  display: inline-block;
  padding: 0.9rem 2rem;
  background-color: #6BBE44;
  color: #0B2038;
  font-weight: bold;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}
.cta-button:hover { background-color: #5AAE39; }

/* Service Buttons on Homepage */
.service-buttons { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.service-buttons li { margin: 0; }
.service-buttons a, .service-buttons button { display: inline-block; padding: 0.75rem 1.25rem; background-color: #6BBE44; color: #0F1727; text-decoration: none; font-weight: 600; border-radius: 4px; transition: background-color 0.3s ease, color 0.3s ease; border: none; cursor: pointer; }
.service-buttons a:hover, .service-buttons button:hover { background-color: #5AAE39; color: #ffffff; }

/* Sections */
section { max-width: 1100px; margin: 0 auto; padding: 2rem; }
section img { display: block; margin: 1rem auto; max-width: 90%; height: auto; }
section h1, section h2 { font-size: 1.8rem; margin-bottom: 1rem; color: #0B2038; }

/* Footer */
footer { background-color: #0B2038; color: #ffffff; text-align: center; padding: 1.2rem; margin-top: 2rem; font-size: 0.9rem; }

/* Accessibility */
a:focus, button:focus { outline: 2px solid #6BBE44; outline-offset: 3px; }


/* ===================================================================
 * CORRECTED HEADER & NAVIGATION STYLES (Mobile First: <= 900px)
 * ===================================================================
 */

/* --- 1. Sticky Header Layout --- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Logo left, controls right */
  flex-wrap: wrap; /* Allows Call Us button to wrap */
  padding: 0.5rem 1rem;
  background-color: #0F1727;
  border-bottom: 4px solid #6BBE44;
  position: sticky;
  top: 0;
  z-index: 1001; /* Ensure header is above other content */
}

/* --- 2. Logo Styling --- */
header img.logo {
  height: 90px !important;
  width: auto;
}

/* Hide decorative site title to achieve the desired layout */
.site-title {
  display: none;
}

/* --- 3. Header Controls (Menu + Hamburger) --- */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto; /* Pushes it to the right */
}

.menu-label {
  display: block;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-toggle {
  display: block;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0 .5rem;
}
.menu-toggle::after { content: "☰"; }
.menu-toggle[aria-expanded="true"]::after { content: "✕"; }

/* --- 4. "Call Us" Button (Full-width row) --- */
.call-button {
  display: block;
  width: 100%;
  order: 3; /* Forces it to the next line */
  margin-top: 0.5rem;
  text-align: center;
  background-color: #6BBE44;
  color: #0F1727;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

/* --- 5. Push-Down Navigation Container --- */
nav#primary-navigation {
  /* Sits below the header in the DOM */
  background-color: #ffffff;
  max-height: 0; /* Collapsed by default */
  overflow: hidden;
  transition: max-height 0.3s ease;
  width: 100%;
  position: sticky; /* Sticks below the header */
  top: 106px; /* Adjust based on header height, may need tweaking */
  z-index: 1000;
}

/* When menu is open, expand it and allow vertical scrolling if needed */
nav#primary-navigation.nav-open {
  max-height: 70vh; /* Pushes content down, not an overlay */
  overflow-y: auto;
}

/* --- 6. Body Scroll Lock & Hiding "Call Us" --- */
body.menu-open {
  overflow: hidden; /* Locks main page scroll */
}
body.menu-open .call-button {
  display: none; /* Hide button when menu is open */
}

/* --- 7. Mobile Menu & Accordion Styling --- */
.main-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Top-level menu items (Green Bars) */
.main-nav > li > a {
  display: block;
  background-color: #6BBE44;
  color: #0F1727;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid #0F1727;
  text-decoration: none;
}

/* Sub-menu container (hidden by default) */
.dropdown .dropdown-menu {
  display: none;
  position: static;
  width: 100%;
  background: #f9f9f9;
  padding: 0;
}

/* When parent has .open, show the sub-menu */
.dropdown.open > .dropdown-menu {
  display: block;
}

/* Sub-menu links */
.dropdown-menu li a {
  display: block;
  color: #0F1727;
  background: #f9f9f9;
  padding: 0.9rem 1.5rem;
  padding-left: 2.5rem; /* Indent sub-items */
  border-bottom: 1px solid #eeeeee;
  text-decoration: none;
}
.dropdown-menu li a:hover {
  background-color: #6BBE44;
  color: #ffffff;
}

/* --- 8. Screen Size Adjustments --- */
@media (max-width: 576px) {
  header img.logo {
    height: 70px !important;
  }
  nav#primary-navigation {
    top: 86px; /* Adjust for smaller logo */
  }
}


/* ===================================================================
 * DESKTOP OVERRIDES (>= 901px)
 * ===================================================================
 */
@media (min-width: 901px) {
  /* --- 1. Restore Header Layout --- */
  header {
    flex-wrap: nowrap; /* Prevent wrapping */
  }
  header img.logo {
    height: 60px !important; /* Smaller logo on desktop */
  }
  .header-controls, .call-button {
    display: none; /* Hide all mobile controls */
  }

  /* --- 2. Restore Desktop Navigation Bar --- */
  nav#primary-navigation {
    display: block;
    position: static; /* No longer sticky */
    max-height: none; /* Always visible */
    overflow: visible; /* CRITICAL for dropdowns */
    background-color: #0F1727;
    width: auto;
    margin-left: auto;
  }

  .main-nav {
    flex-direction: row;
    justify-content: center;
  }
  .main-nav > li {
    position: relative; /* Context for absolute dropdown */
    margin: 0 0.5rem;
  }
  .main-nav > li > a {
    background-color: transparent;
    color: #ffffff;
    border: none;
  }
  .main-nav > li > a:hover {
    background-color: #6BBE44;
    color: #0F1727;
  }

  /* --- 3. Restore Hover Dropdowns --- */
  .dropdown .dropdown-menu {
    display: none !important; /* Overrides .open class if present */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: #0F1727;
    padding: 0.5rem 0;
    z-index: 1000;
  }
  .dropdown:hover > .dropdown-menu {
    display: block !important; /* Show on hover */
  }
  .dropdown-menu li a {
    background: transparent;
    color: #ffffff;
    padding: 0.6rem 1rem;
    border: none;
  }
  .dropdown-menu li a:hover {
    background-color: #6BBE44;
    color: #0F1727;
  }
}

/* ===================================================================
 * HERO READABILITY & SLIDER OVERLAY
 *
 * The default hero styles set heading and paragraph colours that work
 * well on a light background. However, on the home page the hero
 * section uses photographic images which can vary in brightness and
 * contrast. To ensure the text and call‑to‑action remain legible
 * regardless of the underlying image, we apply a dark overlay and
 * force the text colour to white. The overlay sits behind the content
 * thanks to positioning and z‑index rules. The slider arrows are also
 * brought above the overlay so they don't disappear beneath it.
 */

/* Ensure the hero is relative so the pseudo‑element can cover it */
.hero {
  position: relative;
}

/* Dark overlay across the entire hero section */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}

/* Ensure hero text and buttons sit above the overlay and remain white */
.hero h1,
.hero p,
.hero a.cta-button {
  position: relative;
  z-index: 1;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Bring slider arrows above the overlay */
.hero .slider-arrow {
  position: absolute;
  z-index: 1;
}
