/* ==========================================================================
   Homesafe Inspections — Layout
   Nav, footer, page containers, grids
   ========================================================================== */

/* ---- Navigation ----
   Live site: white bg, logo left, links center, CTA right
   Fixed top with fade-in animation
*/

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--page-padding);
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: transform 0.9s;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Match live site: 360px desktop, 200px at <=767px (set in responsive.css) */
.site-logo img {
  max-width: 360px;
  height: auto;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a,
.nav-links button {
  text-decoration: none;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links button:hover {
  color: var(--text-grey);
}

/* Nav phone */
.nav-phone {
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--text-dark);
  letter-spacing: 0.5px;
  text-align: right;
}

.nav-phone small {
  display: block;
  font-size: 10px;
  font-weight: var(--weight-normal);
  color: var(--text-grey);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after,
.nav-dropdown > button::after {
  content: ' ▾';
  font-size: 10px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  border-top: 2px solid var(--accent);
  list-style: none;
  min-width: 220px;
  z-index: 200;
}

/* Hover bridge: invisible pseudo-element covers the gap between
   the nav item and the dropdown, so the mouse doesn't leave the
   dropdown hit-area while traversing the gap. */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 14px 20px;
  font-size: var(--text-sm);
  color: var(--text-dark);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background var(--transition-fast);
}

.nav-dropdown-menu li a:hover {
  background: rgba(217, 230, 112, 0.2);
  color: var(--text-dark);
}

/* Show dropdown on pure CSS hover AND via JS hover-intent class.
   The JS class (.dropdown-open) adds a 250ms close delay so users
   can move the mouse across the gap reliably. */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.dropdown-open .nav-dropdown-menu {
  display: block;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 200;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: all var(--transition-fast);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-white);
  z-index: 150;
  padding: 80px var(--page-padding-mobile) var(--space-2xl);
  flex-direction: column;
  gap: var(--space-lg);
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a,
.nav-mobile button {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-dark);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: var(--space-sm) 0;
  border-bottom: var(--border-light);
}

/* Mobile close button — positioned top-right of the overlay */
.nav-mobile-close {
  position: absolute;
  top: 20px;
  right: var(--page-padding-mobile);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  color: var(--text-dark);
  padding: 0;
  z-index: 210;
}

.nav-mobile-close:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Mobile dropdown groups */
.nav-mobile-group {
  display: flex;
  flex-direction: column;
}

.nav-mobile-toggle {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-dark);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: var(--border-light);
  text-align: left;
  cursor: pointer;
  padding: var(--space-sm) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-mobile-toggle::after {
  content: '+';
  font-size: var(--text-lg);
  font-family: var(--font-body);
  font-weight: var(--weight-normal);
  color: var(--text-grey);
  transition: transform var(--transition-fast);
}

.nav-mobile-toggle[aria-expanded="true"]::after {
  content: '-';
}

/* Submenu items hidden by default */
.nav-mobile-submenu {
  display: none;
  flex-direction: column;
  padding-left: var(--space-lg);
}

.nav-mobile-submenu.open {
  display: flex;
}

.nav-mobile-submenu a {
  font-size: var(--text-lg);
  padding: var(--space-xs) 0;
}

/* ---- Location-Aware Banner ---- */
/* PRODUCTION: Shown when 180-day territory cookie exists.
   Displays franchisee name + direct phone number.
   Hidden when no cookie — shows generic 1300 number in nav instead. */
.local-banner {
  background: var(--accent);
  text-align: center;
  padding: 14px var(--page-padding);
  font-size: 14px;
  font-weight: var(--weight-normal);
  color: var(--text-dark);
}

.local-banner strong {
  font-weight: var(--weight-bold);
}

.local-banner.hidden {
  display: none;
}

/* ---- Hero Section ---- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 580px;
  overflow: visible;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-4xl) var(--page-padding);
}

.hero-content h1 {
  margin-bottom: var(--space-lg);
  color: var(--text-dark);
  max-width: none;
}

.hero-content p {
  font-size: 16px;
  margin-bottom: var(--space-xl);
  max-width: 480px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden; /* contain the image, not the whole hero */
}

/* ---- Page Layout (for booking pages) ---- */
.page-centered {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--page-padding-mobile) var(--space-4xl);
}

.page-centered--wide {
  max-width: 600px;
}

.page-centered h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  text-align: center;
  margin-bottom: var(--space-xs);
}

.page-centered > p {
  text-align: center;
  color: var(--text-grey);
  font-size: var(--text-base);
  margin-bottom: 40px;
}

/* ---- Two-Column Layout ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.two-col--content-image {
  align-items: center;
}

/* ---- Footer ----
   Live site: grey background (#6B6B6B), three-column layout
   (enquiries + links, navigation, legal)
*/
.site-footer {
  background: var(--footer-bg);
  color: var(--bg-white);
  padding: var(--space-2xl) var(--page-padding);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.site-footer h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  font-weight: var(--weight-medium);
  color: var(--bg-white);
}

.site-footer p,
.site-footer a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  line-height: 2;
  display: block;
}

.site-footer a:hover {
  color: var(--bg-white);
}

.footer-bottom {
  background: #555;
  padding: var(--space-md) var(--page-padding);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: rgba(255, 255, 255, 0.75);
}

/* ---- Service Area Map (Location Page) ---- */
.map-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xl);
}

.map-embed {
  background: #E8E6E0;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-grey);
  border: var(--border-light);
}

/* ---- Inspector Profile (Location Page) ---- */
.inspector-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ---- Services Grid (Location Page) ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  max-width: 800px;
  margin: 0 auto;
}

.service-item {
  background: rgba(255, 255, 255, 0.6);
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-item h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  margin-bottom: 2px;
}

.service-item .desc {
  font-size: var(--text-xs);
  color: var(--text-grey);
}

.service-item .price {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
