/* ==========================================================================
   SCAR 2.0 v3 layer (notes/V3-DIRECTION.md). Loaded last on every page.
   1. Section skin: light canvas + stone cards, onyx gallery + graphite cards,
      blue-hour panels, 40px radii, halftone photo texture.
   2. Readable colour: white text on dark, ink on light. No grey on black.
   3. Type lock: four sizes for the whole site.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Sections
   -------------------------------------------------------------------------- */
.band { --bg: var(--v3-pumice); --card: var(--v3-stone); --card-line: transparent; --fg: var(--v3-ink); --fg2: rgba(20, 22, 28, .82); --line: rgba(20, 22, 28, .12); }
.band.has-surface-background-color, :is(.wp-block-post-content, .entry) > .section:not([class*="v2-"]) { --bg: var(--v2-soot); --card: var(--v3-graphite); --card-line: rgba(238, 240, 242, .07); --fg: #fff; --fg2: rgba(238, 240, 242, .9); --line: rgba(238, 240, 242, .14); }
.band--ink { --card: rgba(91, 182, 234, .08); --card-line: rgba(91, 182, 234, .18); --fg: #fff; --fg2: rgba(238, 240, 242, .9); --line: rgba(238, 240, 242, .16); }
.service-main, .site-main.section { background: var(--v3-pumice) !important; }

.band-title, .band h2 { font-weight: 400 !important; letter-spacing: -.02em !important; line-height: .98 !important; }
.band h3, .card h3, .tl-item h3, .service-card__body h2, .post-card__title { font-weight: 400 !important; letter-spacing: -.01em !important; line-height: 1.05 !important; }

.cards > .card { border-radius: var(--v3-r) !important; padding: clamp(1.75rem, 2.8vw, 2.5rem) !important; }
.cards > .card:hover { box-shadow: none !important; }

.split__img, .service-card .wp-block-image, .contact-photo { position: relative; border-radius: var(--v3-r) !important; overflow: hidden; }
.split__img img, .contact-photo img { border-radius: var(--v3-r) !important; }
.split__img::after, .service-card .wp-block-image::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(circle, rgba(50, 157, 215, .9) 1.2px, transparent 1.7px) 0 0 / 7px 7px;
	mix-blend-mode: multiply; opacity: .45; transition: opacity .8s var(--v2-ease);
}
.split__img:hover::after, .service-card:hover .wp-block-image::after { opacity: 0; }

/* Figures → stat cards; the first in red */
.figures { gap: 1rem !important; }
.figures > .figure { background: var(--card); border: 1px solid var(--card-line) !important; border-radius: var(--v3-r); padding: 2rem 1.75rem !important; }
.figures > .figure::before { display: none !important; }
.figure__num { font-weight: 400 !important; font-style: italic; letter-spacing: -.02em !important; color: var(--v2-blue) !important; }
:is(.band--ink, .band.has-surface-background-color) .figure__num { color: var(--v2-blue-hi) !important; }
.figures > .figure:first-child { background: var(--wp--preset--color--brand); border-color: transparent !important; }
.figures > .figure:first-child :is(.figure__num, .figure__label) { color: #fff !important; }
.figures > .figure:first-child { background: #c81d23 !important; }

/* Timeline and checklist on cards */
.timeline { background: var(--card); border-radius: var(--v3-r); padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem) calc(clamp(1.5rem, 4vw, 3rem) + 2.25rem) !important; }
.timeline::before, .timeline::after { left: calc(clamp(1.5rem, 4vw, 3rem) + .55rem) !important; top: clamp(2.5rem, 4.5vw, 3.5rem) !important; }
.timeline::after { height: calc(100% - clamp(5rem, 9vw, 7rem)) !important; }
.timeline > .tl-item::before { background: var(--card) !important; }
ol.checklist { background: var(--card); border-radius: var(--v3-r); padding: .5rem clamp(1.5rem, 3vw, 2.5rem) !important; }
ol.checklist > li:last-child { border-bottom: 0 !important; }
ol.checklist > li::before { background: var(--v2-blue) !important; }

.compare-table table { border-radius: var(--v3-r) !important; border: 0 !important; overflow: hidden; }
.compare-table thead th { background: var(--v3-ink) !important; }
.wp-block-details.more { background: var(--card); border: 0 !important; border-radius: 24px; padding: .25rem 1.5rem !important; }
.wp-block-details.more + .wp-block-details.more { margin-top: .5rem !important; }
:is(.related-links, .region-line) { border-radius: 999px !important; border: 0 !important; padding: 1rem 1.75rem !important; }
.layers { border-radius: var(--v3-r) !important; }
.quote-band p:first-child { font-style: italic; font-weight: 400 !important; letter-spacing: -.015em; }

/* Steps in a row: cards with italic blue numerals (as on the home page) */
.band .steps { gap: 1rem !important; border-top: 0 !important; }
.band .steps > .step { background: var(--card); border-radius: var(--v3-r); padding: 2rem 1.75rem !important; }
.band .steps > .step::after { display: none !important; }
.band .steps > .step::before { color: var(--v2-blue) !important; font-style: italic; font-weight: 400 !important; margin-bottom: 1.5rem !important; }
@media (max-width: 960px) { .band .steps { border-left: 0 !important; margin-left: 0 !important; } .band .steps > .step { padding: 1.75rem 1.5rem !important; } }

/* FAQ lists inside bands sit on a card */
.band .scar-faq { background: var(--card); border-radius: var(--v3-r); border-top: 0 !important; padding: .5rem clamp(1.5rem, 3vw, 2.5rem); }
.band .scar-faq details { border-bottom-color: var(--line) !important; }
.band .scar-faq details:last-child { border-bottom: 0 !important; }

.service-card { border-radius: var(--v3-r) !important; }

/* Closing CTA: a rounded blue-hour panel inset on onyx, with a red halftone corner */
.cta-band { background: var(--v2-soot) !important; padding: clamp(1rem, 2vw, 1.5rem) !important; border-top: 0 !important; }
.cta-band > .wp-block-columns {
	position: relative; overflow: hidden; isolation: isolate; max-width: none !important; margin: 0 !important;
	border-radius: var(--v3-r); padding: clamp(3.5rem, 7vw, 6rem) clamp(1.75rem, 5vw, 5rem) !important;
	background: linear-gradient(135deg, #1b6ea3 0%, var(--v2-blue) 55%, #57b3e6 100%);
}
.cta-band > .wp-block-columns::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(circle, rgba(218, 33, 40, .85) 1.6px, transparent 2.1px) 0 0 / 11px 11px;
	-webkit-mask: radial-gradient(70% 90% at 100% 100%, #000, transparent 70%); mask: radial-gradient(70% 90% at 100% 100%, #000, transparent 70%);
}
.cta-band :is(h2, p) { color: #fff !important; }
.cta-band h2 { font-weight: 400 !important; letter-spacing: -.02em !important; }
.cta-band .wp-block-button:not(.is-style-outline) > .wp-block-button__link { background: var(--v3-ink) !important; }
.cta-band .wp-block-button.is-style-outline > .wp-block-button__link { background: #fff !important; color: var(--v3-ink) !important; border-color: #fff !important; }

.quote-strip { background: var(--v3-graphite) !important; }
.site-main.section :is(.testimonial-card, .post-card) { border-radius: var(--v3-r) !important; background: var(--v3-stone) !important; border: 0 !important; }
.single-photo, :is(.service-hero__photo, .hero-statement__photo) { border-radius: var(--v3-r) !important; }
.form-panel { border-radius: var(--v3-r) !important; background: var(--v3-stone) !important; }
:is(.page-hero, .service-hero, .hero-statement, .hero-photo-panel, .hero-urgent, .sig) :is(h1, .wp-block-post-title) { font-weight: 400 !important; letter-spacing: -.02em !important; line-height: .95 !important; }

/* --------------------------------------------------------------------------
   2. Readable colour: white on dark, ink on light
   -------------------------------------------------------------------------- */
:is(.band.has-surface-background-color, .band--ink, :is(.wp-block-post-content, .entry) > .section:not([class*="v2-"]), .hero-index-wrap, .v2-steps, .v2-explainer, .v2-testimonials, .page-hero, .service-hero, .hero-statement, .hero-photo-panel, .sig, .quote-strip, .air-quote, .site-footer)
	:is(p, li, dd, dt, td, figcaption, .lead, .breadcrumbs, .breadcrumbs a, .service-hero__summary, .service-hero__summary p, .wp-block-post-excerpt__excerpt, label):not(:is(.form-panel, .card--accent, .figure:first-child, .testimonial-card, .hero-index__item, .layers, .v2-facts, .office-card, .office-panel) *) { color: rgba(238, 240, 242, .92) !important; }
:is(.band.has-surface-background-color, .band--ink, :is(.wp-block-post-content, .entry) > .section:not([class*="v2-"]), .v2-steps, .v2-explainer, .v2-testimonials)
	:is(h2, h3, h4, strong, summary, .scar-faq summary, .wp-block-details summary, .service-row__name a, .text-link a):not(:is(.form-panel, .card--accent, .figure:first-child, .hero-index__item, .layers, .v2-facts, .v2-testimonials li:first-child, .office-card, .office-panel) *) { color: #fff !important; }
.band:not(.band--ink):not(.has-surface-background-color) :is(p, li, td, .lead, figcaption):not(:is(.card--accent, .figure:first-child) *) { color: rgba(20, 22, 28, .85) !important; }
.band:not(.band--ink):not(.has-surface-background-color) :is(h2, h3, h4, strong, summary, .scar-faq summary, .wp-block-details summary) { color: var(--v3-ink) !important; }
/* Cards keep their own text colour */
.card--accent :is(h3, p, li, a), .figures > .figure:first-child :is(.figure__num, .figure__label), .air-quote .form-panel :is(p, li, label, h2, legend), .form-panel :is(p, li, label, legend) { color: inherit; }
.card--accent :is(h3, p, li, a) { color: #fff !important; }
.air-quote .form-panel :is(p, li, label, legend), .form-panel :is(p, li, label, legend) { color: var(--v3-ink) !important; }
.site-footer :is(a, .footer-heading) { color: #fff !important; }

/* --------------------------------------------------------------------------
   3. Type lock: four sizes, site-wide.
      T1 hero titles · T2 section headings and big numbers · T3 sub-headings
      (cards, list titles, questions, pull quotes) · T4 everything else.
      On phones T1 scales with the screen width (see the media query below).
   -------------------------------------------------------------------------- */
:root {
	--t1: calc(clamp(3rem, 7vw, 7.25rem) * var(--v2-ds));
	--t2: calc(clamp(2.3rem, 4.4vw, 4.25rem) * var(--v2-ds));
	--t3: calc(clamp(1.4rem, 1.9vw, 1.85rem) * var(--v2-ds));
	--t4: 1.0625rem;
}
/* Phones: the hero size follows the screen so the longest words (REMEDIATION, MANAGEMENT) fit. */
@media (max-width: 600px) { :root { --t1: 10.5vw; } }
:root:root:root body :is(h1, .wp-block-post-title:is(h1)) { font-size: var(--t1) !important; }
:root:root:root body :is(h2, .band-title, .figure__num, .fact__num, .band-phone a, .hero-urgent__phone, .quote-band p:first-child, .air-quote .form-panel h2) { font-size: var(--t2) !important; }
:root:root:root body :is(h3, h4, .card h3, .hero-index__title, .service-row__name, .service-card__body h2, .post-card__title, .tl-item h3, .scar-faq summary, .wp-block-details summary) { font-size: var(--t3) !important; }
:root:root:root body .v2-testimonials li:not(:first-child) .testimonial-card :is(.wp-block-post-content, .wp-block-post-content p) { font-size: var(--t4) !important; }
:root:root:root body :is(p:not(.figure__num):not(.fact__num):not(.band-phone):not(.hero-urgent__phone), li, dd, dt, td, th, label, legend, input, select, textarea, button, figcaption, small, .lead, .breadcrumbs, .breadcrumbs a, .chip, .hero-meta, .wp-element-button, .wp-block-button__link, .wp-block-navigation-item__content, .service-hero__summary, .wp-block-post-excerpt__excerpt, .note, .info-note, .text-link, .text-link a, .header-phone, .footer-nav, .wp-block-post-date, .post-card__date, .hero-credit, .air-lens__tag, .quote-band__cite, .logo-label, .region-title, .band-label, .eyebrow, .hero-index__label, .hero-urgent__label, .quote-strip__text, summary, .wpcf7 span, .wpcf7-not-valid-tip, .wpcf7-response-output, .launch-hint, .scar-explainer .loading, .sig__docs .doc b, .contact-line strong, .wpcf7 :is(p, a, small)) { font-size: var(--t4) !important; }
/* Steps numerals and the hero-index index numbers are display marks: T2 */
:root:root:root body :is(.v2-steps .steps > .step, .band .steps > .step)::before { font-size: var(--t2) !important; }
:root:root:root body .hero-index > .hero-index__item::after { font-size: var(--t3) !important; }

/* Audience tiles: colours deep enough for white text; the stone tile uses ink */
.hero-index > .hero-index__item:nth-child(1) { background: #1b6ea3 !important; }
.hero-index > .hero-index__item:nth-child(2) { background: #163f5f !important; }
.hero-index > .hero-index__item:nth-child(3) { background: #c81d23 !important; }
.hero-index > .hero-index__item:not(:nth-child(4)) :is(.hero-index__label, .hero-index__desc, .hero-index__title a) { color: #fff !important; }
.hero-index > .hero-index__item:nth-child(4) :is(.hero-index__desc, .hero-index__title a) { color: var(--v3-ink) !important; }
.hero-index > .hero-index__item:nth-child(4) .hero-index__label { color: #1b6ea3 !important; }
:root .band .layers .layer :is(h3, p) { color: var(--v3-ink) !important; }
:root .band .layers .layer--3 h3 { color: var(--wp--preset--color--brand-dark) !important; }
:root .v2-facts .fact__text { color: rgba(20, 22, 28, .85) !important; }
:is(.office-card, .office-panel) { border-radius: var(--v3-r) !important; overflow: hidden; }
.office-panel { background: var(--v3-stone) !important; }
:root:root:root :is(.office-card, .office-panel, .form-panel) :is(h2, h3, p, li, a, label, legend) { color: var(--v3-ink) !important; }
:root:root:root .office-panel .office-panel__label { color: #1b6ea3 !important; }

/* --------------------------------------------------------------------------
   Footer: compact (brand · two-column links · contact · legal row)
   -------------------------------------------------------------------------- */
.site-footer { background: var(--v2-soot) !important; padding: clamp(4rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3rem) 2rem !important; border-top: 1px solid rgba(238, 240, 242, .08); }
.site-footer__cols { gap: clamp(2rem, 5vw, 5rem) !important; }
.site-footer__brand p { max-width: 24rem; }
.site-footer .footer-nav .wp-block-navigation__container { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 2.5rem !important; }
.site-footer .footer-nav a { color: #fff !important; text-decoration: none; white-space: nowrap; }
.site-footer .footer-nav .wp-block-navigation__container { grid-template-columns: repeat(2, max-content) !important; }
.site-footer .footer-nav a:hover { color: var(--v2-blue-hi) !important; }
.site-footer .footer-phone a { font-family: var(--wp--preset--font-family--heading); font-weight: 400; color: #fff !important; }
:root:root:root body .site-footer a { font-size: var(--t4) !important; }
:root:root:root body .site-footer .footer-phone a { font-size: var(--t3) !important; }
.site-footer p { margin: 0 0 1rem !important; }
.site-footer__base { margin-top: clamp(2.5rem, 5vw, 4rem) !important; padding-top: 1.25rem; border-top: 1px solid rgba(238, 240, 242, .1); }
.site-footer__base p { margin: 0 !important; color: rgba(238, 240, 242, .75) !important; }
.site-footer__base a { color: rgba(238, 240, 242, .9) !important; }
@media (max-width: 781px) { .site-footer__cols { gap: 2.5rem !important; } }

/* --------------------------------------------------------------------------
   Accessibility polish (audit, 17 Oct)
   -------------------------------------------------------------------------- */
/* Map labels: one size, hierarchy by weight; a visible focus ring on towns */
.nzmap__town text, .nzmap__town .nzmap__sub, .nzmap__town.is-office text:not(.nzmap__sub), .nzmap__note { font-size: 17px !important; font-family: var(--wp--preset--font-family--body) !important; }
.nzmap__town.is-office text:not(.nzmap__sub) { font-weight: 700; }
.nzmap__town:focus-visible circle:not(.nzmap__ring) { stroke: var(--v2-blue) !important; stroke-width: 5 !important; }
/* Marquee pauses for keyboard users too */
.accreditations:focus-within .logo-strip.is-marquee { animation-play-state: paused; }
/* Phones: 44px tap targets; hide the last breadcrumb (it repeats the page title) */
@media (max-width: 781px) {
	.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
	.breadcrumbs [aria-current], .breadcrumbs [aria-hidden]:nth-last-child(2) { display: none; }
	.scar-faq summary, .wp-block-details summary { min-height: 44px; }
	/* Non-pinned heroes size to their content instead of leaving empty screen */
	:is(.page-hero, .service-hero, .hero-statement, .sig:not(.sig--pin)) { min-height: 0 !important; }
}
/* Reduced motion: no transitions or hover lifts anywhere */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Headings written as paragraphs (tile titles, big numbers) keep their heading size; the body-size rule above must not shrink them. */
:root:root:root:root body :is(p.hero-index__title, p.service-row__name, .hero-index__title a) { font-size: var(--t3) !important; }
:root:root:root:root body :is(p.fact__num, p.figure__num, p.band-phone, p.hero-urgent__phone) { font-size: var(--t2) !important; }
/* Tile titles are the headline of each tile: serif, ink or white, above the description */
.hero-index__title, .hero-index__title a { font-family: var(--wp--preset--font-family--body) !important; font-weight: 600 !important; letter-spacing: -.01em !important; line-height: 1.15 !important; }
.hero-index__title { margin: .5rem 0 .9rem !important; }

/* --------------------------------------------------------------------------
   Alignment: card rows share one grid (subgrid), so labels, titles and text
   line up across a row however long each card's copy is.
   -------------------------------------------------------------------------- */
/* Home audience tiles: label · title · description */
.hero-index { grid-auto-rows: auto; align-items: stretch !important; }
.hero-index > .hero-index__item { display: grid !important; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; justify-content: stretch !important; }
.hero-index > .hero-index__item > * { align-self: start; }
.hero-index__label { padding-right: 0; }
/* Steps: numeral · heading · text */
.steps { grid-auto-rows: auto; }
.steps > .step { display: grid !important; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.steps > .step > :is(h3, p) { align-self: start; }
/* Icon/text cards: icon · heading · text (cards without an icon still span three rows) */
.cards { grid-auto-rows: auto; }
.cards > .card { display: grid !important; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.cards > .card:not(.has-icon) > :first-child { grid-row: 2; }
.cards > .card > * { align-self: start; }
/* Stat figures: number · label */
.figures { grid-auto-rows: auto; }
.figures > .figure { display: grid !important; grid-row: span 2; grid-template-rows: subgrid; row-gap: .5rem; align-content: start; }
/* Services hub cards: photo · body; body text starts level */
.card-grid > .service-card { display: flex; flex-direction: column; }
.card-grid > .service-card .service-card__body { flex: 1; }
/* Hub cards: reserve two lines for the title so descriptions start level across a row */
@media (min-width: 782px) { .card-grid > .service-card .service-card__body h2 { min-height: calc(2 * 1.05em); } .post-card__title { min-height: calc(3 * 1.05em); } }

/* Tile numbers sit bottom-right so labels get the full width */
.hero-index > .hero-index__item { padding-bottom: 3.75rem !important; }
.hero-index > .hero-index__item::after { top: auto !important; bottom: 1.5rem !important; right: 1.75rem !important; }
/* Breathing room: the photo fades to dark beneath the quote card, then the tiles start */
.home .site-main .air-ready + .air-quote { background: linear-gradient(to bottom, transparent 0, transparent 55%, var(--v2-soot) 92%) !important; padding-bottom: clamp(4rem, 8vw, 7rem) !important; }
.hero-index-wrap { padding-top: clamp(1rem, 3vw, 2.5rem) !important; }

/* Small screens (iPod / folded phones): footer links wrap in two even columns; header logo is a 44px tap target */
@media (max-width: 480px) {
	.site-footer .footer-nav .wp-block-navigation__container { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .7rem 1.25rem !important; }
	.site-footer .footer-nav a { white-space: normal !important; }
}
.site-header .wp-block-site-logo a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__contact a, .site-footer__base a, .footer-review a { display: inline-flex; align-items: center; min-height: 44px; }
.nzmap__town .nzmap__hit { fill: transparent !important; stroke: none !important; }

/* Testimonials: three identical cards (same widths, same type) on the home page and the Testimonials page */
.wp-block-post-template.testimonials-featured { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.wp-block-post-template.testimonials-featured > li:first-child { grid-column: auto !important; grid-row: auto !important; }
.testimonials-featured > li .wp-block-post-content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.testimonials-featured > li .wp-block-post-content > p:nth-child(n+2) { display: none; }
.testimonial-card { display: flex !important; flex-direction: column; }
.testimonial-card .wp-block-post-content { flex: 1; }
:root:root:root:root body :is(.testimonial-card .wp-block-post-content, .testimonial-card .wp-block-post-content p) { font-family: var(--wp--preset--font-family--body) !important; font-weight: 400 !important; font-style: normal !important; letter-spacing: 0 !important; line-height: 1.6 !important; font-size: var(--t4) !important; }
:root:root:root:root body :is(.testimonial-card .wp-block-post-title, .testimonial-card .wp-block-post-title a) { font-family: var(--wp--preset--font-family--body) !important; font-weight: 700 !important; font-size: var(--t4) !important; letter-spacing: 0 !important; }
.v2-testimonials .testimonial-card :is(.wp-block-post-content, .wp-block-post-content p) { color: rgba(238, 240, 242, .92) !important; }
.v2-testimonials .testimonial-card :is(.wp-block-post-title, .wp-block-post-title a) { color: #fff !important; }
@media (max-width: 781px) { .wp-block-post-template.testimonials-featured { grid-template-columns: minmax(0, 1fr) !important; } }
