/*
Theme Name: GMS Northland
Theme URI: https://www.gartonmechanicalservices.co.nz/
Author: Prepared for Garton Mechanical Services
Description: A warm, pastel-toned WordPress theme for Garton Mechanical Services — a Northland diesel mechanics and agricultural machinery business. Includes a Machinery custom post type, team section, testimonials, brand partners, Instagram grid and a built-in contact form.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gms
Tags: business, portfolio, custom-menu, custom-logo, featured-images, translation-ready, two-columns, right-sidebar
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --gms-clay: #C97A54;
  --gms-clay-light: #E4A97E;
  --gms-deep-clay: #8C4A30;
  --gms-sage: #7C9473;
  --gms-sage-light: #AFC2A4;
  --gms-sand: #F1E4D3;
  --gms-pale-clay: #F3DCCB;
  --gms-pale-sage: #E4EAE1;
  --gms-ink: #2E2A27;
  --gms-muted: #8B8378;
  --gms-line: #EFE6DA;
  --gms-white: #FFFFFF;

  --gms-serif: Cambria, Georgia, "Times New Roman", serif;
  --gms-sans: Calibri, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --gms-radius: 12px;
  --gms-radius-lg: 18px;
  --gms-shadow: 0 6px 22px rgba(140, 74, 48, .10);
  --gms-shadow-lg: 0 12px 40px rgba(140, 74, 48, .14);
  --gms-wrap: 1240px;
  --gms-header-h: 84px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--gms-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--gms-ink);
  background: var(--gms-white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--gms-deep-clay); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--gms-serif);
  font-weight: 700;
  color: var(--gms-ink);
  line-height: 1.15;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.15rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }

p { margin: 0 0 1.1em; }

.gms-wrap { width: 100%; max-width: var(--gms-wrap); margin: 0 auto; padding: 0 24px; }
.gms-section { padding: 72px 0; }
.gms-section--tight { padding: 48px 0; }
.gms-eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gms-deep-clay); margin: 0 0 .6rem;
}
.gms-lead { font-size: 1.06rem; color: var(--gms-ink); }
.gms-muted { color: var(--gms-muted); }
.gms-center { text-align: center; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto;
  clip: auto; background: var(--gms-deep-clay); color: #fff; padding: 10px 16px; border-radius: 8px;
}

/* ==========================================================================
   3. Buttons & pills
   ========================================================================== */
.gms-btn {
  display: inline-block; font-family: var(--gms-sans); font-size: .97rem; font-weight: 700;
  padding: 14px 30px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: .18s ease; text-align: center; line-height: 1.2;
}
.gms-btn:hover { text-decoration: none; transform: translateY(-1px); }
.gms-btn--primary { background: var(--gms-deep-clay); color: #fff; }
.gms-btn--primary:hover { background: #74381F; color: #fff; }
.gms-btn--outline { background: transparent; color: var(--gms-deep-clay); border-color: var(--gms-deep-clay); }
.gms-btn--outline:hover { background: var(--gms-deep-clay); color: #fff; }
.gms-btn--sage { background: var(--gms-sage); color: #fff; }
.gms-btn--sage:hover { background: #6A8161; color: #fff; }
.gms-btn--sm { padding: 10px 22px; font-size: .88rem; }
.gms-btn--block { display: block; width: 100%; }

.gms-tag {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  padding: 5px 14px; border-radius: 999px; background: var(--gms-pale-sage); color: var(--gms-sage);
}

/* ==========================================================================
   4. Header / navigation
   ========================================================================== */
.gms-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--gms-white); border-bottom: 1px solid var(--gms-line);
}
.gms-header__inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--gms-header-h);
}
.gms-brand { font-family: var(--gms-serif); font-size: 1.6rem; font-weight: 700; color: var(--gms-ink); }
.gms-brand:hover { text-decoration: none; }
.gms-brand img { max-height: 52px; width: auto; }
.gms-brand__tag { display: block; font-family: var(--gms-sans); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gms-muted); font-weight: 700; }

.gms-nav { margin-left: auto; }
.gms-nav ul { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.gms-nav a { font-size: .96rem; color: var(--gms-ink); }
.gms-nav a:hover { color: var(--gms-deep-clay); text-decoration: none; }
.gms-nav .current-menu-item > a,
.gms-nav .current_page_item > a { color: var(--gms-deep-clay); font-weight: 700; }
.gms-nav ul ul {
  display: none; position: absolute; flex-direction: column; gap: 0;
  background: #fff; border: 1px solid var(--gms-line); border-radius: var(--gms-radius);
  box-shadow: var(--gms-shadow); padding: 8px 0; min-width: 210px;
}
.gms-nav li:hover > ul, .gms-nav li:focus-within > ul { display: flex; }
.gms-nav ul ul a { display: block; padding: 9px 18px; }

.gms-header__cta { flex-shrink: 0; }
.gms-nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; padding: 8px;
  cursor: pointer; color: var(--gms-ink);
}
.gms-nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; transition: .2s; }

/* ==========================================================================
   5. Hero
   ========================================================================== */
.gms-hero { display: grid; grid-template-columns: 44fr 56fr; min-height: 560px; }
.gms-hero__text {
  background: var(--gms-pale-clay);
  padding: 76px clamp(28px, 5vw, 76px);
  display: flex; flex-direction: column; justify-content: center;
}
.gms-hero__text > *:last-child { margin-bottom: 0; }
.gms-hero h1 { margin-bottom: .55em; max-width: 12ch; }
.gms-hero p { max-width: 46ch; }
.gms-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.gms-hero__media { position: relative; background: var(--gms-ink); overflow: hidden; }
.gms-hero__media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.gms-hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: var(--gms-clay); mix-blend-mode: multiply; opacity: .34;
}

/* ==========================================================================
   6. Trust strip
   ========================================================================== */
.gms-trust { background: var(--gms-deep-clay); color: #fff; padding: 34px 0; }
.gms-trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.gms-trust__item { display: flex; align-items: center; gap: 16px; }
.gms-trust__icon {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%;
  background: var(--gms-clay); display: grid; place-items: center;
}
.gms-trust__icon svg { width: 22px; height: 22px; fill: #fff; }
.gms-trust__value { font-family: var(--gms-serif); font-size: 1.22rem; font-weight: 700; line-height: 1.2; }
.gms-trust__label { font-size: .84rem; color: #E9D3C4; line-height: 1.35; }

/* ==========================================================================
   7. Cards & grids
   ========================================================================== */
.gms-grid { display: grid; gap: 26px; }
.gms-grid--4 { grid-template-columns: repeat(4, 1fr); }
.gms-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gms-grid--2 { grid-template-columns: repeat(2, 1fr); }
.gms-grid--5 { grid-template-columns: repeat(5, 1fr); gap: 16px; }

.gms-card {
  background: #fff; border: 1px solid var(--gms-line); border-radius: var(--gms-radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .2s ease;
}
.gms-card:hover { box-shadow: var(--gms-shadow-lg); transform: translateY(-3px); }
.gms-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--gms-pale-sage); }
.gms-card__media img { width: 100%; height: 100%; object-fit: cover; }
.gms-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.gms-card__title { font-family: var(--gms-sans); font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.35; }
.gms-card__title a { color: var(--gms-ink); }
.gms-card__price { font-family: var(--gms-serif); font-weight: 700; color: var(--gms-deep-clay); }
.gms-card__body .gms-btn { margin-top: auto; }
.gms-card__tag { align-self: flex-start; }

.gms-section__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 30px;
}
.gms-section__head h2 { margin: 0; }

/* Filters */
.gms-filters { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.gms-filters a {
  display: inline-block; font-size: .85rem; font-weight: 700; padding: 9px 20px;
  border-radius: 999px; background: var(--gms-sand); color: var(--gms-ink);
}
.gms-filters a:hover { text-decoration: none; background: var(--gms-pale-clay); }
.gms-filters .is-active a { background: var(--gms-clay); color: #fff; }

/* ==========================================================================
   8. Testimonials / brands / instagram
   ========================================================================== */
.gms-quote {
  background: var(--gms-pale-sage); border-radius: var(--gms-radius);
  padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 12px;
}
.gms-quote__mark { font-family: var(--gms-serif); font-size: 2.6rem; line-height: .7; color: var(--gms-sage); }
.gms-quote p { font-style: italic; margin: 0; font-size: .98rem; }
.gms-quote cite { font-style: normal; font-weight: 700; font-size: .88rem; color: var(--gms-sage); margin-top: auto; }

.gms-brands {
  background: var(--gms-sand); border-radius: var(--gms-radius); padding: 26px 34px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
/* Keeps the logo strip legible on phones — it becomes swipeable instead of shrinking to nothing. */
.gms-brands img { margin: 0 auto; min-width: 520px; }
.gms-brands::-webkit-scrollbar { height: 6px; }
.gms-brands::-webkit-scrollbar-thumb { background: var(--gms-clay-light); border-radius: 3px; }

.gms-insta__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.gms-insta__grid a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 10px; }
.gms-insta__grid img { width: 100%; height: 100%; object-fit: cover; transition: .3s ease; }
.gms-insta__grid a:hover img { transform: scale(1.05); }
.gms-insta__handle { font-weight: 700; color: var(--gms-clay); font-size: .92rem; }

/* ==========================================================================
   9. About / team
   ========================================================================== */
.gms-split { display: grid; grid-template-columns: 37fr 63fr; align-items: stretch; }
.gms-split__panel { background: var(--gms-pale-sage); padding: 66px clamp(26px, 4vw, 54px); display: flex; flex-direction: column; justify-content: center; }
.gms-split__panel .gms-eyebrow { color: var(--gms-sage); }
.gms-split__panel .gms-btn { align-self: flex-start; margin-top: 10px; }
.gms-split__content { padding: 66px clamp(26px, 4vw, 54px); }

.gms-team__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.gms-team__item figure { margin: 0; }
.gms-team__photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--gms-radius); background: var(--gms-ink); }
.gms-team__photo img { width: 100%; height: 100%; object-fit: cover; }
.gms-team__photo::after { content: ""; position: absolute; inset: 0; background: var(--gms-clay); mix-blend-mode: multiply; opacity: .22; }
.gms-team__name { font-weight: 700; margin: 12px 0 0; }
.gms-team__role { color: var(--gms-clay); font-size: .86rem; }

.gms-fleet { list-style: none; margin: 0; padding: 0; }
.gms-fleet li { padding: 14px 0; border-bottom: 1px solid var(--gms-line); font-size: 1rem; }
.gms-fleet li:first-child { border-top: 1px solid var(--gms-line); }

/* ==========================================================================
   10. Contact
   ========================================================================== */
.gms-contact { display: grid; grid-template-columns: 52fr 48fr; gap: 46px; }
.gms-field { margin-bottom: 18px; }
.gms-field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; }
.gms-field input, .gms-field textarea, .gms-field select {
  width: 100%; font-family: var(--gms-sans); font-size: 1rem; color: var(--gms-ink);
  padding: 12px 14px; border: 1px solid #E2D6C6; border-radius: 8px; background: #fff;
}
.gms-field input:focus, .gms-field textarea:focus {
  outline: 2px solid var(--gms-clay); outline-offset: 1px; border-color: var(--gms-clay);
}
.gms-field textarea { min-height: 128px; resize: vertical; }
.gms-hp { position: absolute !important; left: -9999px; }

.gms-infobox { background: var(--gms-pale-clay); border-radius: var(--gms-radius); padding: 28px 30px; }
.gms-infoline { display: flex; gap: 16px; align-items: flex-start; padding: 12px 0; }
.gms-infoline svg { width: 20px; height: 20px; fill: var(--gms-clay); flex: 0 0 auto; margin-top: 4px; }
.gms-infoline strong { display: block; font-size: 1rem; }
.gms-infoline span { font-size: .85rem; color: var(--gms-muted); }
.gms-mapbox {
  background: var(--gms-pale-sage); border-radius: var(--gms-radius); margin-top: 20px;
  min-height: 240px; display: grid; place-items: center; text-align: center; padding: 30px; overflow: hidden;
}
.gms-mapbox iframe { width: 100%; min-height: 240px; border: 0; border-radius: var(--gms-radius); }
.gms-mapbox__icon { width: 62px; height: 62px; border-radius: 50%; background: var(--gms-sage); display: grid; place-items: center; margin: 0 auto 12px; }
.gms-mapbox__icon svg { width: 28px; height: 28px; fill: #fff; }
.gms-mapbox p { color: var(--gms-sage); font-weight: 700; margin: 0; }

.gms-notice { border-radius: var(--gms-radius); padding: 16px 20px; margin-bottom: 22px; font-weight: 700; }
.gms-notice--ok { background: var(--gms-pale-sage); color: #4E6647; }
.gms-notice--err { background: var(--gms-pale-clay); color: var(--gms-deep-clay); }

.gms-social { display: flex; gap: 12px; margin-top: 18px; }
.gms-social a { width: 40px; height: 40px; border-radius: 50%; background: var(--gms-sand); display: grid; place-items: center; }
.gms-social a:hover { background: var(--gms-pale-clay); }
.gms-social svg { width: 18px; height: 18px; fill: var(--gms-deep-clay); }

/* ==========================================================================
   11. Page banner, single machinery, content
   ========================================================================== */
.gms-banner { background: var(--gms-pale-clay); padding: 60px 0 56px; }
.gms-banner h1 { margin: 0; }
.gms-banner p { margin: 12px 0 0; max-width: 62ch; color: var(--gms-ink); }

.gms-single { display: grid; grid-template-columns: 58fr 42fr; gap: 44px; align-items: start; }
.gms-single__media img { border-radius: var(--gms-radius); width: 100%; }
.gms-specs { list-style: none; margin: 18px 0 0; padding: 0; }
.gms-specs li { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--gms-line); font-size: .95rem; }
.gms-specs strong { color: var(--gms-ink); }

.gms-content > *:last-child { margin-bottom: 0; }
.gms-content ul, .gms-content ol { padding-left: 1.25em; }
.gms-content blockquote {
  margin: 1.5em 0; padding: 18px 24px; background: var(--gms-pale-sage);
  border-radius: var(--gms-radius); font-style: italic;
}
.gms-content img { border-radius: var(--gms-radius); }
.gms-content table { width: 100%; border-collapse: collapse; }
.gms-content th, .gms-content td { border: 1px solid var(--gms-line); padding: 10px 12px; text-align: left; }

.gms-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.gms-pagination .page-numbers {
  padding: 9px 16px; border-radius: 999px; background: var(--gms-sand); font-weight: 700; font-size: .9rem;
}
.gms-pagination .current { background: var(--gms-clay); color: #fff; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.gms-footer { background: var(--gms-ink); color: #D9CFC4; padding: 62px 0 0; margin-top: 0; }
.gms-footer a { color: #E9D3C4; }
.gms-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 42px; padding-bottom: 46px; }
.gms-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: .9em; }
.gms-footer ul { list-style: none; margin: 0; padding: 0; }
.gms-footer li { margin-bottom: 10px; font-size: .95rem; }
.gms-footer__brand { font-family: var(--gms-serif); font-size: 1.7rem; color: #fff; font-weight: 700; }
.gms-footer__bar {
  border-top: 1px solid #453D35; padding: 22px 0; font-size: .84rem;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #9C917F;
}

/* Sticky mobile call bar */
.gms-callbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--gms-deep-clay); color: #fff; padding: 13px 18px;
  align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: .96rem;
}
.gms-callbar:hover { color: #fff; text-decoration: none; }
.gms-callbar svg { width: 17px; height: 17px; fill: #fff; }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .gms-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .gms-grid--5, .gms-insta__grid { grid-template-columns: repeat(3, 1fr); }
  .gms-trust__grid { grid-template-columns: repeat(2, 1fr); }
  .gms-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .gms-nav-toggle { display: block; }
  .gms-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--gms-line); box-shadow: var(--gms-shadow);
    padding: 12px 24px 22px;
  }
  .gms-nav.is-open { display: block; }
  .gms-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .gms-nav ul li { border-bottom: 1px solid var(--gms-line); }
  .gms-nav ul li:last-child { border-bottom: 0; }
  .gms-nav a { display: block; padding: 13px 0; }
  .gms-nav ul ul { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 8px 14px; }
  .gms-header__cta { display: none; }

  .gms-hero { grid-template-columns: 1fr; }
  .gms-hero__text { order: 2; padding: 44px 24px 52px; }
  .gms-hero__media { order: 1; min-height: 300px; }
  .gms-split, .gms-contact, .gms-single { grid-template-columns: 1fr; gap: 0; }
  .gms-split__panel, .gms-split__content { padding: 46px 24px; }
  .gms-contact, .gms-single { gap: 38px; padding-top: 0; }
  .gms-callbar { display: flex; }
  body { padding-bottom: 56px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .gms-section { padding: 48px 0; }
  .gms-grid--4, .gms-grid--3, .gms-grid--2, .gms-team__grid { grid-template-columns: 1fr; }
  .gms-grid--5, .gms-insta__grid { grid-template-columns: repeat(2, 1fr); }
  .gms-trust__grid { grid-template-columns: 1fr; gap: 18px; }
  .gms-footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .gms-hero__actions .gms-btn { width: 100%; }
  .gms-brands { padding: 20px; }
}

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-block-image figcaption { font-size: .85rem; color: var(--gms-muted); }
.sticky, .gallery-caption, .bypostauthor { }
