/* =============================================================================
   SPS Panels — Responsive Stylesheet
   ============================================================================= */

/* ── 1440px ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1440px) {
  .container { padding-inline: 1.5rem; }
  .footer-grid { gap: 2.5rem; }
}

/* ── 1200px ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 3rem; }
  .carousel-slide { flex: 0 0 calc(50% - 0.5rem); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 1024px ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --header-height: 70px;
    --space-5xl: 6rem;
    --space-4xl: 4.5rem;
  }

  .primary-nav { display: none; }
  .header-phone { display: none; }
  .header-social { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero__content { padding-bottom: 5rem; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .stats-strip__inner { grid-template-columns: repeat(2, 1fr); }
  .ba-carousel__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 900px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-contact-list { gap: 1.5rem 3rem; }
  .two-col,
  .two-col--top,
  .three-two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .services-check-list { grid-template-columns: 1fr; }
}

/* ── 768px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --space-5xl: 5rem;
    --space-4xl: 3.5rem;
    --space-3xl: 3rem;
    --space-2xl: 2rem;
  }

  .section { padding-block: var(--space-5xl); }

  .hero { max-height: 750px; }
  .hero__content { padding-bottom: 4rem; }

  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-brand__desc { max-width: 100%; }

  .footer-bottom { flex-direction: column; text-align: center; gap: 0.75rem; }

  .page-banner { height: 280px; }
  .page-banner__content { padding-bottom: 2rem; }

  .project-hero { height: 55vh; min-height: 380px; }

  .carousel-slide { flex: 0 0 calc(100% - 0.5rem); }

  .before-after__label { font-size: 0.6rem; }

  .section-header { margin-bottom: 2.5rem; }

  .lightbox__img-wrap { padding: 1rem 60px; }
  .lightbox__prev { left: 0.5rem; }
  .lightbox__next { right: 0.5rem; }
  .lightbox__prev, .lightbox__next { width: 44px; height: 44px; font-size: 1rem; }
}

/* ── 600px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding-inline: 1.25rem; }

  .grid--4 { grid-template-columns: 1fr; }
  .ba-carousel__grid { grid-template-columns: 1fr; }

  .hero { min-height: 520px; }

  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
  .gallery-grid--home { grid-template-columns: repeat(2, 1fr); }

  .stats-strip__inner { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .stat__number { font-size: 2.25rem; }

  .cta-contact-list { flex-direction: column; gap: 1.5rem; align-items: center; }

  .btn { padding: 0.75rem 1.5rem; font-size: 0.72rem; }
  .btn--lg { padding: 0.875rem 2rem; }

  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; max-width: 280px; justify-content: center; }

  .lightbox__thumbnails { display: none; }
  .lightbox__img-wrap { padding: 0.5rem 0.5rem; max-height: calc(100vh - 100px); }
  .lightbox__close { top: 0.5rem; right: 0.5rem; }
}

/* ── 430px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 430px) {
  :root {
    --header-height: 60px;
    --space-xl: 1.5rem;
  }

  .header-logo__name { font-size: 0.95rem; }
  .header-logo__tagline { font-size: 0.58rem; }
  .header-logo__img { height: 38px; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.25rem; }

  .hero { max-height: 650px; }
  .hero__title { font-size: 1.7rem; }

  .card__body { padding: 1.25rem; }

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

  .form-control { font-size: 16px; }
}

/* ── 375px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 375px) {
  .container { padding-inline: 1rem; }
  .hero__content { padding-inline: 1rem; }
  .section-label::before, .section-label::after { display: none; }
  .stats-strip__inner { grid-template-columns: 1fr 1fr; }
}

/* ── 320px ──────────────────────────────────────────────────────────────────── */
@media (max-width: 320px) {
  :root { --header-height: 56px; }
  .header-logo__tagline { display: none; }
  .header-logo__est { display: none; }
  h1 { font-size: 1.75rem; }
  .hero__title { font-size: 1.5rem; }
}

/* ── Touch targets ──────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .carousel-btn { min-width: 48px; min-height: 48px; }
  .primary-nav__link { padding: 0.875rem 0.875rem; }
  .mobile-nav__link { padding: 1.125rem 0; }
  .gallery-item { min-height: 120px; }
}

/* ── High contrast ──────────────────────────────────────────────────────────── */
@media (prefers-contrast: high) {
  :root {
    --colour-cream: #ffffff;
    --colour-light-grey: #dddddd;
    --colour-grey: #bbbbbb;
    --colour-copper: #ffaa44;
    --colour-copper-light: #ffcc66;
  }
  .site-header { border-bottom-color: rgba(255,170,68,.5); }
  .card { border-color: rgba(255,255,255,.2); }
}

/* ── Print ──────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .mobile-menu-btn, .mobile-nav, .nav-overlay,
  .carousel-nav, .lightbox, .hero__actions, .cta-band,
  .site-footer .footer-social { display: none !important; }
  body { background: white; color: black; }
  .page-content { padding-top: 0; }
  a { color: black; text-decoration: underline; }
}

/* ── Mobile: centre header logo ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .header-inner {
    justify-content: center;
    position: relative;
  }
  .mobile-menu-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ── Mobile: hero, sections, reviews ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* 1. Hide hero video; poster image shows through the <video> poster attr
        and the bg fallback below handles the dark bg */
  .hero__video { display: none !important; }
  .hero__bg {
    background-image: url('/assets/images/banner.png');
    background-size: cover;
    background-position: center center;
  }

  /* 2. Show centred brand logo in hero below the header bar */
  .hero__mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: calc(var(--header-height) + 1.5rem);
    left: 0;
    right: 0;
    z-index: 3;
    pointer-events: none;
  }
  .hero__mobile-brand img {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,.95));
  }
  /* Push hero text down to clear the logo */
  .hero__content { padding-top: calc(90px + 3.5rem); }

  /* Centre all hero text on mobile */
  .hero__label    { display: block; text-align: center; }
  .hero__title    { text-align: center; }
  .hero__subtitle { text-align: center; margin-inline: auto; }
  .hero__actions  { justify-content: center; }

  /* 3. Hide Before & After section entirely */
  section[aria-labelledby="before-after-title"] { display: none !important; }

  /* 4. Hide home project / gallery image grids — headings & CTA buttons remain */
  .home-grid--desktop { display: none !important; }

  /* 5. Reviews carousel: 2 cards on tablet */
  .rev-card { width: calc((100% - 1.5rem) / 2); }
}

/* ── Reviews carousel: 1 card on small mobile ───────────────────────────────── */
@media (max-width: 540px) {
  .rev-card { width: 100%; }
}
