/* ==========================================================================
   Halstead Landscaping & Construction
   Shared stylesheet
   ========================================================================== */

:root {
  --color-green: #8bab5e;
  --color-green-dark: #6d8c46;
  --color-charcoal: #3f4541;
  --color-charcoal-soft: #5a615c;
  --color-cream: #f7f4ec;
  --color-stone: #eae4d4;
  --color-stone-dark: #d9d1ba;
  --color-terracotta: #b5651d;
  --color-terracotta-dark: #954f16;
  --color-white: #ffffff;

  --font-heading: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --max-width: 1200px;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(63, 69, 65, 0.12);
}

/* ---- Reset ---------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background: var(--color-cream);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-charcoal);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

ul {
  padding-left: 1.2em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--color-stone);
}

.section-intro {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-intro p {
  color: var(--color-charcoal-soft);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-green-dark);
  margin-bottom: 0.6em;
}

/* ---- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-cta {
  background: var(--color-terracotta);
  color: var(--color-white);
  box-shadow: var(--shadow);
}

.btn-cta:hover {
  background: var(--color-terracotta-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background: var(--color-green);
  color: var(--color-white);
}

.btn-secondary:hover {
  background: var(--color-green-dark);
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-stone-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand img {
  height: 76px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
}

.main-nav a:not(.btn) {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-charcoal);
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.main-nav a:not(.btn):hover,
.main-nav a.active {
  color: var(--color-green-dark);
  border-color: var(--color-green);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
}

.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--color-charcoal);
  border-radius: 2px;
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
  background: var(--color-stone);
  padding: 4rem 0;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3.5rem;
  }
}

.hero h1 {
  color: var(--color-charcoal);
  margin: 0 0 0.3em;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  color: var(--color-green-dark);
  margin: 0 0 0.9em;
}

.hero .lede {
  max-width: 520px;
  margin: 0 0 1.8em;
  font-size: 1.1rem;
  color: var(--color-charcoal-soft);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn-outline-dark {
  background: transparent;
  border-color: var(--color-charcoal);
  color: var(--color-charcoal);
}

.btn-outline-dark:hover {
  background: rgba(63, 69, 65, 0.08);
}

.page-hero {
  background: var(--color-charcoal);
  color: var(--color-white);
  padding: 3.5rem 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: 0.3em;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Trust strip --------------------------------------------------------- */

.trust-strip {
  background: var(--color-charcoal);
  color: var(--color-white);
  padding: 2rem 0;
}

.trust-strip .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1.5rem;
  text-align: center;
}

.trust-stat .stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-green);
  display: block;
}

.trust-stat .stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ---- Cards / grids -------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 0.4em;
}

.card a.card-link {
  display: inline-block;
  margin-top: 0.6em;
  font-weight: 600;
  color: var(--color-green-dark);
  text-decoration: none;
}

.card a.card-link:hover {
  text-decoration: underline;
}

.service-group {
  margin-bottom: 3rem;
}

.service-group h2 {
  border-bottom: 3px solid var(--color-green);
  display: inline-block;
  padding-bottom: 0.2em;
}

/* ---- Photo grid (gallery + featured work) --------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.photo-grid figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--color-white);
}

.photo-grid img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.photo-grid figcaption {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-charcoal-soft);
}

.gallery-section-title {
  text-align: center;
  margin-bottom: 2rem;
}

/* ---- Before / After comparison --------------------------------------------- */

.ba-pair {
  margin-bottom: 2.5rem;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Default (no-JS) layout: clean static side-by-side, 2 columns */
.ba-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  user-select: none;
}

.ba-compare .ba-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.ba-compare img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-compare .ba-slider-handle,
.ba-compare .ba-slider-input {
  display: none;
}

/* JS-enhanced layout: draggable overlay slider (desktop/tablet only) */
.ba-compare.ba-active {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
}

.ba-compare.ba-active .ba-img-wrap {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.ba-compare.ba-active .ba-after-wrap {
  clip-path: inset(0 50% 0 0);
}

.ba-compare.ba-active .ba-slider-handle,
.ba-compare.ba-active .ba-slider-input {
  display: block;
}

.ba-label {
  position: absolute;
  top: 0.75rem;
  z-index: 2;
  background: rgba(63, 69, 65, 0.85);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35em 0.9em;
  border-radius: 999px;
}

.ba-label-before {
  left: 0.75rem;
}

.ba-label-after {
  left: 0.75rem;
  right: auto;
}

.ba-compare.ba-active .ba-label-after {
  left: auto;
  right: 0.75rem;
}

.ba-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--color-white);
  cursor: ew-resize;
  z-index: 3;
  transform: translateX(-50%);
}

.ba-slider-handle::after {
  content: "\2194";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  background: var(--color-white);
  color: var(--color-charcoal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.ba-slider-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 4;
  -webkit-appearance: none;
  appearance: none;
}

.ba-caption {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--color-charcoal-soft);
  font-size: 0.95rem;
}

/* Mobile: always stack vertically, never the cramped side-by-side or the
   drag slider (fiddly on touch) — a plain stacked comparison reads best. */
@media (max-width: 640px) {
  .ba-compare,
  .ba-compare.ba-active {
    display: grid;
    grid-template-columns: 1fr;
    position: static;
    aspect-ratio: auto;
  }

  .ba-compare .ba-img-wrap,
  .ba-compare.ba-active .ba-img-wrap {
    position: static;
    inset: auto;
    aspect-ratio: 4 / 3;
  }

  .ba-compare.ba-active .ba-after-wrap {
    clip-path: none;
    border-top: 3px solid var(--color-white);
  }

  .ba-compare .ba-slider-handle,
  .ba-compare .ba-slider-input,
  .ba-compare.ba-active .ba-slider-handle,
  .ba-compare.ba-active .ba-slider-input {
    display: none;
  }

  .ba-label-after,
  .ba-compare.ba-active .ba-label-after {
    left: 0.75rem;
    right: auto;
  }
}

/* ---- Reviews -------------------------------------------------------------- */

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.review-grid figure {
  margin: 0;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.review-grid img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.reviews-cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ---- Lightbox (used on the reviews page) ----------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  z-index: 1000;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-white);
  color: var(--color-charcoal);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ---- About ------------------------------------------------------------ */

.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 800px) {
  .about-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.about-layout img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.value-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.value-list li {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

/* ---- Contact ------------------------------------------------------------ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-stone);
  text-decoration: none;
  color: var(--color-charcoal);
}

.contact-method:last-child {
  border-bottom: none;
}

.contact-method .icon {
  font-size: 1.5rem;
  color: var(--color-green-dark);
  flex-shrink: 0;
}

.contact-method .label {
  font-size: 0.85rem;
  color: var(--color-charcoal-soft);
  display: block;
}

.contact-method .value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

.contact-method-actions {
  justify-content: space-between;
  gap: 1rem;
}

.contact-method-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-chip {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45em 0.9em;
  border-radius: 999px;
  border: 1px solid var(--color-stone-dark);
  background: var(--color-white);
  color: var(--color-charcoal);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-chip:hover {
  background: var(--color-stone);
}

.copy-btn.is-copied {
  background: var(--color-green);
  border-color: var(--color-green);
  color: var(--color-white);
}

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- CTA banner (repeated across pages) ----------------------------------- */

.cta-banner {
  background: var(--color-green);
  color: var(--color-white);
  text-align: center;
  padding: 3rem 0;
}

.cta-banner h2 {
  color: var(--color-white);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 500px;
  margin: 0 auto 1.5em;
}

.cta-banner .btn-cta {
  background: var(--color-terracotta);
}

.cta-banner .btn-cta:hover {
  background: var(--color-terracotta-dark);
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  background: var(--color-charcoal);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8em;
}

.footer-brand img {
  height: 68px;
  width: auto;
  background: var(--color-white);
  border-radius: 8px;
  padding: 6px;
}

.site-footer h4 {
  color: var(--color-white);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8em;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-green);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---- Responsive nav ------------------------------------------------------ */

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-stone-dark);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.25rem 1.5rem;
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav ul li {
    border-bottom: 1px solid var(--color-stone-dark);
  }

  .main-nav a:not(.btn) {
    display: block;
    padding: 0.85em 0;
  }

  .main-nav .btn {
    margin-top: 1rem;
    text-align: center;
  }
}
