/* =============================================================================
   4-header.css — Fixed top bar (#header): logo, nav links, CTA, theme toggle
   Nav grid and spacing are in layout.css; button size is .button--small in 3-button.css.
   ============================================================================= */

/* ---------- Default — bar and trim ---------- */

/* Fixed dark green strip at the top of the page */
.header {
  background-color: var(--color-primary-dark);
  transition: box-shadow 0.4s;
}

/* Grass SVG along the bottom edge of the header */
.header__border {
  width: 100%;
  height: 14px;
  position: absolute;
  bottom: 0;
  left: 0;
}

/* ---------- Default — logo and nav links ---------- */

/* “The Greener Grass” link, top-left */
.nav__logo {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--color-white);
  text-decoration: none;
}

/* Hamburger — hidden until mobile menu is wired up */
.nav__toggle {
  padding: 0.4rem 0.75rem;
  border: 1px solid hsla(0, 0%, 100%, 0.35);
  border-radius: 0.25rem;
  background: transparent;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  display: none;
}

/* Section anchors — Home, Services, Our work, Contact, etc. */
.nav__link {
  color: var(--color-white);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.3s;
}

/* ---------- Default — header actions ---------- */

/* “Get a Quote” — uses .button--small; collapses on home (see States) */
.nav__cta {
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  max-width: 9rem;
  box-shadow: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    max-width 0.25s ease,
    padding 0.25s ease,
    margin 0.25s ease;
}

/* Light / dark mode toggle, circle next to the CTA */
.nav__theme {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid hsla(0, 0%, 100%, 0.28);
  border-radius: 50%;
  background: transparent;
  color: var(--color-white);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

/* ---------- States — scroll, hover, home section ---------- */

/* After ~50px scroll — shadow under bar; grass trim fades (main.js) */
.header.scroll-header {
  box-shadow: 0 2px 8px hsla(120, 18%, 12%, 0.35);
}

.header.scroll-header .header__border {
  opacity: 0;
}

.nav__link:hover,
.nav__link.active-link {
  color: var(--color-accent-warm);
}

.nav__theme:hover {
  border-color: var(--color-accent-warm);
  color: var(--color-accent-warm);
}

/* Home #home in view — hide header CTA so only the hero button shows */
.header.hero-in-view .nav__cta {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-width: 0;
  padding-inline: 0;
  margin-inline: 0;
}

/* ---------- Responsive — 768px up ---------- */

@media (min-width: 768px) {
  .nav__cta {
    max-width: 11rem;
    box-shadow: 0 4px 16px hsla(150, 40%, 12%, 0.15);
  }

  .header.hero-in-view .nav__cta {
    max-width: 0;
  }

  .nav__link {
    font-size: var(--text-body);
  }
}

/* ---------- Responsive — 768px–1023px (nav wraps) ---------- */

@media (min-width: 768px) and (max-width: 1023px) {
  .nav__list {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
  }

  .nav__link {
    font-size: var(--text-small);
  }
}

/* ---------- Responsive — 1024px up ---------- */

@media (min-width: 1024px) {
  .nav {
    padding-block: 0;
    min-height: calc(var(--header-height) + 1rem);
  }

  .nav__list {
    column-gap: 1.75rem;
  }
}
