/* Site-wide refinements for the Southern Grounds preview.
   Shared CSS: if this file ships to production, it will also change
   existing pages (why-us, reviews, footer tap targets, section scroll margins,
   and mobile photo-card / section spacing). */

/* ---- Sticky header clearance ----
   When jumping to a section anchor, the section's top edge — including
   the kicker/eyebrow above the heading — must sit below the sticky
   header with breathing room. Headings get a larger margin so a heading
   target does not tuck the kicker under the header. */
html {
  scroll-padding-top: calc(var(--header) + 1.25rem);
}
.section,
.why-section,
#why-us,
#services,
#recent-projects,
#google-reviews,
#contact,
.page-hero,
.rp-index-hero,
.band {
  scroll-margin-top: calc(var(--header) + 1.75rem);
}
.section-head,
.section-head h2,
.why,
.why-intro,
.why-intro h2,
.hero-copy,
.hero-copy h1,
.page-hero-copy,
.page-hero-copy h1,
.page-hero h1,
.rp-page .page-hero h1,
.band-copy,
.band h2,
.eyebrow {
  scroll-margin-top: calc(var(--header) + 3.5rem);
}

/* Why-us sat at padding-top:0, so the heading slid under the 86px sticky header. */
.why-section,
#why-us {
  padding-top: 4rem;
  padding-bottom: 5.5rem;
}
@media (min-width: 900px) {
  .why-section,
  #why-us { padding-top: 5rem; }
}

.why {
  padding: 2.15rem 1.35rem 1.85rem;
}
@media (min-width: 900px) {
  .why { padding: 2.4rem 2rem 2.2rem; }
}

/* ---- Reason cards: gap was desktop-only; mobile stacked them flush ---- */
.reasons {
  display: grid;
  gap: 1rem;
  counter-reset: reason;
}
@media (min-width: 900px) {
  .reasons { gap: 1.1rem; }
}
.reason {
  counter-increment: reason;
  background: rgba(255, 253, 248, 0.09);
  border: 1px solid rgba(255, 252, 245, 0.18);
  border-radius: 22px;
  padding: 1.3rem 1.2rem 1.4rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}
.reason h3 {
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: #fffdf8;
}
.reason h3::before {
  content: counter(reason, decimal-leading-zero);
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  color: var(--lime);
  margin-bottom: 0.45rem;
}
.reason p {
  margin: 0;
  color: rgba(255, 252, 245, 0.8);
  font-size: 1.04rem;
  line-height: 1.55;
}

/* Review quotes also had gap only from 700px up */
.quotes {
  display: grid;
  gap: 0.95rem;
}

/* Footer / legal tap targets on mobile */
@media (max-width: 899px) {
  .footer ul { gap: 0.15rem; }
  .footer li a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.15rem 0;
  }
  .legal a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .socials a {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Open mobile nav was semi-transparent and let the page show through.
   Header redesign (sg-header.css) takes over the panel; this is the fallback. */
@media (max-width: 899px) {
  .nav-check:checked ~ .nav {
    background: #f3f0e7;
  }
}

/* Section CTAs ("View the Blog", "See all projects") */
.section-head a {
  color: var(--leaf);
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.section-head a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
#recent-projects .section-head a {
  white-space: nowrap;
}

/* Footer paragraph links (phone) and service-option chips */
@media (max-width: 899px) {
  .footer p a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .option {
    min-height: 44px;
    padding: 0.55rem 0.95rem;
  }
  .check {
    min-height: 44px;
  }
}

/* ------------------------------------------------------------------
   Mobile spacing pass (390px and up to the desktop breakpoint)
   Root cause of the ~200px holes: leftover desktop min-heights on
   .story-card (inline min-height:420px on sod, about, cleanup) plus
   .section padding of 5.5rem stacking on both sides of a join
   (~176px of empty cream). Fix it once, everywhere.
   ------------------------------------------------------------------ */
@media (max-width: 899px) {
  .section {
    padding: 3.25rem 0;
  }

  /* Don't let two full paddings pile up between stacked sections. */
  .section + .section {
    padding-top: 1.1rem;
  }

  .page-hero + .section,
  .hero + .section {
    padding-top: 3.25rem;
  }

  .section.why-section,
  #why-us {
    padding-top: 4rem;
    padding-bottom: 3.75rem;
  }

  .renovations {
    padding-top: 2.75rem;
  }

  /* Photo cards: size from a 4:3 ratio, never a 420px desktop leftover. */
  .story-card,
  .story-card.reveal,
  .story-card[style] {
    min-height: 0 !important;
    height: auto;
    aspect-ratio: 4 / 3;
    transform: none !important;
  }

  .story-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .story-grid,
  .expertise {
    gap: 1rem;
  }

  .prose {
    gap: 1.15rem;
  }

  /* Galleries stay an even 2-col, 4:3 grid on small screens.
     Base CSS switches to masonry at 700px; keep the even grid through
     the tablet range and leave masonry for desktop. */
  .mosaic,
  .home-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    columns: unset;
    column-gap: normal;
  }

  .shot {
    aspect-ratio: 4 / 3;
    margin: 0;
    break-inside: auto;
    position: relative;
  }

  .shot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media (min-width: 900px) {
  /* Restore masonry only once we are at a desktop width. */
  .mosaic {
    display: block;
    columns: 2;
    column-gap: 0.8rem;
  }
  .mosaic .shot,
  .home-mosaic .shot {
    aspect-ratio: auto;
    margin: 0 0 0.8rem;
  }
  .mosaic .shot img,
  .home-mosaic .shot img {
    position: static;
    height: auto;
  }
  .home-mosaic {
    columns: 3;
  }
}
