/* Trimatrix Resources — theme styles beyond theme.json. Loaded on the site and in the editor. */

/* Wide cut of Archivo for headings, navigation, buttons and labels */
h1, h2, h3, h4, h5, h6,
.wp-block-site-title,
.wp-block-navigation,
.wp-element-button,
.wp-block-button__link,
.project-region,
.footer-name,
.footer-heading,
figcaption,
.wp-block-table th {
	font-stretch: var(--wp--custom--heading-stretch, normal);
}
.hero-title,
.page-header h1 {
	font-stretch: var(--wp--custom--display-stretch, normal);
	letter-spacing: var(--wp--custom--display-tracking, -0.02em);
	text-wrap: balance;
}
h2, h3 { text-wrap: balance; }

/* Body text: runs the full width of the page grid (no narrow measure since 1.1.1) */
p { text-wrap: pretty; }
.measure > h2 { margin-bottom: 0; }

/* Paragraphs and list items in page content are justified, with hyphenation so the
   word spacing stays even. A paragraph given its own alignment in the editor
   (left, centre or right) keeps it. On phones text is left-aligned, because justified
   lines on a narrow screen leave wide gaps between words. */
:is(.wp-block-post-content, .wp-block-post-content-is-layout-constrained) :is(p, li):not([class*="has-text-align-"]) {
	text-align: justify;
	text-justify: inter-word;
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 7 3 3;
}
@media (max-width: 600px) {
	:is(.wp-block-post-content, .wp-block-post-content-is-layout-constrained) :is(p, li):not([class*="has-text-align-"]) {
		text-align: left;
		-webkit-hyphens: manual;
		hyphens: manual;
	}
}

/* Links in running text: green underline */
:where(p, li, figcaption) a {
	text-decoration-color: var(--wp--preset--color--green);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}
:where(h2, h3) a { text-decoration: none; color: inherit; }
:where(h2, h3) a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--green); text-decoration-thickness: 3px; text-underline-offset: 0.18em; }

/* Keyboard focus */
:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--green);
	outline-offset: 3px;
	border-radius: 1px;
}

/* Sections placed one after another never leave white gaps */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }

/* ---------- Strata edge: thin layered bands along the bottom, like a stratigraphic column ---------- */
.is-style-strata { position: relative; }
.is-style-strata::after,
.site-footer::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 26px;
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(to bottom,
		transparent 0 3px,
		rgba(255, 255, 255, 0.45) 3px 4px,
		transparent 4px 8px,
		var(--wp--preset--color--green) 8px 13px,
		transparent 13px 15px,
		rgba(255, 255, 255, 0.22) 15px 18px,
		transparent 18px 20px,
		var(--wp--preset--color--indigo-deep) 20px 26px);
}
.is-style-strata::after { bottom: 0; }
.site-footer { position: relative; }
.site-footer::before { top: 0; transform: scaleY(-1); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.site-brand { align-items: center; }
.site-brand .wp-block-site-logo img { display: block; height: auto; }
.wp-block-site-title { white-space: nowrap; }
.main-nav .wp-block-navigation-item__content { padding-block: 0.35em; border-bottom: 3px solid transparent; }
.main-nav .wp-block-navigation-item__content:hover { border-bottom-color: var(--wp--preset--color--line); text-decoration: none; }
.main-nav .current-menu-item > .wp-block-navigation-item__content,
.main-nav .wp-block-navigation-item__content[aria-current="page"] { border-bottom-color: var(--wp--preset--color--green); }
.main-nav a { text-decoration: none; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 2rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.5rem; }

/* ---------- Hero: content lines up with the logo on the wide grid ---------- */
.home-hero .wp-block-cover__background,
.home-hero .wp-block-cover__gradient-background {
	background: var(--wp--custom--hero-overlay) !important;
	opacity: 1 !important;
}
.home-hero.wp-block-cover {
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}
.home-hero .wp-block-cover__inner-container {
	width: 100% !important;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto !important;
}
.home-hero .wp-block-cover__inner-container > * { margin-left: 0 !important; margin-right: 0 !important; }
.home-hero .hero-title { margin-bottom: 0.3em; line-height: 0.98; }
.home-hero .lead { margin-top: 0; }
.home-hero .wp-block-buttons { margin-top: 2rem; }
.lead { line-height: 1.5; }
.page-header .lead { opacity: 0.92; }
.page-header h1 { margin-bottom: 0.3em; }
.page-header .wp-block-post-date { opacity: 0.85; }

/* Outline buttons on dark bands */
.has-white-color.wp-block-button__link:hover,
.is-style-outline > .has-white-color.wp-block-button__link:hover { background: rgba(255, 255, 255, 0.12); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--indigo); color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--indigo); }
.wp-block-button.is-style-outline > .wp-block-button__link.has-white-color:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--indigo); border-color: var(--wp--preset--color--white); }
.has-white-background-color.wp-block-button__link { border-color: var(--wp--preset--color--white); }
.has-white-background-color.wp-block-button__link:hover { background: var(--wp--preset--color--limestone) !important; border-color: var(--wp--preset--color--limestone); }
.jump-links { margin-top: 2rem; gap: 0.75rem; }
.jump-links .wp-block-button__link { font-size: 0.9375rem; padding: 0.6em 1.1em; }

/* ---------- Home ---------- */
.activity-columns h3 { margin-top: 1.1rem; margin-bottom: 0.4rem; }
.activity-columns p { font-size: 1.0625rem; }
/* Media & text: text sits on the grid edge, gap only on the image side */
.wp-block-media-text > .wp-block-media-text__content { padding-left: 0; padding-right: 0; }
.wp-block-media-text:not(.has-media-on-the-right) > .wp-block-media-text__content { padding-left: clamp(1.5rem, 4.5vw, 4rem); }
.wp-block-media-text.has-media-on-the-right > .wp-block-media-text__content { padding-right: clamp(1.5rem, 4.5vw, 4rem); }

/* Projects register: one row per property, like a land register */
.home-projects h2 { margin: 0; }
.home-projects > .wp-block-group.alignwide { margin-bottom: var(--wp--preset--spacing--50); }
.register-row { margin-block: 0 !important; }
.register-row:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.register-row h3 { margin: 0; }
.register-row h3 a { color: var(--wp--preset--color--white); }
.register-row p { margin-top: 0.4rem; margin-bottom: 0; opacity: 0.92; }
.register-row .project-region { color: var(--wp--preset--color--green); opacity: 1; }
.register-row img { display: block; }

.statement {
	font-family: var(--wp--custom--statement-font, var(--wp--preset--font-family--body));
	line-height: 1.35;
	font-weight: 400;
	color: var(--wp--preset--color--indigo);
}
.statement { margin-top: 0.2rem; }

/* ---------- Projects ---------- */
.project-region {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--green-dark);
	margin-top: 0.35rem !important;
}
.wp-block-table.project-facts { margin-block: 1.75rem; }
.project-facts table { border-collapse: collapse; width: 100%; }
.project-facts th,
.project-facts td { border: 0; border-top: 1px solid var(--wp--preset--color--line); padding: 0.8rem 0; vertical-align: top; }
.project-facts tr:last-child th,
.project-facts tr:last-child td { border-bottom: 1px solid var(--wp--preset--color--line); }
.project-facts th {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	text-align: left;
	color: var(--wp--preset--color--slate);
	width: 48%;
	padding-right: 1rem;
}
.project-facts td { font-family: var(--wp--preset--font-family--heading); font-weight: 600; color: var(--wp--preset--color--indigo); }
.phase-list li { margin-bottom: 0.6rem; padding-left: 0.25rem; }
.phase-list li::marker { font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: var(--wp--preset--color--green-dark); }
.figure-row figure { margin: 0; }
figcaption.wp-element-caption { margin-top: 0.6rem; }

/* ---------- Footer ---------- */
.site-footer a { color: var(--wp--preset--color--white); text-decoration-color: rgba(255, 255, 255, 0.4); }
.site-footer a:hover { text-decoration-color: var(--wp--preset--color--green); color: var(--wp--preset--color--white); }
.site-footer p { font-size: 1rem; line-height: 1.6; }
.footer-name { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.125rem !important; margin-top: 1.25rem; margin-bottom: 0.15rem; }
.footer-name + p { margin-top: 0; opacity: 0.8; }
.site-footer .footer-heading {
	font-size: 1rem;
	font-weight: 600;
	color: var(--wp--preset--color--green);
	margin-bottom: 0.6rem;
	letter-spacing: 0;
}
.footer-nav { gap: 0.4rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-legal {
	margin-top: var(--wp--preset--spacing--60) !important;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	opacity: 0.75;
}

/* ---------- Contact form ---------- */
.tmx-form { display: grid; gap: 1.1rem; max-width: 40rem; }
.tmx-form > p { margin: 0; }
.tmx-form label { display: block; font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.35rem; color: var(--wp--preset--color--basalt); }
.tmx-form input[type="text"],
.tmx-form input[type="email"],
.tmx-form textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid #9AA0AE;
	border-radius: 2px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--basalt);
}
.tmx-form input:focus,
.tmx-form textarea:focus { border-color: var(--wp--preset--color--indigo); outline: 3px solid var(--wp--preset--color--green); outline-offset: 1px; }
.tmx-form textarea { min-height: 10rem; resize: vertical; }
.tmx-form .tmx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tmx-form button { cursor: pointer; justify-self: start; }
.tmx-note { font-size: 0.9375rem; color: var(--wp--preset--color--slate); margin: 0; }
.tmx-msg { padding: 1rem 1.25rem; border-left: 4px solid; font-family: var(--wp--preset--font-family--heading); font-size: 1rem; margin-bottom: 1.25rem; }
.tmx-msg.is-success { border-color: var(--wp--preset--color--green-dark); background: #EAF6EC; color: #14532D; }
.tmx-msg.is-error { border-color: #B42318; background: #FDECEA; color: #7A1A12; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.home-hero { min-height: 78vh !important; }
	.register-row > .wp-block-column:first-child { max-width: 22rem; }
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content { padding-left: 0; padding-right: 0; padding-top: 1.5rem; }
	.wp-block-site-title { font-size: 1rem; }
	.site-brand .wp-block-site-logo img { width: 56px !important; }
}
@media (max-width: 420px) {
	.wp-block-site-title { white-space: normal; max-width: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 1rem; }
