/* ---------------------------------------------------------------------------
 * home.css — sections exclusive to the Home template (Figma page 560:597).
 * Values are taken from the section bundles; the design width is 1920px.
 * ------------------------------------------------------------------------- */

/* --- Hero (560:598) ------------------------------------------------------ */
.home-hero {
  display: flex;
  /* Full-viewport hero with the copy vertically centered (client round 6);
     svh keeps phones honest about their browser chrome. */
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  /* The fixed header overlays the hero, so without this the copy centers on the
     full viewport and reads as hugging the menu — the centering space must be
     what is left BELOW the chrome. */
  padding-top: var(--header-h, 174px);
  /* Figma fills: a 75%-opacity grey→black gradient over a flat 20% black wash. */
  --overlay-layers:
    linear-gradient(180deg, rgba(102, 102, 102, 0.015) 0%, rgba(0, 0, 0, 0.75) 100%),
    rgba(var(--black-rgb, 0, 0, 0), 0.2);
}

.home-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 27px;
  max-width: calc(1500px + var(--gutter) * 2);
  padding-block: 40px;
}

.home-hero h1 {
  max-width: 1500px;
  margin: 0;
  /* 48px floor: the 40px minimum read too close to the 18px lead on phones
     (client round 7). */
  font-size: clamp(48px, 5.21vw, 100px);
  line-height: 1.11;
  color: var(--white, #ffffff);
}

.home-hero h1 .accent {
  color: var(--brand, #008AF7);
}

/* The design breaks after the first sentence; below tablet the heading is small
   enough that natural wrapping reads better. */
@media (max-width: 991px) {
  .home-hero h1 .break {
    display: none;
  }
}

.home-hero .lead {
  max-width: 1079px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--white, #ffffff);
}

.home-hero .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 1px;
}

/* Client spec: the hero pair splits on hover — first (Explore) hollows out
   via the global .default rule; the second (Request An Estimate) goes white
   with brand text. Both share .default in markup, so position scopes it. */
.home-hero .buttons .btn-layout:last-child:hover,
.home-hero .buttons .btn-layout:last-child:focus-visible {
  background: var(--white, #ffffff);
  border-color: var(--white, #ffffff);
  color: var(--brand, #008AF7);
}

/* --- About intro (560:606) ----------------------------------------------- */
.home-intro {
  padding-block: 146px;
  background: var(--bg, #ffffff);
}

.home-intro-inner {
  display: flex;
  align-items: center;
  gap: 31px;
}

.home-intro .mark {
  flex: none;
  width: 276px;
  height: auto;
}

.home-intro p {
  margin: 0;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--black, #000000);
}

/* --- Performance & quality (560:610) ------------------------------------- */
.home-performance {
  display: grid;
  grid-template-columns: minmax(0, 622px) minmax(0, 1049px);
  align-items: center;
  justify-content: center;
  gap: 89px;
  background: rgba(var(--light-rgb, 232, 232, 232), 0.24);
}

/* At exactly 1920 the centered 622+1049 grid leaves ~80px of breathing room
   on each side; below that the columns compress and the text hits the
   viewport edge. Give the section its own gutters below 1920. */
/* 992-1919: text keeps the left gutter, the photo bleeds to the right edge
   (client call) — the second column flexes to fill whatever the band gives.
   At >=1920 the centered fixed grid restores the Figma side margins. */
@media (min-width: 992px) and (max-width: 1919px) {
  .home-performance {
    grid-template-columns: minmax(0, 622px) minmax(0, 1fr);
    justify-content: start;
    padding-left: var(--gutter, 40px);
  }
}

.home-performance .text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 37px;
  padding-block: var(--section-pad, 87px);
  justify-self: end;
  max-width: 622px;
}

.home-performance h2 {
  width: 694px;
  max-width: none;
  margin: 0;
  font-size: clamp(32px, 3.33vw, 64px);
  line-height: 1.234;
}

.home-performance h2 .accent {
  color: var(--brand, #008AF7);
}

.home-performance p {
  max-width: 630px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--black, #000000);
}

.home-performance .media {
  width: 100%;
  height: 100%;
  min-height: 741px;
  object-fit: cover;
  /* Figma image filter on this fill: saturation -1, contrast +0.3, exposure +0.08. */
  filter: grayscale(1) contrast(1.3) brightness(1.08);
}

/* --- Our services (562:689) ---------------------------------------------- */
.home-services {
  padding-block: 81px 50px;
  background: var(--bg, #ffffff);
}

.home-services-inner {
  max-width: calc(1760px + var(--gutter) * 2);
}

.home-services .head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 0;
}

.home-services h2 {
  margin: 0;
  font-size: clamp(24px, 1.875vw, 36px);
  line-height: 1.222;
}

.home-services .controls {
  display: flex;
  gap: 16px;
}

.home-services .controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--radius, 3px);
  background: var(--brand, #008AF7);
  color: var(--white, #ffffff);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.home-services .controls button:hover,
.home-services .controls button:focus-visible {
  background: var(--brand-dark, #0070ca);
}

.home-services .controls button.swiper-button-disabled {
  opacity: 0.4;
  cursor: default;
}

.home-services .controls .cnm-icon {
  width: 17px;
  height: 14px;
}

/* Swiper adds .swiper-button-lock when every slide already fits (nothing to page)
   and .swiper-button-disabled at either end of a track that can move. The design
   always shows both chips solid, so the locked case keeps its Figma appearance;
   only the end-of-track case dims, which is real navigation feedback. */
.home-services .controls button.swiper-button-lock {
  cursor: default;
  pointer-events: none;
}

.home-services .controls button.swiper-button-disabled:not(.swiper-button-lock) {
  opacity: 0.35;
  cursor: default;
}

.home-services .services-slider {
  padding-block: 90px;
}

/* Swiper subtracts the container's own padding when sizing slides, so real
   padding-inline (not a max-width) keeps the cards inset from the heading at
   every viewport — a max-width only bites once the container outgrows it. */
@media (min-width: 992px) {
  .home-services .services-slider {
    padding-inline: clamp(32px, 3.3vw, 64px);
  }
}

.home-services .services-slider .swiper-wrapper {
  transition-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
}

.home-services .card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 44px;
  height: auto;
  min-height: 612px;
  padding: 50px;
  border-radius: var(--radius-xl, 24px);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* The card lifts on hover and on keyboard focus, so pointer and keyboard users
   get the same affordance. */
.home-services .card:hover,
.home-services .card:focus-within {
  transform: translateY(-18px) scale(1.015);
  box-shadow: 0 26px 54px rgba(var(--black-rgb, 0, 0, 0), 0.34);
}

/* Stretched link: the existing "Learn More" anchor covers the whole card, so the
   entire card is clickable while the only interactive element remains a native
   <a>. No clickable div, and focus/hover states stay on the anchor. */
.home-services .card .btn-layout.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.home-services .card .btn-layout.stretched:focus-visible {
  outline: 2px solid var(--white, #ffffff);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .home-services .card {
    transition: none;
  }

  .home-services .card:hover,
  .home-services .card:focus-within {
    transform: none;
  }

  /* Swiper sets transition-duration inline; !important is the only way to
     suppress the slide animation for reduced-motion users. */
  .home-services .services-slider .swiper-wrapper {
    transition-duration: 0ms !important;
  }
}

.home-services .card h3 {
  position: relative;
  width: 100%;
  margin: 0 0 6px;
  padding-bottom: 12px;
  /* Single line, never wrapping (client round 8): the vw term keeps the longest
     title ("CONCRETE RECYCLING") inside the card on narrow phones. */
  font-size: min(clamp(24px, 1.875vw, 36px), 4.8vw);
  line-height: 1.222;
  white-space: nowrap;
  /* Flush with the underline's left edge (client round 8) — was centered. */
  text-align: left;
  text-transform: uppercase;
  color: var(--light, #E8E8E8);
}

.home-services .card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 417px;
  max-width: 100%;
  height: 2px;
  background: var(--brand, #008AF7);
}

.home-services .card p {
  max-width: 417px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--white, #ffffff);
}

.home-services .card .btn-layout {
  padding: 18px 28px;
  border-radius: var(--radius-md, 5px);
}

.home-services .card .cnm-icon {
  width: 9px;
  height: 13px;
}

/* --- Ready CTA (560:643) ------------------------------------------------- */
.home-cta {
  display: flex;
  align-items: center;
  background-size: 108.63% 184.52%;
  background-position: 23.05% 93.93%;
  min-height: 755px;
  padding-block: var(--section-pad, 87px);
  border-radius: var(--radius-lg, 11px);
  --overlay-wash: 0.51;
}

.home-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 31px;
  text-align: center;
}

.home-cta .mark {
  width: 144px;
  height: auto;
}

.home-cta h2 {
  max-width: 838px;
  margin: 0;
  font-size: clamp(34px, 4.17vw, 80px);
  line-height: 1.1125;
  color: var(--white, #ffffff);
}

.home-cta .text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
}

.home-cta p {
  max-width: 764px;
  margin: 0;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--white, #ffffff);
}

.home-cta .buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 31px;
}

/* --- About standards (987:1574) ------------------------------------------ */
.home-standards {
  padding-block: 140px;
  background: var(--bg, #ffffff);
}

.home-standards-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 78px;
}

.home-standards h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(32px, 3.33vw, 64px);
  line-height: 1.234;
  text-align: center;
}

.home-standards .columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 657px));
  gap: 141px;
  width: 100%;
}

.home-standards .columns p {
  margin: 0 0 26px;
  font-size: 18px;
  line-height: 1.4444;
}

.home-standards .columns p:last-child {
  margin-bottom: 0;
}

.home-standards .serving {
  max-width: 1008px;
  margin: 0;
  font-family: var(--display, system-ui, sans-serif);
  font-size: clamp(22px, 1.875vw, 36px);
  font-weight: 700;
  line-height: 1.222;
  text-align: center;
  color: var(--brand, #008AF7);
}

/* --- Locations (560:656) ------------------------------------------------- */
.home-locations {
  display: grid;
  grid-template-columns: minmax(0, 1113px) minmax(0, 545px);
  align-items: center;
  justify-content: center;
  gap: 79px;
  padding-block: 58px;
  background: var(--bg, #ffffff);
}

.home-locations .map {
  width: 100%;
  height: auto;
  aspect-ratio: 1113 / 504;
  object-fit: cover;
  border-radius: var(--radius-lg, 11px);
}

.home-locations .details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 31px;
}

.home-locations h2 {
  margin: 0;
  font-size: clamp(32px, 3.33vw, 64px);
  line-height: 1.234;
  color: var(--muted, #909091);
}

.home-locations .contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 71px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-locations .contact li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  line-height: 1.4444;
  color: var(--muted, #909091);
}

.home-locations .contact .cnm-icon {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--brand, #008AF7);
}

.home-locations .contact a {
  color: inherit;
}

.home-locations .contact a:hover,
.home-locations .contact a:focus-visible {
  color: var(--brand, #008AF7);
}

/* --- Social feed (560:650) ----------------------------------------------- */
.home-social {
  display: grid;
  grid-template-columns: repeat(5, 441px);
  justify-content: center;
  gap: 3px;
  padding-block: 13px;
  overflow: hidden;
  background: var(--bg, #ffffff);
}

.home-social img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-lg, 11px);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1399px) {
  .home-performance {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
  }

  .home-performance h2 {
    width: auto;
  }

  .home-performance .media {
    min-height: 520px;
  }

  .home-standards {
    padding-block: 96px;
  }

  .home-standards .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
  }

  .home-locations {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 48px;
  }

  .home-services .card {
    min-height: 520px;
    padding: 40px;
  }

  .home-social {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .home-hero {
    /* The header floats over the hero, so the copy has to clear it once the
       heading is tall enough to fill the frame — plus 16px of breathing room
       so the title never kisses the logo. */
    padding-top: calc(var(--header-h, 104px) + 16px);
  }

  .home-intro-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .home-intro .mark {
    width: 180px;
  }

  .home-performance {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .home-performance .text {
    padding-inline: var(--gutter);
    justify-self: stretch;
    max-width: none;
  }

  .home-performance .media {
    min-height: 400px;
  }

  .home-standards .columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-locations {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-block: 48px;
  }

  .home-locations .details {
    padding-inline: var(--gutter);
  }

  .home-social {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .home-hero .buttons,
  .home-cta .buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 16px;
  }

  .home-intro {
    padding-block: 48px;
  }

  .home-services {
    padding-top: 48px;
  }

  .home-services .head {
    margin-bottom: 40px;
  }

  /* Half the desktop breathing room — 90px around single-card slides reads as
     dead space at phone widths (client round 4). */
  .home-services .services-slider {
    padding-block: 44px;
  }

  .home-cta {
    min-height: 0;
  }

  .home-locations .contact {
    flex-direction: column;
    gap: 16px;
  }

  .home-social {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  /* Softer card interior on phones (client round 10); the shorter card also
     starts the title higher — less empty photo above the copy. */
  .home-services .card {
    gap: 28px;
    min-height: 440px;
    padding: 28px;
  }

  /* Largest size that still keeps the longest title ("CONCRETE RECYCLING",
     ~12.3em wide) on one line: available width is 100vw minus gutters (48px)
     and card padding (56px); /12.6 leaves a small safety margin. */
  .home-services .card h3 {
    font-size: min(24px, calc((100vw - 104px) / 12.6));
  }
}

@media (max-width: 575px) {

  .home-standards {
    padding-block: 56px;
  }

  .home-social {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }
}
