/* ==========================================================================
   Phipps & Sons Plastering — stylesheet
   ========================================================================== */

:root {
  --navy: #122226;
  --navy-light: #1c3338;
  --navy-lighter: #28454b;
  --teal: #2fa89c;
  --teal-dark: #217169;
  --teal-light: #8fd9cf;
  --cream: #f7f4ee;
  --white: #ffffff;
  --grey: #51605f;
  --grey-light: #e7e2d8;
  --ink: #16201f;
  --amber: #e0a23b;

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

  --radius: 10px;
  --shadow: 0 10px 30px rgba(18, 34, 38, 0.12);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

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

.section-navy {
  background: var(--navy);
  color: var(--grey-light);
}
.section-navy h2, .section-navy h3 { color: var(--white); }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 10px;
}
.section-navy .eyebrow { color: var(--teal-light); }

.section-head {
  max-width: 700px;
  margin: 0 auto 40px;
  text-align: center;
}
.section-head.left {
  margin: 0 0 40px;
  text-align: left;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-heading);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  font-size: 0.98rem;
  line-height: 1.2;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--teal);
  color: var(--navy);
  box-shadow: 0 8px 20px rgba(47, 168, 156, 0.35);
}
.btn-primary:hover { background: var(--teal-light); }

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

.btn-dark {
  background: var(--navy);
  color: var(--white);
}
.btn-dark:hover { background: var(--navy-light); }

.btn-block { width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 24px);
  /* Longhand on purpose — a "padding: 14px 0" shorthand here would zero
     out the left/right padding .container already set on this same
     element (same specificity, declared later wins), pulling the logo
     and header-cta in flush with the edge instead of lining up with the
     container padding every other section uses. */
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}
.brand img { height: 48px; width: 48px; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text .name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  white-space: nowrap;
}
.brand-text .tag {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-light);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 8px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 36px);
}
.main-nav > a {
  color: var(--grey-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
}
.main-nav > a:hover,
.main-nav > a[aria-current="page"] {
  color: var(--white);
}
.main-nav > a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--teal);
}

/* ---------- Nav dropdown ("Company": About, Reviews, Areas We Cover) ---------- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--grey-light);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-body);
  font-size: 0.98rem;
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
}
.nav-dropdown-toggle .caret {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-current="page"],
.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--white);
}
.nav-dropdown.open .nav-dropdown-toggle .caret {
  transform: rotate(180deg);
}
.nav-dropdown-toggle[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--teal);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
}
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--grey-light);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a[aria-current="page"] {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(18,34,38,0.92), rgba(18,34,38,0.75)),
    var(--navy) url('../images/hero-placeholder.svg') center/cover no-repeat;
  color: var(--white);
  padding: 90px 0 100px;
  /* Grows with viewport width so the hero-photo box (full width, full
     height) doesn't get proportionally wider than the photo itself at
     wide windows — that's what was zooming in and cropping the team
     member's head/feet off before. The photo is ~2.3:1 (1600x694); at
     44vw the box ratio is a flat 100/44 ≈ 2.27:1, which is narrower
     than the photo at any width — so cover crops the sides, never the
     top/bottom, for every width up to ~2160px before the max kicks in. */
  min-height: clamp(560px, 44vw, 950px);
  box-sizing: border-box;
}
/* Large background photo, filling the full width and height of the hero
   section (edge to edge, touching the header above and the next section
   below), faded into the hero background via the mask + scrim below. */
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Horizontal 90% keeps the crop on the left (background), vertical 20%
     keeps it on the bottom (ground/feet) rather than the top — his head
     is the priority if any crop is still needed past ~2160px wide. */
  object-position: 90% 20%;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 90% 95% at 84% 50%, #000 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 95% at 84% 50%, #000 50%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
/* Dark scrim, independent of the photo's own fade, guaranteeing the text
   stays readable no matter what's behind it in the photo. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg,
    rgba(18,34,38,0.97) 0%,
    rgba(18,34,38,0.95) 57%,
    rgba(18,34,38,0.5) 70%,
    rgba(18,34,38,0) 86%);
  pointer-events: none;
}
.hero > .container {
  position: relative;
  z-index: 2;
}
.hero-text { max-width: 620px; }
.hero h1 { color: var(--white); }
.hero .lede {
  font-size: 1.15rem;
  color: var(--grey-light);
  max-width: 540px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 32px;
}
.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
}
.hero-badge svg { color: var(--teal-light); flex-shrink: 0; }
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Trust strip ---------- */
.trust-strip {
  background: var(--white);
  border-bottom: 1px solid var(--grey-light);
}
.trust-strip .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 18px;
  column-gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy);
  font-size: 0.92rem;
  text-align: left;
}
.trust-item svg { color: var(--teal-dark); flex-shrink: 0; }

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
}
/* Service/story photos come in from different sources (placeholder SVGs,
   real job photos of varying dimensions) and need to read as one
   consistent set, matching the gallery's 4:3 crop. */
.card-grid img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
/* The "Learn more" links on the homepage jump to these sections by id.
   Without this, the sticky header (~80px) scrolls over the top of the
   target and hides its heading, since native anchor-scroll aligns the
   section's top with the viewport top, not with the space below the
   header. */
#plastering,
#dry-lining,
#rendering,
#acrylic-silicone,
#floor-screeds {
  scroll-margin-top: 96px;
}
/* The homepage "What We Do" grid has exactly 6 cards, so fix the column
   count per breakpoint to a divisor of 6 (3, 2 or 1) instead of auto-fit,
   which can land on 4 and leave an unbalanced trailing row of 2. */
#services .card-grid {
  grid-template-columns: repeat(3, 1fr);
}
.service-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.service-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--teal);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.service-card h3 { margin-bottom: 8px; }
.service-card p { color: var(--grey); margin-bottom: 0; }
.service-card a.card-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}
.service-card a.card-link:hover { text-decoration: underline; }

/* ---------- Why choose us ---------- */
.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.feature {
  display: flex;
  gap: 16px;
}
.feature .num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--teal);
  flex-shrink: 0;
}
/* Reserve space for 2 lines regardless of how many the heading actually
   needs, so the paragraph below always starts at the same height across
   every column, whatever the current grid width wraps the text to. */
.feature h3 {
  margin-bottom: 6px;
  min-height: 2.4em;
}
.feature p { color: var(--grey-light); margin-bottom: 0; }
.section-navy .feature p { color: #c5d2d1; }
.section-alt .feature p, .section-white .feature p { color: var(--grey); }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--grey-light);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(18,34,38,0.85), transparent);
  color: var(--white);
  padding: 30px 16px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}
.filter-btn {
  border: 1px solid var(--grey-light);
  background: var(--white);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--grey);
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ---------- Testimonials ---------- */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.review-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--grey-light);
}
.stars {
  color: var(--amber);
  letter-spacing: 2px;
  margin-bottom: 12px;
  font-size: 1rem;
}
.review-card p.quote {
  color: var(--navy);
  font-style: italic;
  margin-bottom: 16px;
}
.review-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--grey);
}
.review-source {
  font-weight: 400;
  color: var(--teal-dark);
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-bottom: 36px;
  border: 1px solid var(--grey-light);
  flex-wrap: wrap;
}
.rating-summary-cta { margin-left: auto; }
.rating-summary .score {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
}

/* ---------- Areas ---------- */
.area-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.area-list li {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.area-list li svg { color: var(--teal-dark); flex-shrink: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--navy), var(--navy-lighter));
  color: var(--white);
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: #c5d2d1; max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 32px;
}
.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.contact-detail svg { color: var(--teal-dark); flex-shrink: 0; margin-top: 3px; }
.contact-detail > div { min-width: 0; }
.contact-detail a { color: var(--navy); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.contact-detail a:hover { color: var(--teal-dark); }
.contact-detail .label { font-size: 0.82rem; color: var(--grey); font-weight: 500; }

.social-row { display: flex; gap: 12px; margin-top: 10px; }
.social-row a {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.social-row a:hover { background: var(--teal-dark); }

form.quote-form {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 32px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }
label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--navy);
  font-family: var(--font-heading);
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--grey-light);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: var(--white);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.82rem; color: var(--grey); margin-top: 10px; }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--grey-light);
  margin-top: 24px;
}
.map-wrap iframe { width: 100%; height: 280px; border: 0; display: block; }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--grey-light);
  padding: 20px 0;
}
.faq-item summary {
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--teal-dark);
  margin-left: 16px;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 12px; color: var(--grey); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #a9bcba;
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: #a9bcba; max-width: 280px; }
.site-footer h4 {
  color: var(--white);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #a9bcba; text-decoration: none; font-size: 0.94rem; }
.footer-links a:hover { color: var(--teal-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 22px;
  font-size: 0.84rem;
}
.footer-bottom a { color: #a9bcba; text-decoration: none; }

/* ---------- Sticky mobile call bar ---------- */
.mobile-call-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 16px;
  gap: 10px;
}
.mobile-call-bar a {
  flex: 1;
  text-align: center;
}
/* The header buttons' full padding/font-size don't fit two-per-row at
   narrow phone widths ("Get a Free Quote" was overflowing its half of
   the bar) — same classes and text, just sized down to fit. */
.mobile-call-bar .btn {
  padding: 13px 10px;
  font-size: 0.86rem;
  gap: 6px;
}

/* ---------- Page header (inner pages) ---------- */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 56px 0;
  text-align: center;
}
.page-header h1 { color: var(--white); margin-bottom: 10px; }
.page-header p { color: var(--grey-light); max-width: 620px; margin: 0 auto; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--teal-light);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--teal-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Services page: alternating image/text rows ---------- */
.service-desc-short { display: none; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  /* The 80%-height background photo only works as a backdrop for text at
     full desktop width. Rather than force a cramped, heavily-cropped
     stand-in below the breakpoint, drop the photo entirely and keep the
     hero text-only on its own background. */
  .hero-photo { display: none; }
  .hero::before { display: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  /* .contact-left already holds the card then the map in the right
     order, so swapping it with the form (instead of flattening it with
     display:contents, which WebKit can mis-size/reorder) is enough to
     get: quote form first, contact details, map last. */
  .contact-left { order: 1; min-width: 0; }
  .quote-form { order: -1; min-width: 0; }
  /* The form reads as a centred block on mobile rather than a
     left-aligned card now that it's first and full-width. */
  .quote-form h3 { text-align: center; }
  .quote-form .form-note { text-align: center; }
  /* Without min-width:0 above, nowrap text (the WhatsApp button label
     especially) forces the single-column grid track wider than the
     viewport, eating the right-hand side padding on mobile. */
  .contact-card .btn-block { white-space: normal; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  #services .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  #services .card-grid { grid-template-columns: 1fr; }
  /* padding and min-height were sized to give the desktop background
     photo room to breathe; the photo is hidden below 960px, so on
     phones that just leaves a lot of dead space above/below the text. */
  .hero { padding: 48px 0 56px; min-height: auto; }
}

/*
 * The full header row (logo + nav links + WhatsApp/CTA buttons) only has
 * room to sit on one line once the container reaches ~900px. Below that
 * — tablets and small laptop screens, not just phones — collapse to the
 * hamburger menu rather than letting the nav links and buttons wrap.
 */
@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: 77px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    max-height: calc(100vh - 77px);
    overflow-y: auto;
  }
  .main-nav.open { transform: translateY(0); opacity: 1; }
  .nav-toggle { display: block; }

  /* Dropdown becomes an inline expandable section inside the stacked menu
     instead of a floating panel. */
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; font-size: 1rem; }
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0 0 16px;
    min-width: 0;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
    margin-top: 10px;
    transform: none;
  }
  .nav-dropdown-menu a { font-size: 1rem; padding: 10px 0; }
}

@media (max-width: 780px) {
  body { padding-bottom: 64px; }
  .mobile-call-bar { display: flex; }
  /* The sticky call bar above already repeats this action (with the
     exact same WhatsApp/Quote buttons), so drop the header CTA entirely
     (not just the buttons inside it) — an empty flex item still claims
     a slot in justify-content: space-between, which was pushing the
     hamburger away from the true right edge instead of letting it sit
     flush like the logo on the left. */
  .header-cta { display: none; }
  /* Same reasoning for the hero's own buttons — the sticky bar already
     covers the quote/WhatsApp actions, so showing both is redundant. */
  .hero-actions { display: none; }
  .trust-strip .container { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  section { padding: 54px 0; }
  /* At 2 columns, several items ("Caerphilly & All South Wales",
     "Fast, Reliable Turnaround"...) wrap to a second line while
     shorter ones don't, so align-items:center pulls their icons up
     against the text block unevenly. One column keeps every item on
     a single line, so the row spacing reads as consistent. */
  .trust-strip .container { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .rating-summary { flex-direction: column; align-items: flex-start; }
  /* The button's margin-left:auto was meant to push it to the far right
     of a horizontal row — in the column layout above it instead pushes
     it off to the side on the cross axis, leaving it misaligned with
     the left-aligned score/stars/text above it. Drop the auto margin so
     it sits flush left like everything else, still last/at the bottom
     since it's the last item in the column. */
  .rating-summary-cta { margin-left: 0; }
}

/* Services page alternating rows: each one hardcodes a 1fr 1fr grid via
   inline style (needed so desktop can alternate image left/right per
   row), which left no room for the paragraph + 4-item list + image once
   squeezed into ~150px-wide columns on a phone. Stack to one column,
   force the image to the top (overriding the inline order:2 some rows
   use for desktop alternation) and make it full width/larger, and swap
   in a shorter, purpose-written description instead of just shrinking
   the same long paragraph into less space. */
@media (max-width: 700px) {
  #plastering .card-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  #plastering .card-grid img {
    order: -1 !important;
    width: 100%;
  }
  .service-desc-full { display: none; }
  .service-desc-short { display: block; }
}

/* About page "Our Story": same fix as the services rows above — the
   1.1fr/0.9fr grid is hardcoded via inline style with no mobile
   override, squeezing the photo and three paragraphs into narrow
   columns on a phone. Stack to one column with the image on top (full
   width, more room to breathe), text underneath. */
@media (max-width: 700px) {
  #our-story .card-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  #our-story .card-grid img {
    order: -1;
    width: 100%;
  }
}
