/* ============================================================
   Rutland Building Ltd – Main Stylesheet
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
  --green:  #71BF44;
  --bg:     #F6F7F8;
  --white:  #FFFFFF;
  --text:   #1E1E1E;
  --muted:  #5F6368;
  --dark:   #2B2F33;
  --border: #D1D5DB;
  --max:    1100px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

img { display: block; }

/* ===== LAYOUT ===== */
.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: auto;
}

/* ===== TOP BAR ===== */
.topbar {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  padding: 7px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.topbar a:hover { color: #fff; }

.topbar-contact {
  display: flex;
  gap: 22px;
  align-items: center;
}

.topbar-contact i {
  margin-right: 5px;
  color: var(--green);
}

.topbar-social {
  display: flex;
  gap: 14px;
  align-items: center;
}

.topbar-social a {
  font-size: 13px;
  transition: color 0.2s;
}

.topbar-social a:hover { color: var(--green); }

/* ===== HEADER ===== */
header {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  position: relative;
}

.nav-logo img { height: 56px; }

/* ===== NAV LINKS ===== */
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

.nav-links a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ===== HAMBURGER ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .25)),
    url("../images/IMG_6541.jpg") center / cover no-repeat;
}

.hero-content {
  max-width: 650px;
  padding: 80px 0;
}

.hero h1 {
  font-size: 48px;
  margin: 0 0 14px;
  line-height: 1.1;
}

.hero p {
  color: rgba(255, 255, 255, .9);
  font-size: 18px;
  margin-bottom: 28px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-right: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  border-color: #fff;
  color: #fff;
  background: transparent;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

/* ===== SECTIONS ===== */
section { padding: 64px 0; }

h2 {
  font-size: 30px;
  margin: 0 0 10px;
}

p.section-intro {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 16px;
}

/* ===== SERVICES ===== */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.service-panel-link {
  display: block;
  color: inherit;
  height: 100%;
}

.service-panel-link:hover .service {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.service:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.service-panel-link .service {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-panel-link .service .content {
  flex: 1;
}

.service img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.service .content { padding: 18px; }

.service .content h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.service .content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== SPLIT ===== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split img {
  width: 100%;
  border-radius: 16px;
}

.bullets {
  margin-top: 10px;
  color: var(--muted);
  padding-left: 20px;
}

.bullets li { margin-bottom: 8px; }

/* ===== GALLERY ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.2s;
}

.gallery img:hover {
  opacity: 1;
  transform: scale(1.01);
}

/* ===== TESTIMONIALS ===== */
.testimonials {
  background: var(--dark);
  color: #fff;
}

.testimonials h2 { color: #fff; }

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.quote {
  background: rgba(255, 255, 255, 0.06);
  padding: 24px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.7;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quote strong {
  display: inline-block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

/* ===== CONTACT ===== */
.contact-section {
  background:
    radial-gradient(circle at top right, rgba(76, 175, 80, 0.08), transparent 280px),
    linear-gradient(180deg, #f9fbfa 0%, #f2f5f4 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.contact-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 34px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 26px;
  align-items: start;
}

.contact-info-panel,
.contact-form-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.05);
}

.contact-info-panel {
  padding: 28px 24px;
}

.contact-info-panel h3,
.contact-form-panel h3 {
  margin: 0 0 16px;
  font-size: 24px;
}

.contact-info-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.contact-info-panel p:last-child {
  margin-bottom: 0;
}

.contact-info-panel i {
  width: 18px;
  color: var(--green);
  margin-right: 8px;
}

.contact-info-panel a {
  color: var(--text);
  font-weight: 600;
}

.contact-info-panel a:hover {
  color: var(--green);
}

.contact-form-panel {
  padding: 28px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.enquiry-status {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.enquiry-status.success {
  display: block;
  background: #e9f7ea;
  border: 1px solid #b9dfbc;
  color: #1f6a25;
}

.enquiry-status.error {
  display: block;
  background: #fdecec;
  border: 1px solid #efb7b7;
  color: #8d1f1f;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field-row {
  display: grid;
  gap: 16px;
}

.field-row.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  font-weight: 700;
  font-size: 15px;
}

.required {
  color: #d14343;
}

.field-group input,
.field-group textarea {
  border: 1px solid #cfd5d9;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  padding: 12px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group textarea {
  resize: vertical;
  min-height: 132px;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.16);
}

.consent-wrap {
  margin-top: 2px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

.checkbox-label input {
  margin-top: 3px;
}

.form-actions {
  margin-top: 4px;
}

.form-actions .btn {
  margin-right: 0;
}

/* ===== LEGACY CTA (kept for possible reuse) ===== */
.cta {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--border);
}

.cta h2 { margin: 0 0 6px; }
.cta p  { color: var(--muted); margin: 0; }

/* ===== ACCREDITATIONS ===== */
.accreditations-strip {
  background-color: white;
  padding: 12px 0 12px 0
}

.accreditations-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.accreditation-card {
  min-height: 84px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accreditation-card img {
  width: 100%;
  max-width: 180px;
  max-height: 52px;
  height: auto;
  object-fit: contain;
}

/* ===== FOOTER ===== */
footer {
  background: #1f2327;
  color: rgba(255, 255, 255, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding: 56px 0 40px;
}

.footer-col h4 {
  color: var(--green);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0 0 16px;
}

.footer-col p,
.footer-col address {
  font-style: normal;
  font-size: 14px;
  line-height: 1.9;
  margin: 0;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 14px;
  line-height: 2.1;
  transition: color 0.2s;
}

.footer-col p a {
  display: inline;
  line-height: inherit;
}

.footer-col a:hover { color: #fff; }

.footer-col p i,
.footer-col address i {
  width: 16px;
  color: var(--green);
  margin-right: 6px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 22px;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 0;
  font-size: 13px;
  text-align: center;
  color: rgba(255, 255, 255, 0.38);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover { transform: translateY(-2px); }

/* ===== INNER PAGES ===== */
.page-hero {
  min-height: 360px;
  color: #fff;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.35));
}

.page-hero .wrap {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: 48px;
}

.page-hero p {
  margin: 0;
  max-width: 760px;
  font-size: 19px;
  color: rgba(255, 255, 255, 0.92);
}

.mini-cta {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.mini-cta p {
  margin: 0;
  color: var(--muted);
}

.mini-cta-links {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.text-link {
  position: relative;
  color: var(--text);
  font-weight: 700;
  padding-bottom: 2px;
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.3);
  transform: scaleX(0.35);
  transform-origin: left center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.text-link:hover {
  color: var(--green);
}

.text-link:hover::after,
.text-link:focus-visible::after,
.text-link.active::after {
  transform: scaleX(1);
  background: var(--green);
}

.text-link.active {
  color: var(--green);
}

.service-copy p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.8;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.service-grid img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
}

/* ===== IMAGE INTERACTIONS ===== */
.service img,
.gallery img,
.service-grid img,
.split img {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.service img:hover,
.gallery img:hover,
.service-grid img:hover,
.split img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  filter: saturate(1.04);
}

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 500;
}

.image-modal.open {
  display: flex;
}

.image-modal img {
  max-width: min(1200px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.reviews-page {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.review-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.review-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.75;
}

.review-card strong {
  color: var(--text);
  font-size: 14px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .services,
  .gallery,
  .quotes,
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reviews-page {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .contact-info-panel,
  .contact-form-panel {
    padding: 24px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .split img { max-height: 340px; object-fit: cover; }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

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

  .cta {
    flex-direction: column;
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 600px) {
  /* Top bar */
  .topbar-social { display: none; }

  /* Nav */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: -20px;           /* bleed to edge of viewport */
    right: -20px;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--green);
    padding: 8px 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    border-bottom-width: 1px;
    font-size: 16px;
  }

  .nav-links a:last-child { border-bottom: none; }

  /* Hero */
  .hero { min-height: auto; }
  .hero-content { padding: 60px 0; }
  .hero h1 { font-size: 30px; }
  .hero p  { font-size: 16px; }
  .page-hero h1 { font-size: 34px; }
  .page-hero p { font-size: 16px; }

  /* Grids */
  .services,
  .gallery,
  .quotes,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .mini-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-cta-links {
    width: 100%;
  }

  .accreditations-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .accreditation-card {
    min-height: 76px;
    padding: 10px 14px;
  }

  .accreditation-card img {
    max-width: 150px;
    max-height: 44px;
  }

  .field-row.two-col {
    grid-template-columns: 1fr;
  }

  .contact-form-panel {
    padding: 20px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 0 28px;
  }

  /* Typography */
  h2 { font-size: 24px; }

  /* CTA */
  .cta { padding: 28px 20px; }
}


/* ===== PROJECT SLIDESHOW ===== */
.project-slideshow {
  max-width: 920px;
  margin: 0 auto 28px;
}
.slideshow-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #15181b;
}
.slideshow-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.slideshow-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
}
.slideshow-arrow:hover,
.slideshow-arrow:focus-visible { background: rgba(0,0,0,.78); }
.slideshow-prev { left: 16px; }
.slideshow-next { right: 16px; }
.slideshow-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 3px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.slideshow-thumb {
  flex: 0 0 94px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.slideshow-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slideshow-thumb.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(113,191,68,.2);
}
.slideshow-status {
  margin: 2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.footer-hours { white-space: nowrap; }

@media (max-width: 600px) {
  .slideshow-stage { aspect-ratio: 4 / 3; }
  .slideshow-arrow { width: 40px; height: 40px; }
  .slideshow-prev { left: 8px; }
  .slideshow-next { right: 8px; }
  .slideshow-thumb { flex-basis: 76px; height: 56px; }
}
