/* Masterbuild Ltd – Civil, Electrical & Ground Works
   Striking palette: deep navy + electric blue accent */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --surface: #f8fafc;
  --surface-muted: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --white: #ffffff;
  --nav-color: #0f172a;
  --nav-hover: #b794f6;
  --max-width: 1200px;
  --header-height: 72px;
  --radius: 6px;
  --shadow: 0 4px 6px -1px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --transition: 0.2s ease;
}

/* Scrollbar – snazzy branded colours (mobile & desktop) */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface-muted);
}
body {
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface-muted);
}
@media (max-width: 767px) {
  html,
  body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--primary-light);
  }
}
/* WebKit (Chrome, Safari, Edge, some mobile browsers) */
html ::-webkit-scrollbar,
body ::-webkit-scrollbar,
::-webkit-scrollbar { width: 8px; height: 8px; }
html ::-webkit-scrollbar-track,
body ::-webkit-scrollbar-track,
::-webkit-scrollbar-track { background: var(--surface-muted); }
html ::-webkit-scrollbar-thumb,
body ::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
@media (max-width: 767px) {
  html ::-webkit-scrollbar,
  body ::-webkit-scrollbar,
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  html ::-webkit-scrollbar-track,
  body ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-track { background: var(--primary-light); }
  html ::-webkit-scrollbar-thumb,
  body ::-webkit-scrollbar-thumb,
  ::-webkit-scrollbar-thumb { background: var(--accent); }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  min-width: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
ul { list-style: none; margin: 0; padding: 0; }

/* Layout */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4rem 0; }
.section--alt { background: var(--surface); }
.section__title { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 4vw, 2rem); color: var(--primary); }
.section__subtitle { margin: 0 0 2rem; font-size: 1.125rem; color: var(--text-muted); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--surface-muted);
  box-shadow: var(--shadow);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 44px; width: auto; }

/* Nav – desktop */
.nav ul { display: flex; align-items: center; gap: 0.5rem; }
.nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  color: var(--nav-color);
  border-radius: var(--radius);
}
.nav a:hover { background: var(--surface); color: var(--nav-hover); }
.nav .nav__item--active a { color: var(--nav-hover); }

/* Sub-nav (Services dropdown) */
.nav__sub { position: relative; }
.nav__sub-trigger { cursor: pointer; }
.nav__sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.nav__sub.is-open .nav__sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
@media (min-width: 768px) {
  .nav__sub .nav__sub-menu {
    left: auto;
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 220px;
  }
  .nav__sub:hover .nav__sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__sub-menu li { margin: 0; }
  .nav__sub-menu a { white-space: normal; min-width: 0; }
}
.nav__sub-menu a { padding: 0.5rem 0.75rem; white-space: nowrap; }

/* Hamburger – mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  transition: var(--transition);
}
.hamburger span:nth-child(1) { background: var(--primary); }
.hamburger span:nth-child(2) { background: var(--accent); }
.hamburger span:nth-child(3) { background: var(--nav-hover); }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  background-image: url("../images/pylon.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.hero--yorkshire {
  background-image: url("../images/projects/yorkshire-green/fbee43_3b17105d7cb3493e8ed82a63de9acafc.webp");
}
.hero--hs2 {
  background-image: url("../images/hs2/4.webp");
}
.hero--evc {
  background-image: url("../images/projects/evc/IMG-20210427-WA0001.webp");
}
.hero--haul-roads {
  background-image: url("../images/4%20VW%20Haul%20roadscrane%20pads.webp");
}
.hero--bu-spen {
  background-image: url("../images/webp/BU-SPEN-Route.webp");
}
.hero--zo-spen {
  background-image: url("../images/projects/zo-spen/fbee43_9d67f1d4a88c430fba87489c6fccb239.webp");
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--primary);
  opacity: 0.75;
}
.hero .container { position: relative; z-index: 1; }
.hero__title { margin: 0 0 1rem; font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 700; line-height: 1.2; }
.hero__text { margin: 0 0 1.5rem; font-size: 1.125rem; opacity: 0.9; max-width: 640px; }
.hero__cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.hero__cta:hover { background: var(--accent-hover); color: var(--white); }

/* Placeholder block (for hero/project images) */
.placeholder {
  background: var(--surface-muted);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  aspect-ratio: 16 / 9;
}
.placeholder--hero { aspect-ratio: 21 / 9; min-height: 280px; }

/* About / intro */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .intro-grid { grid-template-columns: 1fr 1fr; }
}
.intro__content { max-width: 720px; }
.intro__content p { margin: 0 0 1rem; color: var(--text-muted); }
.intro__media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.intro__media img { width: 100%; height: auto; display: block; }
.content-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.content-card__media img { width: 100%; height: auto; display: block; }

/* Logo strips */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2rem; }
.logo-strip img { max-height: 48px; width: auto; object-fit: contain; filter: grayscale(1); opacity: 0.8; }
.logo-strip img:hover { filter: grayscale(0); opacity: 1; }
.logo-strip--certs img { max-height: 64px; }
.logo-strip__label { width: 100%; text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* Cards (projects, services) */
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: 0 10px 15px -3px rgb(15 23 42 / 0.1), 0 4px 6px -4px rgb(15 23 42 / 0.1); transform: translateY(-2px); }
.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card--link:hover { color: inherit; }
.card--link .card__link { color: var(--accent); font-weight: 600; }
.card--link:hover .card__link { color: var(--accent-hover); }
.card__media { aspect-ratio: 16 / 9; background: var(--surface-muted); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.25rem; }
.card__title { margin: 0 0 0.5rem; font-size: 1.125rem; color: var(--primary); }
.card__text { margin: 0 0 1rem; font-size: 0.9375rem; color: var(--text-muted); }
.card__link { font-weight: 600; color: var(--accent); }

/* Certs grid */
.certs-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.certs-grid img { max-height: 64px; width: auto; object-fit: contain; }

/* Contact */
.contact-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-details p { margin: 0 0 0.5rem; }
.contact-form label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--surface-muted);
  border-radius: var(--radius);
  font: inherit;
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--transition);
  text-decoration: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.btn:hover {
  background: var(--accent-hover);
  color: var(--white);
  text-decoration: none;
}
.btn--primary {
  background: #6599FE;
}
.btn--primary:hover {
  background: #4a7ede;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 0.5rem;
}
.form-actions .btn,
.form-actions .btn--call { min-height: 2.75rem; }
.form-actions button.btn {
  background: #6599FE;
}
.form-actions button.btn:hover { background: #4a7ede; }
.form-actions .btn--call {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #6766CC;
  color: var(--white);
  border: none;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.form-actions .btn--call:hover { background: #5251a8; color: var(--white); }
.btn--back {
  background: #003399;
  -webkit-appearance: none;
  appearance: none;
}
.btn--back:hover { background: #002a7a; color: var(--white); }
@media (max-width: 767px) {
  .contact-form .btn,
  .form-actions .btn,
  .form-actions .btn--call,
  .contact-form-wrap .btn,
  .btn--back {
    -webkit-appearance: none;
    appearance: none;
    color: var(--white);
    width: 100%;
    min-width: 0;
  }
  .form-actions button.btn {
    background: #6599FE;
    color: var(--white);
  }
  .form-actions .btn--call {
    background: #6766CC;
    color: var(--white);
  }
  .service-enquiry .btn--back,
  .btn--back {
    background: #003399;
    color: var(--white);
  }
  .form-actions {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
  }
  .form-actions .btn,
  .form-actions .btn--call {
    width: 100%;
  }
}
.service-enquiry { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--surface-muted); }
.service-enquiry .section__title { margin-bottom: 1rem; }

/* Map (above footer) – full width with coloured overlay */
.map-section {
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.map-wrap {
  width: 100%;
  height: 250px;
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
}
.map-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.map-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--primary);
  opacity: 0.35;
  pointer-events: none;
}
@media (max-width: 767px) {
  .map-wrap { height: 250px; }
}

/* Single project – gallery grid */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 2rem;
}
.gallery-grid__item {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-muted);
  border: 3px solid #0f172a;
}
.gallery-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-grid__item:hover img {
  transform: scale(1.06);
}
.gallery-grid__item.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
@media (max-width: 767px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* Footer */
.footer {
  background: var(--primary);
  color: var(--white);
  padding: 3rem 0 2rem;
  margin-top: 0;
}
.footer a { color: var(--surface-muted); }
.footer a:hover { color: var(--accent); }
.footer__grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 640px) { .footer__grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.footer__title { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }
.footer__bottom { padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.875rem; color: var(--surface-muted); text-align: center; }

/* Page title */
.page-title { padding: 2rem 0 1rem; background: var(--surface); }
.page-title h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); color: var(--primary); }

/* Mobile nav */
@media (max-width: 767px) {
  .hamburger { display: flex; }
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--surface-muted);
    padding: 1rem;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
    pointer-events: none;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav__sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--surface); margin: 0.5rem 0 0 1rem; padding: 0.5rem; display: none; }
  .nav__sub.is-open .nav__sub-menu { display: block; }
  .nav a { padding: 0.75rem; }
  .section { padding: 3rem 0; }
  .hero { min-height: 360px; background-attachment: scroll; }
  .hero__text { font-size: 1rem; }
}
