/* J&M Groundworks — shared stylesheet. Static site, no framework. */

/* Self-hosted variable fonts (latin + latin-ext). */
@font-face{font-family:"Archivo";font-style:normal;font-weight:500 700;font-display:swap;src:url(fonts/archivo-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"Archivo";font-style:normal;font-weight:500 700;font-display:swap;src:url(fonts/archivo-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400 600;font-display:swap;src:url(fonts/instrument-sans-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400 600;font-display:swap;src:url(fonts/instrument-sans-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

:root{
  --ink:#16191C; --ink-2:#4A5257; --ink-3:#5A6167; --ink-4:#5A6167;
  --paper:#FBFAF7; --paper-2:#F1EEE8; --line:#E2DED6; --line-2:#D8D3C9;
  --green:oklch(0.46 0.075 152); --green-dark:oklch(0.36 0.075 152); --green-light:oklch(0.82 0.075 152);
  --gx:max(clamp(16px,4vw,46px),calc((100% - 1500px)/2)); /* side gutter; caps content at 1500px, backgrounds stay full-bleed */
}

html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--paper);font-family:"Instrument Sans",system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);text-wrap:pretty}
*{box-sizing:border-box}
img{max-width:100%}
a{color:var(--green);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:var(--green-dark)}
h1,h2,h3,h4{font-family:"Archivo",system-ui,sans-serif;margin:0;letter-spacing:-0.02em}
p{margin:0}
summary::-webkit-details-marker{display:none}
summary{cursor:pointer}
:focus-visible{outline:3px solid var(--green);outline-offset:3px}

/* ---------- reveal on scroll (only when JS is running) ---------- */
.js [data-reveal]{opacity:0;transform:translateY(16px)}
.js [data-reveal].is-in{opacity:1;transform:none;transition:opacity 620ms cubic-bezier(.2,.7,.2,1),transform 620ms cubic-bezier(.2,.7,.2,1)}
.js [data-step]{opacity:.8;transition:opacity 300ms ease,background 300ms ease,border-color 300ms ease}
.js [data-step].is-on{opacity:1}

/* ---------- header ---------- */
.jm-head{position:relative;top:0;left:0;right:0;z-index:40}
.jm-head--ov{position:absolute}
.jm-skip{position:absolute;left:-9999px;top:8px;background:var(--paper);color:var(--ink);font-weight:600;font-size:15px;padding:12px 18px;border:2px solid var(--green);border-radius:4px;z-index:60;text-decoration:none}
.jm-skip:focus{left:var(--gx)}

.jm-strip{background:var(--ink);color:#C9CFD3;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:9px var(--gx);font-size:clamp(11.5px,1.2vw,13px);flex-wrap:wrap}
.jm-head--ov .jm-strip{background:rgba(12,14,16,.62);color:#E7EAEC;border-bottom:1px solid rgba(251,250,247,.16)}
.jm-strip-msg{display:block;line-height:1.45;white-space:nowrap}
.jm-strip-msg i,.jm-strip-msg svg{display:inline-block;width:15px;height:15px;vertical-align:-3px;margin-right:8px}
.jm-strip-long{display:inline;white-space:nowrap}
.jm-strip-right{display:flex;align-items:center;gap:clamp(12px,2vw,18px);flex-wrap:wrap}
.jm-strip-loc{display:flex;align-items:center;gap:7px}
.jm-strip a{color:var(--paper);font-weight:600;text-decoration:none;display:flex;align-items:center;gap:7px;min-height:24px}
.jm-strip i{width:15px;height:15px;flex:none}

.jm-nav{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px var(--gx);border-bottom:1px solid var(--line);background:var(--paper)}
.jm-head--ov .jm-nav{background:transparent;border-bottom:0}
.jm-logo{display:flex;align-items:center;text-decoration:none;flex:none}
.jm-logo img{height:clamp(38px,4.4vw,50px);width:auto;display:block}
.jm-head--ov .jm-logo img{filter:brightness(0) invert(1)}

.jm-links{display:flex;align-items:center;gap:clamp(10px,1.5vw,22px);font-size:14.5px;font-weight:500;flex-wrap:wrap;justify-content:flex-end}
.jm-links a{color:var(--ink);text-decoration:none;padding:4px 0}
.jm-head--ov .jm-links a{color:var(--paper)}
.jm-links a:hover{opacity:.72}
.jm-links a[aria-current="page"]{text-decoration:underline;text-decoration-color:var(--green);text-decoration-thickness:2px;text-underline-offset:6px}
.jm-cta{background:var(--green);color:var(--paper)!important;text-decoration:none;padding:11px 18px;border-radius:4px;font-weight:600;display:flex;align-items:center;gap:8px;white-space:nowrap;transition:background 180ms ease,transform 180ms ease}
.jm-links a.jm-cta{padding:11px 20px}
.jm-cta:hover{background:var(--green-dark);transform:translateY(-1px);opacity:1!important}
.jm-cta i{width:16px;height:16px}

.jm-compact{display:none;align-items:center;gap:9px}
.jm-iconbtn{width:46px;height:46px;display:grid;place-items:center;background:var(--green);color:var(--paper);border-radius:4px;text-decoration:none}
.jm-iconbtn i{width:20px;height:20px}
.jm-burger{width:46px;height:46px;display:grid;place-items:center;background:var(--paper);color:var(--ink);border:1px solid var(--ink);border-radius:4px;cursor:pointer;font:inherit;padding:0}
.jm-head--ov .jm-burger{background:rgba(12,14,16,.4);color:var(--paper);border-color:rgba(251,250,247,.6)}
.jm-burger i{width:22px;height:22px}
.jm-burger .jm-x,.jm-burger[aria-expanded="true"] .jm-menu{display:none}
.jm-burger[aria-expanded="true"] .jm-x{display:block}

.jm-panel{background:var(--paper);border-bottom:1px solid var(--line);padding:8px var(--gx) 20px;display:flex;flex-direction:column;gap:2px}
.jm-head--ov .jm-panel{background:var(--ink);border-bottom-color:#31373B}
.jm-panel[hidden]{display:none}
.jm-panel a{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--ink);text-decoration:none;font-size:17px;font-weight:500;padding:15px 2px;border-bottom:1px solid #EFEBE3;min-height:48px}
.jm-head--ov .jm-panel a{color:var(--paper);border-bottom-color:#31373B}
.jm-panel i{width:18px;height:18px;opacity:.6}
.jm-panel .jm-panel-cta{margin-top:14px;background:var(--green);color:var(--paper);padding:16px;border-radius:4px;font-weight:600;font-size:16px;justify-content:center;gap:9px;min-height:52px;border-bottom:0}
.jm-panel .jm-panel-cta i{opacity:1}

/* ---------- sticky header: desktop with a mouse only (phones and tablets keep the normal, scrolling header) ---------- */
:root{--jm-top-h:0px} /* height of the sticky header; site.js keeps it exact. Sticky items below use it as their top offset. */
@media (min-width:1024px) and (pointer:fine){
  :root{--jm-top-h:122px}
  html{scroll-padding-top:calc(var(--jm-top-h) + 16px)} /* in-page links don't land under the header */
  .jm-head{position:sticky}
  .jm-head--ov{position:fixed}
  .jm-strip,.jm-nav{transition:background-color 200ms ease}
  /* over a photo the header is transparent; once the page scrolls it turns solid so it stays readable */
  .jm-head--ov.is-stuck .jm-strip{background:var(--ink);color:#C9CFD3;border-bottom-color:transparent}
  .jm-head--ov.is-stuck .jm-nav{background:var(--paper);border-bottom:1px solid var(--line)}
  .jm-head--ov.is-stuck .jm-logo img{filter:none}
  .jm-head--ov.is-stuck .jm-links a{color:var(--ink)}
  .jm-head--ov.is-stuck .jm-links a.jm-cta{color:var(--paper)}
  /* "On this page" lists on the policy pages: sticky on desktop only, never on a phone */
  .jm-toc{position:sticky;top:calc(var(--jm-top-h) + 20px)}
  /* FAQ section headings: sticky beside their questions on desktop (below the header and the category bar), never on a phone */
  .jm-sticky-side{position:sticky;top:calc(var(--jm-top-h) + 84px)}
}

@media (max-width:879px){
  .jm-links{display:none}
  .jm-compact{display:flex}
}
@media (max-width:759px){ .jm-strip-loc{display:none} }
@media (max-width:1099px){ .jm-strip-long{display:none} }

/* ---------- sticky quote bar ---------- */
.jm-stickybar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--green);color:var(--paper);padding:12px var(--gx);transform:translateY(110%);transition:transform 320ms cubic-bezier(.2,.7,.2,1);flex-wrap:wrap}
.jm-stickybar.is-up{transform:translateY(0)}

/* ---------- review/credential logo rows: one per line on a phone, instead of wrapping ---------- */
@media (max-width:639px){
  .jm-trust{flex-direction:column;align-items:flex-start!important;gap:14px!important}
  .jm-trust-row{flex-direction:column;align-items:flex-start!important;gap:18px!important}
}

/* ---------- links that open in a new tab: ONE shared icon, added automatically to any a[target="_blank"] ---------- */
a[target="_blank"]::after{content:"";content:"" / "(opens in a new tab)";display:inline-block;flex:none;width:.82em;height:.82em;margin-left:.38em;vertical-align:-.08em;
  background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center/contain no-repeat}
/* ...but never on a logo link (a link whose only content is a picture with descriptive alt text). Buttons and text links always get it. */
a[target="_blank"]:has(> img:not([alt=""]):only-child)::after,a[target="_blank"].jm-logo::after{content:none}

/* ---------- the "All services" / "All areas" shortcut rows: a swipeable strip on phones (scrollbar hidden), wrapping onto more lines on desktop ---------- */
.jm-chips{overflow-x:auto;scrollbar-width:none}
.jm-chips::-webkit-scrollbar{display:none}
@media (min-width:1024px){.jm-chips{flex-wrap:wrap;overflow-x:visible}}

/* ---------- gallery filters ---------- */
.jm-filter{white-space:nowrap;font:inherit;font-size:14px;font-weight:500;cursor:pointer;color:var(--ink);background:var(--paper);border:1px solid var(--line-2);padding:13px 17px;min-height:46px;border-radius:999px;transition:border-color 180ms ease}
.jm-filter:hover{border-color:var(--ink)}
.jm-filter[aria-pressed="true"]{color:var(--paper);background:var(--green);border-color:var(--green)}
[data-cat][hidden]{display:none!important} /* !important: the cards carry an inline display:flex, which would otherwise beat this rule */

/* ---------- cookie banner ---------- */
.jm-consent{position:fixed;left:0;right:0;bottom:0;z-index:70;background:var(--ink);border-top:1px solid #31373B;padding:18px var(--gx);display:flex;flex-wrap:wrap;gap:18px;align-items:center;justify-content:space-between}
.jm-consent[hidden]{display:none}
.jm-consent-copy{display:flex;flex-direction:column;gap:7px;max-width:70ch}
.jm-consent h2{font-size:19px;font-weight:700;color:var(--paper)}
.jm-consent p{font-size:15px;line-height:1.6;color:#A9B1B6}
.jm-consent a{color:var(--green-light);font-weight:600}
.jm-consent-btns{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.jm-btn{font:inherit;font-family:"Archivo",system-ui,sans-serif;font-size:15.5px;font-weight:600;min-height:50px;padding:14px 24px;border-radius:4px;cursor:pointer;border:0;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.jm-btn--primary{background:var(--green);color:var(--paper)}
.jm-btn--primary:hover{background:var(--green-dark)}
.jm-btn--ghost{background:transparent;color:var(--paper);border:1px solid rgba(251,250,247,.6)}
.jm-btn--ghost:hover{background:rgba(251,250,247,.14)}

/* ---------- form states ---------- */
.jm-form-error{grid-column:1/-1;font-size:15px;font-weight:600;color:#8A1F11}
input:user-invalid,textarea:user-invalid{border-color:#8A1F11}

@keyframes jmFloat{from{transform:translateY(0)}to{transform:translateY(-6px)}}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation-duration:.001ms!important;transition-duration:.001ms!important}
  .js [data-reveal]{opacity:1;transform:none}
}

@media print{
  .jm-head,.jm-stickybar,.jm-consent,.jm-filter{display:none!important}
  body{background:#fff}
  a[href^="http"]::after{content:" (" attr(href) ")";font-size:11px;color:#555}
}

/* ---------- touch targets (WCAG 2.5.8 / 44px guidance) ---------- */
@media (max-width:1023px),(pointer:coarse){
  .jm-strip a{min-height:44px;margin-block:-9px}
  .jm-logo{min-height:44px}
  nav[aria-label="Breadcrumb"] a{display:inline-block;padding-block:12px;margin-block:-12px}
  main a[style*="font-weight: 600"][style*="text-decoration: none"]:not([class]){min-height:44px}
  main summary{min-height:44px}
  footer a{display:inline-block;padding-block:6px}
  footer a[aria-label$="J&M Groundworks"]{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
}

/* gallery: several photos per project */
.jm-gal-open{all:unset;display:block;position:relative;cursor:pointer;overflow:hidden;width:100%}
.jm-gal-open:focus-visible{outline:3px solid oklch(0.46 0.075 152);outline-offset:-3px}
.jm-gal-open:hover img,.jm-gal-open:focus-visible img{transform:scale(1.04)!important}
.jm-gal-badge{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:6px;background:rgba(15,18,20,.82);color:#fff;font-size:13px;font-weight:600;line-height:1;padding:7px 11px;border-radius:999px}
.jm-gal-badge svg{width:16px;height:16px}
.jm-gal-hint{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(15,18,20,.38);opacity:0;transition:opacity .25s}
.jm-gal-hint span{background:oklch(0.46 0.075 152);color:#fff;font-weight:600;font-size:15px;padding:9px 16px;border-radius:999px}
.jm-gal-open:hover .jm-gal-hint,.jm-gal-open:focus-visible .jm-gal-hint{opacity:1}
.jm-gal-strip{display:flex;gap:4px;padding:8px 8px 0}
.jm-gal-strip span{flex:1;height:44px;border-radius:3px;overflow:hidden;cursor:pointer;background:#E2DED6}
.jm-gal-strip img{width:100%;height:100%;object-fit:cover;display:block}
.jm-gal-strip .jm-gal-more{display:flex;align-items:center;justify-content:center;background:#16191C;color:#fff;font-size:13px;font-weight:600}
@media (max-width:640px){.jm-gal-strip{display:none}}
html.jm-gal-lock{overflow:hidden}
dialog.jm-gal{border:0;padding:0;margin:0;max-width:none;max-height:none;width:100%;height:100%;background:rgba(10,12,14,.96);color:#fff;flex-direction:column}
dialog.jm-gal[open]{display:flex}
dialog.jm-gal::backdrop{background:#000}
.jm-gal-top{display:flex;align-items:center;gap:14px;padding:12px 16px}
.jm-gal-title{font-family:"Archivo",sans-serif;font-size:16px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jm-gal-count{font-size:14px;color:#d6d2c8}
.jm-gal-close{all:unset;cursor:pointer;font-size:32px;line-height:1;min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;border-radius:50%}
.jm-gal-stage{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center;padding:0 12px}
.jm-gal-img{max-width:100%;max-height:100%;object-fit:contain;border-radius:4px;background:#1b1f23}
.jm-gal-nav{all:unset;cursor:pointer;position:absolute;top:50%;transform:translateY(-50%);width:48px;height:48px;border-radius:50%;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:30px;line-height:1;z-index:1}
.jm-gal-prev{left:10px}.jm-gal-next{right:10px}
.jm-gal-nav:hover,.jm-gal-close:hover{background:oklch(0.46 0.075 152)}
.jm-gal button:focus-visible{outline:3px solid #fff;outline-offset:2px}
.jm-gal-foot{padding:10px 16px 16px;text-align:center}
.jm-gal-cap{margin:0 0 10px;font-size:14px;color:#d6d2c8}
.jm-gal-th{display:flex;gap:6px;justify-content:center;overflow-x:auto;padding:2px}
.jm-gal-th button{all:unset;cursor:pointer;flex:0 0 auto;width:64px;height:46px;border-radius:3px;overflow:hidden;opacity:.55;border:2px solid transparent;box-sizing:border-box}
.jm-gal-th button[aria-current="true"]{opacity:1;border-color:#fff}
.jm-gal-th img{width:100%;height:100%;object-fit:cover;display:block}
@media (max-width:640px){.jm-gal-nav{width:40px;height:40px}.jm-gal-cap{display:none}}
