:root {
  --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1180px;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .18);

  /* Fallbacks. Theme CSS may override these. */
  --bg: #f4f2ed;
  --text: #111111;
  --brand-yellow: #f4c400;
  --brand-yellow-dark: #a67c00;
  --brand-black: #0b0c0f;
  --brand-charcoal: #17191d;
  --muted-text: rgba(0, 0, 0, .68);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

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

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

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.narrow {
  max-width: 840px;
}

/* Header / navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  font-weight: 900;
  letter-spacing: .02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 1000;
}

.brand-logo {
  max-width: 58px;
  max-height: 46px;
  object-fit: contain;
}

.brand-logo-horizontal {
  width: clamp(220px, 15vw, 285px);
  height: auto;
  max-width: none;
  max-height: none;
}

.brand-text {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: .94rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.phone-link {
  font-weight: 800;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  border: 0;
  font-size: 1.5rem;
  background: transparent;
  color: inherit;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
  border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

/* Hero sections */
.page-hero {
  min-height: 390px;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-large {
  min-height: 680px;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding-block: 80px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .16em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -.04em;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.6rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  font-size: 1.35rem;
}

.hero-subtitle,
.lead {
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  max-width: 720px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* Trust strip */
.trust-strip {
  padding: 18px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.trust-item {
  border-radius: var(--radius);
  padding: 16px 18px;
}

.trust-item strong {
  display: block;
}

.trust-item span {
  font-size: .9rem;
  opacity: .75;
}

/* Sections */
.section {
  padding: 84px 0;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 28px;
}

.section-heading.centered {
  text-align: center;
  margin-bottom: 28px;
}

.split-intro {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: start;
}

/* Cards and grids */
.card-grid {
  display: grid;
  gap: 24px;
}

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

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

.feature-card,
.machine-card,
.project-card,
.testimonial-card,
.contact-panel,
.site-form {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.feature-card img,
.machine-card img,
.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  padding: 22px;
}

/* Machine cards */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.machine-card span {
  display: inline-block;
  margin-top: 8px;
  font-weight: 900;
  font-size: .88rem;
}

.machine-card.large {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.machine-card.large img {
  height: 100%;
  aspect-ratio: auto;
}

/* Machine Hire page refinements */
.machine-intro-section {
  padding-top: 56px;
  padding-bottom: 18px;
}

.machine-intro-section .lead {
  margin: 0;
}

.machine-cards-section {
  padding-top: 18px;
}

.machine-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.machine-hire-card {
  min-width: 0;
  grid-template-columns: 44% 56%;
  min-height: 360px;
}

.machine-image-wrap {
  background: #f8f8f5;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
}

.machine-card.large .machine-image,
.machine-hire-card .machine-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: contain;
  object-position: center;
  padding: 16px;
}

.machine-hire-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.machine-hire-card .card-body p {
  margin: 0 0 8px;
}

.machine-hire-card h3 {
  margin-bottom: 8px;
}

/* Homepage Featured Machine Hire */
.featured-machine-grid {
  align-items: stretch;
}

.featured-machine-card {
  display: flex;
  flex-direction: column;
}

.featured-machine-card img.machine-card-image {
  width: 100%;
  height: 210px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  padding: 18px;
  background: #fff;
}

.featured-machine-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.featured-machine-card h3 {
  white-space: nowrap;
  font-size: clamp(1.05rem, 1.05vw, 1.22rem);
  letter-spacing: -0.035em;
}

.featured-machine-card .card-body p {
  margin-bottom: 18px;
}

.featured-machine-card .card-body span {
  margin-top: auto;
}

/* Projects */
.project-strip,
.project-grid {
  display: grid;
  gap: 22px;
}

.project-strip {
  grid-template-columns: repeat(5, 1fr);
}

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

.project-tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  min-height: 260px;
}

.project-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-tile div {
  position: absolute;
  inset: auto 14px 14px 14px;
  z-index: 2;
  padding: 14px;
  border-radius: 14px;
}

.project-tile strong,
.project-tile span {
  display: block;
}

/* Testimonials */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.testimonial-card {
  margin: 0;
  padding: 28px;
}

.testimonial-card footer {
  margin-top: 18px;
  font-weight: 900;
}

.testimonial-card footer span {
  display: block;
  opacity: .7;
  font-weight: 700;
}

.testimonials-intro-section {
  padding-bottom: 14px;
}

.testimonials-intro-section .lead {
  margin-bottom: 0;
}

.testimonials-cards-section {
  padding-top: 14px;
}

/* CTA */
.cta-band {
  padding: 56px 0;
}

.cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

/* Forms */
.form-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 38px;
  align-items: start;
}

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

.site-form p {
  margin: 0 0 18px;
}

.site-form label {
  display: block;
  font-weight: 900;
  margin-bottom: 6px;
}

.site-form input,
.site-form textarea,
.site-form select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .16);
  padding: 13px 14px;
  font: inherit;
}

.site-form input[type="file"] {
  background: #fff;
  padding: 12px;
}

.site-form .helptext {
  display: block;
  margin-top: 6px;
  font-size: .86rem;
  color: rgba(0, 0, 0, .62);
}

.site-form .errorlist {
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  list-style: none;
  background: #fff0f0;
  color: #8a1111;
  font-weight: 800;
}

.success-message {
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 800;
}

/* Footer */
.site-footer {
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 34px;
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 18px;
  font-size: .9rem;
  opacity: .75;
}

/* Rich text content and Wagtail page body links */
.rich-text img,
.page-content img,
.content-copy img,
.standard-page-content img {
  border-radius: var(--radius);
}

/*
  General Wagtail/public content links.
  This targets normal links inside editable page content without affecting buttons,
  nav links, logos, phone links or the mobile CTA bar.
*/
.rich-text a:not(.btn),
.page-content a:not(.btn),
.content-copy a:not(.btn),
.standard-page-content a:not(.btn) {
  color: var(--brand-yellow-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color .18s ease, text-decoration-thickness .18s ease, background .18s ease;
}

.rich-text a:not(.btn):hover,
.page-content a:not(.btn):hover,
.content-copy a:not(.btn):hover,
.standard-page-content a:not(.btn):hover {
  color: var(--brand-yellow);
  text-decoration-thickness: 2px;
}

/*
  Fallback styling for page/content links that are rendered outside .rich-text.
  This is intentionally limited to main content and excludes nav/header/button classes.
*/
main a:not(.btn):not(.site-logo):not(.brand):not(.phone-link):not(.nav-link):not(.mobile-cta-link) {
  color: var(--brand-yellow-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

main a:not(.btn):not(.site-logo):not(.brand):not(.phone-link):not(.nav-link):not(.mobile-cta-link):hover {
  color: var(--brand-yellow);
  text-decoration-thickness: 2px;
}

/*
  Important Terms / document links.
  These become pill-style secondary buttons.
*/
main a[href*="terms-and-conditions"],
main a[href*="/terms"],
main a[href*="/documents/"],
.rich-text a[href*="terms-and-conditions"],
.rich-text a[href*="/terms"],
.rich-text a[href*="/documents/"],
.page-content a[href*="terms-and-conditions"],
.page-content a[href*="/terms"],
.page-content a[href*="/documents/"],
.content-copy a[href*="terms-and-conditions"],
.content-copy a[href*="/terms"],
.content-copy a[href*="/documents/"],
.standard-page-content a[href*="terms-and-conditions"],
.standard-page-content a[href*="/terms"],
.standard-page-content a[href*="/documents/"] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin: 0.65rem 0 1.25rem;
  padding: 0.75rem 1.05rem;
  border-radius: 999px;
  border: 1px solid #d8aa00;
  background: #111;
  color: #f4c400 !important;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

/* Optional arrow marker for terms/document buttons */
main a[href*="terms-and-conditions"]::after,
main a[href*="/terms"]::after,
main a[href*="/documents/"]::after,
.rich-text a[href*="terms-and-conditions"]::after,
.rich-text a[href*="/terms"]::after,
.rich-text a[href*="/documents/"]::after,
.page-content a[href*="terms-and-conditions"]::after,
.page-content a[href*="/terms"]::after,
.page-content a[href*="/documents/"]::after,
.content-copy a[href*="terms-and-conditions"]::after,
.content-copy a[href*="/terms"]::after,
.content-copy a[href*="/documents/"]::after,
.standard-page-content a[href*="terms-and-conditions"]::after,
.standard-page-content a[href*="/terms"]::after,
.standard-page-content a[href*="/documents/"]::after {
  content: "→";
  font-weight: 1000;
  line-height: 1;
}

main a[href*="terms-and-conditions"]:hover,
main a[href*="/terms"]:hover,
main a[href*="/documents/"]:hover,
.rich-text a[href*="terms-and-conditions"]:hover,
.rich-text a[href*="/terms"]:hover,
.rich-text a[href*="/documents/"]:hover,
.page-content a[href*="terms-and-conditions"]:hover,
.page-content a[href*="/terms"]:hover,
.page-content a[href*="/documents/"]:hover,
.content-copy a[href*="terms-and-conditions"]:hover,
.content-copy a[href*="/terms"]:hover,
.content-copy a[href*="/documents/"]:hover,
.standard-page-content a[href*="terms-and-conditions"]:hover,
.standard-page-content a[href*="/terms"]:hover,
.standard-page-content a[href*="/documents/"]:hover {
  background: #f4c400;
  border-color: #f4c400;
  color: #111 !important;
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

/* Mobile sticky CTA */
.mobile-cta-bar {
  display: none;
}

/* Tablet */
@media (max-width: 1180px) {
  .brand-logo-horizontal {
    width: 230px;
  }

  .site-nav {
    gap: 14px;
  }

  .featured-machine-card h3 {
    font-size: 1.1rem;
  }
}

/* Small desktop / tablet navigation */
@media (max-width: 1020px) {
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 20px;
  }

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .header-actions {
    display: none;
  }

  .card-grid.four,
  .card-grid.three,
  .machine-grid,
  .project-strip,
  .project-grid,
  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-intro,
  .form-layout,
  .machine-card.large,
  .cta-inner {
    grid-template-columns: 1fr;
    display: grid;
  }

  .machine-list {
    grid-template-columns: 1fr;
  }

  .machine-hire-card {
    grid-template-columns: 42% 58%;
  }

  .featured-machine-card img.machine-card-image {
    height: 230px;
  }

  .featured-machine-card h3 {
    font-size: 1.35rem;
  }
}

/* Mobile */
@media (max-width: 680px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .header-inner {
    min-height: 72px;
  }

  .brand-logo-horizontal {
    width: min(62vw, 245px);
  }

  .brand-text {
    font-size: .95rem;
  }

  .hero-large {
    min-height: 610px;
  }

  .trust-grid,
  .card-grid.four,
  .card-grid.three,
  .machine-grid,
  .project-strip,
  .project-grid,
  .testimonial-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 58px 0;
  }

  .section-heading-row {
    display: block;
  }

  .machine-intro-section {
    padding-top: 42px;
    padding-bottom: 10px;
  }

  .machine-cards-section {
    padding-top: 10px;
  }

  .machine-hire-card {
    display: block;
    min-height: 0;
    border-radius: 22px;
  }

  .machine-image-wrap {
    min-height: auto;
    padding: 0;
  }

  .machine-card.large .machine-image,
  .machine-hire-card .machine-image {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    padding: 0;
  }

  .machine-hire-card .card-body {
    padding: 26px 24px 30px;
    display: block;
  }

  .featured-machine-card img.machine-card-image {
    height: auto;
    max-height: 280px;
    padding: 16px;
  }

  .featured-machine-card h3 {
    white-space: normal;
    font-size: 1.45rem;
  }

  .testimonials-intro-section {
    padding-bottom: 8px;
  }

  .testimonials-cards-section {
    padding-top: 8px;
  }

  .mobile-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-cta-bar a {
    display: grid;
    place-items: center;
    min-height: 56px;
    font-weight: 1000;
  }

  body {
    padding-bottom: 56px;
  }
}
